/* ==========================================================================
   Advokasy — design tokens
   Palette: deep chambers green + brass + oxblood ribbon-red + warm ivory
   Type: Fraunces (display, characterful serif) / Instrument Sans (body/UI) /
         Space Mono (data, case numbers)
   Signature: a wax-seal emblem that stamps into place — legal work, made official.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,340;0,9..144,480;0,9..144,600;1,9..144,420;1,9..144,500&family=Instrument+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root{
  --ink:        #17241C;
  --ink-soft:   #1F3327;
  --ink-tint:   #2A4636;
  --paper:      #F5F1E6;
  --paper-dim:  #ECE4D2;
  --card:       #FFFDF8;
  --brass:      #AD8A3D;
  --brass-dark: #8F6F2C;
  --brass-tint: #EEE3C4;
  --forest:     #24402F;
  --forest-tint:#DEE8DF;
  --clay:       #8C3A2B;
  --clay-tint:  #F0DCD3;
  --slate:      #635D4E;
  --slate-soft: #8C8570;
  --rule:       #DED2B3;
  --success:    #3F7A5A;
  --success-tint:#DCEBE2;
  --danger:     #963B2C;
  --danger-tint:#F0DCD6;
  --warn:       #B98A2E;
  --warn-tint:  #F3E7CB;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, Menlo, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(23,36,28,0.08), 0 8px 24px -12px rgba(23,36,28,0.22);
  --shadow-pop: 0 16px 44px -10px rgba(23,36,28,0.4);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body{
  margin:0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 .4em;
  letter-spacing: -0.01em;
}
p{ margin: 0 0 1em; color: var(--slate); line-height: 1.6; }
a{ color: inherit; }
button{ font-family: var(--font-body); }
.mono{ font-family: var(--font-mono); }

:focus-visible{
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.container{ max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ---------------------------------------------------------------- links */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family: var(--font-body); font-weight:600; font-size:14.5px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor:pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  text-decoration:none; line-height:1;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--brass); color: var(--paper); }
.btn-primary:hover{ background: var(--brass-dark); box-shadow: 0 6px 16px -6px rgba(168,124,46,.55); transform: translateY(-1px); }
.btn-dark{ background: var(--ink); color: var(--paper); }
.btn-dark:hover{ background: var(--ink-soft); box-shadow: 0 6px 16px -6px rgba(22,35,58,.5); transform: translateY(-1px); }
.btn-ghost{ background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover{ border-color: var(--slate-soft); }
.btn-sm{ padding: 7px 14px; font-size: 13px; }
.btn-danger{ background: var(--danger-tint); color: var(--danger); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* --------------------------------------------------------------- forms */
label{ display:block; font-size:12.5px; font-weight:600; color: var(--slate); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea{
  width:100%; font-family: var(--font-body); font-size:14.5px; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--card); transition: border-color .12s ease;
}
input:focus, select:focus, textarea:focus{ border-color: var(--brass); outline:none; }
.field{ margin-bottom: 16px; }
.field-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 14px; }
textarea{ resize: vertical; min-height: 90px; }

/* ---------------------------------------------------------------- misc */
.eyebrow{
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brass-dark); display:flex; align-items:center; gap:8px; margin-bottom:10px;
}
.eyebrow::before{ content:''; width:16px; height:1px; background: var(--brass-dark); display:inline-block; }

.tag{ display:inline-flex; align-items:center; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight:600; }
.tag-success{ background: var(--success-tint); color: var(--success); }
.tag-danger{ background: var(--danger-tint); color: var(--danger); }
.tag-warn{ background: var(--warn-tint); color: var(--warn); }
.tag-neutral{ background: var(--paper-dim); color: var(--slate); }

.card{ background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }

/* =========================================================================
   Marketing / landing page (index.html)
   ========================================================================= */
.site-header{
  position: sticky; top:0; z-index: 40; background: rgba(245,241,230,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .container{ display:flex; align-items:center; justify-content:space-between; height: 72px; gap:16px; }
.brand{ display:flex; align-items:center; gap:10px; font-family: var(--font-display); font-weight:600; font-size: 21px; color: var(--ink); text-decoration:none; flex-shrink:0; }
.brand .mark{
  width: 32px; height:32px; border-radius: 50%; background: var(--forest);
  display:flex; align-items:center; justify-content:center; color: var(--brass-tint);
  font-family: var(--font-display); font-style:italic; font-weight:600; font-size: 15px; flex-shrink:0; overflow:hidden;
}
.site-nav{ display:flex; align-items:center; gap: 30px; }
.site-nav a{ text-decoration:none; color: var(--slate); font-size: 14.5px; font-weight:500; }
.site-nav a:hover{ color: var(--ink); }
.header-actions{ display:flex; align-items:center; gap: 12px; }
.nav-toggle{
  display:none; background:none; border:1px solid var(--rule); border-radius: var(--radius-sm);
  width:38px; height:38px; cursor:pointer; align-items:center; justify-content:center; flex-shrink:0;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after{
  content:''; display:block; width:16px; height:2px; background: var(--ink); position:relative; transition: transform .15s ease, opacity .15s ease;
}
.nav-toggle span::before{ position:absolute; top:-5px; }
.nav-toggle span::after{ position:absolute; top:5px; }
.nav-toggle.open span{ background: transparent; }
.nav-toggle.open span::before{ top:0; transform: rotate(45deg); }
.nav-toggle.open span::after{ top:0; transform: rotate(-45deg); }

/* ---- Hero ---------------------------------------------------------- */
.hero{ padding: 76px 0 64px; position:relative; overflow:hidden; }
.hero::before{
  content:''; position:absolute; inset:0; pointer-events:none; opacity:.55;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px);
  background-size: 100% 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.4), transparent 65%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.4), transparent 65%);
}
.hero .container{ position:relative; }
.hero-grid{ display:grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items:center; }
.hero h1{ font-size: 50px; line-height: 1.06; max-width: 600px; font-weight:480; }
.hero h1 em{ font-style:italic; color: var(--clay); font-weight:500; }
.hero .lede{ font-size: 17px; max-width: 460px; margin-top:18px; }
.hero-actions{ display:flex; gap:14px; margin-top: 30px; flex-wrap:wrap; }
.trust-row{ display:flex; gap:22px; margin-top:22px; flex-wrap:wrap; }
.trust-row span{ font-size:12.5px; color: var(--slate); display:flex; align-items:center; gap:6px; }
.trust-row span::before{ content:'✓'; color: var(--success); font-weight:700; }

/* Signature element: a wax seal that stamps into place on load */
.seal-wrap{ position:relative; display:inline-block; margin-bottom:18px; }
.seal{
  width:64px; height:64px;
  animation: seal-stamp .6s cubic-bezier(.2,1.4,.4,1) .15s both;
  filter: drop-shadow(0 6px 10px rgba(23,36,28,.25));
}
@keyframes seal-stamp{
  0%{ opacity:0; transform: scale(1.9) rotate(-18deg); }
  60%{ opacity:1; }
  100%{ opacity:1; transform: scale(1) rotate(-8deg); }
}

/* ---- Login card (right side of hero) — a dark ledger-bound panel --- */
.login-card{
  background: var(--forest); border-radius: var(--radius-lg); padding: 34px 30px 28px;
  box-shadow: var(--shadow-pop); position:relative; color: var(--paper);
  background-image: radial-gradient(circle at 100% 0%, rgba(173,138,61,.22), transparent 60%);
}
.login-card::before{
  content:'SIGN IN'; position:absolute; top:-13px; left:28px; background: var(--brass); color: var(--ink);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing:.16em; font-weight:700;
  padding: 5px 12px; border-radius: 3px;
}
.login-card h3{ font-size: 20px; margin-bottom: 4px; color: var(--paper); }
.login-card .sub{ font-size: 13.5px; color: rgba(245,241,230,.62); margin-bottom: 22px; }
.login-card label{ color: rgba(245,241,230,.55); }
.login-card input{
  background: rgba(245,241,230,.07); border: 1px solid rgba(245,241,230,.2); color: var(--paper);
}
.login-card input::placeholder{ color: rgba(245,241,230,.32); }
.login-card input:focus{ border-color: var(--brass); background: rgba(245,241,230,.11); }
.login-card .form-foot{ color: rgba(245,241,230,.55); }
.login-card .form-foot a{ color: var(--brass-tint); }
.login-card .form-msg.error{ background: rgba(140,58,43,.35); color: #F4DAD3; }
.login-card .form-msg.success{ background: rgba(63,122,90,.35); color: #D9EEE3; }

/* ---- Ribbon divider — used between major sections ------------------ */
.ribbon-divider{ display:flex; align-items:center; gap:16px; margin: 0 auto; max-width: 1180px; padding: 0 28px; }
.ribbon-divider::before, .ribbon-divider::after{ content:''; flex:1; height:1px; background: var(--rule); }
.ribbon-divider .medallion{
  width:30px; height:30px; border-radius:50%; background: var(--clay); flex-shrink:0;
  display:flex; align-items:center; justify-content:center; color: var(--brass-tint);
  font-family: var(--font-display); font-style:italic; font-size:13px; box-shadow: 0 4px 10px rgba(140,58,43,.35);
}

/* ---- Stats strip ----------------------------------------------------- */
.strip{ background: var(--forest); color: var(--paper); padding: 40px 0; }
.strip-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align:center; }
.strip-grid > div{ padding: 0 12px; border-left: 1px solid rgba(245,241,230,.14); }
.strip-grid > div:first-child{ border-left:none; }
.strip-grid .num{ font-family: var(--font-display); font-size: 32px; color: var(--brass-tint); font-style:italic; }
.strip-grid .lbl{ font-size: 12.5px; color: rgba(245,241,230,.6); text-transform: uppercase; letter-spacing: .05em; margin-top:4px; }

.features{ padding: 84px 0; }
.section-head{ max-width: 620px; margin-bottom: 48px; }
.section-head h2{ font-size: 32px; }

/* ---- Ledger showcase card (case file preview) ------------------------ */
.ledger-stack{ position:relative; }
.ledger-stack::before{
  content:''; position:absolute; inset:16px -16px -16px 16px; background: var(--forest-tint);
  border-radius: var(--radius-lg); transform: rotate(-2deg); z-index:0;
}
.ledger-card{
  background: var(--card); border:1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 30px 28px; box-shadow: var(--shadow-pop); position:relative; z-index:1;
}
.ledger-card::before{
  content:''; position:absolute; top:-8px; right:32px; width:16px; height:42px; background: var(--clay);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  box-shadow: 0 3px 6px rgba(140,58,43,.3);
}
.ledger-row{ display:flex; justify-content:space-between; align-items:baseline; padding: 12px 0; border-bottom: 1px dashed var(--rule); font-size: 13.5px; }
.ledger-row:last-child{ border-bottom:none; }
.ledger-row .k{ color: var(--slate-soft); font-family: var(--font-mono); font-size: 11px; text-transform:uppercase; letter-spacing:.05em; }
.ledger-row .v{ font-family: var(--font-mono); color: var(--ink); font-weight:700; }

/* ---- Modules grid ------------------------------------------------------ */
.module-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.module-card{
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-md);
  padding: 24px 22px 22px; position:relative; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.module-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--brass); }
.module-card .icon-badge{
  width:42px; height:42px; border-radius:50%; background: var(--forest-tint); color: var(--forest);
  display:flex; align-items:center; justify-content:center; margin-bottom:16px;
}
.module-card .icon-badge svg{ width:21px; height:21px; }
.module-card .num{ position:absolute; top:22px; right:20px; font-family: var(--font-mono); font-size:11px; color: var(--slate-soft); }
.module-card h3{ font-size: 15.5px; margin: 0 0 8px; line-height:1.3; }
.module-card p{ font-size: 13px; color: var(--slate); margin:0; line-height:1.55; }

/* ---- Testimonials, styled as signed letters --------------------------- */
.testimonial-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:18px; }
.testimonial-card{ padding: 26px 24px; border-left: 3px solid var(--clay); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.testimonial-card .quote{ font-family: var(--font-display); font-style:italic; font-size:16px; color: var(--ink); line-height:1.6; margin-bottom:18px; }
.testimonial-card .who .name{ font-weight:600; font-size:13.5px; position:relative; display:inline-block; }
.testimonial-card .who .name::after{ content:''; display:block; width:34px; height:2px; background: var(--clay); margin-top:5px; border-radius:2px; }
.testimonial-card .who .role{ font-size:12px; color: var(--slate-soft); margin-top:6px; }

/* ---- Pricing teaser cards ---------------------------------------------- */
.pricing-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:18px; margin-top:8px; }
.pricing-card{ padding:28px 24px; text-align:left; position:relative; }
.pricing-card.featured{ border-color: var(--brass); box-shadow: var(--shadow-pop); }
.pricing-card.featured::before{
  content:'MOST CHOSEN'; position:absolute; top:-11px; left:24px; background: var(--brass); color: var(--ink);
  font-family: var(--font-mono); font-size: 10px; letter-spacing:.12em; font-weight:700; padding: 4px 10px; border-radius: 3px;
}
.pricing-card .plan-name{ font-family: var(--font-display); font-size:20px; margin-bottom:2px; }
.pricing-card .plan-price{ font-family: var(--font-mono); font-size:26px; color: var(--ink); margin: 10px 0 4px; }
.pricing-card .plan-price span{ font-size:12.5px; color: var(--slate-soft); font-family: var(--font-body); }
.pricing-card ul{ list-style:none; margin: 18px 0 22px; padding:0; font-size:13.5px; color: var(--slate); }
.pricing-card li{ padding: 6px 0; display:flex; gap:8px; }
.pricing-card li::before{ content:'✓'; color: var(--success); font-weight:700; }

.cta-band{
  background: var(--clay); color: var(--paper); padding: 76px 0; text-align:center; position:relative;
}
.cta-band::before{ content:''; position:absolute; top:0; left:0; right:0; height:3px; background: linear-gradient(90deg, transparent, var(--brass-tint), transparent); }
.cta-band h2{ color: var(--paper); font-size: 32px; }
.cta-band p{ color: rgba(245,241,230,.75); max-width: 480px; margin: 0 auto 26px; }
.cta-band .btn-primary{ background: var(--brass); color: var(--ink); }
.cta-band .btn-primary:hover{ background: var(--brass-tint); }

.site-footer{ padding: 34px 0; border-top: 1px solid var(--rule); }
.site-footer .container{ display:flex; justify-content:space-between; align-items:center; font-size: 13px; color: var(--slate-soft); flex-wrap:wrap; gap:10px; }

/* Login card on landing page */
.auth-panel{ background: var(--card); border-radius: var(--radius-lg); border:1px solid var(--rule); box-shadow: var(--shadow-card); padding: 26px; }
.auth-panel h3{ font-size: 19px; margin-bottom: 4px; }
.auth-panel .sub{ font-size: 13.5px; color: var(--slate); margin-bottom: 20px; }
.form-msg{ font-size: 13.5px; padding: 9px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; display:none; }
.form-msg.show{ display:block; }
.form-msg.error{ background: var(--danger-tint); color: var(--danger); }
.form-msg.success{ background: var(--success-tint); color: var(--success); }
.form-foot{ margin-top: 14px; font-size: 13px; text-align:center; color: var(--slate); }
.form-foot a{ color: var(--brass-dark); font-weight:600; text-decoration:none; }

/* Register / pricing page */
.auth-page{ min-height: 100vh; display:flex; align-items:center; padding: 60px 0; }
.auth-shell{ max-width: 480px; margin: 0 auto; width:100%; }
.plan-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.plan-option{
  border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 12px; cursor:pointer;
  text-align:center; transition: border-color .12s ease, background .12s ease;
}
.plan-option.active{ border-color: var(--brass); background: var(--brass-tint); }
.plan-option .name{ font-weight:700; font-size:14px; }
.plan-option .price{ font-family: var(--font-mono); font-size: 12.5px; color: var(--slate); }
.cycle-toggle{ display:flex; gap:8px; margin-bottom:18px; }
.cycle-toggle button{ flex:1; padding:8px; border-radius: var(--radius-sm); border:1px solid var(--rule); background:var(--card); font-size:13px; font-weight:600; cursor:pointer; }
.cycle-toggle button.active{ background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* =========================================================================
   App shell (dashboard.html) — sidebar styled as a case-file tab index
   ========================================================================= */
.app-shell{ display:grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar{ background: var(--ink); color: var(--paper); display:flex; flex-direction:column; }
.sidebar .brand{ color: var(--paper); padding: 22px 20px 18px; border-bottom: 1px solid rgba(250,247,241,.1); }
.sidebar .brand .mark{ background: var(--brass); color: var(--ink); }
.side-nav{ flex:1; padding: 14px 10px; overflow-y:auto; }
.side-nav .tab-label{ font-family: var(--font-mono); font-size: 10.5px; letter-spacing:.1em; color: rgba(250,247,241,.4); text-transform:uppercase; padding: 14px 12px 6px; }
.side-link{
  display:flex; align-items:center; gap:11px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(250,247,241,.72); text-decoration:none; font-size: 14px; font-weight:500; cursor:pointer;
  border-left: 2px solid transparent;
}
.side-link .idx{ font-family: var(--font-mono); font-size:11px; color: rgba(250,247,241,.4); width:18px; }
.side-link:hover{ background: rgba(250,247,241,.06); color: var(--paper); }
.side-link.active{ background: rgba(168,124,46,.14); color: var(--paper); border-left-color: var(--brass); }
.side-link.active .idx{ color: var(--brass); }
.sidebar-foot{ padding: 16px 20px; border-top: 1px solid rgba(250,247,241,.1); font-size: 13px; }
.sidebar-foot .who{ font-weight:600; }
.sidebar-foot .role{ color: rgba(250,247,241,.5); font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; }
.sidebar-foot button{ margin-top:10px; width:100%; }

.main{ display:flex; flex-direction:column; min-height:100vh; background: var(--paper); }
.topbar{
  height: 66px; display:flex; align-items:center; justify-content:space-between;
  padding: 0 28px; border-bottom: 1px solid var(--rule); background: var(--paper);
  position: sticky; top:0; z-index: 20;
}
.topbar h1{ font-size: 20px; margin:0; }
.topbar-actions{ display:flex; align-items:center; gap: 14px; }
.bell-btn{ position:relative; background:none; border:1px solid var(--rule); border-radius: 50%; width:38px; height:38px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.bell-dot{ position:absolute; top:7px; right:8px; width:7px; height:7px; border-radius:50%; background: var(--danger); display:none; }
.bell-dot.show{ display:block; }

.view{ padding: 26px 28px 60px; }
.view-head{ display:flex; align-items:flex-end; justify-content:space-between; margin-bottom: 20px; flex-wrap:wrap; gap:12px; }
.view-head h2{ font-size: 22px; margin-bottom:2px; }
.view-head .desc{ font-size: 13.5px; color: var(--slate); margin:0; }

.kpi-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.kpi-card{ padding: 18px 20px; }
.kpi-card .lbl{ font-size: 12px; color: var(--slate); text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
.kpi-card .val{ font-family: var(--font-display); font-size: 28px; }

.panel-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:18px; margin-bottom: 22px; }
.panel{ padding: 20px 22px; }
.panel h3{ font-size: 15px; display:flex; align-items:center; justify-content:space-between; }
.panel .empty{ font-size: 13.5px; color: var(--slate-soft); padding: 18px 0; text-align:center; }
.list-row{ display:flex; justify-content:space-between; align-items:center; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.list-row:last-child{ border-bottom:none; }
.list-row .t1{ font-weight:600; }
.list-row .t2{ color: var(--slate); font-size:12.5px; }

.toolbar{ display:flex; gap:10px; align-items:center; margin-bottom: 16px; flex-wrap:wrap; }
.toolbar input, .toolbar select{ width:auto; min-width: 160px; }
.toolbar .grow{ flex:1; min-width:200px; }

table{ width:100%; border-collapse: collapse; font-size: 13.5px; }
.table-card{ overflow-x:auto; }
thead th{
  text-align:left; font-size: 11px; text-transform:uppercase; letter-spacing:.05em; color: var(--slate);
  padding: 12px 16px; border-bottom: 1px solid var(--rule); background: var(--paper-dim);
  position: sticky; top:0;
}
tbody td{ padding: 13px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background: var(--paper-dim); }
.row-link{ color: var(--brass-dark); font-weight:600; cursor:pointer; text-decoration:none; }
.cell-mono{ font-family: var(--font-mono); font-size: 12.5px; color: var(--slate); }
.avatar-stack{ display:flex; }
.avatar{
  width:24px; height:24px; border-radius:50%; background: var(--brass-tint); color: var(--brass-dark);
  font-size: 10.5px; font-weight:700; display:flex; align-items:center; justify-content:center;
  border: 2px solid var(--card); margin-left:-6px;
}
.avatar:first-child{ margin-left:0; }

.icon-btn{ background:none; border:none; cursor:pointer; color: var(--slate); padding:4px; border-radius:4px; }
.icon-btn:hover{ color: var(--ink); background: var(--paper-dim); }

/* Modal */
.modal-backdrop{
  position: fixed; inset:0; background: rgba(22,35,58,.45); display:none; align-items:center; justify-content:center;
  z-index: 100; padding: 20px;
}
.modal-backdrop.show{ display:flex; }
.modal{ background: var(--card); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 88vh; overflow-y:auto; box-shadow: var(--shadow-pop); }
.modal-head{ display:flex; justify-content:space-between; align-items:center; padding: 20px 22px; border-bottom: 1px solid var(--rule); }
.modal-head h3{ margin:0; font-size:17px; }
.modal-body{ padding: 22px; }
.modal-foot{ padding: 16px 22px; border-top: 1px solid var(--rule); display:flex; justify-content:flex-end; gap:10px; }
.modal-close{ background:none; border:none; font-size:20px; cursor:pointer; color: var(--slate); line-height:1; }

/* Toast */
.toast-wrap{ position: fixed; bottom: 24px; right: 24px; z-index: 200; display:flex; flex-direction:column; gap:10px; }
.toast{
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; box-shadow: var(--shadow-pop); min-width: 240px;
  animation: toast-in .18s ease;
}
.toast.error{ background: var(--danger); }
.toast.success{ background: var(--success); }
@keyframes toast-in{ from{ opacity:0; transform: translateY(8px); } to{ opacity:1; transform:none; } }

.badge-count{
  display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 4px;
  background: var(--brass); color: var(--ink); font-size: 10.5px; font-weight:700; border-radius: 10px; margin-left:auto;
}

/* Chat-style AI panel */
.ai-output{
  background: var(--paper-dim); border: 1px solid var(--rule); border-radius: var(--radius-md);
  padding: 18px; font-family: var(--font-mono); font-size: 12.5px; line-height:1.7; white-space: pre-wrap;
  max-height: 420px; overflow-y:auto;
}

/* Responsive */
.sidebar-backdrop{ display:none; position: fixed; inset:0; background: rgba(22,35,58,.45); z-index:55; }
.sidebar-backdrop.show{ display:block; }
.menu-toggle{
  display:none; background:none; border:1px solid var(--rule); border-radius: var(--radius-sm);
  width:36px; height:36px; cursor:pointer; align-items:center; justify-content:center; flex-shrink:0;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after{
  content:''; display:block; width:15px; height:2px; background: var(--ink); position:relative;
}
.menu-toggle span::before{ position:absolute; top:-5px; }
.menu-toggle span::after{ position:absolute; top:5px; }

@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .login-card{ max-width: 440px; margin: 0 auto; }
  .strip-grid{ grid-template-columns: repeat(2,1fr); row-gap: 22px; }
  .strip-grid > div:nth-child(3){ border-left:none; }
  .module-grid{ grid-template-columns: repeat(2, 1fr); }
  .panel-grid{ grid-template-columns: 1fr; }
  .kpi-grid{ grid-template-columns: repeat(2,1fr); }

  /* App shell becomes a slide-out drawer instead of a fixed column */
  .app-shell{ grid-template-columns: 1fr; }
  .sidebar{
    position: fixed; top:0; left:0; bottom:0; width: 258px; z-index:60;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: none;
  }
  .sidebar.open{ transform: translateX(0); box-shadow: var(--shadow-pop); }
  .menu-toggle{ display:flex; }
}

@media (max-width: 720px){
  .site-nav{ display:none; }
  .site-nav.open{
    display:flex; flex-direction:column; gap:2px; position:absolute; top:100%; left:0; right:0;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: 10px 20px 16px; box-shadow: var(--shadow-card);
  }
  .site-nav.open a{ padding: 10px 4px; border-bottom: 1px solid var(--rule); }
  .site-nav.open a:last-child{ border-bottom:none; }
  .nav-toggle{ display:flex; }
}

@media (max-width: 640px){
  .container{ padding: 0 18px; }
  .hero{ padding: 48px 0 40px; }
  .hero h1{ font-size: 30px; }
  .hero .lede{ font-size: 15px; }
  .hero-actions .btn{ flex:1; min-width: 140px; }
  .strip{ padding: 24px 0; }
  .strip-grid{ grid-template-columns: repeat(2,1fr); gap:16px; }
  .strip-grid .num{ font-size: 24px; }
  .testimonial-grid{ grid-template-columns: 1fr; }
  .module-grid{ grid-template-columns: 1fr; }
  .pricing-grid{ grid-template-columns: 1fr; }
  .features{ padding: 52px 0; }
  .section-head h2{ font-size: 24px; }
  .cta-band{ padding: 48px 0; }
  .cta-band h2{ font-size: 24px; }
  .auth-page{ padding: 36px 0; }
  .plan-grid{ grid-template-columns: 1fr; }
  .field-row{ grid-template-columns: 1fr; gap:0; }
  .kpi-grid{ grid-template-columns: 1fr 1fr; gap:10px; }
  .kpi-card .val{ font-size: 22px; }
  .topbar{ padding: 0 16px; }
  .topbar h1{ font-size: 17px; }
  .view{ padding: 18px 16px 48px; }
  .view-head{ align-items:flex-start; flex-direction:column; }
  .toolbar{ flex-direction:column; align-items:stretch; }
  .toolbar input, .toolbar select{ width:100%; min-width:0; }
  .modal{ max-width: 94vw; max-height:92vh; }
  .modal-body{ padding:16px; }
  .ledger-row{ font-size:12.5px; }
}


/* Toggle switch (feature flags) — super admin panel */
.switch-row{ display:flex; align-items:center; justify-content:space-between; padding: 14px 0; border-bottom: 1px solid var(--rule); gap:16px; }
.switch-row:last-child{ border-bottom:none; }
.switch-row .t1{ font-weight:600; font-size:14px; }
.switch-row .t2{ color: var(--slate); font-size:12.5px; margin-top:2px; }
.switch{ position: relative; width:42px; height:24px; flex-shrink:0; }
.switch input{ opacity:0; width:0; height:0; }
.switch .slider{
  position:absolute; inset:0; background: var(--rule); border-radius: 24px; cursor:pointer; transition: background .15s ease;
}
.switch .slider::before{
  content:''; position:absolute; width:18px; height:18px; left:3px; top:3px; background: var(--card);
  border-radius:50%; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider{ background: var(--brass); }
.switch input:checked + .slider::before{ transform: translateX(18px); }

.section-card{ padding: 22px 24px; margin-bottom: 18px; }
.section-card h3{ font-size:15px; margin-bottom:2px; }
.section-card .hint{ font-size:12.5px; color: var(--slate-soft); margin-bottom:16px; }

/* CMS page body — raw HTML authored by the super admin (terms, privacy, custom pages) */
.page-body{ font-size:15px; line-height:1.75; color: var(--ink); }
.page-body h2{ font-size:19px; margin-top:28px; }
.page-body h3{ font-size:16px; margin-top:20px; }
.page-body p{ color: var(--ink); }
.page-body ul, .page-body ol{ color: var(--ink); padding-left:22px; margin-bottom:1em; }
.page-body li{ margin-bottom:6px; }
.page-body a{ color: var(--brass-dark); }

/* Calendar view */
.calendar-toolbar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:12px; }
.calendar-toolbar h3{ margin:0; font-size:19px; font-family: var(--font-display); }
.calendar-nav{ display:flex; gap:8px; align-items:center; }
.calendar-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:1px; background: var(--rule); border:1px solid var(--rule); border-radius: var(--radius-md); overflow:hidden; }
.calendar-weekday{ background: var(--paper-dim); padding:9px 6px; text-align:center; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color: var(--slate); font-weight:700; }
.calendar-day{ background: var(--card); min-height:92px; padding:8px; cursor:pointer; transition: background .12s ease; position:relative; }
.calendar-day:hover{ background: var(--paper-dim); }
.calendar-day.other-month{ background: var(--paper-dim); opacity:.45; cursor:default; }
.calendar-day.today{ background: var(--brass-tint); }
.calendar-day .day-num{ font-family: var(--font-mono); font-size:12px; color: var(--slate); }
.calendar-day.today .day-num{ font-weight:700; color: var(--ink); }
.calendar-day .day-count{
  position:absolute; top:7px; right:7px; background: var(--clay); color: var(--paper);
  font-size:10px; font-weight:700; border-radius:10px; padding:1px 7px; font-family: var(--font-mono);
}
.calendar-day .day-events{ margin-top:16px; display:flex; flex-direction:column; gap:3px; }
.calendar-day .day-event{
  font-size:10.5px; background: var(--forest-tint); color: var(--forest); padding:2px 5px; border-radius:3px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.calendar-day .day-event-more{ font-size:10px; color: var(--slate-soft); padding:0 5px; }
@media (max-width: 640px){
  .calendar-day{ min-height:60px; padding:5px; }
  .calendar-day .day-events{ display:none; }
  .calendar-weekday{ font-size:9px; padding:6px 2px; }
}
