/* Admin site + customer portal shell (uses tokens from styles.css) */

/* Light glass variant: same components as the public site, re-tokened for long working sessions. */
body.app {
  --text: #0B1033; --text-muted: #4A5578; --heading: #0B1033; --link: var(--navy); --line: rgba(22, 33, 138, .1);
  --glass: rgba(255, 255, 255, .62); --glass-strong: rgba(255, 255, 255, .8); --glass-border: rgba(255, 255, 255, .85);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .9); --blur: blur(18px) saturate(170%);
  --field-bg: rgba(255, 255, 255, .7); --field-focus: #fff; --chip-bg: rgba(255, 255, 255, .6);
  --shadow: 0 12px 34px -18px rgba(16, 24, 79, .35);
  --glow-lime: 0 0 0 1px rgba(122, 213, 1, .35), 0 16px 40px -20px rgba(99, 174, 0, .45);
  min-height: 100vh; color: var(--text);
  background:
    radial-gradient(40vw 40vw at 100% 0%, rgba(34, 227, 245, .22), transparent 70%),
    radial-gradient(36vw 36vw at 20% 100%, rgba(122, 213, 1, .16), transparent 70%),
    radial-gradient(50vw 40vw at 55% 45%, rgba(201, 220, 234, .7), transparent 70%),
    #E9F1F8;
  background-attachment: fixed;
}
body.app ::selection { background: rgba(122, 213, 1, .35); color: var(--ink); }
body.app input::placeholder, body.app textarea::placeholder { color: #8A96B0; }
body.app input, body.app select, body.app textarea { border-color: rgba(22, 33, 138, .14); box-shadow: inset 0 1px 2px rgba(16, 24, 79, .06); }
body.app input:focus, body.app select:focus, body.app textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(22, 33, 138, .12); }
body.app select option { background: #fff; color: var(--text); }
body.app label .req, body.app .form-error { color: #B42318; }
body.app .btn-navy { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 8px 20px -10px rgba(22, 33, 138, .6); }
body.app .btn-navy:hover { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
body.app .btn-outline, body.app .btn-ghost { background: rgba(255, 255, 255, .55); color: var(--navy); border-color: rgba(22, 33, 138, .3); }
body.app .btn-outline:hover, body.app .btn-ghost:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
body.app .kicker, body.app .service .cat, body.app .support-card .step { color: var(--lime-600); }
body.app .cal-grid button:disabled { color: #B8C2D6; }
body.app .cal-grid button:hover:not(:disabled), body.app .slots button:hover { border-color: var(--navy); background: #fff; }
body.app .info-card { background: var(--bar); }
body.app .preview-flag { background: rgba(255, 244, 220, .8); border-color: #F4D27A; color: #6B5200; }
body.app .stat strong { text-shadow: none; }
/* Frosted white surfaces */
.panel-box, .stat-card, .table-wrap, .month, .msg, .steps span, .modal, .topline {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--aurora); background-size: var(--aurora-size); animation: aurora 18s ease-in-out infinite alternate; color: var(--text-on-dark); position: sticky; top: 0; height: 100vh;
  box-shadow: 1px 0 0 rgba(122, 213, 1, .18), 10px 0 40px -20px rgba(16, 24, 79, .6);
  display: flex; flex-direction: column; padding: 22px 14px; overflow-y: auto;
  border-right: 1px solid var(--line-dark);
}
.sidebar .brand img { height: 96px; margin: 0 8px 12px; }
.sidebar .org-name { font-size: .8rem; color: var(--muted-on-dark); margin: 0 10px 18px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; color: var(--text-on-dark); text-decoration: none;
  padding: 10px 12px; border-radius: 10px; font-weight: 500; font-size: .95rem;
}
.sidebar nav a svg { width: 19px; height: 19px; opacity: .8; flex: none; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(122, 213, 1, .16), rgba(255, 255, 255, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--lime), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sidebar nav a.active svg { color: var(--lime); opacity: 1; }
.sidebar nav a .count { margin-left: auto; background: var(--lime); color: var(--ink); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.sidebar .nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #6F82A3; margin: 18px 12px 6px; font-weight: 600; }
.sidebar .me { padding: 14px 10px 0; border-top: 1px solid var(--line-dark); font-size: .88rem; }
.sidebar .me strong { display: block; color: #fff; }
.sidebar .me a, .sidebar .me button { color: var(--muted-on-dark); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }

.main { min-width: 0; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px; border-bottom: 1px solid rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .55); box-shadow: 0 8px 24px -18px rgba(16, 24, 79, .4); position: sticky; top: 0; z-index: 5; }
.topline h1 { font-size: 1.5rem; margin: 0; }
.topline .crumb { font-size: .82rem; color: var(--text-muted); }
.topline .crumb a { color: var(--text-muted); }
.topline .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page { padding: 28px 32px 60px; }
.mobile-bar { display: none; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(2, 3, 15, .5); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; background: var(--bar); padding: 8px 16px; }
  .mobile-bar img { height: 46px; width: auto; filter: drop-shadow(0 0 8px rgba(122, 213, 1, .3)); }
  .mobile-bar button { background: none; border: 0; color: #fff; padding: 6px; }
  .mobile-bar svg { width: 26px; height: 26px; }
  .topline { padding: 16px; position: static; flex-wrap: wrap; }
  .page { padding: 20px 16px 48px; }
}

.btn-sm { padding: .5em 1em; font-size: .88rem; }
.btn-danger { background: rgba(255, 255, 255, .7); color: #B42318; border-color: #F3C3BE; }
.btn-danger:hover { background: #B42318; color: #fff; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); cursor: pointer; text-decoration: underline; }

/* Panels & stats */
.panel-box { background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--shadow); border-radius: var(--radius); padding: 22px; }
.panel-box > h2, .panel-box > h3 { font-size: 1.1rem; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-box + .panel-box { margin-top: 20px; }
.cols { display: grid; gap: 20px; align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-21 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .cols, .cols-3, .cols-21 { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--shadow); transition: transform .15s, box-shadow .15s; border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--text); display: block; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--glass-hi), var(--glow-lime); }
.stat-card .n { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-card .l { font-size: .86rem; color: var(--text-muted); }
.stat-card.accent { background: radial-gradient(circle at 90% 0%, rgba(122, 213, 1, .3), transparent 55%), linear-gradient(135deg, var(--bar), #1B3FA8); border-color: rgba(122, 213, 1, .35); color: #fff; }
.stat-card.accent .n { color: var(--lime); }
.stat-card.accent .l { color: var(--ice); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--glass-border); border-radius: var(--radius); background: var(--glass); box-shadow: var(--glass-hi), var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; padding: 12px 14px; background: rgba(201, 220, 234, .35); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: rgba(255, 255, 255, .7); }
table.data td.actions { text-align: right; white-space: nowrap; }
.empty { text-align: center; color: var(--text-muted); padding: 36px 16px; }
.empty svg { width: 40px; height: 40px; color: var(--ice); margin-bottom: 8px; }

/* Badges */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.badge.green { background: #E9F8D6; color: #2F5F00; border-color: #CBEBA0; }
.badge.blue { background: #E3EEF7; color: var(--navy); border-color: var(--ice); }
.badge.amber { background: #FFF4DC; color: #7A5200; border-color: #F6DDA1; }
.badge.red { background: #FDECEA; color: #B42318; border-color: #F3C3BE; }
.badge.gray { background: #F0F2F6; color: #5B6478; }

/* Customer tags + Premium crown */
.tag-chip { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.4; padding: 2px 9px; border-radius: 999px; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.premium-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; vertical-align: -5px; border-radius: 7px; background: linear-gradient(135deg, #FFE08A, #E3A008); color: #6B4500; box-shadow: 0 4px 10px -4px rgba(180, 120, 0, .6); }
.premium-mark svg { width: 14px; height: 14px; }
.toggle-row strong .premium-mark { margin: 0 6px 0 0; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag-pick label { position: relative; cursor: pointer; }
.tag-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tag-pick .tag-chip { font-size: .82rem; padding: 5px 12px; opacity: .38; filter: saturate(.5); transition: opacity .15s, filter .15s, box-shadow .15s; }
.tag-pick input:checked + .tag-chip { opacity: 1; filter: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(22, 33, 138, .35); }
.tag-pick input:checked + .tag-chip::before { content: "✓ "; }
.tag-pick input:focus-visible + .tag-chip { outline: 2px solid var(--navy); outline-offset: 3px; }
.tag-pick input:disabled + .tag-chip { cursor: default; }
.tag-list { display: grid; gap: 10px; }
.tag-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .55); }
.tag-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; flex: 1; min-width: 0; }
.tag-edit input[name=name] { flex: 1 1 180px; min-width: 0; }
.tag-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.tag-swatches input[type=color] { width: 30px; height: 30px; padding: 2px; border-radius: 8px; cursor: pointer; background: #fff; }
.tag-btns { display: flex; gap: 6px; margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .tag-pick .tag-chip { transition: none; } }

/* Toggles (portal access switches) */
.toggle-list { display: grid; gap: 4px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row strong { display: block; font-size: .95rem; }
.toggle-row span { font-size: .84rem; color: var(--text-muted); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: #C8D1E0; border-radius: 999px; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .track { background: var(--lime-600); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(22, 33, 138, .12); margin-bottom: 22px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--navy); border-color: var(--lime); }

/* Forms in app */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field input[type=checkbox] { width: auto; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin-bottom: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
textarea.code { font-family: Consolas, Menlo, monospace; font-size: .85rem; min-height: 320px; }

/* Wizard */
.steps { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.steps span { font-size: .85rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-muted); }
.steps span.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.steps span.done { background: #E9F8D6; border-color: #CBEBA0; color: #2F5F00; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(5, 10, 36, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { background: rgba(255, 255, 255, .88); border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--radius-lg); width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow: auto; padding: 28px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.modal.wide { max-width: 900px; }
.modal h2 { font-size: 1.3rem; display: flex; justify-content: space-between; align-items: center; }
.modal .x { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--text-muted); line-height: 1; }

/* Toast */
.toast { position: fixed; bottom: 20px; right: 20px; background: rgba(16, 24, 79, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 80; font-size: .93rem; max-width: 380px; border-left: 4px solid var(--lime); }
.toast.err { border-left-color: #F04438; }

/* Ticket thread */
.thread { display: grid; gap: 14px; }
.msg { border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 14px 18px; background: var(--glass); box-shadow: var(--glass-hi), var(--shadow); }
.msg.staff { background: rgba(225, 238, 248, .75); border-color: var(--ice); box-shadow: inset 3px 0 0 var(--lime), var(--shadow); }
.msg.internal { background: rgba(255, 248, 225, .8); border-color: #F4D27A; }
.msg .meta { font-size: .82rem; color: var(--text-muted); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg .meta strong { color: var(--text); }
.msg .body { white-space: pre-wrap; word-wrap: break-word; }

/* Calendar (admin) */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--glass-border); border-radius: var(--radius); overflow: hidden; background: var(--glass); box-shadow: var(--glass-hi), var(--shadow); }
.month .dow { background: rgba(201, 220, 234, .35); font-size: .75rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); padding: 8px; border-bottom: 1px solid var(--line); }
.month .day { min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; font-size: .8rem; min-width: 0; }
.month .day:nth-child(7n) { border-right: 0; }
.month .day.other { background: rgba(255, 255, 255, .3); color: #A9B3C7; }
.month .day.today .d { background: var(--lime); color: var(--ink); border-radius: 999px; padding: 0 7px; }
.month .d { font-weight: 700; display: inline-block; margin-bottom: 4px; }
.ev { display: block; width: 100%; text-align: left; border: 0; font: inherit; font-size: .76rem; padding: 3px 6px; border-radius: 6px; margin-bottom: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.booking { background: var(--navy); color: #fff; }
.ev.outlook { background: #DCEBFA; color: #0B3B73; }
.ev.cancelled { background: #F0F2F6; color: #8A93A7; text-decoration: line-through; }
.legend { display: flex; gap: 16px; font-size: .84rem; color: var(--text-muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
@media (max-width: 760px) { .month .day { min-height: 70px; } .ev { font-size: 0; height: 8px; padding: 0; } }

/* Misc */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: .94rem; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; }
.score { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--navy);
  background: conic-gradient(var(--lime) calc(var(--v) * 1%), var(--ice-50) 0); position: relative; }
.score::before { content: ""; position: absolute; inset: 9px; background: rgba(255, 255, 255, .92); border-radius: 50%; }
.score span { position: relative; }
.preview-bar { background: rgba(255, 244, 220, .85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #7A5200; border-bottom: 1px solid #F6DDA1; padding: 10px 32px; font-size: .9rem; font-weight: 600; }
.callout { background: rgba(255, 255, 255, .5); border: 1px dashed #B6C7DB; border-radius: var(--radius); padding: 16px 18px; font-size: .92rem; color: var(--text-muted); }
.callout code { background: #fff; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); word-break: break-all; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.muted { color: var(--text-muted); font-size: .88rem; }
.search { max-width: 280px; }
iframe.email-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ===== CRM & billing ===== */
table.data th.num, table.data td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tr.off td { opacity: .55; }
table.data td.click { cursor: pointer; }
table.data tfoot td { border-bottom: 0; padding-top: 8px; padding-bottom: 8px; color: var(--text-muted); }
table.data tfoot tr.grand td { color: var(--text); font-weight: 700; font-size: 1rem; border-top: 1px solid var(--line); }
.stat-card .n.danger { color: #B42318; }
.group-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin: 22px 0 10px; }
.group-h:first-child { margin-top: 0; }
.field-row { display: grid; gap: 10px; margin-bottom: 10px; }
.list-plain li.done label { text-decoration: line-through; color: var(--text-muted); }
.action-stack { display: grid; gap: 10px; }
.action-stack .btn { justify-content: center; width: 100%; }
.action-stack .btn svg { width: 16px; height: 16px; }
.btn svg { width: 16px; height: 16px; vertical-align: -3px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid rgba(22, 33, 138, .2); border-radius: 999px; background: rgba(255, 255, 255, .6); cursor: pointer; font-weight: 500; font-size: .92rem; }
.seg label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg input { width: auto; accent-color: var(--lime); }
.pick { max-height: 220px; overflow: auto; border: 1px solid rgba(22, 33, 138, .14); border-radius: 12px; padding: 10px 14px; background: rgba(255, 255, 255, .6); }
.pick .check { margin-bottom: 6px; }
.timeline { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: start; }
.timeline .badge { text-align: center; }
.timeline .body { white-space: pre-wrap; }
.timeline .muted { font-size: .8rem; }
.note-form, .task-form { margin-bottom: 8px; }

/* Overview chart: single series, no legend; tooltip + table view */
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 6px; height: 200px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; cursor: default; position: relative; }
.bar-col .bar { width: 100%; max-width: 24px; min-height: 2px; background: #4A8500; border-radius: 4px 4px 0 0; transition: background .12s; }
.bar-col:hover .bar, .bar-col:focus-visible .bar { background: var(--navy); }
.bar-col span { position: absolute; bottom: -22px; font-size: .72rem; color: var(--text-muted); }
.bars + div, .bars ~ #chart-tbl { margin-top: 30px; }
.chart-tip { position: absolute; z-index: 90; background: rgba(16, 24, 79, .94); color: #fff; font-size: .82rem; padding: 7px 11px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.aging { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.aging div { background: rgba(255, 255, 255, .55); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.aging span { font-size: .76rem; color: var(--text-muted); }
.aging .late strong { color: #B42318; }
@media (max-width: 760px) { .aging { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Pipeline kanban */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: rgba(255, 255, 255, .4); border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius); padding: 12px; min-height: 240px; display: grid; gap: 10px; align-content: start; transition: background .12s; }
.kcol.over { background: rgba(122, 213, 1, .14); border-color: rgba(122, 213, 1, .6); }
.khead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .9rem; padding: 0 2px 4px; }
.khead .muted { font-size: .78rem; }
.kcard { background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 4px; cursor: grab; box-shadow: 0 6px 16px -12px rgba(16, 24, 79, .5); font-size: .9rem; }
.kcard:hover, .kcard:focus-visible { border-color: var(--navy); outline: none; }
.kcard.dragging { opacity: .5; }
.kcard .muted { font-size: .82rem; }
.krow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.kval { font-weight: 700; color: var(--navy); }
.knext { font-size: .8rem; color: var(--lime-600); font-weight: 600; }
.kempty { font-size: .82rem; color: #8A96B0; text-align: center; padding: 20px 0; border: 1px dashed rgba(22, 33, 138, .15); border-radius: 10px; }

/* Invoice / quote */
.doc-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-amt { display: grid; justify-items: end; gap: 4px; }
.doc-amt strong { font-family: var(--font-head); font-size: 2rem; color: var(--navy); line-height: 1; }
table.data.lines td { padding: 8px 6px; vertical-align: middle; }
table.data.lines input, table.data.lines select { padding: 8px 10px; font-size: .9rem; }
table.data.lines input.num { text-align: right; }
table.data.lines input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); }
.doc-totals { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 18px; align-items: flex-start; }
.doc-totals dl { display: grid; grid-template-columns: auto 140px; gap: 6px 20px; margin: 0; font-variant-numeric: tabular-nums; }
.doc-totals dt { color: var(--text-muted); text-align: right; }
.doc-totals dd { margin: 0; text-align: right; }
.doc-totals .grand { font-weight: 700; color: var(--text); font-size: 1.1rem; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; margin-top: 20px; z-index: 4; }

/* Notifications */
.notif { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .75); border: 1px solid var(--line); }
.notif .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--navy); }
.notif.lv-maintenance .dot { background: #D99A00; }
.notif.lv-alert .dot { background: #D92D20; }
.notif.lv-billing .dot { background: #1B3FA8; }
.notif.lv-success .dot { background: var(--lime-600); }
.notif p { margin: 4px 0; font-size: .92rem; white-space: pre-wrap; }
.notif .muted { font-size: .8rem; }
.notif.unread { border-color: rgba(122, 213, 1, .6); box-shadow: inset 3px 0 0 var(--lime); }
a.notif { text-decoration: none; color: var(--text); }
a.notif:hover { border-color: var(--navy); }
.notif-list { display: grid; gap: 10px; }
.bell-btn { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--text-on-dark); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); padding: 10px 12px; border-radius: 10px; font: inherit; font-weight: 500; font-size: .95rem; cursor: pointer; text-decoration: none; margin-bottom: 12px; }
.bell-btn svg { width: 19px; height: 19px; }
.bell-btn .count { margin-left: auto; background: var(--lime); color: var(--ink); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.doc-top h2 { font-size: 1.35rem; line-height: 1.25; }
.doc-top h2 a { text-decoration: none; color: var(--navy); }
.doc-top h2 a:hover { text-decoration: underline; }
.list-plain li > span:first-child { min-width: 0; }
.list-plain li > .badge, .list-plain li > strong { flex: none; }
body.app [hidden] { display: none !important; }
.section-h { font-size: 1.25rem; margin: 28px 0 14px; }

/* ===== IT operations ===== */
.tab-groups { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tab-groups a { padding: 7px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .88rem; color: var(--navy); background: rgba(255, 255, 255, .55); border: 1px solid rgba(22, 33, 138, .18); }
.tab-groups a:hover { background: #fff; }
.tab-groups a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input { width: auto; min-width: 160px; }
.mono { font-family: Consolas, Menlo, monospace; font-size: .9em; }
.otp { font-size: 1.6rem; font-weight: 700; letter-spacing: .08em; color: var(--navy); }
.secret { word-break: break-all; }
.progress { height: 8px; border-radius: 999px; background: rgba(22, 33, 138, .1); overflow: hidden; margin-bottom: 4px; }
.progress span { display: block; height: 100%; background: #4A8500; border-radius: 999px; }
.report-sec + .report-sec { margin-top: 28px; }
.report-sec > h2 { display: flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--lime-600, #4C8F00); margin-bottom: 12px; }
.report-sec > h2 svg { width: 16px; height: 16px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.report-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.report-card:hover { transform: translateY(-2px); box-shadow: var(--glass-hi), var(--glow-lime); }
.report-card:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.report-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--navy); color: var(--lime); box-shadow: 0 10px 24px -12px rgba(16, 24, 79, .7); }
.report-ico svg { width: 22px; height: 22px; }
.report-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.report-main strong { font-family: var(--font-head); color: var(--navy); font-size: 1rem; }
.report-main span { font-size: .85rem; color: var(--text-muted); }
.report-go { flex: none; color: var(--navy); opacity: .45; font-size: 1.1rem; transition: transform .15s, opacity .15s; }
.report-card:hover .report-go { opacity: 1; transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .report-card, .report-go { transition: none; } .report-card:hover { transform: none; } }
/* Report page: headline figures, chart, P&L statement */
.rep-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.rep-kpis .stat-card { position: relative; overflow: hidden; }
.rep-kpis .stat-card:hover { transform: none; box-shadow: var(--glass-hi), var(--shadow); }
.rep-kpis .stat-card .n { font-size: 1.6rem; margin: 4px 0 2px; }
.rep-kpis .stat-card .n.neg { color: #B42318; }
.rep-kpis .stat-card.accent .n.neg { color: #FF8A80; }
.rep-kpis .stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--navy); }
.rep-kpis .stat-card.good::before, .rep-kpis .stat-card.accent::before { background: var(--lime); }
.rep-kpis .stat-card.bad::before { background: #D92D20; } .rep-kpis .stat-card.warn::before { background: #E3A008; }
.rep-kpis .stat-card.accent.bad::before { background: #FF8A80; }
.rep-delta { display: inline-block; margin-top: 8px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.rep-delta.up { color: #2F5F00; background: #E9F8D6; } .rep-delta.down { color: #B42318; background: #FDECEA; }
.stat-card.accent .rep-delta.up { color: var(--lime); background: rgba(122, 213, 1, .14); } .stat-card.accent .rep-delta.down { color: #FF8A80; background: rgba(255, 138, 128, .14); }
.rep-chart { margin-bottom: 20px; }
.rep-chart .chart-box { max-width: 1000px; margin: 0 auto; }
.rep-chart .chart-tip { transform: translate(-50%, calc(-100% - 6px)); white-space: nowrap; pointer-events: none; z-index: 2; }
.rep-chart .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.rep-chart .wk.on .hit { fill: rgba(22, 33, 138, .05); }
.table-wrap.flat { border: 0; box-shadow: none; background: none; }
table.data td.neg { color: #B42318; }
table.stmt .sec td { padding-top: 18px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); border-bottom: 1px solid rgba(22, 33, 138, .35); }
table.stmt td.ind { padding-left: 26px; }
table.stmt .sub td { font-weight: 700; background: rgba(22, 33, 138, .04); }
table.stmt .net td { font-weight: 700; font-size: 1rem; color: var(--lime); background: #16218A; border: 0; }
table.stmt .net td:first-child { color: #fff; border-radius: 10px 0 0 10px; box-shadow: inset 4px 0 0 var(--lime); }
table.stmt .net td:last-child { border-radius: 0 10px 10px 0; }
table.stmt .net td.neg { color: #FF8A80; }
table.stmt .mgn td { color: var(--text-muted); font-size: .86rem; border-bottom: 0; }
table.stmt tbody tr:hover td { background: inherit; }
.rep-sub { font-size: 1.05rem; margin: 24px 0 10px; }
.rep-note { margin-top: 14px; font-size: .86rem; }
.steps-list { padding-left: 20px; margin: 0 0 12px; display: grid; gap: 6px; }
.gsearch { margin: 0 4px; padding-top: 16px; }
.sidebar .gsearch + .me { margin-top: 14px; }
.gsearch .search-bubble { display: none; }
.gsearch input { width: 100%; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #fff; padding: 9px 12px; border-radius: 10px; font-size: .9rem; box-shadow: none; }
body.app .gsearch input { border-color: rgba(255, 255, 255, .16); box-shadow: none; }
.gsearch input::placeholder { color: #8FA0C2; }
body.app .gsearch input:focus { background: rgba(255, 255, 255, .14); border-color: var(--lime); box-shadow: 0 0 0 3px rgba(122, 213, 1, .25); }
.search-res li { justify-content: flex-start; gap: 14px; }
@media print { .sidebar, .mobile-bar, .topline .actions, .toolbar { display: none !important; } .app-shell { display: block; } }
.callout svg { width: 18px; height: 18px; vertical-align: -4px; color: var(--navy); margin-right: 4px; }

/* ---- Admin sidebar: section bubbles with drop-down links, pinnable ---- */
.sidebar nav.bubbles { flex-direction: column; align-items: flex-start; gap: 10px; padding: 2px 8px; }
.sidebar nav.bubbles .bubble {
  position: relative; display: grid; place-items: center; flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; cursor: pointer;
  color: var(--ice, #C9DCEA); background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04) 70%);
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .6); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sidebar nav.bubbles .bubble svg { width: 20px; height: 20px; opacity: .9; }
.sidebar nav.bubbles .bubble:hover, .sidebar nav.bubbles .bubble:focus-visible { border-color: rgba(122, 213, 1, .7); box-shadow: 0 0 0 3px rgba(122, 213, 1, .18); transform: translateY(-1px); outline: none; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06) 70%); }
.sidebar nav.bubbles a.bubble.active, .sidebar nav.bubbles .nav-sec.has-active > .bubble { color: var(--lime); border-color: var(--lime); box-shadow: 0 0 0 3px rgba(122, 213, 1, .22), 0 0 18px -4px rgba(122, 213, 1, .6); }
.sidebar nav.bubbles a.bubble.active svg { color: var(--lime); }
.sidebar nav.bubbles .dot { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: .68rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bar); }
.nav-sec { position: relative; display: flex; }
.nav-sec .sec-title, .nav-sec .pin { display: none; }
.nav-sec.open { align-self: stretch; margin: 0 -7px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 0 10px; padding: 6px; border-radius: 22px 16px 16px 16px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .08); }
.nav-sec.open > .bubble { color: #fff; border-color: rgba(122, 213, 1, .55); }
.nav-sec.open .sec-title { display: block; font: 600 .82rem "Space Grotesk", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.nav-sec.open .pin { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: #6F82A3; cursor: pointer; }
.nav-sec .pin svg { width: 16px; height: 16px; transform: rotate(45deg); transition: transform .15s; }
.nav-sec .pin:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-sec.pinned .pin { color: var(--lime); }
.nav-sec.pinned .pin svg { transform: none; fill: currentColor; }
.nav-sec .sec-links { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sidebar nav.bubbles .sec-links a { padding: 8px 10px; font-size: .9rem; }
/* Favorites: a star on every sub-section link; starred links gather in the always-open section at the top */
.nl { position: relative; display: block; }
.nl > a { padding-right: 38px !important; }
.nl .fav { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: #8FA3C4; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, background .15s; }
.nl .fav svg { width: 15px; height: 15px; }
.nl:hover .fav, .nl .fav:focus-visible, .nl > a:focus-visible + .fav { opacity: 1; }
.nl .fav:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nl .fav:focus-visible { outline: 2px solid var(--lime); outline-offset: 0; }
.nl.is-fav .fav { opacity: 1; color: #F5C542; }
.nl.is-fav .fav svg { fill: currentColor; }
@media (hover: none) { .nl .fav { opacity: .55; } .nl.is-fav .fav { opacity: 1; } }
.nav-sec.favs.open { background: linear-gradient(160deg, rgba(245, 197, 66, .12), rgba(255, 255, 255, .04) 60%); border-color: rgba(245, 197, 66, .3); }
.nav-sec.favs > .bubble { color: #F5C542; }
.nav-sec.favs > .bubble svg { fill: currentColor; }
.nav-sec.favs.open > .bubble { border-color: rgba(245, 197, 66, .55); cursor: default; }
.favs .sec-links .nl { cursor: grab; touch-action: pan-y; }
.favs .sec-links .nl.dragging { opacity: .85; border-radius: 10px; background: rgba(245, 197, 66, .14); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .6); }
.fly-links .nl > a { padding-right: 38px; }
@media (prefers-reduced-motion: reduce) { .nl .fav { transition: none; } }
.nav-tip { position: fixed; z-index: 100; transform: translate(-4px, -50%); opacity: 0; pointer-events: none; white-space: nowrap; padding: 6px 12px; border-radius: 8px; background: #0C1340; color: #fff; font: 600 .85rem Inter, system-ui, sans-serif; border: 1px solid rgba(122, 213, 1, .45); box-shadow: 0 10px 24px -10px rgba(2, 3, 15, .7); transition: opacity .12s, transform .12s; }
.nav-tip::before { content: ""; position: absolute; left: -5px; top: 50%; width: 8px; height: 8px; background: #0C1340; border-left: 1px solid rgba(122, 213, 1, .45); border-bottom: 1px solid rgba(122, 213, 1, .45); transform: translateY(-50%) rotate(45deg); }
.nav-tip.show { opacity: 1; transform: translate(0, -50%); }
@media (prefers-reduced-motion: reduce) { .sidebar nav.bubbles .bubble, .nav-tip, .nav-sec .pin svg { transition: none; } }

/* ---- Billing settings: invoice logo picker ---- */
.logo-pick { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin: 6px 0 10px; }
.logo-preview { width: 170px; height: 128px; flex: none; display: grid; place-items: center; padding: 16px; border-radius: 16px; background: radial-gradient(140px 90px at 85% 0, rgba(122, 213, 1, .2), transparent 70%), linear-gradient(135deg, #10184F, #16218A); box-shadow: inset 0 -4px 0 var(--lime); }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview.on-light img { background: #fff; border-radius: 10px; padding: 8px; }

/* ---- Admin sidebar, minimised (nothing pinned): a rail of bubbles with pop-out panels ---- */
.app-shell { transition: grid-template-columns .2s ease; }
body.nav-mini .app-shell { grid-template-columns: 78px 1fr; }
body.nav-mini .sidebar { padding: 18px 0; align-items: center; }
body.nav-mini .sidebar .brand img { height: 46px; width: auto; margin: 0 0 16px; }
/* Collapsed sidebar shows the compact logo (Admin → Website content), filling the rail instead of a shrunken full logo. */
.sidebar .brand .logo-compact, body.nav-mini .sidebar .brand .logo-full { display: none; }
body.nav-mini .sidebar .brand .logo-compact { display: block; width: 58px; height: 58px; object-fit: contain; }
body.nav-mini .sidebar .org-name, body.nav-mini .sidebar .gsearch input, body.nav-mini .sidebar .me-full { display: none; }
body.nav-mini .sidebar .gsearch { margin: 0; align-self: center; }
body.nav-mini .sidebar .gsearch .search-bubble {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%; cursor: pointer; color: var(--ice);
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04) 70%); border: 1px solid rgba(255, 255, 255, .14);
}
body.nav-mini .sidebar .gsearch .search-bubble svg { width: 20px; height: 20px; }
body.nav-mini .sidebar .gsearch .search-bubble:hover, body.nav-mini .sidebar .gsearch .search-bubble:focus-visible, body.nav-mini .sidebar .gsearch .search-bubble[aria-expanded="true"] { border-color: var(--lime); color: #fff; box-shadow: 0 0 0 3px rgba(122, 213, 1, .18); outline: none; }
body.nav-mini .sidebar nav.bubbles { align-items: center; padding: 2px 0; }
body.nav-mini .sidebar .me { padding: 14px 0 0; align-self: stretch; display: flex; justify-content: center; }
.sidebar .me .me-bubble { display: none; }
body.nav-mini .sidebar .me .me-bubble {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; padding: 0; cursor: pointer; text-decoration: none;
  font: 700 .82rem "Space Grotesk", sans-serif; letter-spacing: .04em; color: var(--ink); background: var(--lime); border: 2px solid rgba(255, 255, 255, .25);
}
body.nav-mini .sidebar .me .me-bubble:hover, body.nav-mini .sidebar .me .me-bubble:focus-visible { box-shadow: 0 0 0 3px rgba(122, 213, 1, .3); outline: none; }
.sidebar nav.bubbles .bubble[aria-expanded="true"] { color: #fff; border-color: var(--lime); background: rgba(122, 213, 1, .16); }

.nav-fly {
  position: fixed; z-index: 90; min-width: 230px; max-width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 8px;
  color: var(--text-on-dark); background: linear-gradient(180deg, #1A2FA8, #16218A 45%, #10184F 80%, #0A0F36); border: 1px solid rgba(122, 213, 1, .35); border-radius: 16px;
  box-shadow: 0 24px 50px -18px rgba(2, 3, 15, .75); animation: fly-in .14s ease-out;
}
@keyframes fly-in { from { opacity: 0; transform: translateX(-6px); } }
.fly-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 8px 10px; }
.fly-head span { font: 600 .8rem "Space Grotesk", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.fly-head .pin { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: #6F82A3; cursor: pointer; }
.fly-head .pin svg { width: 16px; height: 16px; transform: rotate(45deg); }
.fly-head .pin:hover { color: var(--lime); background: rgba(255, 255, 255, .08); }
.fly-links { display: flex; flex-direction: column; gap: 2px; }
.fly-links a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text-on-dark); text-decoration: none; font-weight: 500; font-size: .92rem; }
.fly-links a svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.fly-links a:hover { background: rgba(255, 255, 255, .07); }
.fly-links a.active { background: linear-gradient(90deg, rgba(122, 213, 1, .16), rgba(255, 255, 255, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--lime); }
.fly-links a.active svg { color: var(--lime); opacity: 1; }
.fly-links .count { margin-left: auto; background: var(--lime); color: var(--ink); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.fly-search input { width: 280px; max-width: 100%; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #fff; padding: 10px 12px; border-radius: 10px; font: inherit; font-size: .92rem; }
.fly-search input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(122, 213, 1, .25); }
.fly-search input::placeholder { color: #8FA0C2; }
.fly-me { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; font-size: .88rem; }
.fly-me strong { color: #fff; }
.fly-me a, .fly-me button { color: var(--lime); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; }
.fly-me a:hover, .fly-me button:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .app-shell { transition: none; } .nav-fly { animation: none; } }

/* ---- Sidebar rearranging ---- */
#nav.bubbles > a.bubble, #nav.bubbles > .nav-sec > .bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.nav-dragging, body.nav-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
#nav.bubbles > .dragging { position: relative; z-index: 2; }
#nav.bubbles > a.bubble.dragging, #nav.bubbles > .nav-sec.dragging > .bubble { transform: scale(1.12); border-color: var(--lime); box-shadow: 0 0 0 4px rgba(122, 213, 1, .25), 0 14px 28px -10px rgba(0, 0, 0, .7); }
#nav.bubbles > .nav-sec.open.dragging { outline: 2px dashed rgba(122, 213, 1, .55); outline-offset: 2px; }
.nav-tip small { display: block; font-weight: 500; font-size: .72rem; color: #8FA0C2; margin-top: 1px; }

/* ---- Sidebar aurora: colours and keyframes live in styles.css (shared with the public site) ---- */
@media (prefers-reduced-motion: reduce) { .sidebar { animation: none; } }

/* ---- Greeting under the admin logo ---- */
.sidebar .org-name.greeting { text-transform: none; letter-spacing: .01em; font: 600 1.02rem "Space Grotesk", sans-serif; color: #fff; text-shadow: 0 1px 10px rgba(2, 3, 15, .35); }

/* ---- Staff profile label under the admin logo ---- */
.sidebar .role-tag { align-self: flex-start; margin: -4px 10px 12px; padding: 3px 10px; border-radius: 999px; font: 700 .7rem "Space Grotesk", sans-serif; letter-spacing: .14em; color: var(--lime, #7AD501); border: 1px solid rgba(122, 213, 1, .45); background: rgba(122, 213, 1, .08); }
.sidebar .company-name { margin: -4px 10px 12px; font: 700 .78rem "Space Grotesk", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--lime, #7AD501); overflow-wrap: anywhere; }
body.nav-mini .sidebar .role-tag, body.nav-mini .sidebar .company-name { display: none; }

/* ----- Service offers (portal "New services", dashboard spotlight, admin preview) ----- */
.offer-card { display: flex; gap: 18px; align-items: flex-start; padding: 22px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(122, 213, 1, .12), rgba(255, 255, 255, .75) 55%); border: 1px solid rgba(122, 213, 1, .45); box-shadow: var(--glass-hi), var(--shadow); }
.offer-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--navy); color: var(--lime); box-shadow: 0 10px 24px -12px rgba(16, 24, 79, .7); }
.offer-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.offer-main { min-width: 0; flex: 1; }
.offer-kicker { font: 700 .72rem "Space Grotesk", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #4E8A00; }
.offer-main h3 { margin: 2px 0 6px; font-size: 1.25rem; }
.offer-tag { margin: 0 0 10px; color: var(--text-muted); }
.offer-points { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 4px; }
.offer-points li { padding-left: 22px; position: relative; }
.offer-points li::before { content: "✓"; position: absolute; left: 2px; color: #4E8A00; font-weight: 700; }
.offer-price { font: 600 1rem "Space Grotesk", sans-serif; color: var(--navy); margin-bottom: 12px; }
.offer-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.offer-skip { background: none; border: 0; padding: 6px 4px; color: var(--text-muted); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.offer-skip:hover { color: var(--text); }
.offer-done { color: #3D7000; font-weight: 600; }
.offer-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.offer-grid.dim .offer-card { opacity: .75; background: var(--glass); border-color: var(--glass-border); }
.offer-spot { margin-bottom: 24px; }
.offer-edit { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
.offer-edit #of-prev .offer-card { pointer-events: none; }
@media (max-width: 860px) { .offer-edit { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .offer-card { flex-direction: column; padding: 18px; } .offer-grid { grid-template-columns: 1fr; } }

/* ----- Team performance ----- */
.perf-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.perf-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.perf-table th, .perf-table td { white-space: nowrap; }
.tabs-sub { margin-top: -8px; }
.hrs-chart { --viz-1: #4C8F00; --viz-2: #3B5BDB; }
.chart-legend { display: flex; gap: 16px; font-size: .85rem; color: var(--text-muted); margin-bottom: 6px; }
.chart-legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-box { position: relative; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-box .grid { stroke: rgba(22, 33, 138, .1); stroke-width: 1; }
.chart-box .tick { font-size: 11px; fill: var(--text-muted); }
.chart-box .hit { fill: transparent; }
.chart-box .wk.on .hit { fill: rgba(22, 33, 138, .05); }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow); font-size: .82rem; display: grid; gap: 2px; pointer-events: none; white-space: nowrap; }
.chart-tip[hidden] { display: none; }
.chart-tip span { display: block; }
.chart-table { margin-top: 10px; }
.chart-table summary { cursor: pointer; color: var(--text-muted); font-size: .85rem; }

/* ----- Pinned sidebar bottom (search + account) -----
   It sticks to the bottom edge while the menus scroll; the negative margins stretch it over the sidebar's padding.
   While menu items are behind it (.has-under, set in sidenav.js) a soft aurora glow fades in, darkest at the bottom. */
.side-foot { position: sticky; bottom: -22px; z-index: 2; margin: auto -14px -22px; padding: 0 14px 22px; isolation: isolate; }
.side-foot::before, .side-foot::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.side-foot::before {
  background: linear-gradient(to top, rgba(48, 83, 1, .62) 0%, rgba(83, 145, 1, .42) 45%, rgba(148, 254, 6, .14) 82%, rgba(148, 254, 6, 0) 100%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to top, #000 70%, transparent); mask-image: linear-gradient(to top, #000 70%, transparent);
}
.side-foot::after {   /* slow-drifting light bands for the aurora shimmer */
  background: radial-gradient(60% 40% at 25% 70%, rgba(148, 254, 6, .22), transparent 70%), radial-gradient(55% 35% at 80% 85%, rgba(83, 145, 1, .3), transparent 70%);
  background-size: 200% 100%; animation: foot-aurora 14s ease-in-out infinite alternate;
  -webkit-mask-image: linear-gradient(to top, #000 60%, transparent); mask-image: linear-gradient(to top, #000 60%, transparent);
}
.side-foot.has-under::before, .side-foot.has-under::after { opacity: 1; }
.side-foot.has-under .me { border-top-color: rgba(148, 254, 6, .35); }
@keyframes foot-aurora { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { .side-foot::after { animation: none; } }
body.nav-mini .sidebar .side-foot { margin: auto 0 -18px; padding: 0 0 18px; bottom: -18px; align-self: stretch; display: flex; flex-direction: column; align-items: center; }

/* ----- Documents & contracts ----- */
.doc-disclaimer { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: rgba(122, 213, 1, .08); border: 1px solid rgba(122, 213, 1, .3); font-size: .9rem; color: var(--text-muted); }
.doc-disclaimer svg { width: 18px; height: 18px; flex: none; color: var(--lime-600, #4C8F00); margin-top: 2px; }
.doc-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.doc-edit.locked { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
.doc-body-input { min-height: 520px; font: .88rem/1.55 "JetBrains Mono", ui-monospace, Consolas, monospace; resize: vertical; }
.blank-bar { display: flex; gap: 10px; align-items: center; min-height: 30px; margin: 4px 0 6px; }
.doc-prev { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2, rgba(255,255,255,.04)); }
.doc-prev-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; font-size: .82rem; color: var(--text-muted); background: var(--surface, #fff); border-bottom: 1px solid var(--border); }
.paper { margin: 14px; padding: 34px 38px; background: #fff; color: #0B1033; border-radius: 6px; box-shadow: 0 10px 30px -18px rgba(16, 24, 79, .5); font: .9rem/1.6 Inter, system-ui, sans-serif; }
.paper .d-h1 { font: 700 1.5rem/1.2 "Space Grotesk", sans-serif; color: #10184F; margin: 0 0 14px; }
.paper .d-h2 { font: 700 1.02rem "Space Grotesk", sans-serif; color: #16218A; margin: 20px 0 6px; }
.paper .d-h3 { font: 600 .95rem "Space Grotesk", sans-serif; margin: 14px 0 4px; }
.paper p { margin: 0 0 10px; } .paper ul { margin: 0 0 10px; padding-left: 22px; } .paper hr { border: 0; border-top: 1px solid #DCE5EE; margin: 16px 0; }
.paper mark.fill { background: #FFF1B8; color: #7A4B00; border-radius: 4px; padding: 0 3px; box-shadow: inset 0 -1px 0 #E0B000; }
.paper-sigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; margin-top: 30px; padding-top: 18px; border-top: 2px solid #16218A; }
.paper-sig h4 { margin: 0 0 6px; font: 600 .7rem "JetBrains Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: #5B6685; }
.paper-sig-line { height: 54px; border-bottom: 1px solid #0B1033; display: flex; align-items: flex-end; }
.paper-sig-line img { max-height: 52px; max-width: 100%; }
.paper-sig > span { display: block; font-size: .82rem; margin-top: 4px; }
.paper-sig .muted { color: #5B6685; }
.sig-typed { font: 600 1.9rem/1 Caveat, "Segoe Script", cursive; color: #10184F; }
.sig-pad { display: block; width: 100%; height: 160px; border-radius: 12px; border: 1px dashed var(--border); background: #fff; cursor: crosshair; }
.link { background: none; border: 0; padding: 0; color: var(--accent, #3B5BDB); cursor: pointer; font: inherit; font-size: .85rem; margin-left: 8px; text-decoration: underline; }
.seg-links { display: flex; gap: 6px; margin: -6px 0 14px; } .seg-links a { padding: 5px 12px; border-radius: 999px; font-size: .85rem; color: var(--text-muted); text-decoration: none; border: 1px solid var(--border); }
.seg-links a.active { color: var(--text); border-color: var(--lime); background: rgba(122, 213, 1, .1); }
.tpl-list li.click { cursor: pointer; } .tpl-list li.click:hover strong { text-decoration: underline; }
.fld-h { margin: 12px 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.fld-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { font: inherit; font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.chip-btn:hover { border-color: var(--lime); background: rgba(122, 213, 1, .1); }
.doc-events li { font-size: .88rem; }
.hr-box { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 12px; }
.hr-box summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.hr-box summary::-webkit-details-marker { display: none; }
.hr-box summary h3 { margin: 0; } .hr-box summary h3::before { content: "▸ "; color: var(--text-muted); } .hr-box[open] summary h3::before { content: "▾ "; }
.hr-box .form-grid { margin-top: 12px; }
.hr-docs { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 12px; } .hr-docs h3 { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 1100px) { .doc-edit, .doc-edit.locked { grid-template-columns: 1fr; } .doc-prev { position: static; max-height: none; } }
@media (max-width: 640px) { .paper { margin: 8px; padding: 20px 18px; } }

/* ----- Staff & access ----- */
.perm-grid { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.perm-row:last-child { border-bottom: 0; }
.perm-row:nth-child(even) { background: rgba(201, 220, 234, .18); }
.perm-row strong { display: block; font-size: .92rem; }
.perm-row .muted { font-size: .8rem; }
.lvl { display: inline-flex; flex-wrap: wrap; background: #EEF3F8; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-shrink: 0; }
.lvl label { margin: 0; cursor: pointer; position: relative; }
.lvl input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.lvl span { display: block; padding: 5px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.lvl input:checked + span { background: #16218A; color: #fff; }
.lvl input[value="none"]:checked + span { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 79, .15); }
.lvl input[value="view"]:checked + span { background: #C9DCEA; color: #10184F; }
.lvl input:focus-visible + span { outline: 2px solid #7AD501; outline-offset: 1px; }
.cust-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.cust-pick .check { margin: 4px 0; }
@media (max-width: 640px) { .perm-row { flex-direction: column; align-items: flex-start; } }
/* View-only access: edit controls are hidden (the server refuses changes anyway). */
body.view-only #view .topline .actions, body.view-only #view .form-actions, body.view-only #view .btn-lime,
body.view-only #view .btn-danger, body.view-only #view [id^="add-"] { display: none !important; }
body.view-only #view .topline h1::after { content: "View only"; margin-left: 12px; vertical-align: middle; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: #C9DCEA; color: #10184F; }

/* ----- Ticket pictures ----- */
.pic-pick { margin: 4px 0 14px; }
.pic-drop { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px dashed rgba(22, 33, 138, .28); border-radius: 14px; background: rgba(255, 255, 255, .55); cursor: pointer; transition: border-color .15s, background .15s; }
.pic-drop:hover, .pic-pick.over .pic-drop { border-color: #7AD501; background: rgba(122, 213, 1, .08); }
.pic-drop svg { width: 26px; height: 26px; color: var(--navy); flex-shrink: 0; }
.pic-drop strong { display: block; color: var(--navy); font-size: .95rem; }
.pic-drop small { color: var(--text-muted); font-size: .82rem; }
.pic-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.pic-thumbs:not(:empty) { margin-top: 10px; }
.pic-thumbs figure { position: relative; margin: 0; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.pic-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic-thumbs button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(10, 15, 54, .75); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.msg-files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.msg-files a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.msg-files img { display: block; width: 150px; height: 110px; object-fit: cover; transition: transform .2s; }
.msg-files a:hover img { transform: scale(1.04); }
.msg-files a.file { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--navy); font-size: .88rem; text-decoration: none; max-width: 260px; }
.msg-files a.file svg { width: 18px; height: 18px; flex-shrink: 0; }
.msg-files a.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Page change in the admin site / portal: the new page eases up into focus. */
#view > .topline, #view > .page { animation: app-page-in 620ms cubic-bezier(.22, 1, .36, 1) both; }
#view > .page { animation-delay: 70ms; }
@keyframes app-page-in { from { opacity: 0; transform: translateY(12px); filter: blur(5px); } }
@media (prefers-reduced-motion: reduce) { #view > .topline, #view > .page { animation: none; } }

/* ---------- Sidebar scrollbars: a slim translucent ice track with a lime thumb, like the rest of the navy chrome ---------- */
.sidebar, .nav-fly { scrollbar-width: thin; scrollbar-color: rgba(122, 213, 1, .45) rgba(201, 220, 234, .06); }
.sidebar::-webkit-scrollbar, .nav-fly::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track, .nav-fly::-webkit-scrollbar-track { background: rgba(201, 220, 234, .05); border-radius: 999px; margin: 10px 0; }
.sidebar::-webkit-scrollbar-thumb, .nav-fly::-webkit-scrollbar-thumb { background: rgba(122, 213, 1, .4); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.sidebar::-webkit-scrollbar-thumb:hover, .nav-fly::-webkit-scrollbar-thumb:hover { background: rgba(122, 213, 1, .75); background-clip: padding-box; }

/* ---------- My security (two-factor) ---------- */
.tf-steps { margin: 0; padding-left: 20px; display: grid; gap: 18px; }
.tf-steps li { padding-left: 4px; }
.tf-qr { width: 200px; margin: 12px 0; padding: 10px; background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px rgba(22, 33, 138, .12), 0 10px 24px -14px rgba(16, 24, 79, .4); }
.tf-qr svg { display: block; width: 100%; height: auto; }
.tf-key { display: inline-block; margin-top: 4px; padding: 4px 10px; border-radius: 8px; background: rgba(22, 33, 138, .06); font: 600 .95rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .06em; word-break: break-all; }
.recovery-codes { margin: 0 0 6px; padding: 14px 18px; border-radius: 12px; background: #fff; border: 1px dashed rgba(99, 174, 0, .5); font: 600 1rem/1.9 ui-monospace, Consolas, monospace; letter-spacing: .08em; columns: 2; }

/* Contract terms (admin customer tab + portal Service plan) */
.terms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.terms-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 14px 0 6px; }
.terms-group .kv { margin: 0; }
.terms-pending { border-left: 4px solid #F5A623; margin-bottom: 20px; }
.terms-diff { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 6px; }
.terms-diff li { display: flex; justify-content: space-between; gap: 14px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); }
.terms-diff li span { text-align: right; }
.terms-form-h { font-size: .95rem; margin: 18px 0 8px; }
.terms-form-h:first-child { margin-top: 0; }
@media (max-width: 760px) { .terms-grid { grid-template-columns: 1fr; } .terms-diff li { flex-direction: column; gap: 2px; } .terms-diff li span { text-align: left; } }

/* Icon picker (service catalog → website tile icon) */
.icon-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick label { cursor: pointer; position: relative; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--navy); transition: border-color .15s, box-shadow .15s; }
.icon-pick svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-pick input:checked + span { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(122, 213, 1, .3); background: #F4FBE9; }
.icon-pick input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ---------- Phone app (≤ 760px; see js/mobile.js): app bar, bottom tabs, "More" sheet, cards, bottom sheets ---------- */
.tabbar, .fab, .ptr, .offline-bar, .sheet-head, .app-back, .app-title { display: none; }
@media (max-width: 760px) {
  body.app { padding-bottom: calc(72px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain; }
  /* App bar */
  .mobile-bar { position: sticky; top: 0; z-index: 30; gap: 8px; justify-content: flex-start; min-height: 56px; padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
    background: rgba(16, 24, 79, .94); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: 0 1px 0 rgba(122, 213, 1, .25), 0 10px 24px -16px rgba(0, 0, 0, .7); }
  .mobile-bar .menu-btn { display: none; }
  .mobile-bar img.app-logo { height: 38px; }
  .mobile-bar.has-back img.app-logo { display: none; }
  .mobile-bar .app-back:not([hidden]) { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -6px; border-radius: 50%; color: #fff; background: none; border: 0; }
  .mobile-bar .app-back:active { background: rgba(255, 255, 255, .12); }
  .mobile-bar .app-back svg { width: 26px; height: 26px; }
  .mobile-bar .app-title { display: block; flex: 1; min-width: 0; color: #fff; font: 600 1.05rem "Space Grotesk", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The page title moves into the app bar; the page header keeps its breadcrumb and actions. */
  .topline { padding: 12px 16px 4px; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topline h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }   /* shown in the app bar */
  .topline:not(:has(.crumb)):has(.actions:empty) { display: none; }
  .topline .actions:empty { display: none; }
  .cols, .cols-3, .cols-21 { grid-template-columns: minmax(0, 1fr); }
  .topline .actions .fab-source { display: none; }
  .page { padding: 12px 14px 32px; }
  #view > .topline, #view > .page { animation: none; }
  #view.slide-in { animation: app-slide-in .32s cubic-bezier(.2, .8, .2, 1); }
  #view.slide-back { animation: app-slide-back .32s cubic-bezier(.2, .8, .2, 1); }

  /* Bottom tabs */
  body.sheet-open .tabbar { z-index: 55; }
  .tabbar { display: grid; grid-template-columns: repeat(var(--tabs, 5), 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(16, 24, 79, .96); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
    border-top: 1px solid rgba(201, 220, 234, .14); box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .7); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 4px; border: 0; border-radius: 14px; background: none;
    color: #9FB0CC; font: 600 .7rem Inter, sans-serif; text-decoration: none; cursor: pointer; transition: color .15s, background .15s, transform .1s; }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar [aria-current="page"] { color: #fff; background: rgba(122, 213, 1, .13); }
  .tabbar [aria-current="page"] svg { color: var(--lime); }
  .tabbar :is(a, button):active { transform: scale(.93); }
  .tabbar b { position: absolute; top: 1px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--lime); color: var(--ink);
    font: 700 .66rem/18px Inter, sans-serif; text-align: center; box-shadow: 0 0 0 2px rgba(16, 24, 79, .96); }

  /* "More": the sidebar slides up as a full-height sheet with every section open */
  .sidebar { inset: auto 0 0 0; width: auto; height: calc(100dvh - 8px - env(safe-area-inset-top)); max-height: none; z-index: 50; border-radius: 22px 22px 0 0; border: 0;
    padding: 0 16px calc(84px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .34s cubic-bezier(.2, .8, .2, 1); }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(2, 3, 15, .55); }
  body.sheet-open { overflow: hidden; }
  .sidebar .sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 3; margin: 0 -16px 8px; padding: 18px 18px 10px;
    background: linear-gradient(180deg, rgba(16, 24, 79, .98), rgba(16, 24, 79, .9)); font: 600 1.1rem "Space Grotesk", sans-serif; color: #fff; }
  .sidebar .sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: rgba(255, 255, 255, .3); }
  .sidebar .sheet-head button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
  .sidebar .brand { display: none; }
  .sidebar nav.bubbles { padding: 0; gap: 8px; align-items: stretch; }
  .sidebar nav.bubbles > a.bubble { display: none; }
  .sidebar nav.bubbles .nav-sec { display: grid; grid-template-columns: 1fr; margin: 0; padding: 10px 6px 4px; border-radius: 16px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .08); }
  .sidebar nav.bubbles .nav-sec > .bubble, .sidebar nav.bubbles .nav-sec .pin { display: none; }
  .sidebar nav.bubbles .nav-sec .sec-title { display: block; padding: 0 10px 4px; font: 600 .74rem "Space Grotesk", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #8FA3C4; }
  .sidebar nav.bubbles .nav-sec .sec-links, .sidebar nav.bubbles .nav-sec .sec-links[hidden] { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0; }
  .sidebar nav.bubbles .sec-links a { padding: 11px 10px; font-size: .9rem; }
  .sidebar nav.bubbles .nav-sec.favs { background: linear-gradient(160deg, rgba(245, 197, 66, .12), rgba(255, 255, 255, .04) 60%); border-color: rgba(245, 197, 66, .3); }
  .side-foot { position: relative; bottom: auto; margin: 16px 0 0; padding: 0; }
  .side-foot::before, .side-foot::after { display: none; }

  /* Tables become cards: first column is the card title, the rest are label · value rows */
  .table-wrap:has(> table.cards) { overflow: visible; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  table.data.cards, table.data.cards tbody, table.data.cards tr, table.data.cards td { display: block; }
  table.data.cards thead { display: none; }
  table.data.cards tr { margin-bottom: 10px; padding: 10px 0 6px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), 0 8px 20px -16px rgba(16, 24, 79, .5); }
  table.data.cards tr.click:active { transform: scale(.985); }
  table.data.cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 4px 14px; border: 0; text-align: right; }
  table.data.cards td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  table.data.cards td:first-child { display: block; padding-bottom: 6px; text-align: left; font-weight: 600; font-size: 1rem; }
  table.data.cards td:first-child::before, table.data.cards td[data-label=""]::before { display: none; }
  table.data.cards td:empty { display: none; }
  table.data.cards td.actions { justify-content: flex-end; padding-top: 6px; }
  table.data.cards-kicker td:first-child { padding-bottom: 0; font-size: .78rem; font-weight: 700; color: var(--text-muted); }
  table.data.cards-kicker td:nth-child(2) { display: block; padding-bottom: 6px; text-align: left; font-weight: 600; font-size: 1rem; }
  table.data.cards-kicker td:nth-child(2)::before { display: none; }
  table.data.cards tfoot { display: block; }

  /* Floating + button (the page's "New …" action) */
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 44; width: 58px; height: 58px; border-radius: 18px; border: 0;
    background: linear-gradient(180deg, #8FE81A, var(--lime)); color: var(--ink); box-shadow: 0 12px 26px -8px rgba(99, 174, 0, .65), 0 2px 6px rgba(16, 24, 79, .25); cursor: pointer; transition: transform .12s; }
  .fab svg { width: 28px; height: 28px; stroke-width: 2.4; }
  .fab:active { transform: scale(.92); }
  body.sheet-open .fab { display: none; }

  /* Modals become bottom sheets */
  .modal-back { place-items: end center; padding: 0; animation: app-fade-in .2s; }
  .modal, .modal.wide { max-width: none; max-height: 92dvh; border-radius: 22px 22px 0 0; padding: 26px 18px calc(22px + env(safe-area-inset-bottom)); animation: app-sheet-up .3s cubic-bezier(.2, .8, .2, 1); transition: transform .2s; }
  .modal > h2 { position: relative; touch-action: none; }
  .modal > h2::before { content: ""; position: absolute; top: -16px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: rgba(16, 24, 79, .2); }
  .toast { left: 14px; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: none; }

  /* Pull to refresh + offline */
  .ptr { display: grid; place-items: center; position: fixed; top: calc(62px + env(safe-area-inset-top)); left: 50%; z-index: 29; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%;
    background: #fff; color: var(--navy); box-shadow: 0 6px 18px -6px rgba(16, 24, 79, .5); opacity: 0; pointer-events: none;
    transform: translateY(calc(var(--pull, 0) * 1px - 50px)) rotate(calc(var(--pull, 0) * 4deg)); }
  .ptr svg { width: 22px; height: 22px; }
  .ptr.show { opacity: 1; }
  .ptr.ready { color: #4F8A00; }
  .ptr.spin { transform: translateY(14px); transition: transform .2s; }
  .ptr.spin svg { animation: app-spin .7s linear infinite; }
  .offline-bar { display: block; position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 46; padding: 10px 14px; border-radius: 12px;
    background: #B42318; color: #fff; font-size: .88rem; font-weight: 600; text-align: center; transform: translateY(160%); opacity: 0; transition: .25s; pointer-events: none; }
  .offline-bar.show { transform: none; opacity: 1; }

  /* Install tip on the dashboard */
  .install-tip { position: relative; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 14px 40px 14px 14px; border-radius: 16px; color: #fff;
    background: linear-gradient(135deg, #16218A, #0A0F36); box-shadow: 0 12px 28px -14px rgba(16, 24, 79, .8); }
  .install-tip img { border-radius: 12px; flex: none; }
  .install-tip strong { display: block; font-family: "Space Grotesk", sans-serif; }
  .install-tip p { margin: 2px 0 8px; font-size: .88rem; color: #C9DCEA; }
  .install-tip p svg { width: 16px; height: 16px; vertical-align: -3px; color: #7FB2FF; }
  .install-tip .tip-x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.2rem; cursor: pointer; }
}
@keyframes app-slide-in { from { opacity: .4; transform: translateX(28px); } }
@keyframes app-slide-back { from { opacity: .4; transform: translateX(-28px); } }
@keyframes app-sheet-up { from { transform: translateY(100%); } }
@keyframes app-fade-in { from { opacity: 0; } }
@keyframes app-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .sidebar, .modal, .modal-back, #view.slide-in, #view.slide-back { animation: none; transition: none; } }
