/* ============================================================
   ELF SERVICES — Design System
   Ethereal Glass · OLED black · copper accent
   ============================================================ */

:root{
  /* Surfaces */
  --bg:            #08090B;
  --bg-soft:       #0D0F12;
  --surface:       rgba(255,255,255,.042);
  --surface-2:     rgba(255,255,255,.065);
  --surface-3:     rgba(255,255,255,.09);
  --line:          rgba(255,255,255,.09);
  --line-strong:   rgba(255,255,255,.16);

  /* Text */
  --text:          #F3F0EB;
  --text-2:        #B9B7B2;
  --muted:         #7E7E88;
  --faint:         #55555F;

  /* Accent — copper */
  --accent:        #E09A5E;
  --accent-strong: #F0AE72;
  --accent-dim:    rgba(224,154,94,.14);
  --accent-line:   rgba(224,154,94,.34);

  /* Semantic */
  --ok:            #5FBF8F;
  --ok-dim:        rgba(95,191,143,.13);
  --warn:          #E0B45E;
  --warn-dim:      rgba(224,180,94,.13);
  --danger:        #E07070;
  --danger-dim:    rgba(224,112,112,.13);
  --info:          #6FA8DC;
  --info-dim:      rgba(111,168,220,.13);

  /* Type */
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;

  /* Space */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* Radius */
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;

  /* Motion */
  --ease: cubic-bezier(.32,.72,0,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur: .42s;

  /* Shadow */
  --shadow-float: 0 18px 50px -12px rgba(0,0,0,.75);
  --shadow-card:  0 2px 20px -6px rgba(0,0,0,.5);

  --sidebar-w: 248px;
  --topbar-h: 76px;
}

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

html,body{ height:100%; }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-sans);
  font-size:15px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}

h1,h2,h3,h4{ margin:0; font-weight:600; letter-spacing:-.02em; line-height:1.15; }
p{ margin:0; }
button{ font-family:inherit; font-size:inherit; color:inherit; cursor:pointer; }
input,textarea,select{ font-family:inherit; font-size:inherit; color:inherit; }
a{ color:var(--accent); text-decoration:none; }
::selection{ background:var(--accent-dim); color:var(--accent-strong); }

/* ---------- Backdrop ---------- */
.backdrop{ position:fixed; inset:0; z-index:0; overflow:hidden; pointer-events:none; }
.orb{ position:absolute; border-radius:50%; filter:blur(90px); opacity:.5; }
.orb-a{ width:52vw; height:52vw; top:-18vw; left:-10vw;
  background:radial-gradient(circle, rgba(224,154,94,.30), transparent 68%); }
.orb-b{ width:46vw; height:46vw; bottom:-16vw; right:-8vw;
  background:radial-gradient(circle, rgba(90,120,190,.20), transparent 70%); }
.orb-c{ width:34vw; height:34vw; top:38%; left:52%;
  background:radial-gradient(circle, rgba(150,90,160,.14), transparent 70%); }
.grain{ position:absolute; inset:0; opacity:.035; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Glass primitive ---------- */
.glass{
  background:var(--surface);
  backdrop-filter:blur(22px) saturate(150%);
  -webkit-backdrop-filter:blur(22px) saturate(150%);
  border:1px solid var(--line);
  box-shadow:var(--shadow-float), inset 0 1px 0 rgba(255,255,255,.07);
}

/* ---------- Typography helpers ---------- */
.eyebrow{
  font-size:10px; font-weight:600; letter-spacing:.22em; text-transform:uppercase;
  color:var(--muted); margin:0 0 6px;
}
.serif{ font-family:var(--font-serif); font-weight:400; letter-spacing:-.01em; }
.muted{ color:var(--muted); }
.small{ font-size:12.5px; }
.mono{ font-variant-numeric:tabular-nums; font-feature-settings:"tnum"; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-screen{
  position:relative; z-index:2; min-height:100dvh;
  display:grid; place-items:center; padding:24px;
}
.login-card{
  width:100%; max-width:420px; border-radius:var(--r-xl);
  padding:clamp(28px,5vw,44px);
  animation:rise .8s var(--ease-out) both;
}
@keyframes rise{ from{ opacity:0; transform:translateY(24px) scale(.985); filter:blur(6px);} to{ opacity:1; transform:none; filter:none;} }

.login-brand{ display:flex; gap:16px; align-items:flex-start; margin-bottom:34px; }
.brand-mark{
  width:46px; height:46px; flex:none; border-radius:14px;
  display:grid; place-items:center; color:var(--accent);
  background:linear-gradient(150deg, rgba(224,154,94,.20), rgba(224,154,94,.05));
  border:1px solid var(--accent-line);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12);
}
.brand-mark svg{ width:26px; height:26px; }
.brand-mark.small{ width:38px; height:38px; border-radius:11px; }
.brand-mark.small svg{ width:21px; height:21px; }

.login-title{
  font-family:var(--font-serif); font-weight:400; font-size:clamp(30px,7vw,38px);
  line-height:1.02; letter-spacing:-.02em;
}
.login-title em{ font-style:italic; color:var(--accent); }

.field{ display:block; margin-bottom:16px; }
.field-label{
  display:block; font-size:11px; font-weight:600; letter-spacing:.14em;
  text-transform:uppercase; color:var(--muted); margin-bottom:8px;
}
.field input, .field textarea, .field select{
  width:100%; padding:13px 15px; border-radius:var(--r-md);
  background:rgba(0,0,0,.28); border:1px solid var(--line);
  color:var(--text); outline:none;
  transition:border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.field input::placeholder{ color:var(--faint); }
.field input:focus, .field textarea:focus, .field select:focus{
  border-color:var(--accent-line); background:rgba(0,0,0,.4);
  box-shadow:0 0 0 3px var(--accent-dim);
}
.field-pw{ position:relative; }
.field-pw input{ padding-right:48px; }
.pw-toggle{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  width:36px; height:36px; border:0; background:transparent; border-radius:9px;
  display:grid; place-items:center; color:var(--muted);
  transition:color .2s, background .2s;
}
.pw-toggle:hover{ color:var(--text); background:var(--surface-2); }
.pw-toggle svg{ width:19px; height:19px; }

.login-error{
  color:var(--danger); font-size:13px; margin:-4px 0 14px;
  padding:10px 13px; border-radius:var(--r-sm);
  background:var(--danger-dim); border:1px solid rgba(224,112,112,.25);
}
.login-foot{
  text-align:center; font-size:11px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--faint); margin-top:26px;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  padding:11px 18px; border-radius:var(--r-full); border:1px solid transparent;
  font-weight:600; font-size:14px; letter-spacing:-.01em;
  transition:transform .3s var(--ease), background .3s var(--ease),
             border-color .3s var(--ease), box-shadow .3s var(--ease), color .3s;
  white-space:nowrap; user-select:none;
}
.btn:active{ transform:scale(.975); }
.btn svg{ width:17px; height:17px; flex:none; }

.btn-primary{
  background:linear-gradient(160deg, var(--accent-strong), var(--accent));
  color:#1A1208; border-color:rgba(255,255,255,.18);
  box-shadow:0 8px 24px -8px rgba(224,154,94,.55), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover{ box-shadow:0 12px 32px -8px rgba(224,154,94,.7), inset 0 1px 0 rgba(255,255,255,.45); }

.btn-ghost{
  background:var(--surface); border-color:var(--line); color:var(--text-2);
}
.btn-ghost:hover{ background:var(--surface-2); border-color:var(--line-strong); color:var(--text); }

.btn-danger{ background:var(--danger-dim); border-color:rgba(224,112,112,.3); color:var(--danger); }
.btn-danger:hover{ background:rgba(224,112,112,.2); }

.btn-sm{ padding:8px 13px; font-size:12.5px; }
.btn-sm svg{ width:15px; height:15px; }
.btn-block{ width:100%; padding:14px 18px; }
.btn-icon{
  width:26px; height:26px; border-radius:50%; display:grid; place-items:center;
  background:rgba(0,0,0,.14); margin-right:-6px;
  transition:transform .35s var(--ease-out);
}
.btn-primary:hover .btn-icon{ transform:translateX(3px); }
.btn-icon svg{ width:15px; height:15px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app{ position:relative; z-index:2; min-height:100dvh; display:flex; }

/* ---------- Sidebar ---------- */
.sidebar{
  position:fixed; top:0; left:0; bottom:0; width:var(--sidebar-w); z-index:40;
  display:flex; flex-direction:column; padding:22px 16px;
  border-radius:0; border-left:0; border-top:0; border-bottom:0;
  background:rgba(10,11,14,.72);
}
.sidebar-head{ display:flex; align-items:center; gap:11px; padding:0 6px 26px; }
.sidebar-brand{ display:flex; flex-direction:column; line-height:1.2; }
.sidebar-brand strong{ font-size:14.5px; letter-spacing:-.01em; }
.sidebar-brand span{ font-size:10.5px; letter-spacing:.18em; text-transform:uppercase; color:var(--muted); }

.nav{ display:flex; flex-direction:column; gap:3px; flex:1; }
.nav-item{
  display:flex; align-items:center; gap:12px; width:100%;
  padding:11px 13px; border-radius:var(--r-md); border:1px solid transparent;
  background:transparent; color:var(--text-2); font-weight:500; font-size:14px;
  text-align:left; transition:background .25s var(--ease), color .25s, border-color .25s;
}
.nav-item svg{ width:19px; height:19px; flex:none; opacity:.8; }
.nav-item:hover{ background:var(--surface); color:var(--text); }
.nav-item.active{
  background:linear-gradient(100deg, var(--accent-dim), transparent 85%);
  border-color:var(--accent-line); color:var(--accent-strong);
}
.nav-item.active svg{ opacity:1; }

.sidebar-foot{ display:flex; flex-direction:column; gap:6px; padding-top:16px; border-top:1px solid var(--line); }
.sidebar-foot .btn{ justify-content:flex-start; }

/* ---------- Main ---------- */
.main{
  flex:1; min-width:0; margin-left:var(--sidebar-w);
  display:flex; flex-direction:column; min-height:100dvh;
}
.topbar{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:18px clamp(20px,3vw,40px);
  background:linear-gradient(180deg, rgba(8,9,11,.92), rgba(8,9,11,.55) 70%, transparent);
  backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
}
.topbar-title h2{ font-family:var(--font-serif); font-weight:400; font-size:clamp(24px,3vw,32px); }
.topbar-actions{ display:flex; gap:9px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }

.view{ padding:6px clamp(20px,3vw,40px) 120px; flex:1; }
.view-enter{ animation:viewIn .5s var(--ease-out) both; }
@keyframes viewIn{ from{ opacity:0; transform:translateY(14px);} to{ opacity:1; transform:none;} }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav{ display:none; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* Section header */
.section-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin:8px 0 18px; flex-wrap:wrap; }
.section-head h3{ font-size:17px; font-weight:600; }
.section-head p{ font-size:13px; color:var(--muted); margin-top:3px; }

/* Card */
.card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:20px; box-shadow:var(--shadow-card);
  transition:border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease);
}
.card.hoverable{ cursor:pointer; }
.card.hoverable:hover{ border-color:var(--line-strong); background:var(--surface-2); transform:translateY(-2px); }

/* Grid */
.grid{ display:grid; gap:14px; }
.grid-2{ grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid-3{ grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-auto{ grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); }

/* Stat */
.stat{ display:flex; flex-direction:column; gap:4px; }
.stat-value{ font-family:var(--font-serif); font-size:34px; line-height:1; letter-spacing:-.02em; }
.stat-label{ font-size:11.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); }

/* Badge */
.badge{
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 9px; border-radius:var(--r-full);
  font-size:11px; font-weight:600; letter-spacing:.02em;
  background:var(--surface-2); border:1px solid var(--line); color:var(--text-2);
}
.badge.ok{ background:var(--ok-dim); border-color:rgba(95,191,143,.28); color:var(--ok); }
.badge.warn{ background:var(--warn-dim); border-color:rgba(224,180,94,.28); color:var(--warn); }
.badge.danger{ background:var(--danger-dim); border-color:rgba(224,112,112,.28); color:var(--danger); }
.badge.info{ background:var(--info-dim); border-color:rgba(111,168,220,.28); color:var(--info); }
.badge.accent{ background:var(--accent-dim); border-color:var(--accent-line); color:var(--accent-strong); }

/* Empty state */
.empty{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:12px; padding:64px 24px; text-align:center;
  border:1px dashed var(--line-strong); border-radius:var(--r-lg);
  color:var(--muted);
}
.empty svg{ width:38px; height:38px; opacity:.4; }
.empty h4{ font-size:15px; color:var(--text-2); font-weight:600; }
.empty p{ font-size:13px; max-width:340px; }

/* List row */
.row{
  display:flex; align-items:center; gap:14px; padding:14px 16px;
  border-radius:var(--r-md); border:1px solid var(--line); background:var(--surface);
  transition:background .25s var(--ease), border-color .25s;
}
.row:hover{ background:var(--surface-2); border-color:var(--line-strong); }
.row-main{ flex:1; min-width:0; }
.row-title{ font-weight:600; font-size:14.5px; }
.row-sub{ font-size:12.5px; color:var(--muted); margin-top:2px; }
.row-actions{ display:flex; gap:6px; flex:none; }

/* Icon button */
.icon-btn{
  width:34px; height:34px; border-radius:10px; border:1px solid var(--line);
  background:var(--surface); display:grid; place-items:center; color:var(--text-2);
  transition:background .2s, color .2s, border-color .2s;
}
.icon-btn:hover{ background:var(--surface-3); color:var(--text); border-color:var(--line-strong); }
.icon-btn svg{ width:16px; height:16px; }
.icon-btn.danger:hover{ color:var(--danger); border-color:rgba(224,112,112,.35); background:var(--danger-dim); }

/* Tabs */
.tabs{ display:flex; gap:4px; padding:4px; border-radius:var(--r-full); background:var(--surface); border:1px solid var(--line); width:max-content; max-width:100%; overflow-x:auto; }
.tab{
  padding:8px 16px; border-radius:var(--r-full); border:0; background:transparent;
  color:var(--muted); font-size:13px; font-weight:600; white-space:nowrap;
  transition:background .25s var(--ease), color .25s;
}
.tab:hover{ color:var(--text-2); }
.tab.active{ background:var(--surface-3); color:var(--text); box-shadow:inset 0 1px 0 rgba(255,255,255,.08); }

/* ============================================================
   REPORTS
   ============================================================ */
.template-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:14px; }
.template-card{
  position:relative; overflow:hidden; border-radius:var(--r-lg);
  border:1px solid var(--line); background:var(--surface);
  padding:22px; cursor:pointer; text-align:left;
  transition:transform .35s var(--ease), border-color .35s, background .35s;
}
.template-card:hover{ transform:translateY(-3px); border-color:var(--accent-line); background:var(--surface-2); }
.template-card::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(120% 90% at 100% 0%, var(--tpl-tint, rgba(224,154,94,.16)), transparent 60%);
  opacity:.9;
}
.template-swatch{ width:34px; height:34px; border-radius:10px; margin-bottom:16px; border:1px solid rgba(255,255,255,.14); }
.template-card h4{ font-size:15.5px; margin-bottom:5px; position:relative; z-index:1; }
.template-card p{ font-size:12.5px; color:var(--muted); position:relative; z-index:1; }
.template-meta{ display:flex; gap:6px; margin-top:14px; position:relative; z-index:1; }
.tpl-edit{
  position:absolute; top:14px; right:14px; z-index:2;
  width:30px; height:30px; opacity:.55;
  transition:opacity .25s var(--ease), background .25s, color .25s;
}
.template-card:hover .tpl-edit{ opacity:1; }
.tpl-edit:hover{ background:rgba(255,255,255,.16); }

.edit-row{ display:flex; gap:6px; align-items:center; }
.edit-row input{ flex:1; min-width:0; }
.edit-row .icon-btn{ width:31px; height:31px; flex:none; }

/* Report editor */
.report-sheet{
  background:#FBFAF7; color:#1A1A1A; border-radius:var(--r-lg);
  padding:clamp(24px,4vw,48px); max-width:820px; margin:0 auto;
  box-shadow:0 30px 80px -20px rgba(0,0,0,.8);
}
.report-sheet .rs-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:20px; border-bottom:2px solid var(--rs-accent,#C87941); padding-bottom:18px; margin-bottom:24px; }
.report-sheet .rs-brand{ font-family:var(--font-serif); font-size:26px; line-height:1; }
.report-sheet .rs-brand small{ display:block; font-family:var(--font-sans); font-size:10px; letter-spacing:.2em; text-transform:uppercase; color:#8A8A8A; margin-top:6px; }
.report-sheet .rs-meta{ text-align:right; font-size:12px; color:#6A6A6A; line-height:1.7; }
.report-sheet h3{ font-family:var(--font-serif); font-size:22px; margin:0 0 18px; color:#1A1A1A; }

.rs-field{ margin-bottom:14px; }
.rs-label{ font-size:10px; letter-spacing:.16em; text-transform:uppercase; color:#8A8A8A; margin-bottom:4px; display:block; }
.rs-input{
  width:100%; border:1px solid transparent; background:transparent; border-radius:8px;
  padding:7px 9px; font-size:14px; color:#1A1A1A; outline:none;
  transition:background .2s, border-color .2s;
}
.rs-input:hover{ background:rgba(0,0,0,.035); border-color:rgba(0,0,0,.08); }
.rs-input:focus{ background:#fff; border-color:var(--rs-accent,#C87941); box-shadow:0 0 0 3px rgba(200,121,65,.14); }
.rs-input[readonly]{ cursor:default; }
textarea.rs-input{ resize:vertical; min-height:64px; line-height:1.6; }

.rs-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0 20px; }
.rs-section{ margin:26px 0 14px; padding-top:16px; border-top:1px solid rgba(0,0,0,.1); }
.rs-section h4{ font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:#8A8A8A; font-weight:700; }

.rs-check{ display:flex; align-items:flex-start; gap:10px; padding:7px 9px; border-radius:8px; cursor:pointer; transition:background .2s; }
.rs-check:hover{ background:rgba(0,0,0,.035); }
.rs-check input{ margin-top:3px; accent-color:var(--rs-accent,#C87941); width:16px; height:16px; flex:none; }
.rs-check span{ font-size:13.5px; }

.rs-sign{ display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:26px; }
.sign-box{ border:1px dashed rgba(0,0,0,.25); border-radius:10px; padding:10px; background:#fff; }
.sign-box .rs-label{ margin-bottom:6px; }
.sign-canvas{ width:100%; height:110px; display:block; touch-action:none; border-radius:6px; background:#fff; cursor:crosshair; }
.sign-clear{ margin-top:6px; font-size:11px; color:#8A8A8A; background:none; border:0; padding:0; text-decoration:underline; }

.rs-photos{ display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:10px; margin-top:10px; }
.rs-photo{ position:relative; aspect-ratio:1; border-radius:10px; overflow:hidden; border:1px solid rgba(0,0,0,.12); background:#eee; }
.rs-photo img{ width:100%; height:100%; object-fit:cover; display:block; }
.rs-photo button{ position:absolute; top:5px; right:5px; width:24px; height:24px; border-radius:50%; border:0; background:rgba(0,0,0,.6); color:#fff; display:grid; place-items:center; font-size:14px; line-height:1; }
.rs-add-photo{
  aspect-ratio:1; border-radius:10px; border:1px dashed rgba(0,0,0,.25);
  background:rgba(0,0,0,.02); display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; color:#8A8A8A; font-size:11px; cursor:pointer; transition:background .2s, border-color .2s;
}
.rs-add-photo:hover{ background:rgba(0,0,0,.05); border-color:var(--rs-accent,#C87941); }
.rs-add-photo svg{ width:22px; height:22px; }

/* ============================================================
   AGENDA
   ============================================================ */
.agenda-layout{ display:grid; grid-template-columns:1fr 340px; gap:18px; align-items:start; }
.cal{ border-radius:var(--r-lg); border:1px solid var(--line); background:var(--surface); padding:18px; }
.cal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.cal-title{ font-family:var(--font-serif); font-size:20px; text-transform:capitalize; }
.cal-nav{ display:flex; gap:6px; }
.cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.cal-dow{ text-align:center; font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); padding:6px 0; }
.cal-day{
  position:relative; aspect-ratio:1; border-radius:10px; border:1px solid transparent;
  background:transparent; display:flex; flex-direction:column; align-items:center; justify-content:center;
  font-size:13px; color:var(--text-2); transition:background .2s, border-color .2s, color .2s;
}
.cal-day:hover{ background:var(--surface-2); }
.cal-day.out{ color:var(--faint); }
.cal-day.today{ border-color:var(--accent-line); color:var(--accent-strong); font-weight:700; }
.cal-day.sel{ background:var(--accent-dim); border-color:var(--accent-line); color:var(--accent-strong); }
.cal-day .dot{ position:absolute; bottom:6px; width:4px; height:4px; border-radius:50%; background:var(--accent); }
.cal-day .dot.multi{ box-shadow:7px 0 0 var(--accent), -7px 0 0 var(--accent); }

.agenda-side{ display:flex; flex-direction:column; gap:14px; }
.agenda-day-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.agenda-day-head h4{ font-size:14px; }
.event{
  display:flex; gap:12px; padding:12px; border-radius:var(--r-md);
  border:1px solid var(--line); background:var(--surface); margin-bottom:8px;
  transition:background .2s, border-color .2s;
}
.event:hover{ background:var(--surface-2); border-color:var(--line-strong); }
.event-time{ font-size:12px; font-weight:700; color:var(--accent); min-width:44px; font-variant-numeric:tabular-nums; }
.event-body{ flex:1; min-width:0; }
.event-title{ font-size:13.5px; font-weight:600; }
.event-sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.event-attach{ display:inline-flex; align-items:center; gap:4px; font-size:11px; color:var(--info); margin-top:5px; }
.event-attach svg{ width:12px; height:12px; }

/* ============================================================
   STOCK
   ============================================================ */
.stock-toolbar{ display:flex; gap:10px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }
.search{
  flex:1; min-width:200px; position:relative;
}
.search input{
  width:100%; padding:11px 14px 11px 40px; border-radius:var(--r-full);
  background:var(--surface); border:1px solid var(--line); color:var(--text); outline:none;
  transition:border-color .25s, background .25s;
}
.search input:focus{ border-color:var(--accent-line); background:var(--surface-2); }
.search svg{ position:absolute; left:14px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--muted); }

.table-wrap{ border-radius:var(--r-lg); border:1px solid var(--line); overflow:hidden; background:var(--surface); }
table{ width:100%; border-collapse:collapse; }
thead th{
  text-align:left; font-size:10.5px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--muted); font-weight:600; padding:12px 16px; border-bottom:1px solid var(--line);
  background:rgba(0,0,0,.2); white-space:nowrap;
}
tbody td{ padding:12px 16px; border-bottom:1px solid rgba(255,255,255,.045); font-size:13.5px; }
tbody tr:last-child td{ border-bottom:0; }
tbody tr{ transition:background .2s; }
tbody tr:hover{ background:var(--surface-2); }
.qty{ font-variant-numeric:tabular-nums; font-weight:700; }
.qty.low{ color:var(--warn); }
.qty.zero{ color:var(--danger); }
.qty-ctrl{ display:flex; align-items:center; gap:6px; }
.qty-ctrl button{
  width:26px; height:26px; border-radius:8px; border:1px solid var(--line);
  background:var(--surface-2); display:grid; place-items:center; color:var(--text-2);
  transition:background .2s, color .2s;
}
.qty-ctrl button:hover{ background:var(--surface-3); color:var(--text); }
.qty-ctrl span{ min-width:38px; text-align:center; font-variant-numeric:tabular-nums; font-weight:600; }

/* ============================================================
   FILES
   ============================================================ */
.folder-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; }
.folder{
  display:flex; align-items:center; gap:13px; padding:16px; border-radius:var(--r-md);
  border:1px solid var(--line); background:var(--surface); cursor:pointer; text-align:left;
  transition:background .25s, border-color .25s, transform .25s;
}
.folder:hover{ background:var(--surface-2); border-color:var(--line-strong); transform:translateY(-2px); }
.folder-icon{ width:40px; height:40px; border-radius:11px; display:grid; place-items:center; background:var(--accent-dim); color:var(--accent); flex:none; }
.folder-icon svg{ width:20px; height:20px; }
.folder-name{ font-size:13.5px; font-weight:600; }
.folder-count{ font-size:11.5px; color:var(--muted); }

.file-item{ display:flex; align-items:center; gap:12px; padding:11px 14px; border-radius:var(--r-md); border:1px solid var(--line); background:var(--surface); }
.file-thumb{ width:38px; height:38px; border-radius:9px; object-fit:cover; flex:none; background:var(--surface-3); display:grid; place-items:center; color:var(--muted); }
.file-thumb svg{ width:18px; height:18px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay{
  position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:20px;
  background:rgba(4,5,7,.72); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
  animation:fadeIn .3s var(--ease) both;
}
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }
.modal{
  width:100%; max-width:560px; max-height:88dvh; overflow-y:auto;
  border-radius:var(--r-xl); padding:clamp(22px,4vw,32px);
  background:rgba(16,18,22,.94); border:1px solid var(--line-strong);
  box-shadow:0 40px 100px -20px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.08);
  animation:modalIn .45s var(--ease-out) both;
}
.modal.wide{ max-width:760px; }
@keyframes modalIn{ from{ opacity:0; transform:translateY(20px) scale(.97);} to{ opacity:1; transform:none;} }
.modal-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; }
.modal-head h3{ font-family:var(--font-serif); font-weight:400; font-size:24px; }
.modal-head p{ font-size:12.5px; color:var(--muted); margin-top:3px; }
.modal-close{ width:34px; height:34px; border-radius:10px; border:1px solid var(--line); background:var(--surface); display:grid; place-items:center; color:var(--muted); flex:none; }
.modal-close:hover{ color:var(--text); background:var(--surface-2); }
.modal-close svg{ width:16px; height:16px; }
.modal-foot{ display:flex; gap:10px; justify-content:flex-end; margin-top:24px; flex-wrap:wrap; }

/* Color picker row */
.color-row{ display:flex; gap:8px; flex-wrap:wrap; }
.color-dot{
  width:32px; height:32px; border-radius:50%; border:2px solid transparent; cursor:pointer;
  transition:transform .2s, border-color .2s;
}
.color-dot:hover{ transform:scale(1.1); }
.color-dot.sel{ border-color:#fff; box-shadow:0 0 0 2px rgba(0,0,0,.5); }

/* Toast */
.toast-root{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%); z-index:200; display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none; }
.toast{
  padding:11px 18px; border-radius:var(--r-full); font-size:13px; font-weight:500;
  background:rgba(20,22,26,.96); border:1px solid var(--line-strong); color:var(--text);
  box-shadow:var(--shadow-float); animation:toastIn .4s var(--ease-out) both;
  display:flex; align-items:center; gap:8px;
}
.toast.ok{ border-color:rgba(95,191,143,.4); }
.toast.err{ border-color:rgba(224,112,112,.4); }
@keyframes toastIn{ from{ opacity:0; transform:translateY(14px) scale(.95);} to{ opacity:1; transform:none;} }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px){
  .agenda-layout{ grid-template-columns:1fr; }
  .grid-3{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 860px){
  :root{ --sidebar-w:0px; }
  .sidebar{ display:none; }
  .main{ margin-left:0; }
  .bottom-nav{
    display:flex; position:fixed; bottom:0; left:0; right:0; z-index:50;
    padding:8px 6px calc(8px + env(safe-area-inset-bottom));
    background:rgba(10,11,14,.86); border-top:1px solid var(--line);
    border-radius:0; justify-content:space-around;
  }
  .bnav-item{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    padding:7px 2px; border:0; background:transparent; color:var(--muted);
    font-size:10px; font-weight:600; border-radius:12px;
    transition:color .2s, background .2s;
  }
  .bnav-item svg{ width:21px; height:21px; }
  .bnav-item.active{ color:var(--accent-strong); background:var(--accent-dim); }
  .view{ padding-bottom:110px; }
  .topbar{ padding:14px 18px; }
  .view{ padding-left:18px; padding-right:18px; }
  .grid-2, .grid-3{ grid-template-columns:1fr; }
  .rs-grid{ grid-template-columns:1fr; }
  .rs-sign{ grid-template-columns:1fr; }
  .report-sheet{ padding:22px 18px; border-radius:var(--r-md); }
  .modal{ max-height:92dvh; }
  .toast-root{ bottom:88px; }
}

@media (max-width: 480px){
  .topbar-actions .btn span{ display:none; }
  .topbar-actions .btn{ padding:10px; }
  .template-grid{ grid-template-columns:1fr; }
  .stat-value{ font-size:28px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* Reduced transparency */
@media (prefers-reduced-transparency: reduce){
  .glass, .sidebar, .bottom-nav, .topbar, .modal-overlay, .modal{
    backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
    background:#101216 !important;
  }
}

/* Print — report only */
@media print{
  .backdrop, .sidebar, .topbar, .bottom-nav, .modal-overlay, .toast-root, .no-print{ display:none !important; }
  body{ background:#fff; }
  .main{ margin:0; }
  .view{ padding:0; }
  .report-sheet{ box-shadow:none; max-width:none; border-radius:0; padding:0; }
  .rs-input{ border:0 !important; background:transparent !important; }
  .sign-clear, .rs-add-photo, .rs-photo button{ display:none !important; }
}
