:root {
  --app-bg: #ffffff;               /* HR-app: white workspace + soft washes (on body) */
  --surface: #ffffff;
  --surface-2: #f4f2ea;            /* warm muted */
  --surface-3: #efece1;
  --ink: #10201b;
  --ink-soft: #47554e;
  --muted: #6b776f;
  --line: #e6e0d2;                 /* warm border */
  --line-soft: #efeade;

  --primary: #00a4b2;              /* HR teal-cyan (hsl 185 100% 35%) */
  --primary-ink: #00838f;
  --primary-soft: #d8f2ef;
  --teal: #17b0a6;
  --teal-soft: #e0f6f4;
  --lav: #e7f3ee;

  --gold: #e3a13c;
  --pending: #e3a13c;
  --confirmed: #17b0a6;
  --posted: #157a5c;
  --cancelled: #9aa3b2;

  --shadow: 0 1px 2px rgba(20, 40, 35, 0.04), 0 14px 30px -16px rgba(20, 60, 55, 0.16);
  --shadow-sm: 0 1px 2px rgba(20, 40, 35, 0.04), 0 6px 16px -12px rgba(20, 60, 55, 0.14);
  --radius: 18px;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --serif: 'Inter', system-ui, sans-serif;
  --kicker: .12em;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(at 12% 8%, hsl(154 70% 78% / 0.30) 0px, transparent 42%),
    radial-gradient(at 88% 0%, hsl(185 80% 75% / 0.24) 0px, transparent 38%),
    radial-gradient(at 72% 96%, hsl(43 70% 82% / 0.18) 0px, transparent 45%),
    #ffffff;
  background-attachment: fixed;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: rgba(23, 96, 87, 0.16); }

/* neutralise old atmosphere */
.bg-orbs, .grain { display: none !important; }

@keyframes riseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 244px; flex-shrink: 0; background: #f7f5ef;
  border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; padding: 0 6px; }
.brand-logo { width: 170px; max-width: 100%; height: auto; display: block; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: var(--kicker); padding: 16px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: none; background: transparent;
  border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink-soft); text-align: left;
  transition: all .15s;
}
.nav-item .ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; opacity: .85; }
.nav-item .ic svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-ink); }
.nav-item.active .ic { opacity: 1; }

.sidebar-foot { margin-top: auto; }
.promo-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 3px;
}
.promo-emoji { margin-bottom: 8px; color: var(--primary); display: inline-flex; }
.promo-emoji svg { width: 22px; height: 22px; }
.promo-card strong { font-weight: 700; font-size: 14px; color: var(--ink); }
.promo-card small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.promo-stat { font-size: 12.5px; color: var(--ink-soft); margin: 10px 0 12px; }
.promo-stat span { font-weight: 800; color: var(--primary); }
.promo-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; padding: 9px; border-radius: 9px; transition: all .15s; }
.promo-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Main + header ---------- */
.main { flex: 1; min-width: 0; padding: 22px 30px 40px; }
.view.hidden { display: none; }

.app-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.hamburger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); place-items: center; flex-shrink: 0; }
.hamburger svg { width: 20px; height: 20px; }
.sidebar-backdrop { display: none; }
.search-box {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 15px;
}
.search-box:focus-within { border-color: var(--primary); }
.search-ic { display: inline-flex; align-items: center; color: var(--muted); }
.search-ic svg { width: 16px; height: 16px; }
.search-box input { border: none; background: transparent; outline: none; font-size: 13.5px; width: 100%; color: var(--ink); }
.search-box input::placeholder { color: var(--muted); }
.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.bell { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); display: grid; place-items: center; transition: background .15s, border-color .15s, transform .12s; }
.bell:hover { background: var(--surface-2); border-color: var(--muted); color: var(--ink); }
.bell:active { transform: scale(.94); }
.bell svg { width: 19px; height: 19px; }
.bell.has-notif::after { content: ''; position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; border: 2px solid var(--surface); }
.user-chip { display: flex; align-items: center; gap: 11px; height: 44px; padding: 0 16px 0 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: background .15s, border-color .15s; }
.user-chip:hover { background: var(--surface-2); border-color: var(--muted); }
.user-av { width: 34px; height: 34px; border-radius: 9px; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.add-btn { width: 44px; height: 44px; border-radius: 12px; border: none; background: var(--primary); color: #fff; font-size: 24px; line-height: 1; display: grid; place-items: center; box-shadow: 0 10px 20px -8px rgba(0,131,143,.6); transition: background .15s, transform .12s, box-shadow .15s; }
.add-btn:hover { background: var(--primary-ink); transform: translateY(-1px); box-shadow: 0 14px 26px -8px rgba(0,131,143,.7); }
.add-btn:active { transform: scale(.94); }
.add-btn svg { width: 20px; height: 20px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13px; font-weight: 700; }
.user-meta small { font-size: 10.5px; color: var(--muted); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }

.date-nav { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 21px; color: var(--ink-soft); line-height: 1; display: grid; place-items: center; transition: all .15s; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.date-display { position: relative; display: flex; align-items: center; justify-content: center; min-width: 232px; }
.date-display input[type=date] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 2; }
.date-jump { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 12px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.date-display:hover .date-jump { background: var(--surface-2); border-color: var(--line); }
.date-cal { width: 17px; height: 17px; color: var(--primary); flex-shrink: 0; }
.date-caret { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.date-label { font-size: 19px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.ghost-btn { height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink-soft); transition: all .15s; }
.ghost-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--surface-2); }
.ghost-btn:active { transform: scale(.98); }
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 24px; border-radius: 12px; border: none; background: var(--primary); color: #fff;
  font-weight: 700; font-size: 14px; letter-spacing: .01em; box-shadow: 0 10px 22px -10px rgba(0,131,143,.65);
  transition: background .15s, transform .12s, box-shadow .15s;
}
.primary-btn:hover { background: var(--primary-ink); transform: translateY(-1px); box-shadow: 0 15px 30px -10px rgba(0,131,143,.78); }
.primary-btn:active { transform: translateY(0) scale(.98); }
.bell:focus-visible, .add-btn:focus-visible, .user-chip:focus-visible, .icon-btn:focus-visible, .ghost-btn:focus-visible, .primary-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Stat row ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px;
}
.stat-chip { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.stat-chip svg { width: 22px; height: 22px; }
.stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-card .label { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card .value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Status chips ---------- */
.chip-row { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 12.5px; color: var(--ink-soft);
  transition: all .15s;
}
.chip .cdot { width: 8px; height: 8px; border-radius: 50%; }
.chip .ccount { background: var(--surface-2); color: var(--ink); border-radius: 6px; padding: 1px 7px; font-size: 11.5px; min-width: 20px; text-align: center; font-weight: 700; }
.chip:hover { border-color: var(--muted); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.active .ccount { background: rgba(255,255,255,.15); color: #fff; }

/* ---------- Board + agenda ---------- */
.board-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.board-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: visible; }
.board { position: relative; display: grid; width: 100%; }
.board .corner, .board .thead { position: sticky; top: 0; z-index: 5; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.board .corner { left: 0; z-index: 7; }
.board .time-col-cell, .board .corner { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); }
.thead { padding: 14px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; }
.thead .t-avatar { width: 32px; height: 32px; border-radius: 9px; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.corner { display: grid; place-items: center; font-size: 9.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: var(--kicker); }
.time-col-cell { font-size: 11px; color: var(--muted); font-weight: 600; padding: 3px 12px 0; display: flex; align-items: flex-start; justify-content: flex-end; border-bottom: 1px solid var(--line-soft); }
.time-col-cell.hour { color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--line); }
.slot-cell { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line); cursor: pointer; transition: background .1s; position: relative; }
.slot-cell.hour { border-bottom: 1px solid var(--line); }
.slot-cell:hover { background: var(--primary-soft); }
.slot-cell:hover::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--primary); font-weight: 700; font-size: 16px; opacity: .5; }

.bk {
  position: absolute; left: 4px; right: 4px; top: 3px; height: 48px; border-radius: 10px; padding: 6px 10px; overflow: hidden;
  cursor: pointer; z-index: 3; color: #fff; font-size: 12px; line-height: 1.2;
  box-shadow: 0 2px 6px -2px rgba(23,27,38,.35); transition: transform .12s, box-shadow .12s, opacity .15s;
}
.bk:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -6px rgba(23,27,38,.4); z-index: 6; }
.bk .bk-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk .bk-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; opacity: .96; }
.bk .bk-svc { opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk .bk-price { font-weight: 700; flex-shrink: 0; }
.bk.status-cancelled { opacity: .6; text-decoration: line-through; }
.bk.dimmed { opacity: .12; }

/* ---------- Agenda ---------- */
.agenda { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.agenda h3 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 3px; }
.agenda .asub { font-size: 11px; color: var(--muted); margin-bottom: 16px; font-weight: 600; }
.ag-item { display: flex; gap: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer; border-radius: 11px; border: 1px solid var(--line); transition: all .12s; }
.ag-item:hover { border-color: var(--muted); background: var(--surface-2); }
.ag-item:hover .ag-name { color: var(--primary-ink); }
.ag-time { font-size: 12.5px; font-weight: 800; color: var(--ink); width: 54px; flex-shrink: 0; padding-top: 1px; }
.ag-time span { font-size: 10px; font-weight: 600; color: var(--muted); }
.ag-body { min-width: 0; flex: 1; }
.ag-name { font-weight: 800; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-svc { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.ag-pill { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; color: #fff; }
.ag-src { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ag-price { font-size: 13px; font-weight: 800; margin-left: auto; }
.src-ic { width: 12px; height: 12px; flex-shrink: 0; }
.ag-src .src-ic { width: 11px; height: 11px; }
.hist-src { display: inline-flex; align-items: center; gap: 3px; }
.hist-src .src-ic { width: 11px; height: 11px; }

/* ---------- Week strip ---------- */
.week-strip { display: flex; gap: 8px; margin-bottom: 16px; }
.week-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: all .15s; }
.week-day .wd-name { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.week-day .wd-num { font-size: 16px; font-weight: 800; color: var(--ink); }
.week-day:hover { border-color: var(--primary); }
.week-day.today .wd-num { color: var(--primary); }
.week-day.active { background: var(--primary); border-color: var(--primary); }
.week-day.active .wd-name, .week-day.active .wd-num { color: #fff; }

/* ---------- Board right column + Activity chart ---------- */
.board-right { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 22px; }
.board-right .agenda { position: static; max-height: none; }
.activity-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.act-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.act-head h3 { font-size: 15px; font-weight: 800; }
.act-sub { font-size: 11px; color: var(--muted); font-weight: 600; }
.act-chart { display: flex; align-items: flex-end; gap: 8px; height: 96px; }
.act-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; cursor: pointer; }
.act-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.act-bar { width: 62%; min-height: 6px; border-radius: 6px; background: var(--teal); position: relative; transition: height .25s; }
.act-bar.cur { background: var(--primary); }
.act-val { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: var(--ink-soft); }
.act-lbl { font-size: 10px; font-weight: 700; color: var(--muted); }
.act-col:hover .act-bar { filter: brightness(1.08); }

/* ---------- Agenda featured card + icon squares ---------- */
.ag-featured { background: linear-gradient(135deg, #00a4b2, #1fa06e); color: #fff; border-radius: 14px; padding: 15px 16px; cursor: pointer; margin-bottom: 12px; box-shadow: 0 12px 24px -12px rgba(0,131,143,.75); transition: transform .12s; }
.ag-featured:hover { transform: translateY(-1px); }
.agf-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.agf-time { font-size: 12px; font-weight: 700; opacity: .95; }
.agf-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.agf-ic svg { width: 16px; height: 16px; }
.agf-svc { font-size: 15.5px; font-weight: 800; margin-bottom: 2px; line-height: 1.2; }
.agf-sub { font-size: 12px; opacity: .9; }
.agf-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.agf-pill { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.2); padding: 3px 9px; border-radius: 6px; }
.agf-price { font-size: 14px; font-weight: 800; }
.ag-restlabel { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 8px; }
.ag-ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.75); display: grid; place-items: center; flex-shrink: 0; }
.ag-ic svg { width: 17px; height: 17px; }

/* ---------- Monthly Calendar ---------- */
.cal-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { padding: 12px 14px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-cell { min-height: 118px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 8px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .12s; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.empty { background: #fafbfc; cursor: default; }
.cal-daytop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.cal-daynum { font-size: 12.5px; font-weight: 700; color: var(--ink); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-daynum { background: var(--primary); color: #fff; }
.cal-count { font-size: 10px; font-weight: 800; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 0 7px; }
.cal-cell.today .cal-count { color: var(--primary); }
.cal-chip { font-size: 10.5px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; border-left: 2px solid; line-height: 1.5; }
.cal-more { font-size: 10px; color: var(--muted); font-weight: 700; padding-left: 3px; }

/* ---------- Continue Booking ---------- */
.continue-section { margin-bottom: 24px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.section-sub { font-size: 11px; color: var(--muted); font-weight: 600; }
.continue-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 200px; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.cont-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 15px; display: flex; flex-direction: column; gap: 11px; box-shadow: var(--shadow-sm); }
.cont-top { display: flex; align-items: center; gap: 10px; }
.cont-av { width: 40px; height: 40px; border-radius: 10px; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.cont-info { min-width: 0; }
.cont-name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cont-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cont-svc { font-size: 11.5px; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cont-btn { border: none; background: var(--primary); color: #fff; font-weight: 700; font-size: 12.5px; padding: 9px; border-radius: 8px; transition: background .12s; }
.cont-btn:hover { background: var(--primary-ink); }

/* ---------- Cards (therapists) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.t-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; }
.t-card .t-top { display: flex; align-items: center; gap: 12px; }
.t-card .t-big { width: 48px; height: 48px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.t-card .t-name { font-weight: 800; font-size: 15.5px; }
.t-card .t-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; font-weight: 600; }
.t-card .t-actions { display: flex; gap: 8px; }
.mini-btn { flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 12.5px; color: var(--ink-soft); transition: all .15s; }
.mini-btn:hover { color: var(--primary); border-color: var(--primary); }
.mini-btn.danger:hover { color: #e5484d; border-color: #e5484d; }
.badge-off { font-size: 10px; background: var(--surface-2); color: var(--muted); padding: 2px 8px; border-radius: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Tables ---------- */
/* HR-app (shadcn) style tables: no zebra, no vertical borders, row-bottom borders, muted uppercase header, hover accent */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; }
thead th { height: 44px; padding: 0 18px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; vertical-align: middle; border-bottom: 1px solid var(--line); }
tbody td { padding: 13px 18px; font-size: 14px; vertical-align: middle; }
tbody tr { border-bottom: 1px solid var(--line-soft); transition: background .12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--primary-soft); }
.money { font-weight: 700; }
.money.pos { color: #157a5c; }
.money.neg { color: #d64545; }
.money.zero { color: var(--muted); font-weight: 700; }
.cat-pill { font-size: 10px; padding: 3px 9px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.row-actions { display: flex; gap: 12px; justify-content: flex-end; }
.link-btn { border: none; background: none; color: var(--primary); font-weight: 700; font-size: 13px; }
.link-btn:hover { color: var(--primary-ink); }
.link-btn.danger { color: #e5484d; }

/* customers */
.cust-cell { display: flex; align-items: center; gap: 11px; }
.cust-av { width: 36px; height: 36px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.cust-av.big { width: 54px; height: 54px; border-radius: 14px; font-size: 21px; }
.repeat-badge { font-size: 9.5px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .06em; }
.cust-row { cursor: pointer; }
.cust-summary { display: flex; align-items: center; gap: 14px; }
.cust-modal-name { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.cust-modal-sub { font-size: 12px; color: var(--muted); }
.cust-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.cust-metrics > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 13px; text-align: center; font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; flex-direction: column; gap: 3px; }
.cust-metrics span { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.hist-list { display: flex; flex-direction: column; gap: 8px; max-height: 258px; overflow: auto; }
.hist-item { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.hist-date { font-size: 12px; font-weight: 700; width: 78px; flex-shrink: 0; }
.hist-date span { color: var(--muted); font-weight: 600; font-size: 11px; }
.hist-body { flex: 1; min-width: 0; }
.hist-svc { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-t { font-size: 11px; color: var(--muted); }
.hist-right { text-align: right; }
.hist-price { font-size: 13px; font-weight: 800; margin-top: 4px; }

/* ---------- Reports ---------- */
.range-inputs { display: flex; align-items: center; gap: 12px; }
.range-inputs label { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; flex-direction: column; gap: 5px; }
.range-inputs input { padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); }
.report-body { display: flex; flex-direction: column; gap: 18px; }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.report-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.report-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 18px; letter-spacing: -.01em; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; font-size: 13px; }
.bar-row .bl { width: 118px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bar-track { flex: 1; background: var(--surface-2); border-radius: 7px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; background: var(--primary); display: flex; align-items: center; padding: 0 9px; color: #fff; font-size: 11px; font-weight: 700; min-width: 28px; }
.bar-val { width: 94px; text-align: right; font-weight: 800; }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; background: rgba(23, 27, 38, 0.38); display: grid; place-items: center; z-index: 100; padding: 20px; backdrop-filter: blur(2px); animation: riseIn .16s ease; }
.modal-root.hidden { display: none; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 600px; box-shadow: 0 24px 60px -20px rgba(23,27,38,.35); max-height: 92vh; overflow: auto; }
.modal-head { padding: 24px 26px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.modal-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.modal-close { border: none; background: var(--surface-2); width: 32px; height: 32px; border-radius: 8px; font-size: 18px; color: var(--muted); }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 26px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select, .field textarea { padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal.modal-wide { max-width: min(94vw, 860px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span2 { grid-column: 1; } }
.bk-avail { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 10px; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.bk-avail svg { width: 17px; height: 17px; flex-shrink: 0; }
.bk-avail strong { font-weight: 800; }
.bk-avail.free { background: var(--teal-soft); color: #0f8f8a; border: 1px solid #c7ebe9; }
.bk-avail.busy { background: #fdeceb; color: #bb2d24; border: 1px solid #f4c7c3; }
.bk-avail.hidden { display: none; }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }
.primary-btn:disabled:hover { background: var(--primary); transform: none; }
.status-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.status-pill.sel { color: #fff; border-color: transparent; }
.status-pill.sel[data-s=pending] { background: var(--pending); }
.status-pill.sel[data-s=confirmed] { background: var(--confirmed); }
.status-pill.sel[data-s=posted] { background: var(--posted); }
.status-pill.sel[data-s=cancelled] { background: var(--cancelled); }
.modal-foot { padding: 18px 26px 26px; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.modal-foot .right { display: flex; gap: 10px; margin-left: auto; }
.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.swatch.sel { box-shadow: 0 0 0 2px var(--ink); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 200; box-shadow: 0 16px 34px -14px rgba(23,27,38,.6); transition: opacity .2s, transform .2s; }
.toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(10px); }
.toast.err { background: #e5484d; }

/* ---------- Bill breakdown + WhatsApp ---------- */
.bill { display: none; }
.bill.show { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.bill-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.bill-row.disc { color: #157a5c; font-weight: 700; }
.bill-row.total { border-top: 1px dashed var(--line); margin-top: 5px; padding-top: 8px; font-weight: 800; font-size: 15px; }
.wa-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 12px; border: none; background: #25d366; color: #fff; font-weight: 700; font-size: 13px; }
.wa-btn:hover { background: #1eb959; }
.wa-btn svg { width: 16px; height: 16px; }

/* ---------- Offers ---------- */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.offer-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.offer-card.off { opacity: .6; }
.offer-card::before { content: ''; position: absolute; top: -30px; right: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--primary-soft); }
.offer-badge { align-self: flex-start; background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 10px; position: relative; }
.offer-title { font-weight: 800; font-size: 16px; margin-top: 4px; }
.offer-desc { font-size: 12.5px; color: var(--muted); flex: 1; }
.offer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.offer-code { font-family: ui-monospace, monospace; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px dashed var(--line); padding: 3px 8px; border-radius: 6px; letter-spacing: .05em; }
.offer-status { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.offer-status.on { color: #157a5c; }
.offer-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- CRM / Leads pipeline ---------- */
.crm-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.crm-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.crm-col-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; margin-bottom: 12px; padding: 0 4px; }
.crm-dot { width: 9px; height: 9px; border-radius: 50%; }
.crm-count { margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0 8px; font-size: 11px; color: var(--muted); font-weight: 700; }
.crm-list { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.crm-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 0; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 11px; padding: 12px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .1s; }
.lead-card:hover { transform: translateY(-1px); }
.lead-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lead-top strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-val { font-weight: 800; font-size: 12.5px; color: #157a5c; flex-shrink: 0; }
.lead-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; gap: 6px; }
.lead-phone { font-size: 11px; color: var(--muted); }
.lead-actions { display: flex; gap: 6px; margin-top: 10px; }
.lead-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 9px; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; }
.lead-btn:hover { border-color: var(--primary); color: var(--primary); }
.lead-btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.lead-btn.wa:hover { background: #1eb959; color: #fff; }
.lead-btn.wa svg { width: 14px; height: 14px; }
@media (max-width: 1100px) { .crm-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .crm-board { grid-template-columns: 1fr; } }

/* ---------- Login ---------- */
.login-screen { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: radial-gradient(1000px 600px at 80% -10%, #e7f2ec, transparent 60%), var(--app-bg); }
.login-screen.hidden { display: none; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 70px -30px rgba(23,27,38,.4); padding: 34px 32px; width: 100%; max-width: 384px; text-align: center; }
.login-logo { height: 40px; width: auto; margin-bottom: 18px; }
.login-card h1 { font-size: 22px; font-weight: 800; }
.login-p { font-size: 13px; color: var(--muted); margin: 4px 0 22px; }
.login-card form { display: flex; flex-direction: column; gap: 13px; text-align: left; }
.login-card .field label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.login-card .field input { padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); font-size: 14px; background: var(--surface-2); width: 100%; }
.login-card .field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.login-btn { margin-top: 6px; padding: 13px; font-size: 15px; width: 100%; }
.login-err { background: #fdeceb; color: #bb2d24; border: 1px solid #f4c7c3; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; }
.login-err.hidden { display: none; }
.login-hint { margin-top: 18px; font-size: 11.5px; color: var(--muted); }

/* ---------- Popovers (bell + user menu) ---------- */
.pop-wrap { position: relative; }
.popover { position: absolute; top: calc(100% + 10px); right: 0; z-index: 120; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px -20px rgba(23,27,38,.35); overflow: hidden; }
.popover.hidden { display: none; }
.pop-user { width: 244px; }
.pop-notif { width: 322px; }
.pop-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.pop-head strong { font-size: 14px; }
.pop-head small { display: block; font-size: 11px; color: var(--muted); }
.pop-head .notif-count { margin-left: auto; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; border-radius: 20px; padding: 1px 8px; }
.user-av.lg { width: 40px; height: 40px; border-radius: 11px; font-size: 16px; }
.pop-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 11px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pop-item:hover { background: var(--surface-2); color: var(--primary); }
.pop-item.danger:hover { color: #d64545; }
.pop-sep { height: 1px; background: var(--line-soft); }
.notif-list { max-height: 340px; overflow: auto; }
.notif-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: none; background: none; padding: 11px 16px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.notif-item:first-child { border-top: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-tag { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #fff; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; }
.notif-body { min-width: 0; }
.notif-body strong { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-body small { font-size: 11.5px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.dash-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.dash-row { display: grid; grid-template-columns: 88px 1.3fr 1.4fr 1fr auto auto; align-items: center; gap: 12px; padding: 11px 6px; border-top: 1px solid var(--line-soft); cursor: pointer; font-size: 13.5px; }
.dash-row:first-of-type { border-top: none; }
.dash-row:hover { background: var(--surface-2); }
.dash-time { font-weight: 800; }
.dash-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-svc, .dash-t { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-price { font-weight: 800; text-align: right; }

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-row { grid-template-columns: 70px 1fr auto auto; }
  .dash-row .dash-svc, .dash-row .dash-t { display: none; }
  .pop-notif { width: 280px; }
}

@media (max-width: 1100px) {
  .board-layout { grid-template-columns: 1fr; }
  .agenda { position: static; max-height: none; }
  .board-right { position: static; }
}
@media (max-width: 900px) {
  .main { padding: 18px 16px 34px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .report-cols { grid-template-columns: 1fr; }
  /* sidebar becomes an off-canvas drawer */
  .hamburger { display: grid; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; width: 252px; z-index: 200;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 20px 60px rgba(20,25,35,.28); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(20,25,35,.45); z-index: 190; }
  .search-box { max-width: none; }
  .user-meta { display: none; }
  .week-strip { overflow-x: auto; padding-bottom: 4px; }
  .week-day { min-width: 46px; }
  .cal-cell { min-height: 92px; }
}
@media (max-width: 640px) {
  .app-header { flex-wrap: wrap; gap: 10px; }
  .search-box { order: 3; flex-basis: 100%; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px 13px; gap: 11px; }
  .stat-chip { width: 38px; height: 38px; border-radius: 11px; }
  .stat-chip svg { width: 19px; height: 19px; }
  .stat-card .value { font-size: 20px; }
  .page-title { font-size: 21px; }
  .date-display { min-width: 140px; }
  .date-label { font-size: 16px; }
  .topbar { gap: 10px; }
  .primary-btn { padding: 10px 14px; }
  .cal-cell { min-height: 72px; padding: 5px; }
  .cal-chip { font-size: 9.5px; }
  .modal { max-width: 100%; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .stat-row { grid-template-columns: 1fr; }
}
