*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #1D9E75;
  --green-dark: #0F6E56;
  --green-light: #E1F5EE;
  --amber: #BA7517;
  --amber-light: #FAEEDA;
  --red: #E24B4A;
  --red-light: #FCEBEB;
  --red-text: #A32D2D;
  --blue: #185FA5;
  --blue-light: #E6F1FB;
  --surface: #FAFAF8;
  --surface2: #F3F2EE;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.14);
  --text: #1A1A18;
  --text2: #6B6B64;
  --text3: #9A9A92;
  --white: #FFFFFF;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.05);
}

html { font-size: 14px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3 { font-family: 'DM Serif Display', serif; font-weight: 400; }

a { text-decoration: none; color: inherit; }

button, input, select, textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

button { cursor: pointer; border: none; background: none; transition: all 0.15s; }

/* ── Login ── */
.login-body { background: var(--surface); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.4s ease;
}

.login-logo {
  width: 48px; height: 48px;
  background: var(--green);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}

.login-title { font-size: 28px; margin-bottom: 6px; }
.login-sub   { font-size: 14px; color: var(--text2); margin-bottom: 32px; }

.pin-hint { font-size: 12px; color: var(--text3); margin-top: 16px; text-align: center; line-height: 1.6; }

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

/* ── Sidebar ── */
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.brand-logo {
  width: 34px; height: 34px;
  background: var(--green);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.brand-name { font-family: 'DM Serif Display', serif; font-size: 16px; }
.brand-sub  { font-size: 11px; color: var(--text3); margin-top: 2px; }

.sidebar-user {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text3); }

.sidebar-nav { padding: 10px 8px; flex: 1; }
.nav-section { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 4px; }

.nav-btn {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text2); font-size: 13px;
  margin-bottom: 1px; position: relative;
  transition: background .12s, color .12s;
}
.nav-btn:hover  { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: var(--green-light); color: var(--green-dark); font-weight: 500; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }
.nav-dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.nav-count { font-size: 10px; background: var(--red); color: white; border-radius: 999px; padding: 1px 6px; margin-left: auto; }

.sidebar-logout { padding: 12px 18px; border-top: 1px solid var(--border); }
.logout-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  color: var(--text2); font-size: 13px;
  transition: all .15s;
}
.logout-btn:hover { background: var(--red-light); color: var(--red-text); border-color: transparent; }

/* ── Main content ── */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 13px 26px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-family: 'DM Serif Display', serif; font-size: 19px; }
.topbar-sub   { font-size: 11px; color: var(--text3); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-user  { font-size: 13px; font-weight: 500; }
.topbar-role  { font-size: 11px; color: var(--text3); }

.page-body { padding: 22px 26px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Metrics ── */
.metrics   { display: grid; gap: 12px; margin-bottom: 18px; }
.metrics-4 { grid-template-columns: repeat(4, 1fr); }
.metrics-3 { grid-template-columns: repeat(3, 1fr); }
.metrics-2 { grid-template-columns: repeat(2, 1fr); }

.metric {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.metric-label { font-size: 10px; color: var(--text3); font-weight: 500; letter-spacing: .04em; margin-bottom: 6px; }
.metric-value { font-size: 21px; font-family: 'DM Serif Display', serif; line-height: 1.2; }
.metric-sub   { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
}
.badge-green  { background: #EAF3DE; color: #3B6D11; }
.badge-amber  { background: #FAEEDA; color: #854F0B; }
.badge-red    { background: #FCEBEB; color: #A32D2D; }
.badge-blue   { background: #E6F1FB; color: #185FA5; }
.badge-gray   { background: var(--surface2); color: var(--text2); }
.badge-purple { background: #EEEDFE; color: #534AB7; }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  font-size: 10px; color: var(--text3); font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 7px 12px; border-bottom: 1px solid var(--border); text-align: left;
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface); }
.table-scroll { overflow-x: auto; }
.table-scroll .data-table { min-width: 480px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  transition: all .15s; cursor: pointer;
}
.btn-primary  { background: var(--green); color: white; border: none; }
.btn-primary:hover  { background: var(--green-dark); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: #e8e7e0; }
.btn-danger   { background: var(--red-light); color: var(--red-text); border: none; }
.btn-danger:hover   { background: #f7c1c1; }
.btn-ghost    { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover    { background: var(--surface2); }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.w-full  { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group  { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-label  { font-size: 12px; color: var(--text2); font-weight: 500; display: block; }
.form-input, .form-select {
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  transition: border-color .15s, background .15s;
  outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--green); background: var(--white); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6B64' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: var(--surface);
}
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }

/* ── Alerts ── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}
.alert-success { background: #EAF3DE; color: #3B6D11; }
.alert-danger  { background: var(--red-light); color: var(--red-text); }

/* ── Progress bars ── */
.progress { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.prog-green { background: var(--green); }
.prog-amber { background: var(--amber); }
.prog-red   { background: var(--red); }
.prog-blue  { background: var(--blue); }

/* ── Avatars ── */
.av {
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0;
}
img.av { display: inline-block; }
.av-sm  { width: 28px; height: 28px; font-size: 10px; }
.av-md  { width: 36px; height: 36px; font-size: 13px; }
.av-lg  { width: 52px; height: 52px; font-size: 18px; }

/* ── Data rows ── */
.data-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.data-row:last-child { border-bottom: none; }

/* ── Tabs ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-btn {
  padding: 8px 16px; font-size: 13px;
  color: var(--text2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-weight: 400;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--green-dark); border-bottom-color: var(--green); font-weight: 500; }

/* ── Section header ── */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-family: 'DM Serif Display', serif; font-size: 20px; }
.section-sub   { font-size: 12px; color: var(--text3); margin-top: 3px; }

/* ── MGR rows ── */
.mgr-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  border: 1px solid var(--border);
  transition: border-color .2s;
}
.mgr-row.current  { border-color: var(--green); background: #f5fff9; }
.mgr-row.paid     { opacity: .55; }
.mgr-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}

/* ── Vote cards ── */
.vote-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color .2s;
}
.vote-card.quorum { border-color: var(--green); background: #f8fffe; }

/* ── Notifications ── */
.notif-item {
  display: flex; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-text { font-size: 13px; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ── Fines ── */
.fine-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.fine-row:last-child { border-bottom: none; }

/* ── Calculator ── */
.calc-result-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.calc-result-row:last-child { border-bottom: none; font-weight: 600; font-size: 14px; }

/* ── Info box ── */
.info-box {
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius);
  font-size: 13px;
}

/* ── Utility ── */
.text-muted  { color: var(--text3); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-blue   { color: var(--blue); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-state p { font-size: 13px; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.page-enter { animation: fadeUp .25s ease; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .metrics-4 { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-body { padding: 14px; }
  .topbar { padding: 12px 16px; }
}
.deposit-banner{background:linear-gradient(135deg,var(--green),var(--green-dark));border-radius:var(--radius-lg);padding:16px 20px;color:white;display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px;flex-wrap:wrap}
.deposit-banner h3{font-family:'DM Serif Display',serif;font-size:18px;margin-bottom:3px}
.deposit-banner p{font-size:13px;opacity:.85}
.deposit-btn-white{background:white;color:var(--green-dark);border:none;padding:9px 20px;border-radius:var(--radius);font-size:13px;font-weight:600;cursor:pointer;transition:all .15s}
.deposit-btn-white:hover{background:#f0fdf7}
.paid-banner{background:var(--green-light);border:1px solid #9FE1CB;border-radius:var(--radius-lg);padding:13px 18px;display:flex;align-items:center;gap:12px;margin-bottom:20px}
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1000;align-items:center;justify-content:center;padding:16px}
.modal-overlay.open{display:flex}
.modal{background:white;border-radius:14px;padding:26px;width:100%;max-width:440px;box-shadow:0 20px 60px rgba(0,0,0,.18);animation:fadeUp .2s ease;max-height:90vh;overflow-y:auto}
.modal-title{font-family:'DM Serif Display',serif;font-size:18px;margin-bottom:16px}
.modal-footer{display:flex;gap:8px;justify-content:flex-end;margin-top:16px}
.btn-full{width:100%;justify-content:center}
.info-box{padding:10px 12px;background:var(--surface2);border-radius:var(--radius);font-size:13px}
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}
@media print{.sidebar,.topbar,.no-print{display:none!important}.page-body{padding:0}.card{box-shadow:none}}
