@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0C1B35;
  --navy-2: #0a1730;
  --gold: #C9A84C;
  --gold-light: #DDB96A;
  --surface: #F5F3F0;
  --panel: #FAFBFC;
  --border: #D8DDE3;
  --text: #111111;
  --text-muted: #6b7280;
  --danger: #A33B2E;
  --success: #4f8365;
  --warn: #c99a3f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }

.serif { font-family: 'Cormorant Garamond', serif; }

/* ---- App shell ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background:
    radial-gradient(520px circle at 15% -15%, rgba(184,147,90,0.16), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, #090d15 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, black, transparent 65%);
  mask-image: linear-gradient(180deg, black, transparent 65%);
  pointer-events: none;
}
.sidebar-brand, .sidebar-nav, .sidebar-footer { position: relative; z-index: 1; }
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 4px 8px 20px 8px;
  border-bottom: 2px solid var(--gold);
  margin-bottom: 16px;
}
.sidebar-brand img { width: 44px; height: auto; }
.sidebar-brand .wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}
.sidebar-brand .wordmark-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 9px;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  font-weight: 500;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--gold); color: var(--navy); }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 14px; font-size: 12.5px; color: rgba(255,255,255,0.6); }
.sidebar-footer .logout { display: block; margin-top: 6px; color: var(--gold-light); }

.main { flex: 1; padding: 32px 40px; max-width: 1200px; }
.main h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px 0; }
.main .subtitle { color: var(--text-muted); margin-bottom: 24px; }

/* ---- Login ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--navy);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.5);
}
.login-head {
  background: var(--navy);
  text-align: center;
  padding: 34px 20px 28px;
  border-bottom: 2px solid var(--gold);
}
.login-head img { height: 60px; width: auto; margin-bottom: 12px; }
.login-head .wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
}
.login-head .wordmark-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  margin-top: 10px;
}
.login-body { background: var(--panel); padding: 30px 32px 34px; }
.login-body label {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: #222; margin: 0 0 8px;
}
.login-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 18px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 16px;
  background: #F5F7F9; outline: none;
}
.login-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.14); }
.login-card button {
  width: 100%; padding: 13px; border: none; border-radius: 6px;
  background: var(--gold); color: var(--navy); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; cursor: pointer;
}
.login-card button:hover { background: var(--gold-light); }
.login-foot { background: var(--panel); text-align: center; font-size: 10.5px; color: #6B7280; padding: 0 24px 26px; letter-spacing: 0.04em; }
.login-error { color: var(--danger); font-size: 13px; background: #F9E9E6; border: 1px solid #EDCFC8; border-radius: 6px; padding: 11px 14px; margin-bottom: 16px; line-height: 1.5; }

/* ---- Cards / tables ---- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(14,20,32,0.04), 0 8px 24px rgba(14,20,32,0.05); }
.card-title { font-weight: 600; margin-bottom: 12px; font-size: 15px; }

.summary-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.summary-card {
  flex: 1; min-width: 140px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; position: relative; overflow: hidden;
}
.summary-card::before { content: ''; position: absolute; top:0; left:0; right:0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.summary-card .num { font-size: 26px; font-weight: 700; color: var(--navy); }
.summary-card .label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 10px 12px; color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; border-bottom: 1px solid var(--border); }
.th-sort { color: inherit; cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--navy); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #fbfaf7; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge-pendiente { background: #f2ecdf; color: var(--warn); }
.badge-notificado { background: #e4ecf5; color: #5c7ea8; }
.badge-pagado { background: #e5f0e8; color: var(--success); }
.badge-vencido { background: #f6e6e3; color: var(--danger); }

.btn { display: inline-block; padding: 9px 18px; border-radius: 999px; background: var(--navy); color: #fff; border: none; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-outline { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }

.search-bar { margin-bottom: 18px; }
.search-bar input { width: 320px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 13.5px; }

.muted { color: var(--text-muted); }
.link { color: var(--navy); font-weight: 600; }
.link:hover { color: var(--gold); }

.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
