/* ==========================================================================
   Linea Studio Manager — the back office behind the booking site
   (demo for BeeBranding's "systems" video). Same palette as the public site:
   olive ink, warm white, sand, sage · Fraunces headings, Inter UI · desktop-first
   ========================================================================== */
:root {
  --ink: #2B3428; --ink-2: #3A4536; --soft: #63705D;
  --line: rgba(43, 52, 40, .11); --line-2: rgba(43, 52, 40, .2);
  --bone: #EEF2E8; --paper: #F8FAF4; --sand: #E1E8D8; --white: #FFFFFF;
  --sage: #9DB08A; --sage-soft: #DCE5D2; --sage-deep: #52634A; --clay: #C98B6E;
  --t-reformer: #93A97F; --t-reformer-bg: #E5ECDC;
  --t-mat: #C4A57D; --t-mat-bg: #F3ECE0;
  --t-tower: #C98B6E; --t-tower-bg: #F5E6DD;
  --t-yoga: #7FA3A0; --t-yoga-bg: #E1ECEA;
  --t-prenatal: #AE9ABE; --t-prenatal-bg: #EEE8F3;
  --f-display: "Fraunces", Georgia, serif;
  --f-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bone); color: var(--ink); font: 400 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100vh; }

/* ---------- sidebar ---------- */
.side { display: flex; flex-direction: column; gap: 28px; padding: 24px 14px; background: var(--sage-soft); color: var(--ink); border-right: 1px solid var(--line); }
.side__logo { display: grid; gap: 3px; padding: 0 12px; text-decoration: none; color: inherit; }
.side__name { font: 600 30px/1 var(--f-display); letter-spacing: -.01em; }
.side__sub { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--sage-deep); }
.side__nav { display: grid; gap: 4px; }
.side__link {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 42px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; text-align: left; font-weight: 600; color: rgba(43, 52, 40, .72);
  transition: background .2s, color .2s;
}
.side__link:hover { background: rgba(255, 255, 255, .45); color: var(--ink); }
.side__link.is-active { background: var(--white); color: var(--ink); box-shadow: inset 3px 0 0 var(--sage-deep), 0 4px 12px -8px rgba(43, 52, 40, .35); }
.side__count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--sage-deep); color: var(--white); font-size: 12px; font-weight: 700; text-align: center; }
.side__foot { margin-top: auto; display: grid; gap: 16px; }
.side__site { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .5); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13px; }
.side__site:hover { border-color: var(--sage-deep); }
.side__user { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.side__user strong { display: block; font-size: 13px; }
.side__user span { font-size: 12px; color: var(--soft); }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--sage); color: var(--white); font-weight: 700; font-size: 13px; }
.avatar--sm { width: 30px; height: 30px; font-size: 11px; background: var(--sage-soft); color: var(--sage-deep); }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; padding: 20px 28px 24px; overflow: hidden; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top h1 { margin: 0; font: 500 30px/1.1 var(--f-display); letter-spacing: -.01em; }
.top p { margin: 2px 0 0; color: var(--soft); }
.top__actions { display: flex; align-items: center; gap: 10px; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--white); }
.seg button { min-height: 38px; min-width: 38px; padding: 0 12px; border: 0; background: transparent; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--bone); }
.btn {
  min-height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--white); font-weight: 600;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--sage-deep); color: var(--white); border-color: var(--sage-deep); box-shadow: 0 2px 0 rgba(43, 52, 40, .25); }
.btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--danger { color: #9B2C1F; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 12px 16px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.kpi span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.kpi strong { display: inline-block; margin-top: 2px; font: 600 28px/1.15 var(--f-display); }
.kpi em { display: block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--sage-deep); }
.kpi.is-bump strong { animation: bump .7s var(--ease); }
@keyframes bump { 35% { transform: scale(1.1); color: var(--sage-deep); } }

/* ---------- calendar ---------- */
.view { flex: 1; min-height: 0; }
.view--calendar { display: flex; flex-direction: column; gap: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--soft); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; background: var(--c); }
.legend__appt i { background: var(--white); border: 1px dashed rgba(34, 37, 31, .6); }
.legend__online i { background: var(--white); box-shadow: 0 0 0 2px var(--sage-deep); }

.cal { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 16px; background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.cal__head, .cal__body { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.cal__head { border-bottom: 1px solid var(--line); background: var(--paper); scrollbar-gutter: stable; overflow: hidden; }
.cal__day { display: grid; padding: 8px 10px; border-left: 1px solid var(--line); }
.cal__day span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.cal__day strong { font: 600 22px/1.1 var(--f-display); }
.cal__day em { font-style: normal; font-size: 11px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal__day.is-today strong, .cal__day.is-today span { color: var(--sage-deep); }
.cal__day.is-today span::after { content: " · today"; text-transform: none; letter-spacing: 0; }
.cal__body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
.cal__times { position: relative; }
.cal__time { position: relative; }
.cal__time span { position: absolute; top: -8px; right: 8px; font-size: 11px; color: var(--soft); }
.cal__time:first-child span { top: 3px; }
.cal__col {
  position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hour, 52px));
}
.cal__col.is-today { background-color: rgba(157, 176, 138, .1); }
.cal__now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--clay); z-index: 3; pointer-events: none; }
.cal__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--clay); }

.ev {
  --ev: var(--sage); --ev-bg: var(--t-reformer-bg);
  position: absolute; left: 4px; right: 4px; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 3px 6px 6px 9px;
  border: 0; border-radius: 8px; text-align: left; overflow: hidden; font-size: 11px; line-height: 1.25;
  background: var(--ev-bg); box-shadow: inset 3px 0 0 var(--ev);
  transition: transform .15s var(--ease), box-shadow .2s;
}
.ev:hover { transform: translateY(-1px); z-index: 2; box-shadow: inset 3px 0 0 var(--ev), 0 8px 20px -10px rgba(34, 37, 31, .45); }
.ev__time { font-weight: 700; color: var(--ink-2); }
.ev__name { max-width: 100%; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev__meta { color: var(--soft); white-space: nowrap; }
.ev__bar { position: absolute; left: 9px; right: 6px; bottom: 3px; height: 3px; border-radius: 3px; background: rgba(34, 37, 31, .1); }
.ev__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--fill) * 100%); border-radius: 3px; background: var(--ev); }
.ev.is-full .ev__meta::after { content: " · full"; color: var(--clay); font-weight: 700; }
.ev.is-past { opacity: .55; }
.ev.has-online { box-shadow: inset 3px 0 0 var(--ev), 0 0 0 2px var(--sage-deep); }
.ev--reformer { --ev: var(--t-reformer); --ev-bg: var(--t-reformer-bg); }
.ev--mat { --ev: var(--t-mat); --ev-bg: var(--t-mat-bg); }
.ev--equipment { --ev: var(--t-tower); --ev-bg: var(--t-tower-bg); }
.ev--yoga { --ev: var(--t-yoga); --ev-bg: var(--t-yoga-bg); }
.ev--prenatal { --ev: var(--t-prenatal); --ev-bg: var(--t-prenatal-bg); }
.ev--appt { --ev: var(--ink); --ev-bg: var(--white); box-shadow: none; outline: 1px dashed rgba(34, 37, 31, .5); outline-offset: -1px; }
.ev--appt:hover { box-shadow: 0 8px 20px -10px rgba(34, 37, 31, .45); }
.ev.is-new { animation: flash 1.1s var(--ease) 3; z-index: 4; }
@keyframes flash { 45% { transform: scale(1.05); box-shadow: inset 3px 0 0 var(--ev), 0 0 0 6px rgba(79, 94, 71, .35); } }

/* ---------- tables ---------- */
.panel { height: 100%; overflow: auto; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  position: sticky; top: 0; z-index: 1; padding: 12px 16px; text-align: left; background: var(--paper); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--soft);
}
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.is-new td { background: var(--sage-soft); }
.who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bone); white-space: nowrap; }
.pill--sage { background: #E3EBDD; color: var(--sage-deep); }
.pill--clay { background: #F6E2D9; color: #8A4631; }
.pill--ink { background: var(--sage-deep); color: var(--white); }

/* ---------- instructors ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; align-content: start; height: 100%; overflow: auto; }
.member { display: grid; gap: 4px; padding: 18px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.member h3 { margin: 8px 0 0; font: 500 22px/1.2 var(--f-display); }
.member p { margin: 0; color: var(--soft); }
.member dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; }
.member dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.member dd { margin: 0; font: 600 20px/1.2 var(--f-display); }

/* ---------- details drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(34, 37, 31, .22); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; display: flex; flex-direction: column; width: min(420px, 100vw);
  background: var(--paper); box-shadow: -30px 0 60px -30px rgba(34, 37, 31, .45); transform: translateX(100%); transition: transform .35s var(--ease);
}
.drawer.is-open { transform: none; }
.drawer__head { display: flex; justify-content: space-between; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer__eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-deep); }
.drawer__head h2 { margin: 4px 0 0; font: 500 26px/1.15 var(--f-display); }
.drawer__close { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--white); font-size: 20px; line-height: 1; }
.drawer__body { flex: 1; overflow: auto; display: grid; align-content: start; gap: 18px; padding: 18px 24px 24px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.facts div { padding: 10px 12px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); }
.facts dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.cap { display: grid; gap: 6px; }
.cap__row { display: flex; justify-content: space-between; font-weight: 600; }
.cap__bar { height: 6px; border-radius: 6px; background: var(--sand); overflow: hidden; }
.cap__bar i { display: block; height: 100%; width: calc(var(--fill) * 100%); background: var(--sage-deep); }
.sec h3 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.att-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); }
.att > div { flex: 1; min-width: 0; }
.att strong { display: block; font-size: 13px; }
.att span { display: block; font-size: 12px; color: var(--soft); }
.att--online { border-color: var(--sage-deep); background: var(--sage-soft); }
.tag { padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; background: var(--sand); }
.tag--online { background: var(--sage-deep); color: var(--white); }
.check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--sage-deep); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- new appointment dialog ---------- */
.dlg { width: min(480px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 40px 80px rgba(0, 0, 0, .3); }
.dlg::backdrop { background: rgba(34, 37, 31, .45); backdrop-filter: blur(3px); }
.dlg h2 { margin: 0 0 6px; font: 500 26px/1.15 var(--f-display); }
.form { display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--soft); }
.field select { min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--white); }
.form__err { margin: 0; font-size: 13px; font-weight: 600; color: #9B2C1F; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 48px)); }
.toast {
  display: grid; gap: 2px; padding: 14px 16px 14px 18px; border-radius: 14px; background: var(--sage-deep); color: var(--white);
  box-shadow: 0 20px 40px rgba(43, 52, 40, .3), inset 4px 0 0 var(--sage-soft); animation: toastIn .45s var(--ease) both;
}
.toast strong { font-size: 14px; }
.toast span { font-size: 13px; color: rgba(255, 255, 255, .88); }
.toast.is-out { animation: toastOut .35s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
  .side__nav { display: flex; flex-wrap: wrap; }
  .side__foot { display: none; }
  .main { overflow: visible; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal { min-height: 640px; overflow-x: auto; }
  .cal__head, .cal__body { min-width: 900px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
