/* ============================================================
   SHARED — design tokens, reset, base layout, and generic
   components reused across multiple pages (tables, cards,
   buttons, pills, person rows). Page-specific styles live in
   each page's own folder (overview.css, header.css, etc).
   ============================================================ */

:root{
  --gold:#c48f3c; --gold-deep:#a8752b; --gold-soft:#f9e6c1; --gold-grad1:#ffd966; --gold-grad2:#e6b800;
  --cream:#fff8e7; --surface:#fffbe6; --ink:#333333; --muted:#8a7a5c; --line:#f0dba8;
  --teal:#1e6b7a; --teal-deep:#164f5b; --teal-bg:#e4efef;
  --success:#1e5c2a; --success-bg:#e4f3e6;
  --warn:#8a5a1f; --warn-bg:#faedd2;
  --danger:#8a1f1f; --danger-bg:#fde3e3;
  --radius:10px;
}
*{box-sizing:border-box;}
body{
  margin:0;
  background:var(--cream);
  color:var(--ink);
  font-family:'Inter',sans-serif;
  -webkit-font-smoothing:antialiased;
  font-size:14px;
}
h1,h2,h3{ font-family:'Fraunces',serif; margin:0; color:var(--gold-deep); }
.tab{ font-variant-numeric:tabular-nums; }

.shell{ display:grid; grid-template-columns:236px 1fr; min-height:100vh; }


/* MAIN wrapper */
main{ padding:28px 34px 60px; max-width:1180px; }

/* CARD */
.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.card-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:17px 20px; border-bottom:1px solid var(--line);
}
.card-head h2{ font-size:15px; font-weight:600; font-family:'Fraunces',serif; }
.card-head .link{ font-size:12px; color:var(--gold-deep); font-weight:600; cursor:pointer; text-decoration:none; }

/* TABLE */
table{ width:100%; border-collapse:collapse; }
th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.03em;
  color:var(--muted); font-weight:600; background:var(--gold-soft);
  padding:12px 16px; border-bottom:1px solid var(--line);
}
td{ padding:12px 16px; font-size:13.5px; border-bottom:1px solid var(--line); vertical-align:middle; }
tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background:var(--cream); }
th.num, td.num{ text-align:right; }
.person{ display:flex; align-items:center; gap:10px; }
.p-avatar{
  width:28px; height:28px; border-radius:50%;
  background:var(--gold-soft); color:var(--teal-deep);
  display:flex; align-items:center; justify-content:center;
  font-size:11.5px; font-weight:700; flex-shrink:0;
}
.p-name{ font-weight:600; font-size:13.5px; }
.p-role{ font-size:11px; color:var(--muted); }
.amt{ font-family:'Fraunces',serif; font-weight:600; }
.pill{ display:inline-block; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:600; white-space:nowrap; }
.pill.paid{ background:var(--success-bg); color:var(--success); }
.pill.due{ background:var(--warn-bg); color:var(--warn); }
.pill.overdue{ background:var(--danger-bg); color:var(--danger); }
.row-actions{ display:flex; gap:14px; }
.link-btn{ color:var(--teal-deep); font-size:12.5px; font-weight:600; cursor:pointer; text-decoration:none; }
.link-btn:hover{ color:var(--gold-deep); }

.table-toolbar{ display:flex; justify-content:space-between; align-items:center; padding:17px 20px; border-bottom:1px solid var(--line); flex-wrap:wrap; gap:10px; }
.btn{
  border:1px solid var(--line); background:var(--surface); color:var(--teal-deep);
  font-size:12.5px; font-weight:600; padding:8px 15px; border-radius:8px; cursor:pointer; font-family:inherit;
}
.btn:hover{ border-color:var(--gold); }
.btn.primary{
  background:linear-gradient(160deg, var(--gold), var(--gold-deep));
  border-color:var(--gold-deep); color:#fff;
  box-shadow:0 3px 8px rgba(164,117,43,.3);
}
.btn.primary:hover{ filter:brightness(1.05); }
.search{ background:var(--cream); border:1px solid var(--line); border-radius:8px; padding:8px 12px; font-size:12.5px; color:var(--ink); width:190px; }

/* ---------- phone layout: sidebar becomes a slide-in drawer ---------- */
.za-nav-toggle{
  display:none; position:fixed; top:calc(env(safe-area-inset-top,0px) + 14px); left:14px; z-index:40;
  width:40px; height:40px; padding:0; border-radius:10px; border:1px solid var(--line); background:#fff;
  align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(0,0,0,.12); cursor:pointer;
}
.za-nav-toggle span, .za-nav-toggle span::before, .za-nav-toggle span::after{
  display:block; width:18px; height:2px; background:var(--gold-deep); border-radius:2px; position:relative;
}
.za-nav-toggle span::before{ content:''; position:absolute; top:-6px; }
.za-nav-toggle span::after{ content:''; position:absolute; top:6px; }
.za-nav-backdrop{ display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:998; }

@media (max-width:960px){
  .shell{ grid-template-columns:1fr; }
  .za-nav-toggle{ display:flex; }
  .shell main{ padding:64px 16px 40px; }   /* clears the menu button */

  #sidebar-container{
    position:fixed; top:0; left:0; height:100%; width:min(80vw,280px); z-index:999;
    transform:translateX(-100%); transition:transform .2s ease;
    padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px);
    box-shadow:2px 0 16px rgba(0,0,0,.15);
  }
  body.za-nav-open #sidebar-container{ transform:translateX(0); }
  body.za-nav-open .za-nav-backdrop{ display:block; }
  body.za-nav-open{ overflow:hidden; }

  .card{ overflow-x:auto; }     /* wide tables scroll inside the card instead of being cut off */
  .dlg{ max-width:94vw; }       /* popups (340-520px wide) no longer overflow small phones */
}

/* tab strips scroll sideways instead of squashing (Registrations has 4 tabs, Settings has 7) */
.page-tabs, .settings-tabs{ overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
.page-tab, .settings-tab{ white-space:nowrap; flex-shrink:0; }