:root {
  --gold: #C9A84C;
  --gold-dark: #A8882E;
  --gold-light: #F0DFA0;
  --brown: #3B2A1A;
  --brown-soft: #6B4C2A;
  --bg: #FAF7F2;
  --bg-card: #FFFFFF;
  --text: #2C1F0E;
  --text-muted: #7A6550;
  --border: #E4D9C8;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }

/* ── Navbar ── */
.navbar { background: var(--brown); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 56px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--gold-light); }

/* ── Logo Circle ── */
.logo-circle { width: 48px; height: 48px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: var(--brown); letter-spacing: 0.5px; flex-shrink: 0; }
.logo-circle.sm { width: 32px; height: 32px; font-size: 11px; }

/* ── Login ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 36px; width: 100%; max-width: 380px; }
.logo-wrap { text-align: center; margin-bottom: 28px; }
.logo-wrap .logo-circle { margin: 0 auto 12px; }
.logo-wrap h1 { font-size: 24px; color: var(--brown); }
.logo-wrap .tagline { font-size: 13px; color: var(--text-muted); }

/* ── Container ── */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }

/* ── Page header ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 22px; color: var(--brown); }
.subtitle { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 7px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: all .15s; white-space: nowrap; }
.btn-gold { background: var(--gold); color: var(--brown); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline-gold { background: transparent; border: 1.5px solid var(--gold); color: var(--gold); }
.btn-outline-gold:hover { background: var(--gold); color: var(--brown); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-full { width: 100%; justify-content: center; padding: 11px 18px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ── Forms ── */
.form-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.field-full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.field input, .field select, .field textarea { padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 14px; color: var(--text); background: #fff; transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 72px; }
.field input[type="file"] { padding: 6px; background: var(--bg); }
.thumb { max-width: 120px; max-height: 90px; border-radius: 6px; border: 2px solid var(--border); margin-bottom: 6px; object-fit: cover; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-section { margin-bottom: 28px; }
.section-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gold-dark); border-bottom: 2px solid var(--gold-light); padding-bottom: 6px; margin-bottom: 14px; }

/* ── Search ── */
.search-form { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-form input { flex: 1; min-width: 200px; padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 14px; }
.search-form input:focus { outline: none; border-color: var(--gold); }

/* ── Table ── */
.table-wrap { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--brown); color: var(--gold-light); font-size: 13px; font-weight: 600; padding: 11px 14px; text-align: left; }
td { padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FDF8EE; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); background: var(--bg-card); border-radius: var(--radius); }

/* ── Alert ── */
.alert { padding: 10px 14px; border-radius: 7px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* ══════════════════════════════
   FICHA VER (printable)
   ══════════════════════════════ */
.ficha-container { max-width: 800px; margin: 32px auto; padding: 0 16px 60px; }
.ficha-header { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: start; background: var(--brown); color: #fff; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px; }
.ficha-logo { display: flex; align-items: center; gap: 14px; }
.ficha-logo h1 { font-size: 20px; color: var(--gold-light); }
.ficha-logo p { font-size: 12px; color: var(--gold); }
.ficha-info p, .ficha-dates p { font-size: 13px; line-height: 1.7; }
.ficha-dates { text-align: right; font-size: 13px; }
.ficha-section { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.ficha-section-title { background: var(--gold); color: var(--brown); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 16px; }
.ficha-table { width: 100%; border-collapse: collapse; }
.ficha-table td { padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
.ficha-table td.label { font-weight: 600; color: var(--brown-soft); width: 220px; background: #FAF7F2; }
.ficha-table tr:last-child td { border-bottom: none; }
.obs-text { padding: 12px 16px; font-size: 13px; white-space: pre-wrap; }
.foto-grid { display: flex; gap: 16px; padding: 16px; }
.foto-grid div { text-align: center; }
.foto-grid p { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.foto-grid img { max-width: 340px; max-height: 260px; border-radius: 8px; border: 2px solid var(--border); object-fit: cover; }
.ficha-footer { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 24px; }

@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .ficha-header { grid-template-columns: 1fr; }
  .ficha-dates { text-align: left; }
  .foto-grid { flex-direction: column; }
  .foto-grid img { max-width: 100%; }
}
