/* backend/public/brand.css */
/* ═══════════════════════════════════════════════════════════════
   CondoRD Design System · v2 — Dirección Cofre
   Banca privada con sol · Petrol + Cream + Bronce
   Drop-in replacement for the existing brand.css. All tokens keep
   their original names so existing HTML pages render in the new
   identity without markup changes.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ──────── TOKENS ──────── */
:root {
  /* ─── Brand primaries ─── */
  --accent:          #0E2A33;   /* Petrol deep — sidebar, primary buttons, footer */
  --accent-hover:    #061A21;
  --accent-soft:     #D2DDDF;
  --accent-deep:     #061A21;

  /* ─── Brass secondary ─── */
  --gold:            #B8915A;   /* Brushed brass — accent, seals, secondary CTAs */
  --gold-hover:      #9C7944;
  --gold-soft:       #EBDDC1;
  --gold-soft-hover: #DECBA5;

  /* ─── Surfaces & background ─── */
  --bg:              #F2EBDC;   /* Warm sand — page background */
  --bg-deep:         #E5DCC4;   /* Aged sand — section panels */
  --surface:         #FBF7EE;   /* Surface — cards on bg */
  --surface-alt:     #E9E0CA;   /* Subdued surface — sidebars, mono blocks */

  /* ─── Borders ─── */
  --border:          #CDC2A9;
  --border-strong:   #B5A887;

  /* ─── Text ─── */
  --text:            #0A1418;   /* Near-black with petrol cast */
  --text-2:          #2D4750;   /* Petrol secondary */
  --text-3:          #5A727B;   /* Tertiary — meta, eyebrows */

  /* ─── Semantic ─── */
  --success:         #25624D;   /* Sea-glass deep */
  --success-soft:    #D5E2D9;
  --warning:         #8C6939;   /* Cinnamon */
  --warning-soft:    #EBD9BC;
  --error:           #C24A3A;   /* Coral alert */
  --error-soft:      #F0D6CF;
  --blue:            #1F4E7C;   /* Informational */
  --blue-soft:       #DAE2EC;

  /* ─── Contextual ─── */
  --wa:              #25D366;   /* WhatsApp brand */
  --wa-hover:        #1AAB53;

  /* ─── Opacity tints ─── */
  --accent-a10:      rgba(14, 42, 51, 0.10);
  --accent-a15:      rgba(14, 42, 51, 0.15);
  --bg-a55:          rgba(242, 235, 220, 0.55);
  --bg-a15:          rgba(242, 235, 220, 0.15);

  /* ─── Typography ─── */
  --serif:  'Lora', Georgia, 'Times New Roman', serif;
  --sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:   'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

  /* ─── Scale ─── */
  --text-xs:   10px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  32px;
  --text-3xl:  44px;
  --text-display: 72px;

  /* ─── Shape ─── */
  --radius:    8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --max:       1280px;

  /* ─── Elevation ─── */
  --shadow-sm: 0 1px 2px rgba(10, 20, 24, 0.04);
  --shadow:    0 4px 16px rgba(10, 20, 24, 0.08);
  --shadow-lg: 0 24px 64px rgba(10, 20, 24, 0.12);
}

/* ──────── RESET ──────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ──────── DISPLAY TYPE ──────── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
em { font-style: italic; color: var(--gold); font-weight: 400; }
h1 em, h2 em, h3 em, h4 em { font-style: italic; color: var(--gold); font-weight: 400; }

/* ──────── LAYOUT ──────── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--serif);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text);
}

/* Brass divider — the recurring divider motif of Cofre */
.brass-stripe { height: 3px; width: 36px; background: var(--gold); border-radius: 2px; }
.brass-rule { height: 1px; background: var(--gold); opacity: 0.45; }

/* ──────── BOTTONES ──────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 22px;
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-brass {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: var(--accent);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 10px 22px;
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-brass:hover { background: var(--gold-hover); border-color: var(--gold-hover); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-soft);
  color: var(--gold-hover);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--gold-soft-hover); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 9px 22px;
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-outline:hover { background: var(--accent); color: var(--bg); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-2);
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--accent); }

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wa);
  color: #fff;
  border: 1px solid var(--wa);
  border-radius: var(--radius);
  padding: 10px 22px;
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-whatsapp:hover { background: var(--wa-hover); }

.btn-large { padding: 13px 28px; font-size: var(--text-base); }
.btn-small { padding: 7px 14px; font-size: 12px; }

/* ──────── BADGES & PILLS ──────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--gold-soft);    color: var(--gold-hover); }
.badge-error   { background: var(--error-soft);   color: var(--error); }
.badge-gray    { background: var(--surface-alt);  color: var(--text-2); }
.badge-blue    { background: var(--blue-soft);    color: var(--blue); }
.badge-accent  { background: var(--accent-soft);  color: var(--accent); }
.badge-brass   { background: var(--gold-soft);    color: var(--accent); }

/* Chips — looser, used in resident-side */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }
.chip-error   { background: var(--error-soft);   color: var(--error); }
.chip-muted   { background: var(--surface-alt);  color: var(--text-3); }
.chip-accent  { background: var(--accent-soft);  color: var(--accent); }

/* ──────── CARDS ──────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-stripe {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.card-stripe::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gold);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.kpi-card.accent-bg { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.kpi-card .kpi-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.kpi-card.accent-bg .kpi-label { color: var(--gold); }
.kpi-card .kpi-value {
  font-family: var(--serif);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--text);
  line-height: 1.0;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.kpi-card.accent-bg .kpi-value { color: var(--bg); }
.kpi-card .kpi-value.success { color: var(--success); }
.kpi-card .kpi-value.error { color: var(--error); }
.kpi-card .kpi-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-3);
  margin-top: 6px;
}
.kpi-card.accent-bg .kpi-sub { color: var(--gold); }

/* ──────── FORMS ──────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.form-input,
.form-select,
.form-textarea {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--sans);
  font-size: var(--text-base);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-a10);
}
.form-input::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 96px; }

/* ──────── SIDEBAR (admin) ──────── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  z-index: 40;
  gap: 4px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 12px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}
.sidebar-brand-mark {
  width: 30px; height: 30px;
  background: var(--gold);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
}
.sidebar-brand-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
}
.sidebar-brand-name em { color: var(--gold); font-style: italic; font-weight: 400; }

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: rgba(242, 235, 220, 0.55);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover,
.nav-item.active {
  background: rgba(184, 145, 90, 0.15);
  color: #fff;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-item[data-label]::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #0a1f17;
  color: rgba(242, 235, 220, 0.92);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 300;
}
.nav-item[data-label]:hover::after { opacity: 1; }
.nav-item-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-spacer { flex: 1; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 12px;
}
.sidebar-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13px;
}
.sidebar-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-user-name { font-size: 12px; color: #fff; font-weight: 500; }
.sidebar-user-role { font-size: 10px; color: rgba(242, 235, 220, 0.55); }

.main-with-sidebar { margin-left: 220px; min-height: 100vh; background: var(--bg); }

/* ──────── MOBILE BOTTOM NAV (resident) ──────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  position: relative;
  padding: 8px 4px;
  transition: color .12s;
}
.bnav-item.active { color: var(--accent); }
.bnav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 30%; right: 30%; height: 2px;
  background: var(--gold);
}
.bnav-item svg { width: 20px; height: 20px; }

/* ──────── HERO CARD (resident-side balance) ──────── */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gold);
}

/* ──────── INVOICE ROW ──────── */
.inv-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background .12s;
}
.inv-row:last-child { border-bottom: none; }
.inv-row:hover { background: var(--surface-alt); cursor: pointer; }
.inv-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.inv-dot.paid    { background: var(--success); }
.inv-dot.pending { background: var(--warning); }
.inv-dot.overdue { background: var(--error); }
.inv-info { flex: 1; min-width: 0; }
.inv-concept { font-size: 13px; font-weight: 500; color: var(--text); }
.inv-sub { font-size: 11px; color: var(--text-3); letter-spacing: 0.02em; margin-top: 2px; font-family: var(--mono); }
.inv-amount {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.inv-amount.overdue { color: var(--error); }

/* ──────── EYEBROW ──────── */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow-brass { color: var(--gold-hover); }

/* ──────── SECTIONS (landing) ──────── */
section { padding: 96px 0; }

/* ──────── UTILS ──────── */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

/* ──────── RESPONSIVE ──────── */
@media (max-width: 980px) {
  .container { padding: 0 20px; }
  section { padding: 64px 0; }
}
@media (max-width: 680px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  .sidebar-brand-name, .nav-item span, .nav-item-badge, .sidebar-user-info { display: none; }
  .sidebar-brand { justify-content: center; padding-bottom: 16px; }
  .nav-item { justify-content: center; padding: 12px; }
  .sidebar-user { justify-content: center; padding: 12px; }
  .main-with-sidebar { margin-left: 64px; }
}
