/* BeautyRaena dashboard — design system.
   Extracted from the approved Founder Dashboard mockup so every page matches.
   Type: Inter for all data and UI, Cormorant Garamond for the wordmark and the
   one editorial greeting. Palette: white ground, moss green, gold. */

:root{
  --ink:#000000; --ground:#FAFAF7; --surface:#FFFFFF;
  --accent:#5f6a3e; --gold:#9c7c33; --gold-tint:#F3E9D2; --moss-fill:#eef0e6;
  --border:#ECE8DF; --muted:#6b6a63; --danger:#b3572e; --ok:#4C6B3C;
  --radius:12px;
  --shadow:0 1px 2px rgba(20,20,15,.04), 0 8px 24px rgba(20,20,15,.05);
  --font-ui:'Inter',system-ui,-apple-system,sans-serif;
  --font-editorial:'Cormorant Garamond',Georgia,serif;
}
*{box-sizing:border-box;}
html,body{height:100%;}
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-ui);
  font-weight:400;-webkit-font-smoothing:antialiased;}
h1,h2,h3{font-family:var(--font-ui);font-weight:600;margin:0;}
h1.editorial{font-family:var(--font-editorial);font-weight:600;}
a{color:inherit;}
.wordmark{font-family:var(--font-editorial);letter-spacing:.14em;text-transform:uppercase;
  font-size:16px;font-weight:600;}

/* ---- shell ---- */
.shell{display:flex;flex-direction:column;min-height:100vh;}
.shell>.body{display:flex;flex:1;min-height:0;}

.page-topbar{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;
  border-bottom:1px solid var(--border);background:var(--surface);flex:none;}
.page-switch{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;}
.page-switch .chev{color:var(--muted);font-size:11px;}
.top-actions{display:flex;align-items:center;gap:12px;}
.pill{display:flex;align-items:center;gap:6px;border:1px solid var(--border);
  background:var(--surface);border-radius:999px;
  padding:8px 14px;font-size:13.5px;color:var(--muted);white-space:nowrap;}
.pill svg.ic{width:14px;height:14px;color:var(--muted);}
.bell{position:relative;width:38px;height:38px;border-radius:50%;background:var(--surface);cursor:pointer;
  border:1px solid var(--border);display:flex;align-items:center;justify-content:center;}
.bell .dot{position:absolute;top:6px;right:6px;width:8px;height:8px;border-radius:50%;
  background:var(--danger);}
.avatar{width:38px;height:38px;border-radius:50%;flex:none;cursor:pointer;
  background:var(--gold-tint);color:var(--gold);border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  font-weight:600;font-size:13px;letter-spacing:.02em;user-select:none;}
.avatar:hover{border-color:var(--gold);}

svg.ic{width:16px;height:16px;flex:none;vertical-align:-3px;}
.bell svg.ic{width:17px;height:17px;color:var(--muted);}

/* ---- rail ---- */
.rail{width:220px;flex:0 0 220px;background:var(--surface);border-right:1px solid var(--border);
  display:flex;flex-direction:column;padding:24px 14px;position:sticky;top:0;height:100vh;
  overflow-y:auto;}
.rail .wordmark{padding:0 10px 26px;}
.nav{display:flex;flex-direction:column;gap:2px;flex:1;}
.nav a, .rail .settings a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;
  color:var(--muted);text-decoration:none;font-size:14px;}
.nav a svg.ic, .rail .settings a svg.ic{width:18px;height:18px;flex:0 0 18px;}
.nav a:hover, .rail .settings a:hover{background:var(--ground);color:var(--ink);}
.nav a.active, .rail .settings a.active{background:var(--gold-tint);color:var(--ink);font-weight:600;}
.nav a.active svg.ic, .rail .settings a.active svg.ic{color:var(--gold);}
.nav a .badge{margin-left:auto;background:var(--accent);color:#fff;font-size:11px;
  border-radius:999px;padding:1px 7px;font-weight:600;}
.rail .settings{padding:0;margin:0;}
/* Brand mark, sitting directly above the Settings link. The SVG carries its own
   gold frame, so no border here. Spacing matches the nav item rhythm. */
.rail-mark{display:flex;align-items:center;justify-content:center;padding:14px 0 16px;}
.rail-mark img{width:52px;height:52px;display:block;}

/* ---- main ---- */
.main{flex:1;padding:28px clamp(16px,3vw,40px) 60px;max-width:1280px;min-width:0;}
.topbar{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;
  margin-bottom:24px;flex-wrap:wrap;}
.topbar h1{font-size:26px;line-height:1.2;}
.topbar .sub{color:var(--muted);font-size:15px;margin-top:6px;}

/* ---- cards & grids ---- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:20px;}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.grid-60-40{display:grid;grid-template-columns:1.6fr 1fr;gap:16px;}
.mt{margin-top:16px;}

.card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;gap:12px;}
.card-head h3{font-size:16px;}
.dropdown{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);
  border-radius:8px;padding:6px 12px;font-size:12.5px;
  color:var(--muted);background:var(--surface);cursor:pointer;}
.dropdown svg.ic{width:13px;height:13px;}
.dropdown:hover,.pill:hover{border-color:var(--gold);color:var(--ink);}
.pill{cursor:pointer;}

/* Shared popover for every dropdown in the app. One implementation. */
.menu{position:absolute;z-index:60;min-width:168px;background:var(--surface);
  border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);
  padding:6px;margin-top:6px;}
.menu button{display:block;width:100%;text-align:left;background:none;border:0;
  padding:9px 12px;border-radius:7px;font-family:var(--font-ui);font-size:13.5px;
  color:var(--ink);cursor:pointer;}
.menu button:hover{background:var(--ground);}

/* Notification panel: same popover, richer rows. */
.menu.notif{width:330px;max-height:420px;overflow-y:auto;padding:0;}
.notif-head{display:flex;align-items:center;justify-content:space-between;
  padding:12px 14px;border-bottom:1px solid var(--border);position:sticky;top:0;
  background:var(--surface);}
.notif-head strong{font-size:13.5px;}
.notif-head button{width:auto;padding:4px 8px;font-size:12px;color:var(--gold);border-radius:6px;}
.notif-item{display:block;width:100%;text-align:left;padding:12px 14px;border:0;
  border-bottom:1px solid var(--border);background:none;cursor:pointer;
  font-family:var(--font-ui);border-radius:0;}
.notif-item:last-child{border-bottom:0;}
.notif-item:hover{background:var(--ground);}
.notif-item.unread{background:var(--gold-tint);}
.notif-item .t{display:block;font-size:13.5px;font-weight:600;color:var(--ink);}
.notif-item .b{display:block;font-size:12.5px;color:var(--muted);margin-top:3px;line-height:1.45;}
.notif-item .w{display:block;font-size:11.5px;color:var(--muted);margin-top:5px;}
.notif-empty{padding:30px 16px;text-align:center;color:var(--muted);font-size:13px;}
.menu button[aria-current="true"]{background:var(--gold-tint);font-weight:600;}

/* ---- stat tiles ---- */
.stat .stat-top{display:flex;align-items:center;gap:8px;margin-bottom:14px;}
.stat .ic-dot{width:36px;height:36px;border-radius:50%;background:var(--gold-tint);
  color:var(--gold);display:flex;align-items:center;justify-content:center;flex:0 0 36px;}
.ic-dot svg.ic{width:20px;height:20px;}
.stat label{font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);
  font-weight:500;}
.stat .value{font-weight:500;font-size:30px;font-variant-numeric:tabular-nums;line-height:1;}
.stat .value small{font-size:14px;font-weight:400;color:var(--muted);margin-left:2px;}
.stat .goal-tag{font-size:12px;color:var(--muted);margin-top:2px;}
.delta{font-size:12.5px;color:var(--accent);margin-top:8px;}

/* ---- upsell card ----
   From Ashley's approved dashboard (WhatsApp, 27 Aug): the marketing strip was
   removed and replaced with an upgrade prompt scoped to the current tier.
   Found missing from the live build during DESIGN-QA. */
.upsell{display:flex;align-items:center;justify-content:space-between;gap:20px;
  margin-top:16px;background:var(--moss-fill);border-color:var(--accent);}
.upsell .eyebrow{font-size:11px;font-weight:600;letter-spacing:.08em;
  text-transform:uppercase;color:var(--accent);margin:0 0 4px;}
.upsell h3{font-size:17px;margin:0 0 4px;}
.upsell .upsell-body{font-size:13.5px;color:var(--muted);margin:0;max-width:52ch;}
.upsell-cta{flex:none;background:var(--accent);color:#fff;text-decoration:none;
  font-weight:600;font-size:13.5px;padding:11px 18px;border-radius:8px;white-space:nowrap;}
@media (max-width:640px){.upsell{flex-direction:column;align-items:flex-start;}
  .upsell-cta{width:100%;text-align:center;}}

/* ---- rows ---- */
.row{display:flex;align-items:center;gap:12px;padding:10px 0;
  border-bottom:1px solid var(--border);font-size:14px;}
.row:last-child{border-bottom:0;}
.row.between{justify-content:space-between;}
.num-badge{width:30px;height:30px;border-radius:50%;background:var(--moss-fill);
  color:var(--accent);display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:13px;flex:0 0 30px;}
.row .ic-dot{width:30px;height:30px;flex:0 0 30px;}
.row .ic-dot svg.ic{width:17px;height:17px;}
.row .n{font-weight:700;}
.view-all{display:inline-block;margin-top:12px;color:var(--gold);font-size:13.5px;
  font-weight:600;text-decoration:none;}

/* ---- table ---- */
.tablewrap{overflow-x:auto;}
table.data{width:100%;border-collapse:collapse;font-size:14px;}
table.data th{text-align:left;font-size:11px;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);font-weight:600;padding:0 12px 10px 0;border-bottom:1px solid var(--border);
  white-space:nowrap;}
table.data td{padding:12px 12px 12px 0;border-bottom:1px solid var(--border);vertical-align:middle;}
table.data tr:last-child td{border-bottom:0;}
table.data tbody tr{cursor:default;}
table.data tbody tr.clickable:hover{background:var(--ground);cursor:pointer;}

/* ---- tags ---- */
.tag{display:inline-flex;align-items:center;font-size:11px;font-weight:700;padding:3px 9px;
  border-radius:999px;background:var(--surface);border:1px solid var(--border);color:var(--muted);
  white-space:nowrap;}
.tag.gold{background:var(--gold-tint);border-color:var(--gold-tint);color:var(--gold);}
.tag.moss{background:var(--moss-fill);border-color:var(--moss-fill);color:var(--accent);}
.tag.warn{background:#F7ECD8;border-color:#F7ECD8;color:#9c6b1f;}

/* ---- buttons / forms ---- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--accent);
  color:#fff;border:0;border-radius:8px;padding:12px 20px;font-family:var(--font-ui);
  font-size:14.5px;font-weight:600;cursor:pointer;text-decoration:none;min-height:44px;}
.btn:hover{filter:brightness(1.08);}
.btn.secondary{background:transparent;color:var(--ink);border:1px solid var(--border);}
.btn[disabled],.btn.is-loading{opacity:.6;pointer-events:none;}
.field{margin-bottom:16px;}
.field label{display:block;font-size:13px;font-weight:600;margin-bottom:6px;}
.field input,.field select{width:100%;font-family:var(--font-ui);font-size:15px;padding:12px 14px;
  border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--ink);
  min-height:46px;}
.field input:focus,.field select:focus{outline:2px solid var(--accent);outline-offset:1px;}
.field .hint{font-size:12.5px;color:var(--muted);margin-top:5px;
  display:flex;align-items:center;justify-content:space-between;gap:8px;}
/* Text-styled button, for "Show/Hide password". */
.linkish{background:none;border:0;padding:0;font-family:var(--font-ui);font-size:12.5px;
  color:var(--gold);cursor:pointer;text-decoration:underline;}

/* Consent block. Checkboxes are stacked and separately labelled so agreeing to
   the terms is never confused with agreeing to marketing. */
.consent{margin:4px 0 20px;display:flex;flex-direction:column;gap:12px;}
.check{display:flex;align-items:flex-start;gap:10px;cursor:pointer;
  font-size:12.5px;line-height:1.5;color:var(--muted);}
.check input{margin:1px 0 0;width:16px;height:16px;flex:none;accent-color:var(--accent);cursor:pointer;}
.check a{color:var(--gold);}

/* Long-form legal copy. */
.legal{max-width:720px;margin:0 auto;padding:48px 20px 80px;}
.legal h1{font-family:var(--font-editorial);font-size:32px;font-weight:600;margin-bottom:6px;}
.legal .updated{color:var(--muted);font-size:13px;margin-bottom:28px;}
.legal h2{font-size:15px;margin:28px 0 8px;}
.legal p,.legal li{font-size:14px;line-height:1.65;color:var(--ink);}
.legal ul{padding-left:20px;}
.legal .notice{border:1px solid var(--gold);background:var(--gold-tint);
  border-radius:var(--radius);padding:16px 18px;margin-bottom:28px;font-size:13.5px;}

/* ---- states ---- */
.state{padding:40px 20px;text-align:center;color:var(--muted);font-size:14.5px;}
.state .state-title{font-weight:600;color:var(--ink);margin-bottom:4px;font-size:15px;}
.state.error{color:var(--danger);}
.skeleton{background:linear-gradient(90deg,var(--border) 25%,var(--ground) 50%,var(--border) 75%);
  background-size:200% 100%;animation:sh 1.4s ease-in-out infinite;border-radius:6px;height:14px;}
@keyframes sh{0%{background-position:200% 0;}100%{background-position:-200% 0;}}
@media (prefers-reduced-motion:reduce){.skeleton{animation:none;}}

.banner{display:flex;align-items:center;gap:12px;padding:12px 16px;border-radius:8px;
  font-size:14px;margin-bottom:18px;}
.banner.demo{background:var(--gold-tint);color:#6b5420;}
.banner.warn{background:#F7ECD8;color:#7d5518;}

/* ---- auth pages ---- */
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;}
.auth-card{width:100%;max-width:420px;background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);box-shadow:var(--shadow);padding:32px;}
.auth-card .wordmark{display:block;text-align:center;margin-bottom:6px;font-size:18px;}
.auth-card h1{font-size:20px;text-align:center;margin-bottom:4px;}
.auth-card .sub{text-align:center;color:var(--muted);font-size:14px;margin:0 0 24px;}
.auth-alt{text-align:center;font-size:14px;color:var(--muted);margin-top:18px;}
.auth-alt a{color:var(--accent);font-weight:600;}
.form-error{background:#FBEAE6;color:#A23E32;padding:11px 14px;border-radius:8px;
  font-size:13.5px;margin-bottom:16px;}

/* ---- mobile ---- */
.hamburger{display:none;width:38px;height:38px;border:1px solid var(--border);border-radius:8px;
  background:var(--surface);align-items:center;justify-content:center;cursor:pointer;}
.rail-scrim{display:none;}
@media (max-width:980px){
  .hamburger{display:flex;}
  .rail{position:fixed;left:0;top:0;z-index:40;transform:translateX(-100%);
    transition:transform .2s ease;box-shadow:0 0 40px rgba(0,0,0,.15);}
  .rail.open{transform:translateX(0);}
  .rail-scrim.show{display:block;position:fixed;inset:0;background:rgba(20,20,15,.35);z-index:30;}
  .grid-4{grid-template-columns:1fr 1fr;}
  .grid-3,.grid-2,.grid-60-40{grid-template-columns:1fr;}
  .main{padding:20px 16px 48px;}
}
@media (max-width:560px){
  .grid-4{grid-template-columns:1fr 1fr;}
  .topbar h1{font-size:22px;}
  .page-topbar .pill{display:none;}
}
@media (prefers-reduced-motion:reduce){.rail{transition:none;}}

/* ---- inline help ----------------------------------------------------------
   A small "?" beside a label, opening a short explanation on CLICK. Hover is
   deliberately not a trigger: most of these customers are on a phone, where a
   hover tooltip simply never appears.

   Sized to the 44px touch target rule even though the circle is 16px, so it is
   tappable without being visually loud. */
.help{
  display:inline-flex;align-items:center;justify-content:center;
  width:16px;height:16px;margin-left:6px;padding:0;
  border:1px solid var(--border);border-radius:50%;
  background:transparent;color:var(--muted);
  font-family:var(--font-ui);font-size:11px;font-weight:600;line-height:1;
  cursor:pointer;vertical-align:middle;position:relative;
}
.help::after{content:"";position:absolute;inset:-14px;}   /* touch target */
.help:hover,.help[aria-expanded="true"]{border-color:var(--accent);color:var(--accent);}
.help:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

.helpbox{
  position:absolute;z-index:60;max-width:280px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:12px 14px;box-shadow:0 8px 28px -12px rgba(0,0,0,.28);
}
.helpbox strong{display:block;font-size:13px;margin-bottom:4px;}
.helpbox p{margin:0;font-size:13px;line-height:1.6;color:var(--muted);}
@media (max-width:560px){
  .helpbox{max-width:calc(100vw - 24px);}
}
