/* Be You Center – clinic management UI */
@font-face { font-family: 'Heebo'; font-weight: 300; font-display: swap; src: url(../fonts/heebo-hebrew-300-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 400; font-display: swap; src: url(../fonts/heebo-hebrew-400-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 500; font-display: swap; src: url(../fonts/heebo-hebrew-500-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 700; font-display: swap; src: url(../fonts/heebo-hebrew-700-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-weight: 300; font-display: swap; src: url(../fonts/heebo-latin-300-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'Heebo'; font-weight: 400; font-display: swap; src: url(../fonts/heebo-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'Heebo'; font-weight: 500; font-display: swap; src: url(../fonts/heebo-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'Heebo'; font-weight: 700; font-display: swap; src: url(../fonts/heebo-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF; }
@font-face { font-family: 'Amatic SC'; font-weight: 700; font-display: swap; src: url(../fonts/amatic-sc-hebrew-700-normal.woff2) format('woff2'); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Amatic SC'; font-weight: 700; font-display: swap; src: url(../fonts/amatic-sc-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }

:root {
    --olive: #6f7259; --olive-d: #575a44; --olive-l: #8d9077; --olive-xl: #e9eadf;
    --sand: #e4d7c2; --sand-d: #d6c6aa; --cream: #f6f0e5; --paper: #fffdf8;
    --terra: #b08a5a; --terra-l: #f3e8d8;
    --ink: #3b3d2f; --muted: #7c7a6a; --line: #e7ddcc; --line-2: #efe7da;
    --blue: #5b7fa3; --blue-l: #e6eef6; --green: #5f8a55; --green-l: #e5f0e1;
    --orange: #c2873a; --orange-l: #f8ecd9; --red: #b4594c; --red-l: #f6e1dd;
    --gray: #9c998a; --gray-l: #efede6; --purple: #8a6f8f; --purple-l: #f0e8f1;
    --radius: 14px; --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(60, 55, 40, .06), 0 4px 16px rgba(60, 55, 40, .06);
    --shadow-lg: 0 10px 40px rgba(60, 55, 40, .18);
    --sidebar: 250px;
    --font: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --script: 'Amatic SC', 'Heebo', cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--cream); }
a { color: var(--olive-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .8em; }
code { background: var(--gray-l); padding: 1px 6px; border-radius: 5px; font-size: .9em; direction: ltr; unicode-bidi: embed; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.ic { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .xs { font-size: .76rem; }
.ltr { direction: ltr; unicode-bidi: embed; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; } .left { text-align: left; }
.mt-0 { margin-top: 0 } .mt { margin-top: 16px; } .mt-l { margin-top: 28px; } .mb { margin-bottom: 16px; } .mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.script-title { font-family: var(--script); font-weight: 700; font-size: 2.3rem; letter-spacing: .5px; color: var(--olive-d); }
.flex { display: flex; align-items: center; gap: 10px; } .flex.wrap { flex-wrap: wrap; } .flex.between { justify-content: space-between; } .flex.top { align-items: flex-start; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }

/* ===== Layout ===== */
.sidebar { position: fixed; top: 0; right: 0; bottom: 0; width: var(--sidebar); background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; transition: transform .25s; }
.sidebar .brand { padding: 18px 20px 10px; display: flex; align-items: center; gap: 10px; }
.sidebar .brand img { width: 92px; }
.sidebar .brand .tag { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.nav .sec { font-size: .72rem; color: var(--muted); margin: 14px 10px 4px; letter-spacing: .3px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--ink); font-size: .94rem; margin-bottom: 2px; text-decoration: none; position: relative; }
.nav a:hover { background: var(--cream); }
.nav a.active { background: var(--olive); color: #fff; }
.nav a .count { margin-inline-start: auto; background: var(--terra); color: #fff; border-radius: 20px; font-size: .7rem; padding: 0 7px; min-width: 20px; text-align: center; }
.nav a.active .count { background: rgba(255,255,255,.25); }
.sidebar .foot { padding: 10px 12px 14px; border-top: 1px solid var(--line-2); }
.sidebar .foot a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: .9rem; }
.sidebar .foot a:hover { background: var(--cream); color: var(--ink); text-decoration: none; }
.sidebar .me { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.main { margin-right: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(246, 240, 229, .92); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .menu-btn { display: none; }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { width: 100%; padding: 9px 38px 9px 14px; border-radius: 40px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: .9rem; }
.topbar .search .ic { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results { position: absolute; top: 110%; right: 0; left: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 380px; overflow: auto; z-index: 60; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.search-results a:hover, .search-results a.focus { background: var(--cream); text-decoration: none; }
.topbar .actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--sand); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 6px; left: 8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 10px; background: var(--red); color: #fff; font-size: .68rem; display: flex; align-items: center; justify-content: center; }
.content { padding: 8px 28px 60px; flex: 1; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 2px; font-size: .92rem; }
.page-head .back { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(40, 38, 28, .35); z-index: 35; }

/* ===== Cards & KPIs ===== */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--olive-xl); border-color: #dcdecd; }
.card.sand { background: var(--terra-l); border-color: #ecdcc4; }
.grid { display: grid; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.cols-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.kpi { border-radius: var(--radius); padding: 18px 20px; color: #fff; position: relative; overflow: hidden; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.kpi .v { font-size: 1.85rem; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
.kpi .l { font-size: .88rem; opacity: .92; display: flex; align-items: center; gap: 6px; }
.kpi .s { font-size: .78rem; opacity: .85; }
.kpi::after { content: ''; position: absolute; left: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.1); }
.kpi.olive { background: linear-gradient(135deg, #6f7259, #8a8d70); }
.kpi.terra { background: linear-gradient(135deg, #a8804f, #c49d6c); }
.kpi.sage { background: linear-gradient(135deg, #5f7f6a, #7f9d86); }
.kpi.plum { background: linear-gradient(135deg, #7c6482, #9c84a2); }
.kpi.light { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.kpi.light::after { background: var(--cream); }
.stat { padding: 14px 16px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line-2); }
.stat .v { font-size: 1.4rem; font-weight: 700; }
.stat .l { font-size: .82rem; color: var(--muted); }
.stat.good { background: var(--green-l); border-color: #d3e3cd; } .stat.bad { background: var(--red-l); border-color: #ecd0ca; } .stat.warn { background: var(--orange-l); border-color: #efdcbf; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--cream); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--olive); border-color: var(--olive); color: #fff; }
.btn.primary:hover { background: var(--olive-d); }
.btn.terra { background: var(--terra); border-color: var(--terra); color: #fff; }
.btn.terra:hover { background: #9b774b; }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.wa:hover { background: #1fb857; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sand); }
.btn.danger { color: var(--red); border-color: #e9c9c3; }
.btn.danger:hover { background: var(--red-l); }
.btn.sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn.xs { padding: 3px 8px; font-size: .78rem; border-radius: 7px; gap: 4px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn.icon { padding: 7px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== Forms ===== */
.form .field, .field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .lbl { font-size: .84rem; color: var(--muted); font-weight: 500; }
.field .hint { font-size: .76rem; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url], input:not([type]), select, textarea {
    font: inherit; font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid var(--sand-d); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--olive); box-shadow: 0 0 0 3px rgba(111, 114, 89, .15); }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c7a6a' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 32px; }
input[type=checkbox], input[type=radio] { accent-color: var(--olive); width: 17px; height: 17px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .92rem; margin: 6px 0; }
.form > * + * { margin-top: 14px; }
.form h3 { margin-top: 22px; padding-top: 6px; color: var(--olive-d); }
.form-actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 20px; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; }
legend { padding: 0 6px; font-weight: 600; font-size: .9rem; color: var(--olive-d); }

/* ===== Badges / chips ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: .76rem; font-weight: 500; white-space: nowrap; background: var(--gray-l); color: #5d5b4f; }
.badge.blue { background: var(--blue-l); color: #3f6286; } .badge.green { background: var(--green-l); color: #44703b; }
.badge.orange { background: var(--orange-l); color: #95621d; } .badge.red { background: var(--red-l); color: #93412f; }
.badge.gray { background: var(--gray-l); color: #6b685b; } .badge.purple { background: var(--purple-l); color: #6c5271; }
.badge.olive { background: var(--olive-xl); color: var(--olive-d); } .badge.terra { background: var(--terra-l); color: #84633c; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line); background: var(--paper); font-size: .85rem; color: var(--ink); cursor: pointer; text-decoration: none; }
.chip:hover { background: var(--cream); text-decoration: none; }
.chip.on { background: var(--olive); border-color: var(--olive); color: #fff; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--terra-l); color: #84633c; font-size: .75rem; margin: 1px; }

/* ===== Tabs / segmented ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 16px; color: var(--muted); border: 0; background: none; font: inherit; font-size: .93rem; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs a.on, .tabs button.on { color: var(--olive-d); border-bottom-color: var(--olive); font-weight: 600; }
.seg { display: inline-flex; background: var(--sand); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { padding: 6px 13px; border-radius: 8px; color: var(--ink); font: inherit; font-size: .86rem; border: 0; background: none; cursor: pointer; text-decoration: none; white-space: nowrap; }
.seg a:hover, .seg button:hover { background: rgba(255,255,255,.5); text-decoration: none; }
.seg a.on, .seg button.on { background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 600; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: right; font-weight: 600; font-size: .8rem; color: var(--muted); background: var(--cream); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcf9f2; }
.table tfoot td { font-weight: 700; background: var(--cream); border-top: 1px solid var(--line); }
.table .num { text-align: left; direction: ltr; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table.compact td, .table.compact th { padding: 7px 10px; }

/* ===== Lists ===== */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--sand); color: var(--olive-d); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem; flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar.couple { background: var(--purple-l); color: var(--purple); }
.time-pill { min-width: 62px; text-align: center; padding: 6px 8px; border-radius: 9px; background: var(--olive-xl); color: var(--olive-d); font-weight: 600; font-size: .88rem; }

/* ===== Patients cards ===== */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.pcard .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); }
.pcard .meta span { display: inline-flex; gap: 4px; align-items: center; }
.pcard .bal { font-weight: 600; }
.pcard .bal.due { color: var(--red); }

/* ===== Alerts / empty ===== */
.alert { padding: 11px 15px; border-radius: 11px; margin-bottom: 14px; font-size: .92rem; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert.success { background: var(--green-l); border-color: #cfe1c8; color: #3c6234; }
.alert.error { background: var(--red-l); border-color: #ebcbc4; color: #8a3a2c; }
.alert.info { background: var(--blue-l); border-color: #cfdcea; color: #3b5c7f; }
.alert.warn { background: var(--orange-l); border-color: #eedab9; color: #855615; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .big { font-size: 2.4rem; margin-bottom: 6px; }
.empty h3 { color: var(--ink); }
.toast-wrap { position: fixed; bottom: 22px; left: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: .9rem; animation: tin .25s ease; max-width: 360px; }
.toast.error { background: var(--red); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* ===== Dialog ===== */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow-lg); color: var(--ink); background: var(--paper); }
dialog.wide { width: min(880px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(40, 38, 28, .4); backdrop-filter: blur(2px); }
dialog .dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 2; }
dialog .dlg-head h2 { margin: 0; font-size: 1.15rem; }
dialog .dlg-body { padding: 18px 22px; }
dialog .dlg-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-start; background: var(--cream); position: sticky; bottom: 0; flex-wrap: wrap; }

/* ===== Calendar ===== */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-toolbar .title { font-size: 1.15rem; font-weight: 600; min-width: 170px; text-align: center; }
.cal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-head { display: grid; border-bottom: 1px solid var(--line); background: var(--cream); }
.cal-head div { padding: 8px 4px; text-align: center; font-size: .82rem; color: var(--muted); }
.cal-head div b { display: block; font-size: 1.15rem; color: var(--ink); font-weight: 600; }
.cal-head div.today b { background: var(--olive); color: #fff; border-radius: 50%; width: 32px; height: 32px; line-height: 32px; margin: 2px auto 0; }
.cal-body { display: grid; position: relative; overflow-y: auto; max-height: calc(100vh - 250px); }
.cal-times div { height: 52px; font-size: .74rem; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line-2); padding-top: 2px; }
.cal-col { position: relative; border-right: 1px solid var(--line-2); }
.cal-col .slot { height: 13px; }
.cal-col .slot:nth-child(4n) { border-bottom: 1px solid var(--line-2); }
.cal-col .slot:hover { background: var(--olive-xl); cursor: pointer; }
.cal-col .slot.over { background: var(--sand); }
.cal-col.today { background: #fdfaf2; }
.ev { position: absolute; right: 3px; left: 3px; border-radius: 8px; padding: 4px 7px; font-size: .76rem; line-height: 1.3; overflow: hidden; cursor: pointer; color: #fff; border-right: 4px solid rgba(0,0,0,.18); box-shadow: 0 1px 3px rgba(0,0,0,.12); z-index: 2; }
.ev:hover { filter: brightness(1.05); z-index: 5; }
.ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.st-cancelled { opacity: .5; text-decoration: line-through; }
.ev.st-late_cancel, .ev.st-no_show { background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255,255,255,.2) 6px 12px); }
.ev.st-done::after { content: '✓'; position: absolute; left: 6px; top: 3px; font-weight: 700; }
.ev.dragging { opacity: .5; }
.now-line { position: absolute; right: 0; left: 0; height: 2px; background: var(--red); z-index: 4; pointer-events: none; }
.now-line::before { content: ''; position: absolute; right: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-month .d { min-height: 112px; border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 5px 6px; font-size: .8rem; cursor: pointer; min-width: 0; }
.cal-month .d:hover { background: #fcf9f2; }
.cal-month .d.out { background: #faf7f0; color: var(--gray); }
.cal-month .d .n { font-weight: 600; margin-bottom: 3px; display: inline-block; width: 24px; height: 24px; text-align: center; line-height: 24px; border-radius: 50%; }
.cal-month .d.today .n { background: var(--olive); color: #fff; }
.cal-month .mev { display: block; border-radius: 5px; padding: 1px 6px; margin-bottom: 2px; color: #fff; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-month .more { font-size: .72rem; color: var(--muted); }
.cal-summary { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-top: 10px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }

/* ===== Charts ===== */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 18px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bars .b .col { width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: var(--olive-l); position: relative; min-height: 2px; transition: height .4s; }
.bars .b .col.alt { background: var(--terra); }
.bars .b .col .tip { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: .72rem; color: var(--ink); white-space: nowrap; }
.bars .b .x { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.hbars .row { display: grid; grid-template-columns: 120px 1fr 64px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: .85rem; }
.hbars .row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .track { height: 12px; background: var(--cream); border-radius: 8px; overflow: hidden; }
.hbars .fill { height: 100%; background: var(--olive-l); border-radius: 8px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-legend { list-style: none; padding: 0; margin: 0; font-size: .85rem; }
.donut-legend li { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; }
.donut-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.progress { height: 12px; background: var(--sand); border-radius: 10px; overflow: hidden; position: relative; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--olive-l), var(--olive)); border-radius: 10px; }
.progress.terra > div { background: linear-gradient(90deg, #c9a679, var(--terra)); }

/* ===== Chat (AI) ===== */
.chat-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; height: calc(100vh - 170px); min-height: 480px; }
.chat-side { overflow-y: auto; }
.chat-side a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--ink); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-side a:hover { background: var(--cream); text-decoration: none; }
.chat-side a.on { background: var(--olive-xl); font-weight: 600; }
.chat-main { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 11px 15px; border-radius: 16px; line-height: 1.65; font-size: .94rem; white-space: pre-wrap; word-wrap: break-word; position: relative; }
.msg.user { align-self: flex-start; background: var(--olive); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-end; background: var(--cream); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg .tools { display: flex; gap: 4px; margin-top: 6px; opacity: .25; transition: opacity .15s; }
.msg:hover .tools { opacity: 1; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-input { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 10px; align-items: flex-end; background: var(--paper); }
.chat-input textarea { min-height: 46px; max-height: 180px; border-radius: 12px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }

/* ===== Recorder ===== */
.rec-btn { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--terra); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 24px rgba(176, 138, 90, .4); transition: transform .15s; }
.rec-btn:hover { transform: scale(1.04); }
.rec-btn.on { background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180, 89, 76, .5); } 50% { box-shadow: 0 0 0 16px rgba(180, 89, 76, 0); } }
.rec-time { font-size: 2rem; font-weight: 300; font-variant-numeric: tabular-nums; direction: ltr; }
.meter { height: 8px; background: var(--sand); border-radius: 6px; overflow: hidden; width: 220px; max-width: 100%; }
.meter > div { height: 100%; width: 0; background: var(--green); transition: width .08s; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.steps > div { background: var(--cream); border-radius: 12px; padding: 14px; font-size: .88rem; position: relative; padding-top: 38px; }
.steps > div::before { counter-increment: s; content: counter(s); position: absolute; top: 10px; right: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--olive); color: #fff; font-size: .78rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ===== Timeline ===== */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; right: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 44px 18px 0; }
.timeline li .dot { position: absolute; right: 8px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--olive-l); }
.timeline li.done .dot { border-color: var(--green); } .timeline li.cancelled .dot, .timeline li.late_cancel .dot, .timeline li.no_show .dot { border-color: var(--orange); }
.timeline li.scheduled .dot { border-color: var(--blue); }
.note-box { background: var(--cream); border-radius: 10px; padding: 10px 14px; margin-top: 6px; font-size: .9rem; white-space: pre-wrap; }

/* ===== Auth ===== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; background: radial-gradient(circle at 80% 10%, #eee5d4 0, transparent 50%), radial-gradient(circle at 10% 90%, #e2e3d5 0, transparent 50%), var(--cream); }
.auth-card { background: var(--paper); border-radius: 22px; padding: 34px 34px 28px; box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; border: 1px solid var(--line); }
.auth-card.wide { max-width: 680px; }
.auth-logo { text-align: center; margin-bottom: 6px; }
.auth-card h1 { text-align: center; }
.auth-card .quote { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.checks { list-style: none; padding: 0; columns: 2; font-size: .88rem; }
.checks li { margin-bottom: 4px; } .checks .ok { color: var(--green); } .checks .bad { color: var(--red); font-weight: 600; } .checks .warn { color: var(--orange); }

/* ===== Public pages ===== */
.public-wrap { max-width: 720px; margin: 0 auto; padding: 30px 16px 60px; }
.public-head { text-align: center; margin-bottom: 20px; }
.sig-pad { border: 1px dashed var(--sand-d); border-radius: 12px; background: #fff; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }

/* ===== Misc ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { display: none; position: absolute; top: 105%; left: 0; min-width: 230px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; padding: 6px; max-height: 420px; overflow-y: auto; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; font-size: .88rem; cursor: pointer; text-align: right; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--cream); text-decoration: none; }
.notif { padding: 10px 12px !important; align-items: flex-start !important; border-bottom: 1px solid var(--line-2); border-radius: 0 !important; }
.notif .t { font-size: .86rem; } .notif .s { font-size: .76rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head .info h1 { margin: 0 0 4px; }
.pill-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-stats > div { background: var(--cream); border-radius: 12px; padding: 8px 14px; text-align: center; min-width: 100px; }
.pill-stats b { display: block; font-size: 1.15rem; }
.pill-stats span { font-size: .76rem; color: var(--muted); }
.copy-box { display: flex; gap: 8px; } .copy-box input { direction: ltr; font-size: .85rem; background: var(--cream); }
.print-only { display: none; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.welcome h1 { font-size: 1.7rem; margin: 0; }
.quote-card { font-family: var(--script); font-size: 1.6rem; color: var(--olive-d); line-height: 1.2; }
.capacity { display: flex; gap: 3px; flex-wrap: wrap; }
.capacity i { width: 14px; height: 14px; border-radius: 4px; background: var(--sand); display: inline-block; }
.capacity i.on { background: var(--olive); } .capacity i.wait { background: var(--orange); }
.ws-card { display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.ws-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.ws-date { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; height: 62px; border-radius: 12px; background: var(--olive); color: #fff; line-height: 1.1; }
.ws-date b { font-size: 1.4rem; } .ws-date span { font-size: .72rem; }
.mood { display: flex; gap: 4px; flex-wrap: wrap; }
.mood label { cursor: pointer; } .mood input { display: none; }
.mood span { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; background: var(--cream); font-size: .82rem; border: 1px solid var(--line); }
.mood input:checked + span { background: var(--olive); color: #fff; border-color: var(--olive); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 4px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p, .faq details ul { margin-top: 10px; color: #55574a; }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner.dark { border-color: var(--line); border-top-color: var(--olive); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cols-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(100%); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .overlay { display: block; }
    .main { margin-right: 0; }
    .topbar { padding: 10px 14px; }
    .topbar .menu-btn { display: inline-flex; }
    .content { padding: 4px 14px 80px; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .chat-layout { grid-template-columns: 1fr; height: auto; }
    .chat-side { display: none; }
    .chat-main { height: calc(100vh - 190px); }
    .steps { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 110px 1fr; }
    .cal-month .d { min-height: 70px; padding: 3px; }
    .cal-month .mev { font-size: .64rem; padding: 0 3px; }
    .msg { max-width: 92%; }
    .page-head h1 { font-size: 1.35rem; }
    .hide-sm { display: none !important; }
    .checks { columns: 1; }
}
@media (max-width: 520px) {
    .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi { min-height: 92px; padding: 14px; }
    .kpi .v { font-size: 1.4rem; }
    .card { padding: 15px; }
    .topbar .search { display: none; }
}
@media print {
    .sidebar, .topbar, .no-print, .toast-wrap, .btn, .tabs, .seg { display: none !important; }
    .main { margin: 0; } .content { padding: 0; max-width: none; }
    body { background: #fff; font-size: 12px; }
    .card { box-shadow: none; border: 0; padding: 0; }
    .print-only { display: block; }
    .table-wrap { border: 0; } .table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
