/* Marian Help Desk - UI theme v1.5 (Bootstrap 5.3 layer, no build step) */
@font-face { font-family: "Jakarta"; font-weight: 300; font-display: swap; src: url("../vendor/font/plus-jakarta-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 400; font-display: swap; src: url("../vendor/font/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 500; font-display: swap; src: url("../vendor/font/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 600; font-display: swap; src: url("../vendor/font/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 700; font-display: swap; src: url("../vendor/font/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Jakarta"; font-weight: 800; font-display: swap; src: url("../vendor/font/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 300; font-display: swap; src: url("../vendor/font/outfit-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 400; font-display: swap; src: url("../vendor/font/outfit-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("../vendor/font/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("../vendor/font/outfit-latin-600-normal.woff2") format("woff2"); }

:root {
  --hd-primary: #5b47e0;
  --hd-primary-dark: #4535c4;
  --hd-violet: #7c3aed;
  --hd-blue: #3b6ff5;
  --hd-accent: #ff8a3d;
  --hd-amber: #ffb020;
  --hd-rose: #f2547d;
  --hd-ink: #16143a;
  --hd-topbar: rgba(255, 255, 255, .78);
  --hd-bg: #f5f6fb;
  --hd-surface: #ffffff;
  --hd-surface-2: #f9f9fe;
  --hd-line: #e8e9f4;
  --hd-muted: #6b7090;
  --hd-radius: 16px;
  --hd-shadow: 0 1px 2px rgba(22, 20, 58, .04), 0 10px 30px -18px rgba(22, 20, 58, .18);
  --hd-shadow-lg: 0 24px 60px -28px rgba(45, 30, 140, .45);
  --hd-hero: linear-gradient(118deg, #4b2bd6 0%, #6a3cf0 38%, #4f55e8 64%, #2f86d6 100%);
  --hd-display: "Outfit", "Jakarta", system-ui, sans-serif;
  --bs-primary: #5b47e0;
  --bs-primary-rgb: 91, 71, 224;
  --bs-link-color: #5b47e0;
  --bs-link-color-rgb: 91, 71, 224;
  --bs-link-hover-color: #4535c4;
  --bs-body-font-family: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: .875rem;
  --bs-body-color: #1d1b3f;
  --bs-border-color: #e8e9f4;
  --hd-scale: 1;
}
[data-bs-theme="dark"] {
  --hd-bg: #0c0b1f;
  --hd-surface: #15142e;
  --hd-surface-2: #1b1a3a;
  --hd-line: #2a2852;
  --hd-muted: #a0a2c6;
  --hd-topbar: rgba(16, 15, 38, .82);
  --hd-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  --bs-body-color: #e8e7fb;
  --bs-body-bg: #0c0b1f;
  --bs-border-color: #2a2852;
  --bs-link-color: #a99cff;
  --bs-link-color-rgb: 169, 156, 255;
  --bs-link-hover-color: #c7beff;
}
html { font-size: calc(16px * var(--hd-scale)); }
html.a11y-links a:not(.btn):not(.side-nav a):not(.stat):not(.hglass):not(.quick a) { text-decoration: underline; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation: none !important; transition: none !important; }

body { background: var(--hd-bg); font-family: var(--bs-body-font-family); -webkit-font-smoothing: antialiased; letter-spacing: -.003em; }
h1, h2, h3, h4, h5, h6 { font-weight: 650; letter-spacing: -.015em; }
a { text-decoration: none; }
.text-muted, .form-text { color: var(--hd-muted) !important; }
.tnum { font-variant-numeric: tabular-nums; }
::selection { background: rgba(91, 71, 224, .2); }
:focus-visible { outline: 2px solid var(--hd-blue); outline-offset: 2px; }

.btn { border-radius: 11px; font-weight: 600; font-size: .85rem; padding: .48rem 1rem; transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-sm { font-size: .78rem; padding: .3rem .7rem; border-radius: 9px; }
.btn-lg { font-size: .95rem; padding: .7rem 1.2rem; border-radius: 13px; }
.btn-primary { --bs-btn-bg: var(--hd-primary); --bs-btn-border-color: var(--hd-primary); --bs-btn-hover-bg: var(--hd-primary-dark); --bs-btn-hover-border-color: var(--hd-primary-dark); --bs-btn-active-bg: var(--hd-primary-dark); --bs-btn-active-border-color: var(--hd-primary-dark); --bs-btn-disabled-bg: var(--hd-primary); --bs-btn-disabled-border-color: var(--hd-primary); background-image: linear-gradient(135deg, #6a55f0, #5140d8); border: 0; box-shadow: 0 8px 18px -10px rgba(91, 71, 224, .9); }
.btn-primary:hover { background-image: linear-gradient(135deg, #5d48e6, #4535c4); box-shadow: 0 10px 22px -10px rgba(91, 71, 224, 1); }
.btn-outline-primary { --bs-btn-color: var(--hd-primary); --bs-btn-border-color: rgba(91, 71, 224, .45); --bs-btn-hover-bg: var(--hd-primary); --bs-btn-hover-border-color: var(--hd-primary); --bs-btn-active-bg: var(--hd-primary); --bs-btn-active-border-color: var(--hd-primary); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #b9afff; --bs-btn-border-color: #5f52d6; }
.btn-soft { background: rgba(91, 71, 224, .09); color: var(--hd-primary); border: 0; }
.btn-soft:hover { background: rgba(91, 71, 224, .16); color: var(--hd-primary-dark); }
[data-bs-theme="dark"] .btn-soft { background: rgba(169, 156, 255, .13); color: #c7beff; }
.btn-grad { color: #fff; border: 0; background: linear-gradient(120deg, #7a5cff, #5b47e0 55%, #3b6ff5); box-shadow: 0 10px 22px -12px rgba(91, 71, 224, .95); }
.btn-grad:hover, .btn-grad:focus { color: #fff; filter: brightness(1.06); }
.form-control, .form-select { border-radius: 11px; border-color: var(--hd-line); background-color: var(--hd-surface); font-size: .875rem; padding: .5rem .8rem; transition: border-color .15s ease, box-shadow .15s ease; }
.form-control-lg { font-size: .95rem; padding: .7rem .95rem; border-radius: 13px; }
.form-control:focus, .form-select:focus { border-color: var(--hd-primary); box-shadow: 0 0 0 .22rem rgba(91, 71, 224, .14); }
.form-label { font-weight: 600; font-size: .78rem; margin-bottom: .3rem; color: var(--bs-body-color); }
.form-check-input:checked { background-color: var(--hd-primary); border-color: var(--hd-primary); }
.form-switch .form-check-input { width: 2.3em; height: 1.25em; }
.page-link { color: var(--hd-primary); border-radius: 9px !important; margin: 0 2px; border-color: var(--hd-line); }
.active > .page-link { background: var(--hd-primary); border-color: var(--hd-primary); }
.alert { border-radius: 14px; border: 0; font-size: .86rem; }
.alert-success { background: rgba(5, 150, 105, .1); color: #047857; }
.alert-danger { background: rgba(220, 38, 38, .09); color: #b91c1c; }
.alert-warning { background: rgba(245, 159, 11, .13); color: #92400e; }
.alert-info { background: rgba(59, 111, 245, .1); color: #2848b8; }
[data-bs-theme="dark"] .alert-success { color: #6ee7b7; } [data-bs-theme="dark"] .alert-danger { color: #fca5a5; }
[data-bs-theme="dark"] .alert-warning { color: #fcd34d; } [data-bs-theme="dark"] .alert-info { color: #a5b8ff; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--hd-ink); color: #c9c6ec; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 1040;
  background-image: radial-gradient(380px 300px at -20% -10%, rgba(122, 92, 255, .5), transparent 70%), radial-gradient(300px 260px at 120% 105%, rgba(59, 111, 245, .28), transparent 70%); }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.2rem 1.25rem 1rem; color: #fff; font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.brand:hover { color: #fff; }
.brand small { display: block; font-weight: 500; font-size: .68rem; color: #9b98c8; letter-spacing: .01em; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; color: #fff; background: linear-gradient(135deg, #8b6cff, #5b47e0 55%, #3b6ff5); box-shadow: 0 8px 18px -8px rgba(122, 92, 255, .9); flex: 0 0 auto; }
.nav-section { padding: 1rem 1.4rem .35rem; font-size: .66rem; letter-spacing: .06em; color: #7a77a8; font-weight: 600; }
.side-nav { padding: 0 .7rem; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .54rem .75rem; border-radius: 11px; color: #c9c6ec; font-weight: 500; font-size: .84rem; margin-bottom: 2px; transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.side-nav a i { font-size: 1rem; width: 1.2rem; text-align: center; opacity: .85; }
.side-nav a:hover { background: rgba(59, 111, 245, .5); color: #fff; }
.side-nav a.active, .side-nav a.active:hover { background: linear-gradient(120deg, #3b6ff5, #5b47e0); color: #fff; box-shadow: 0 10px 20px -12px rgba(59, 111, 245, 1); }
.side-nav a.active i, .side-nav a:hover i { opacity: 1; }
.side-nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ff8a3d; color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; }
.side-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .07); font-size: .76rem; display: flex; align-items: center; gap: .65rem; }
.side-foot .ws-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .1); flex: 0 0 auto; }
.side-foot .ws { color: #fff; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.plan-pill { display: inline-block; margin-top: .15rem; padding: .08rem .5rem; border-radius: 999px; background: rgba(255, 176, 32, .16); color: #ffcd6e; font-weight: 600; font-size: .66rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .6rem; padding: .7rem 1.5rem; background: var(--hd-topbar); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--hd-line); }
.topbar .spacer { flex: 1; }
.cmdk { display: flex; align-items: center; gap: .6rem; flex: 0 1 460px; min-width: 0; height: 44px; padding: 0 .9rem; border-radius: 14px; border: 1px solid var(--hd-line); background: var(--hd-surface); color: var(--hd-muted); font-size: .86rem; text-align: left; box-shadow: 0 1px 2px rgba(22, 20, 58, .04); transition: border-color .15s ease, box-shadow .15s ease; }
.cmdk:hover { border-color: rgba(91, 71, 224, .45); box-shadow: 0 0 0 4px rgba(91, 71, 224, .08); }
.cmdk span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk kbd { font-family: inherit; font-size: .7rem; padding: .12rem .4rem; border-radius: 6px; background: var(--hd-bg); color: var(--hd-muted); border: 1px solid var(--hd-line); box-shadow: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--hd-line); background: var(--hd-surface); color: var(--bs-body-color); display: grid; place-items: center; position: relative; flex: 0 0 auto; transition: border-color .15s ease, color .15s ease, transform .15s ease; }
.icon-btn:hover { border-color: var(--hd-primary); color: var(--hd-primary); }
.icon-btn[data-side-toggle] { border: 0; background: transparent; }
.top-action { display: inline-flex; align-items: center; gap: .45rem; height: 42px; padding: 0 1rem; border-radius: 13px; font-weight: 600; font-size: .84rem; color: #fff; background: linear-gradient(120deg, #7a5cff, #5b47e0 60%, #3b6ff5); box-shadow: 0 10px 22px -12px rgba(91, 71, 224, .95); white-space: nowrap; }
.top-action:hover { color: #fff; filter: brightness(1.07); }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .25rem .6rem .25rem .3rem; border-radius: 14px; border: 1px solid transparent; background: transparent; color: inherit; text-align: left; line-height: 1.15; }
.user-chip:hover, .user-chip.show { background: var(--hd-surface); border-color: var(--hd-line); }
.user-chip small { display: block; color: var(--hd-muted); font-size: .7rem; }
.user-chip b { font-size: .84rem; font-weight: 600; }
.user-chip.dropdown-toggle::after { display: none; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--hd-rose); color: #fff; font-size: .64rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--hd-surface); }
.avatar { width: 36px; height: 36px; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 700; font-size: .76rem; color: #fff; background: linear-gradient(135deg, #8b6cff, #5b47e0); flex: 0 0 auto; }
.avatar.sm { width: 28px; height: 28px; font-size: .64rem; border-radius: 9px; }
.avatar.staff { background: linear-gradient(135deg, #ffb26b, #f0661f); }
.content { padding: 1.4rem 1.5rem 1.6rem; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head .crumb { font-size: .74rem; color: var(--hd-muted); margin-bottom: .1rem; }
.page-head h1 { font-family: var(--hd-display); font-size: 1.55rem; font-weight: 500; letter-spacing: -.02em; margin: 0; }
.page-head p { color: var(--hd-muted); margin: .15rem 0 0; font-size: .84rem; }
.app-footer { padding: 1rem 1.5rem; color: var(--hd-muted); font-size: .76rem; border-top: 1px solid var(--hd-line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.dropdown-menu { border-radius: 14px; border-color: var(--hd-line); box-shadow: var(--hd-shadow-lg); font-size: .86rem; padding: .35rem; }
.dropdown-item { border-radius: 9px; padding: .45rem .7rem; }
.dropdown-item:active { background: var(--hd-primary); }
.notif-menu { width: 350px; max-width: 92vw; padding: 0; overflow: hidden; }
.notif-item { display: flex; gap: .7rem; padding: .7rem .9rem; border-bottom: 1px solid var(--hd-line); color: inherit; }
.notif-item:hover { background: rgba(91, 71, 224, .06); }
.notif-item.unread { background: rgba(91, 71, 224, .07); }
.notif-item .ico { width: 34px; height: 34px; border-radius: 11px; background: rgba(91, 71, 224, .12); color: var(--hd-primary); display: grid; place-items: center; flex: 0 0 auto; }
.notif-item b { display: block; font-size: .82rem; font-weight: 600; }
.notif-item span { font-size: .76rem; color: var(--hd-muted); display: block; }
.a11y-menu { width: 270px; padding: .75rem; }
.a11y-menu h6 { font-size: .74rem; color: var(--hd-muted); font-weight: 600; margin: .2rem 0 .45rem; }
.a11y-menu .seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin-bottom: .7rem; }
.a11y-menu .seg button { border: 1px solid var(--hd-line); background: var(--hd-surface); border-radius: 9px; padding: .3rem 0; color: inherit; font-weight: 600; }
.a11y-menu .seg button[aria-pressed="true"] { background: var(--hd-primary); color: #fff; border-color: var(--hd-primary); }

/* Command palette (Ctrl / ⌘ + K) */
.cmdk-modal .modal-dialog { max-width: 620px; margin-top: 10vh; }
.cmdk-modal .modal-content { border: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 40px 80px -30px rgba(22, 20, 58, .55); background: var(--hd-surface); }
.cmdk-input { display: flex; align-items: center; gap: .7rem; padding: .95rem 1.1rem; border-bottom: 1px solid var(--hd-line); }
.cmdk-input i { color: var(--hd-primary); font-size: 1.1rem; }
.cmdk-input input { border: 0; outline: 0; flex: 1; background: transparent; font-size: 1rem; color: inherit; }
.cmdk-list { max-height: 54vh; overflow-y: auto; padding: .4rem; }
.cmdk-list .grp { font-size: .7rem; color: var(--hd-muted); font-weight: 600; padding: .55rem .7rem .25rem; }
.cmdk-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 11px; color: inherit; cursor: pointer; }
.cmdk-item i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(91, 71, 224, .1); color: var(--hd-primary); flex: 0 0 auto; }
.cmdk-item small { margin-left: auto; color: var(--hd-muted); font-size: .72rem; }
.cmdk-item.on, .cmdk-item:hover { background: rgba(91, 71, 224, .1); color: inherit; }
.cmdk-foot { display: flex; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--hd-line); color: var(--hd-muted); font-size: .72rem; }

/* Mobile bottom navigation (phones and the installed app) */
.bottom-nav { display: none; }
.install-pill { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(140%); z-index: 1060; display: flex; align-items: center; gap: .7rem; padding: .5rem .55rem .5rem .6rem; border-radius: 999px; background: #17153b; color: #fff; box-shadow: 0 20px 40px -18px rgba(22, 20, 58, .8); border: 2px solid #ffc04d; transition: transform .45s cubic-bezier(.2, .9, .25, 1.2); max-width: calc(100vw - 24px); }
.install-pill.show { transform: translateX(-50%) translateY(0); }
.install-pill .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #8b6cff, #5b47e0); flex: 0 0 auto; }
.install-pill b { display: block; font-size: .86rem; font-weight: 600; line-height: 1.15; }
.install-pill small { font-size: .7rem; color: #c9c6ec; font-style: italic; }
.install-pill .go { border: 0; border-radius: 999px; padding: .45rem .9rem; background: #ffc04d; color: #17153b; font-weight: 700; font-size: .78rem; }
.install-pill .x { border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; }
.ios-hint { font-size: .8rem; }

/* ---------- Cards, tables ---------- */
.card { border: 1px solid var(--hd-line); border-radius: 18px; background: var(--hd-surface); box-shadow: var(--hd-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--hd-line); padding: .85rem 1.15rem; font-weight: 650; font-size: .9rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-body { padding: 1.15rem; }
.kpi { padding: 1.05rem 1.15rem; display: flex; align-items: center; gap: .9rem; height: 100%; color: inherit; }
a.kpi:hover { border-color: var(--hd-primary); color: inherit; }
.kpi .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.25rem; flex: 0 0 auto; }
.kpi .num { font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .lbl { color: var(--hd-muted); font-size: .8rem; font-weight: 600; }
.tone-open { background: rgba(37, 99, 235, .12); color: #2563eb; }
.tone-in_progress { background: rgba(217, 119, 6, .14); color: #b45309; }
.tone-resolved { background: rgba(5, 150, 105, .13); color: #047857; }
.tone-closed { background: rgba(100, 116, 139, .16); color: #475569; }
.tone-primary { background: rgba(91, 71, 224, .12); color: var(--hd-primary); }
.tone-danger { background: rgba(220, 38, 38, .12); color: #dc2626; }
[data-bs-theme="dark"] .tone-open { color: #7fb0ff; } [data-bs-theme="dark"] .tone-in_progress { color: #fbbf24; }
[data-bs-theme="dark"] .tone-resolved { color: #34d399; } [data-bs-theme="dark"] .tone-closed { color: #a8b3c7; }
[data-bs-theme="dark"] .tone-primary { color: #aab4ff; }

.table { --bs-table-bg: transparent; margin: 0; }
.table > thead th { font-size: .72rem; color: var(--hd-muted); font-weight: 600; background: var(--hd-surface-2); border-bottom: 1px solid var(--hd-line); padding: .7rem 1rem; white-space: nowrap; }
.table > tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--hd-line); }
.table-hover > tbody > tr:hover > * { background: rgba(91, 71, 224, .04); }
.ticket-link { font-weight: 600; color: inherit; }
.ticket-link:hover { color: var(--hd-primary); }
.ticket-no { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; color: var(--hd-muted); }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.s-open { background: rgba(37, 99, 235, .12); color: #2563eb; }
.pill.s-in_progress { background: rgba(217, 119, 6, .14); color: #b45309; }
.pill.s-on_hold { background: rgba(124, 58, 237, .13); color: #6d28d9; }
.pill.s-resolved { background: rgba(5, 150, 105, .13); color: #047857; }
.pill.s-closed { background: rgba(100, 116, 139, .16); color: #475569; }
.pill.p-low { background: rgba(100, 116, 139, .14); color: #475569; }
.pill.p-normal { background: rgba(8, 145, 178, .13); color: #0e7490; }
.pill.p-high { background: rgba(234, 88, 12, .14); color: #c2410c; }
.pill.p-urgent { background: rgba(220, 38, 38, .13); color: #dc2626; }
[data-bs-theme="dark"] .pill.s-open { color: #7fb0ff; } [data-bs-theme="dark"] .pill.s-in_progress { color: #fbbf24; }
[data-bs-theme="dark"] .pill.s-on_hold { color: #c4b5fd; }
[data-bs-theme="dark"] .pill.s-resolved { color: #34d399; } [data-bs-theme="dark"] .pill.s-closed, [data-bs-theme="dark"] .pill.p-low { color: #a8b3c7; }
[data-bs-theme="dark"] .pill.p-normal { color: #67d6ee; } [data-bs-theme="dark"] .pill.p-high { color: #fb9a5c; } [data-bs-theme="dark"] .pill.p-urgent { color: #f87171; }
.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .4rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--hd-muted); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .6; }

/* ---------- Ticket chat ---------- */
.chat { max-height: 520px; min-height: 180px; overflow-y: auto; padding: 1.15rem; display: flex; flex-direction: column; gap: .9rem; }
.msg { display: flex; gap: .6rem; max-width: 86%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble { background: var(--hd-bg); border: 1px solid var(--hd-line); border-radius: 14px 14px 14px 4px; padding: .6rem .8rem; min-width: 120px; }
.msg.mine .bubble { background: var(--hd-primary); border-color: var(--hd-primary); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg .meta { font-size: .7rem; font-weight: 700; margin-bottom: .2rem; display: flex; gap: .5rem; justify-content: space-between; opacity: .8; }
.msg .meta time { font-weight: 500; }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--hd-line); background: var(--hd-bg); display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.thumb .rm { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(14, 19, 48, .75); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.thumb.lg { width: 110px; height: 110px; }
.reply-box { border-top: 1px solid var(--hd-line); padding: .9rem 1.15rem; }
.reply-box textarea { resize: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; display: inline-block; box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.9rem; font-size: .82rem; }
.timeline li::before { content: ""; position: absolute; left: .62rem; top: 1.3rem; bottom: 0; width: 1px; background: var(--hd-line); }
.timeline li:last-child::before { display: none; }
.timeline li i { position: absolute; left: 0; top: 0; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: rgba(91, 71, 224, .12); color: var(--hd-primary); display: grid; place-items: center; font-size: .7rem; }
.timeline li small { display: block; color: var(--hd-muted); }
.dl-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--hd-line); font-size: .86rem; }
.dl-row:last-child { border: 0; }
.dl-row span:first-child { color: var(--hd-muted); }
.dropzone { border: 1.5px dashed var(--hd-line); border-radius: 12px; padding: 1.2rem; text-align: center; color: var(--hd-muted); cursor: pointer; }
.dropzone:hover { border-color: var(--hd-primary); color: var(--hd-primary); }

/* ---------- AI widget ---------- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 1050; width: 56px; height: 56px; border-radius: 50%; border: 0; color: #fff; font-size: 1.4rem; background: linear-gradient(135deg, #8b6cff, #5b47e0 55%, #3b6ff5); box-shadow: 0 14px 30px -10px rgba(91, 71, 224, .9); }
.ai-panel { position: fixed; right: 22px; bottom: 90px; z-index: 1050; width: 370px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 120px); display: none; flex-direction: column; overflow: hidden; }
.ai-panel.open { display: flex; }
.ai-head { padding: .85rem 1rem; color: #fff; background: var(--hd-hero); display: flex; align-items: center; gap: .6rem; }
.ai-head b { display: block; line-height: 1.1; }
.ai-head small { opacity: .8; font-size: .72rem; }
.ai-body { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .6rem; background: var(--hd-bg); }
.ai-msg { max-width: 88%; padding: .55rem .75rem; border-radius: 13px; white-space: pre-wrap; word-break: break-word; font-size: .86rem; }
.ai-msg.bot { background: var(--hd-surface); border: 1px solid var(--hd-line); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg.me { background: var(--hd-primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-src { display: block; margin-top: .35rem; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--hd-muted); }
.ai-chips { display: flex; gap: .4rem; flex-wrap: wrap; padding: .5rem .9rem 0; background: var(--hd-bg); }
.ai-chips button { border: 1px solid var(--hd-line); background: var(--hd-surface); color: inherit; border-radius: 999px; font-size: .74rem; padding: .22rem .65rem; }
.ai-chips button:hover { border-color: var(--hd-primary); color: var(--hd-primary); }
.ai-form { display: flex; gap: .5rem; padding: .7rem .9rem .9rem; background: var(--hd-bg); }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--hd-muted); animation: blink 1.2s infinite both; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.toast-container { z-index: 1090; }

/* ---------- Guest / landing ---------- */
.guest { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.guest-art { background: var(--hd-ink); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; background-image: radial-gradient(600px 380px at 0% 0%, rgba(91, 71, 224, .75), transparent 70%), radial-gradient(520px 320px at 110% 105%, rgba(255, 138, 61, .35), transparent 70%); }
.guest-art h2 { font-size: 2.1rem; font-weight: 800; line-height: 1.15; }
.guest-art li { margin-bottom: .7rem; color: #c5cbe6; }
.guest-art li i { color: #ffb37d; margin-right: .5rem; }
.guest-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.guest-form .inner { width: 100%; max-width: 410px; }
.landing-nav { padding: 1rem 0; }
.hero { background: var(--hd-ink); color: #fff; padding: 1rem 0 5rem; background-image: radial-gradient(700px 420px at 10% 0%, rgba(91, 71, 224, .8), transparent 70%), radial-gradient(520px 320px at 100% 100%, rgba(255, 138, 61, .3), transparent 70%); }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; line-height: 1.08; letter-spacing: -.025em; }
.hero p.lead { color: #c5cbe6; max-width: 560px; }
.hero-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; padding: 1.1rem; backdrop-filter: blur(6px); }
.hero-row { display: flex; align-items: center; gap: .7rem; background: rgba(255, 255, 255, .07); border-radius: 12px; padding: .65rem .8rem; margin-bottom: .55rem; font-size: .86rem; }
.feature { padding: 1.3rem; height: 100%; }
.feature i { font-size: 1.4rem; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: .8rem; }
.price { padding: 1.6rem; height: 100%; }
.price .amount { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; }
.price.featured { border-color: var(--hd-primary); box-shadow: 0 18px 40px -22px rgba(91, 71, 224, .7); }

/* ---------- Responsive ---------- */
.backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(14, 19, 48, .5); z-index: 1035; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .guest { grid-template-columns: 1fr; }
  .guest-art { display: none; }
  .msg { max-width: 96%; }
  .ai-panel { right: 12px; bottom: 84px; }
  .ai-fab { right: 14px; bottom: 14px; }
}

/* ---------- Print (browser "Save as PDF") ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; font-size: 11px; }
  .sidebar, .topbar, .app-footer, .hero-banner .btn, .ai-fab, .ai-panel, .toast-container, .no-print, .backdrop { display: none !important; }
  .print-only { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .table > tbody td, .table > thead th { padding: .3rem .45rem; }
  a { color: inherit; }
}

/* ---------- Dashboard: banner, gradient stats, quick actions ---------- */
.hero-banner { position: relative; overflow: hidden; border-radius: 18px; padding: 1.6rem 1.7rem; color: #fff; background: linear-gradient(100deg, #1b2150 0%, #2a3175 55%, #4e55d6 100%); box-shadow: 0 16px 34px -20px rgba(27, 33, 80, .9); }
.hero-banner::after { content: ""; position: absolute; right: -70px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.hero-banner h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 800; margin: 0 0 .35rem; color: #fff; }
.hero-banner .when { color: #d5d9f3; font-size: .86rem; display: flex; align-items: center; gap: .4rem; margin-bottom: .8rem; }
.btn-amber { background: #ffb020; border: 0; color: #1b2150; font-weight: 700; padding: .55rem 1.1rem; position: relative; z-index: 1; }
.btn-amber:hover, .btn-amber:focus { background: #ffc24d; color: #1b2150; }
.stat { display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.1rem; border-radius: 16px; color: #fff; height: 100%; box-shadow: 0 14px 26px -18px rgba(14, 19, 48, .7); transition: transform .15s ease; }
a.stat:hover { color: #fff; transform: translateY(-2px); }
.stat .ico { width: 46px; height: 46px; border-radius: 12px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 1.2rem; flex: 0 0 auto; }
.stat .lbl { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .95; }
.stat .num { font-size: 1.55rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .72rem; opacity: .85; }
.stat-blue { background: linear-gradient(120deg, #2f6fed, #3d8bf5); }
.stat-green { background: linear-gradient(120deg, #128a4f, #1ea65f); }
.stat-orange { background: linear-gradient(120deg, #e8590c, #f59f0b); }
.stat-purple { background: linear-gradient(120deg, #7b3fe4, #a855f7); }
.quick { display: flex; flex-wrap: wrap; gap: .6rem; }
.quick a, .quick button { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border-radius: 11px; border: 1px solid var(--hd-line); background: var(--hd-surface); color: inherit; font-weight: 700; font-size: .86rem; }
.quick a i, .quick button i { color: var(--hd-primary); }
.quick a:hover, .quick button:hover, .quick a.on { border-color: var(--hd-blue); background: rgba(47, 111, 237, .08); color: var(--hd-blue); }
[data-bs-theme="dark"] .quick a i, [data-bs-theme="dark"] .quick button i { color: #93a0ff; }
.section-title { font-weight: 800; display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.section-title i { color: #f59f0b; }

/* ---------- Platform: workspace cards ---------- */
.ws-card { padding: 1.1rem 1.15rem; height: 100%; display: flex; flex-direction: column; gap: .8rem; }
.ws-card .head { display: flex; align-items: center; gap: .75rem; }
.ws-card .logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #2f6fed, #4e55d6); flex: 0 0 auto; }
.ws-card h6 { margin: 0; font-size: .98rem; }
.ws-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.ws-grid div { background: var(--hd-bg); border-radius: 10px; padding: .5rem .6rem; }
.ws-grid b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ws-grid span { font-size: .68rem; color: var(--hd-muted); font-weight: 600; }
.meter { height: 6px; border-radius: 3px; background: var(--hd-line); overflow: hidden; }
.meter i { display: block; height: 100%; background: #1ea65f; border-radius: 3px; }
.view-toggle .btn { padding: .35rem .7rem; }
.view-toggle .btn.active { background: var(--hd-blue); border-color: var(--hd-blue); color: #fff; }

/* ---------- AI triage ---------- */
.triage { border-left: 4px solid #a855f7; }
.triage h6 { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--hd-muted); margin: 0 0 .35rem; }
.triage ol, .triage ul { padding-left: 1.15rem; margin: 0; }
.triage li { margin-bottom: .25rem; }

/* ---------- Instant chat ---------- */
.im { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 190px); min-height: 440px; overflow: hidden; }
.im-list { border-right: 1px solid var(--hd-line); display: flex; flex-direction: column; min-height: 0; }
.im-items { overflow-y: auto; flex: 1; }
.im-item { display: flex; gap: .7rem; padding: .75rem .9rem; border: 0; border-bottom: 1px solid var(--hd-line); background: transparent; color: inherit; width: 100%; text-align: left; }
.im-item:hover { background: rgba(47, 111, 237, .06); }
.im-item.on { background: rgba(47, 111, 237, .12); }
.im-item .txt { min-width: 0; flex: 1; }
.im-item b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-item span { display: block; font-size: .78rem; color: var(--hd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-item .meta { text-align: right; font-size: .7rem; color: var(--hd-muted); flex: 0 0 auto; }
.im-item .dot { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--hd-blue); color: #fff; font-weight: 700; font-size: .66rem; margin-top: .25rem; }
.im-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.im-head { display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; border-bottom: 1px solid var(--hd-line); }
.im-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; background: var(--hd-bg); }
.im-form { display: flex; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--hd-line); }
.im-back { display: none; }
@media (max-width: 767.98px) {
  .im { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .im.in-thread .im-list, .im:not(.in-thread) .im-thread { display: none; }
  .im-back { display: grid; }
}

/* ---------- Ticket tracking: shortcut menu + ticket cards ---------- */
.track { padding: .4rem; }
.track a { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px; color: inherit; font-weight: 600; font-size: .88rem; }
.track a i { color: var(--hd-muted); width: 1.1rem; text-align: center; }
.track a b { margin-left: auto; font-size: .74rem; font-weight: 700; min-width: 26px; text-align: center; padding: .1rem .4rem; border-radius: 999px; background: var(--hd-bg); color: var(--hd-muted); font-variant-numeric: tabular-nums; }
.track a:hover { background: rgba(47, 111, 237, .08); color: var(--hd-blue); }
.track a.on { background: var(--hd-blue); color: #fff; }
.track a.on i { color: #fff; }
.track a.on b { background: rgba(255, 255, 255, .22); color: #fff; }
.tcard { --tc: #2563eb; position: relative; display: flex; flex-direction: column; height: 100%; border: 1.5px solid var(--tc); border-radius: 14px; background: color-mix(in srgb, var(--tc) 7%, var(--hd-surface)); padding: .8rem .9rem .9rem; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.tcard:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -18px var(--tc); color: inherit; }
.tcard.s-open { --tc: #2563eb; } .tcard.s-in_progress { --tc: #d97706; } .tcard.s-on_hold { --tc: #7c3aed; } .tcard.s-resolved { --tc: #059669; } .tcard.s-closed { --tc: #64748b; }
.tcard .top { display: flex; justify-content: space-between; align-items: center; font-size: .76rem; font-weight: 700; }
.tcard .who { text-align: center; margin: .2rem 0 .6rem; padding-bottom: .6rem; border-bottom: 1px solid color-mix(in srgb, var(--tc) 30%, transparent); }
.tcard .who .avatar { width: 46px; height: 46px; font-size: .9rem; margin-bottom: .3rem; }
.tcard .who b { display: block; font-size: .9rem; color: var(--hd-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-bs-theme="dark"] .tcard .who b { color: #93b4ff; }
.tcard dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .7rem; margin: 0 0 .6rem; font-size: .78rem; }
.tcard dt { font-weight: 500; color: var(--hd-muted); }
.tcard dd { margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .subject { text-align: center; font-size: .8rem; padding: .5rem 0 .7rem; border-top: 1px solid color-mix(in srgb, var(--tc) 30%, transparent); flex: 1; }
.tcard .subject small { display: block; color: var(--hd-muted); font-size: .7rem; }
.tcard .subject span { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .state { text-align: center; background: var(--tc); color: #fff; font-weight: 800; font-size: .84rem; border-radius: 8px; padding: .38rem .5rem; }
.pr-low { color: #64748b; } .pr-normal { color: #0e7490; } .pr-high { color: #c2410c; } .pr-urgent { color: #dc2626; }
[data-bs-theme="dark"] .pr-low { color: #a8b3c7; } [data-bs-theme="dark"] .pr-normal { color: #67d6ee; } [data-bs-theme="dark"] .pr-high { color: #fb9a5c; } [data-bs-theme="dark"] .pr-urgent { color: #f87171; }

/* ---------- Star rating ---------- */
.stars { color: #f59f0b; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--hd-line); }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .15rem; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 1.9rem; line-height: 1; color: var(--hd-line); cursor: pointer; transition: color .1s ease; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f59f0b; }
.star-input input:focus-visible + label { outline: 2px solid var(--hd-blue); outline-offset: 2px; border-radius: 4px; }
.bar-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 30px; align-items: center; gap: .5rem; font-size: .8rem; margin-bottom: .3rem; }

/* ---------- People cards ---------- */
.pcard { padding: 1.05rem 1.1rem; height: 100%; display: flex; flex-direction: column; gap: .75rem; }
.pcard .head { display: flex; align-items: center; gap: .75rem; }
.pcard .head .avatar { width: 46px; height: 46px; font-size: .9rem; }
.pcard .contact { font-size: .8rem; color: var(--hd-muted); }
.pcard .contact div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Knowledge base, insights, copilot ---------- */
.kb-card { padding: 1.1rem 1.15rem; height: 100%; display: flex; flex-direction: column; color: inherit; transition: transform .15s ease, border-color .15s ease; }
.kb-card:hover { border-color: var(--hd-blue); transform: translateY(-2px); color: inherit; }
.kb-card h6 { font-size: .98rem; margin-bottom: .35rem; }
.kb-body { white-space: pre-wrap; word-break: break-word; line-height: 1.65; font-size: .95rem; }
.mood { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.insight-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.agent-box { border-left: 4px solid var(--hd-blue); }
.agent-draft { white-space: pre-wrap; word-break: break-word; background: var(--hd-bg); border: 1px solid var(--hd-line); border-radius: 10px; padding: .8rem .9rem; font-size: .9rem; max-height: 320px; overflow-y: auto; }
.copilot .btn { font-size: .8rem; }
.deflect { border: 1px solid var(--hd-line); border-radius: 12px; padding: .8rem .9rem; background: rgba(47, 111, 237, .05); }
.deflect a { display: block; padding: .45rem .1rem; color: inherit; border-bottom: 1px dashed var(--hd-line); }
.deflect a:last-child { border-bottom: 0; }
.deflect a:hover b { color: var(--hd-blue); }
.deflect a b { display: block; font-size: .88rem; }
.deflect a span { font-size: .78rem; color: var(--hd-muted); }
.msg .bot-tag { font-size: .62rem; font-weight: 800; letter-spacing: .06em; padding: .05rem .35rem; border-radius: 5px; background: rgba(124, 58, 237, .15); color: #6d28d9; }
[data-bs-theme="dark"] .msg .bot-tag { color: #c4b5fd; }
.ai-msg .ai-cta { display: inline-block; margin-top: .5rem; font-weight: 700; font-size: .8rem; }

/* ---------- Plan picker (registration) ---------- */
.plan-pick { display: grid; gap: .5rem; }
.plan-option { display: block; cursor: pointer; margin: 0; }
.plan-option input { position: absolute; opacity: 0; }
.plan-option .box { display: block; border: 1.5px solid var(--hd-line); border-radius: 12px; padding: .7rem .9rem; background: var(--hd-surface); transition: border-color .15s ease, background-color .15s ease; }
.plan-option:hover .box { border-color: var(--hd-blue); }
.plan-option input:checked + .box { border-color: var(--hd-blue); background: rgba(47, 111, 237, .07); box-shadow: 0 0 0 3px rgba(47, 111, 237, .15); }
.plan-option input:focus-visible + .box { outline: 2px solid var(--hd-blue); outline-offset: 2px; }

/* ====================================================================
   v1.5 components
   ==================================================================== */

/* ---------- Dashboard hero ---------- */
.dhero { position: relative; overflow: hidden; border-radius: 26px; padding: 1.6rem; color: #fff; background: var(--hd-hero); box-shadow: 0 30px 60px -34px rgba(75, 43, 214, .85); isolation: isolate; }
.dhero::before, .dhero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(50px); z-index: -1; pointer-events: none; }
.dhero::before { width: 420px; height: 420px; left: -120px; bottom: -220px; background: rgba(255, 255, 255, .16); animation: drift 18s ease-in-out infinite alternate; }
.dhero::after { width: 380px; height: 380px; right: 8%; top: -220px; background: rgba(120, 220, 255, .22); animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, -30px) scale(1.12); } }
.dhero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.6rem; align-items: stretch; }
.dhero .ws-row { display: flex; align-items: center; gap: .9rem; }
.dhero .ws-badge { width: 52px; height: 52px; border-radius: 16px; background: #fff; color: var(--hd-primary); display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); flex: 0 0 auto; }
.dhero .ws-name { font-size: .72rem; letter-spacing: .08em; font-weight: 600; opacity: .85; text-transform: uppercase; }
.dhero h2 { font-family: var(--hd-display); font-weight: 500; font-size: clamp(1.35rem, 2.6vw, 1.85rem); letter-spacing: -.02em; margin: 0; color: #fff; }
.dhero .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.clock { margin-top: 1.1rem; font-family: var(--hd-display); line-height: 1; }
.clock .hm { font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.clock .sec { font-size: .95rem; font-weight: 500; opacity: .8; margin-left: .25rem; font-variant-numeric: tabular-nums; }
.clock .date { display: block; margin-top: .35rem; font-family: var(--bs-body-font-family); font-size: .84rem; opacity: .85; }
.weather { margin-top: 1.2rem; display: inline-flex; flex-direction: column; gap: .55rem; padding: .85rem 1rem; border-radius: 18px; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); min-width: min(100%, 330px); }
.weather .top { display: flex; align-items: center; gap: .8rem; }
.weather .w-ico { width: 46px; height: 46px; border-radius: 13px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 1.5rem; }
.weather .temp { font-family: var(--hd-display); font-size: 1.7rem; font-weight: 600; line-height: 1; }
.weather .cond { font-size: .78rem; opacity: .9; }
.weather .meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .72rem; opacity: .9; }
.weather .meta i { margin-right: .2rem; }
.weather-note { margin-top: .7rem; display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 12px; background: rgba(22, 20, 58, .38); font-size: .78rem; }
.weather.loading .temp, .weather.loading .cond { opacity: .5; }
.htiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.hglass { display: flex; flex-direction: column; justify-content: space-between; min-height: 88px; padding: .75rem .85rem; border-radius: 16px; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); transition: background-color .2s ease, transform .2s ease; }
.hglass:hover { color: #fff; background: rgba(255, 255, 255, .2); transform: translateY(-2px); }
.hglass i { font-size: .95rem; opacity: .9; }
.hglass b { font-family: var(--hd-display); font-size: 1.65rem; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: .25rem; }
.hglass span { font-size: .74rem; opacity: .9; }
.hglass.is-alert { background: linear-gradient(135deg, rgba(255, 120, 170, .5), rgba(255, 255, 255, .14)); border-color: rgba(255, 190, 215, .55); }
.hinsight { margin-top: .75rem; position: relative; padding: .9rem 1rem 1rem; border-radius: 18px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); min-height: 132px; }
.hinsight .bar { display: flex; align-items: center; gap: .5rem; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.hinsight .bar a { margin-left: auto; color: #fff; text-transform: none; letter-spacing: 0; font-size: .76rem; opacity: .95; }
.hinsight .bar button { border: 0; background: rgba(255, 255, 255, .16); color: #fff; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: .7rem; }
.hinsight .slide { display: none; margin-top: .55rem; animation: rise .45s ease both; }
.hinsight .slide.on { display: block; }
.hinsight h4 { font-size: .98rem; font-weight: 650; margin: 0 0 .2rem; display: flex; align-items: center; gap: .45rem; color: #fff; }
.hinsight h4 .dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: .72rem; background: rgba(255, 255, 255, .22); }
.hinsight p { margin: 0; font-size: .8rem; opacity: .9; }
.hinsight .advice { margin-top: .4rem; font-size: .8rem; }
.hinsight .advice a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.hinsight .dots { position: absolute; right: 1rem; bottom: .7rem; display: flex; gap: 4px; }
.hinsight .dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .35); transition: width .25s ease; }
.hinsight .dots i.on { width: 16px; background: #fff; }
.itone-danger .dot { background: rgba(255, 99, 132, .5); } .itone-warning .dot { background: rgba(255, 192, 77, .55); }
.itone-success .dot { background: rgba(52, 211, 153, .5); } .itone-violet .dot { background: rgba(196, 181, 253, .55); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dhero .hero-cta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.btn-glass { color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); }
.btn-glass:hover, .btn-glass:focus { color: #fff; background: rgba(255, 255, 255, .26); }
.btn-white { color: var(--hd-primary); background: #fff; border: 0; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); }
.btn-white:hover, .btn-white:focus { color: var(--hd-primary-dark); background: #f3f1ff; }

/* Live ticker */
.ticker { display: flex; align-items: center; margin-top: 1rem; border-radius: 16px; background: var(--hd-surface); border: 1px solid var(--hd-line); box-shadow: var(--hd-shadow); overflow: hidden; height: 46px; }
.ticker .live { display: inline-flex; align-items: center; gap: .45rem; height: 100%; padding: 0 1rem; background: linear-gradient(120deg, #f2547d, #ff7a59); color: #fff; font-weight: 700; font-size: .72rem; letter-spacing: .08em; flex: 0 0 auto; }
.ticker .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blinkdot 1.4s infinite; }
@keyframes blinkdot { 50% { opacity: .25; } }
.ticker .track { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker .run { display: inline-flex; gap: 2.2rem; white-space: nowrap; padding-left: 1rem; animation: marquee var(--ticker-speed, 60s) linear infinite; }
.ticker:hover .run { animation-play-state: paused; }
.ticker .run a { color: var(--bs-body-color); font-size: .8rem; display: inline-flex; align-items: center; gap: .45rem; }
.ticker .run a i { color: var(--hd-primary); }
.ticker .run a small { color: var(--hd-muted); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Set-up progress */
.setup { display: flex; align-items: center; gap: 1.1rem; margin-top: 1rem; padding: 1rem 1.2rem; border-radius: 20px; background: linear-gradient(110deg, rgba(91, 71, 224, .08), rgba(59, 111, 245, .08)); border: 1px solid rgba(91, 71, 224, .16); flex-wrap: wrap; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#ff8a3d calc(var(--p) * 1%), rgba(255, 138, 61, .16) 0); flex: 0 0 auto; }
.ring b { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--hd-surface); font-family: var(--hd-display); font-size: 1rem; font-weight: 600; }
.setup .txt { flex: 1; min-width: 220px; }
.setup .txt b { display: block; font-weight: 650; }
.setup .txt span { font-size: .82rem; color: var(--hd-muted); }
.setup .txt a { color: #f0661f; font-weight: 600; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px dashed var(--hd-line); }
.steps li:last-child { border: 0; }
.steps li i { font-size: 1.15rem; color: var(--hd-line); }
.steps li.done i { color: #10b981; }
.steps li.done b { text-decoration: line-through; color: var(--hd-muted); }

/* Insight cards (insights pages) */
.icard { display: flex; gap: .9rem; padding: 1rem 1.1rem; height: 100%; border-left: 4px solid var(--tone, var(--hd-primary)); }
.icard .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.15rem; flex: 0 0 auto; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent); }
.icard h6 { font-weight: 650; margin: 0 0 .2rem; font-size: .95rem; }
.icard p { margin: 0; font-size: .82rem; color: var(--hd-muted); }
.icard .advice { margin-top: .45rem; font-size: .82rem; }
.icard .acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.t-danger { --tone: #e11d48; } .t-warning { --tone: #d97706; } .t-info { --tone: #3b6ff5; } .t-success { --tone: #059669; } .t-violet { --tone: #7c3aed; }
.briefing { position: relative; overflow: hidden; border-radius: 20px; padding: 1.2rem 1.3rem; color: #fff; background: var(--hd-hero); }
.briefing h5 { font-family: var(--hd-display); font-weight: 500; margin: 0 0 .35rem; color: #fff; }
.briefing p { margin: 0; opacity: .95; font-size: .9rem; line-height: 1.6; }

/* Settings hub (platform) */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.hub a { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .5rem; min-height: 170px; padding: 1.15rem 1.15rem 1rem; border-radius: 20px; background: var(--hd-surface); border: 1px solid var(--hd-line); color: inherit; box-shadow: var(--hd-shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.hub a::after { content: ""; position: absolute; right: -46px; top: -46px; width: 130px; height: 130px; border-radius: 50%; background: rgba(91, 71, 224, .06); transition: transform .35s ease; }
.hub a:hover { transform: translateY(-3px); border-color: rgba(91, 71, 224, .35); box-shadow: var(--hd-shadow-lg); color: inherit; }
.hub a:hover::after { transform: scale(1.25); }
.hub .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, #8b6cff, #5b47e0); box-shadow: 0 10px 20px -12px rgba(91, 71, 224, .95); }
.hub .go { position: absolute; right: 1.1rem; top: 1.25rem; color: var(--hd-muted); transition: transform .2s ease; z-index: 1; }
.hub a:hover .go { transform: translateX(3px); color: var(--hd-primary); }
.hub h6 { font-weight: 650; margin: .35rem 0 0; font-size: .98rem; }
.hub p { margin: 0; font-size: .8rem; color: var(--hd-muted); flex: 1; }
.hub .st { font-size: .76rem; font-weight: 600; color: var(--hd-blue); }

/* Module switches */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.mod { display: flex; gap: .8rem; padding: 1rem; border-radius: 16px; border: 1px solid var(--hd-line); background: var(--hd-surface); }
.mod .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(91, 71, 224, .1); color: var(--hd-primary); flex: 0 0 auto; }
.mod b { display: block; font-weight: 600; font-size: .9rem; }
.mod span { font-size: .78rem; color: var(--hd-muted); }
.mod .form-switch { margin-left: auto; padding-left: 2.6em; }

/* Audit log */
.audit-row { display: flex; gap: .85rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--hd-line); }
.audit-row:last-child { border: 0; }
.audit-row .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(91, 71, 224, .1); color: var(--hd-primary); flex: 0 0 auto; }
.audit-row.warn .ic { background: rgba(225, 29, 72, .1); color: #e11d48; }
.audit-row .who { font-size: .76rem; color: var(--hd-muted); }
.audit-row .chg { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.audit-row .chg span { font-size: .72rem; padding: .12rem .45rem; border-radius: 7px; background: var(--hd-bg); border: 1px solid var(--hd-line); }
.audit-row .chg del { color: #e11d48; text-decoration-thickness: 1px; }
.audit-row .chg ins { color: #059669; text-decoration: none; }

/* Apps (System) */
.astat { display: flex; gap: .9rem; padding: 1rem 1.1rem; height: 100%; }
.astat .ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.35rem; flex: 0 0 auto; }
.astat b { font-family: var(--hd-display); font-size: 1.8rem; font-weight: 600; line-height: 1.05; display: block; }
.astat .sub { font-size: .78rem; color: var(--hd-muted); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-top: .55rem; }
.spark i { flex: 1; background: rgba(91, 71, 224, .55); border-radius: 2px 2px 0 0; min-height: 2px; }
.devices { font-size: .74rem; color: var(--hd-muted); margin-top: .35rem; }
.app-box { border: 1px solid var(--hd-line); border-radius: 16px; padding: 1rem; background: var(--hd-surface-2); }
.app-box .tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: .12rem .5rem; border-radius: 7px; background: rgba(5, 150, 105, .12); color: #047857; }
.app-box .tag.off { background: rgba(100, 116, 139, .14); color: #475569; }
.hk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.hk div { border-radius: 13px; padding: .65rem .75rem; background: rgba(91, 71, 224, .06); }
.hk b { display: block; font-family: var(--hd-display); font-weight: 600; font-size: 1.05rem; }
.hk span { font-size: .72rem; color: var(--hd-muted); }
.hk i { color: var(--hd-primary); margin-right: .25rem; }

/* Website assistant preview (owner) */
.bot-preview { border: 1px solid var(--hd-line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; height: 420px; background: var(--hd-bg); }
.bot-preview .head { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; color: #fff; background: var(--hd-hero); }
.bot-preview .body { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .5rem; }
.bot-preview form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--hd-line); background: var(--hd-surface); }

/* ---------- Sign-in and registration ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--hd-bg); }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2.6rem 3rem; color: #fff; background: #120f33; isolation: isolate; }
.auth-art .mesh { position: absolute; inset: -20%; z-index: -1; filter: blur(60px); opacity: .95; }
.auth-art .mesh i { position: absolute; border-radius: 50%; }
.auth-art .mesh i:nth-child(1) { width: 55%; height: 55%; left: 0; top: 5%; background: #6a3cf0; animation: blob1 16s ease-in-out infinite alternate; }
.auth-art .mesh i:nth-child(2) { width: 50%; height: 50%; right: 0; top: 30%; background: #2f86d6; animation: blob2 19s ease-in-out infinite alternate; }
.auth-art .mesh i:nth-child(3) { width: 40%; height: 40%; left: 25%; bottom: 0; background: #ff6b8a; opacity: .55; animation: blob3 23s ease-in-out infinite alternate; }
@keyframes blob1 { to { transform: translate(18%, 12%) scale(1.15); } }
@keyframes blob2 { to { transform: translate(-16%, -10%) scale(1.2); } }
@keyframes blob3 { to { transform: translate(10%, -18%) scale(.9); } }
.auth-art .grain { position: absolute; inset: 0; z-index: -1; opacity: .08; background-image: radial-gradient(rgba(255, 255, 255, .8) 1px, transparent 1px); background-size: 3px 3px; }
.auth-art .brand { padding: 0; }
.auth-art h2 { font-family: var(--hd-display); font-weight: 300; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 1rem; max-width: 14ch; color: #fff; }
.auth-art h2 .rot { display: inline-grid; }
.auth-art h2 .rot span { grid-area: 1 / 1; font-weight: 500; opacity: 0; transform: translateY(.4em); animation: rot 12s infinite; background: linear-gradient(90deg, #ffd27a, #ff9ec0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art h2 .rot span:nth-child(2) { animation-delay: 4s; } .auth-art h2 .rot span:nth-child(3) { animation-delay: 8s; }
@keyframes rot { 0% { opacity: 0; transform: translateY(.4em); } 4%, 30% { opacity: 1; transform: none; } 34%, 100% { opacity: 0; transform: translateY(-.4em); } }
.auth-art p.lead { color: rgba(255, 255, 255, .78); font-size: .95rem; font-weight: 300; max-width: 40ch; }
.floaters { position: relative; height: 230px; margin: 1.2rem 0; }
.floater { position: absolute; display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 16px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: .8rem; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .6); animation: float 7s ease-in-out infinite; }
.floater .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); }
.floater b { display: block; font-weight: 600; }
.floater small { opacity: .8; }
.floater:nth-child(1) { left: 0; top: 0; }
.floater:nth-child(2) { left: 32%; top: 78px; animation-delay: -2.4s; }
.floater:nth-child(3) { left: 6%; top: 160px; animation-delay: -4.6s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.auth-art .foot { font-size: .74rem; color: rgba(255, 255, 255, .6); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.auth-card h1 { font-family: var(--hd-display); font-weight: 400; font-size: 2rem; letter-spacing: -.03em; margin: 0 0 .25rem; }
.auth-card .sub { color: var(--hd-muted); margin-bottom: 1.6rem; }
.fl { position: relative; margin-bottom: 1rem; }
.fl input { width: 100%; height: 56px; padding: 1.35rem .95rem .45rem 2.8rem; border-radius: 14px; border: 1.5px solid var(--hd-line); background: var(--hd-surface); color: inherit; font-size: .95rem; transition: border-color .2s ease, box-shadow .2s ease; }
.fl input:focus { outline: 0; border-color: var(--hd-primary); box-shadow: 0 0 0 4px rgba(91, 71, 224, .12); }
.fl label { position: absolute; left: 2.8rem; top: 50%; transform: translateY(-50%); color: var(--hd-muted); font-size: .9rem; pointer-events: none; transition: all .18s ease; }
.fl input:focus + label, .fl input:not(:placeholder-shown) + label { top: .95rem; font-size: .68rem; font-weight: 600; color: var(--hd-primary); }
.fl > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--hd-muted); font-size: 1.05rem; }
.fl .peek { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--hd-muted); width: 38px; height: 38px; border-radius: 10px; }
.fl .peek:hover { color: var(--hd-primary); background: rgba(91, 71, 224, .08); }
.caps { display: none; font-size: .74rem; color: #d97706; margin: -.5rem 0 .8rem; }
.caps.on { display: block; }
.btn-auth { width: 100%; height: 52px; border: 0; border-radius: 14px; color: #fff; font-weight: 600; font-size: .95rem; background: linear-gradient(120deg, #7a5cff, #5b47e0 50%, #3b6ff5); background-size: 200% 100%; transition: background-position .5s ease, transform .12s ease, box-shadow .2s ease; box-shadow: 0 16px 30px -16px rgba(91, 71, 224, 1); }
.btn-auth:hover { background-position: 100% 0; }
.btn-auth .spin { display: none; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; margin-right: .45rem; }
.btn-auth.busy .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-alt { text-align: center; color: var(--hd-muted); font-size: .85rem; margin-top: 1.4rem; }
.auth-mini-brand { display: none; }
.trust { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.4rem; font-size: .74rem; color: var(--hd-muted); justify-content: center; }
.trust i { color: #10b981; margin-right: .25rem; }

/* ---------- Responsive additions ---------- */
@media (max-width: 1199.98px) {
  .dhero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 991.98px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mini-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.6rem; font-weight: 700; color: inherit; }
  .topbar { padding: .55rem .8rem; }
  .cmdk { height: 40px; }
  .cmdk kbd { display: none; }
}
@media (max-width: 767.98px) {
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1045; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--hd-topbar); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); border-top: 1px solid var(--hd-line); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--hd-muted); font-size: .64rem; font-weight: 600; position: relative; }
  .bottom-nav a i { font-size: 1.2rem; }
  .bottom-nav a.on { color: var(--hd-primary); }
  .bottom-nav a.on::before { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--hd-primary); }
  .bottom-nav a.fab i { width: 46px; height: 46px; margin-top: -22px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8b6cff, #5b47e0 60%, #3b6ff5); box-shadow: 0 12px 24px -10px rgba(91, 71, 224, 1); font-size: 1.35rem; }
  .bottom-nav .count { position: absolute; top: 6px; left: 54%; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--hd-rose); color: #fff; font-size: .58rem; display: grid; place-items: center; }
  body.has-bnav .main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body.has-bnav .ai-fab { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.has-bnav .ai-panel { bottom: calc(140px + env(safe-area-inset-bottom)); }
  body.has-bnav .install-pill { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .htiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dhero { padding: 1.2rem; border-radius: 22px; }
  .hk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head h1 { font-size: 1.3rem; }
  .content { padding: 1rem .85rem 1.2rem; }
  .app-footer { display: none; }
}
/* Installed app (PWA): no browser chrome, so behave like a native app */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(.55rem + env(safe-area-inset-top)); }
  .app-footer { display: none; }
  body { overscroll-behavior-y: none; -webkit-user-select: none; user-select: none; }
  input, textarea, [contenteditable], .kb-body, .msg .text, .ai-msg { -webkit-user-select: text; user-select: text; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ticker .run { animation: none; }
}
.min-w-0 { min-width: 0; }
.auth-card.wide { max-width: 540px; }

/* Organisation (departments, locations, teams) */
.org-row { border-top: 1px solid var(--hd-line); }
.org-row summary { display: flex; align-items: center; gap: .8rem; padding: .75rem 1.15rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.org-row summary::-webkit-details-marker { display: none; }
.org-row summary:hover { background: rgba(91, 71, 224, .04); }
.org-row .org-name { flex: 1 1 220px; min-width: 0; }
.org-row .org-meta { flex: 2 1 260px; color: var(--hd-muted); font-size: .8rem; }
.org-row[open] summary { background: rgba(91, 71, 224, .05); }
.org-edit { padding: .8rem 1.15rem 1rem; background: var(--hd-surface-2); border-top: 1px dashed var(--hd-line); }
.org-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.org-chips span { font-size: .72rem; padding: .12rem .5rem; border-radius: 7px; background: rgba(91, 71, 224, .08); color: var(--hd-primary); }
.org-chips span i { margin-right: .2rem; }

/* ---- v1.7 ticket list -------------------------------------------------- */
.tk { overflow: hidden; }
.tk-tabs { display: flex; gap: .25rem; padding: 0 .9rem; border-bottom: 1px solid var(--hd-line); overflow-x: auto; scrollbar-width: none; }
.tk-tabs::-webkit-scrollbar { display: none; }
.tk-tabs a { position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: .95rem .8rem .85rem; font-size: .88rem; font-weight: 600; color: var(--hd-muted); white-space: nowrap; }
.tk-tabs a:hover { color: var(--hd-ink); }
.tk-tabs a.on { color: var(--hd-primary); }
.tk-tabs a.on::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--hd-primary); }
.tk-tabs b { font-size: .72rem; font-weight: 700; min-width: 22px; text-align: center; padding: .08rem .45rem; border-radius: 999px; background: var(--hd-bg); color: var(--hd-muted); font-variant-numeric: tabular-nums; }
.tk-tabs a.on b { background: rgba(91, 71, 224, .12); color: var(--hd-primary); }
.tk-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.tk-dot.t-all { background: linear-gradient(135deg, #8b6cff, #3b6ff5); }
.tk-dot.t-new { background: #2563eb; } .tk-dot.t-in_progress { background: #d97706; } .tk-dot.t-on_hold { background: #7c3aed; } .tk-dot.t-completed { background: #059669; }
[data-bs-theme="dark"] .tk-tabs a:hover { color: #fff; }

.tk-tools { padding: .9rem 1.1rem .75rem; border-bottom: 1px solid var(--hd-line); }
.tk-bar { display: grid; grid-template-columns: minmax(0, 1fr) 150px 160px auto auto; gap: .5rem; align-items: center; }
.tk-search { position: relative; margin: 0; }
.tk-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--hd-muted); pointer-events: none; }
.tk-search input { width: 100%; height: 40px; padding: 0 .9rem 0 2.3rem; border: 1px solid var(--hd-line); border-radius: 11px; background: var(--hd-bg); color: inherit; font-size: .9rem; transition: border-color .15s, background .15s, box-shadow .15s; }
.tk-search input:focus { outline: 0; border-color: var(--hd-primary); background: var(--hd-surface); box-shadow: 0 0 0 3px rgba(91, 71, 224, .14); }
.tk-bar .form-select, .tk-bar .btn { height: 40px; }
.tk-bar .form-select { font-size: .86rem; }
.tk-more-btn { display: inline-flex; align-items: center; gap: .4rem; }
.tk-more-btn[aria-expanded="true"] { background: rgba(91, 71, 224, .16); }
.tk-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 .3rem; border-radius: 999px; background: var(--hd-primary); color: #fff; font-size: .68rem; font-weight: 700; }
.tk-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem .75rem; margin-top: .75rem; padding: .85rem; border-radius: 12px; background: var(--hd-bg); }
.tk-more[hidden] { display: none; }
.tk-more > div { min-width: 0; }
.tk-more .form-label { font-size: .74rem; margin-bottom: .2rem; color: var(--hd-muted); }
.tk-more .form-select, .tk-more .form-control { font-size: .85rem; }
.tk-quick, .tk-active { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .7rem; }
.tk-quick-l { font-size: .74rem; color: var(--hd-muted); margin-right: .15rem; }
.tk-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .7rem; border: 1px solid var(--hd-line); border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--hd-ink); background: var(--hd-surface); }
.tk-chip b { font-size: .7rem; color: var(--hd-muted); font-variant-numeric: tabular-nums; }
.tk-chip:hover { border-color: var(--hd-primary); color: var(--hd-primary); }
.tk-chip.on { background: var(--hd-primary); border-color: var(--hd-primary); color: #fff; }
.tk-chip.on b { color: rgba(255, 255, 255, .8); }
.tk-chip.warm:not(.on) b { color: #c2410c; }
.tk-chip i { font-size: .65rem; }
[data-bs-theme="dark"] .tk-chip:not(.on) { color: #e6e6f5; }
.tk-filter { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .4rem .22rem .6rem; border-radius: 8px; font-size: .76rem; font-weight: 600; background: rgba(91, 71, 224, .09); color: var(--hd-primary); }
.tk-filter .bi-x-lg { font-size: .62rem; opacity: .7; margin-left: .1rem; }
.tk-filter:hover { background: rgba(91, 71, 224, .17); color: var(--hd-primary); }
.tk-clear { font-size: .76rem; color: var(--hd-muted); text-decoration: underline; margin-left: .2rem; }

.tk-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1.1rem; font-size: .84rem; color: var(--hd-muted); }
.tk-head b { color: var(--hd-ink); font-weight: 700; }
[data-bs-theme="dark"] .tk-head b { color: #fff; }

.tk-row { display: grid; grid-template-columns: minmax(0, 2.6fr) 118px 100px minmax(0, 1.1fr) 104px; gap: 1rem; align-items: center; padding: .85rem 1.1rem .85rem 1.25rem; border-top: 1px solid var(--hd-line); color: inherit; position: relative; }
.tk-row.is-staff { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 118px 100px minmax(0, 1fr) 104px; }
.tk-row::before { content: ""; position: absolute; left: 0; top: .7rem; bottom: .7rem; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.tk-row.s-open::before { background: #2563eb; } .tk-row.s-in_progress::before { background: #d97706; } .tk-row.s-on_hold::before { background: #7c3aed; } .tk-row.s-resolved::before { background: #059669; } .tk-row.s-closed::before { background: #94a3b8; }
a.tk-row:hover { background: rgba(91, 71, 224, .045); color: inherit; }
a.tk-row:hover .tk-subject { color: var(--hd-primary); }
a.tk-row:focus-visible { outline: 2px solid var(--hd-primary); outline-offset: -2px; }
.tk-cols { padding-top: .5rem; padding-bottom: .5rem; background: var(--hd-bg); font-size: .7rem; font-weight: 600; color: var(--hd-muted); letter-spacing: .01em; }
.tk-cols::before { display: none; }
.tk-main { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.tk-subject { font-weight: 600; font-size: .93rem; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; transition: color .12s; }
.tk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .85rem; font-size: .75rem; color: var(--hd-muted); }
.tk-meta > span { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.tk-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; color: var(--hd-ink); background: var(--hd-bg); padding: .05rem .4rem; border-radius: 5px; }
[data-bs-theme="dark"] .tk-no { color: #e6e6f5; }
.tk-cat { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.tk-flag { font-weight: 600; }
.tk-person { display: flex; align-items: center; gap: .5rem; min-width: 0; font-size: .84rem; }
.tk-none { font-size: .78rem; color: var(--hd-muted); font-style: italic; }
.tk-pri { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; }
.tk-pri.p-low { color: #64748b; } .tk-pri.p-normal { color: #0e7490; } .tk-pri.p-high { color: #c2410c; } .tk-pri.p-urgent { color: #dc2626; }
.tk-when { text-align: right; font-size: .8rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-when small { display: block; font-weight: 400; font-size: .72rem; color: var(--hd-muted); }
.tk-foot { padding: .8rem 1.1rem; border-top: 1px solid var(--hd-line); }
.tk-foot .pagination { margin: 0; flex-wrap: wrap; }
.tk-foot nav > div:first-child { display: none; }
.tk-empty { text-align: center; padding: 3.2rem 1rem 3.5rem; border-top: 1px solid var(--hd-line); }
.tk-empty i { font-size: 2rem; width: 64px; height: 64px; display: inline-grid; place-items: center; border-radius: 20px; background: rgba(91, 71, 224, .09); color: var(--hd-primary); margin-bottom: .8rem; }
.tk-empty h3 { font-family: var(--hd-display); font-size: 1.15rem; font-weight: 500; margin: 0 0 .3rem; }
.tk-empty p { color: var(--hd-muted); font-size: .87rem; margin: 0 0 1rem; }

@media (max-width: 1199.98px) {
  .tk-row.is-staff { grid-template-columns: minmax(0, 2.4fr) 118px 100px minmax(0, 1fr) 96px; }
  .tk-row.is-staff > :nth-child(2) { display: none; }
}
@media (max-width: 991.98px) {
  .tk-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .tk-bar .tk-search { grid-column: 1 / -1; }
  .tk-bar .btn-primary { display: none; }
  .tk-row, .tk-row.is-staff { grid-template-columns: minmax(0, 1fr) auto; gap: .45rem .8rem; }
  .tk-cols { display: none; }
  .tk-row > :not(.tk-main):not(.tk-when):not(.tk-mob) { display: none; }
  .tk-row .tk-main { grid-column: 1; }
  .tk-row .tk-when { grid-column: 2; grid-row: 1; align-self: start; }
  .tk-row .tk-mob { display: flex; }
}
.tk-mob { display: none; grid-column: 1 / -1; gap: .4rem .8rem; align-items: center; flex-wrap: wrap; font-size: .78rem; }
.tk-mob .tk-person { font-size: .78rem; }
@media (max-width: 575.98px) {
  .tk-tools { padding: .8rem .85rem .7rem; }
  .tk-row { padding: .8rem .85rem .8rem 1rem; }
  .tk-head, .tk-foot { padding-left: .85rem; padding-right: .85rem; }
  .tk-more { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: .7rem; }
}

/* ---- v1.7 raise a ticket: routing box ---------------------------------- */
.route-box { border: 1px solid var(--hd-line); border-radius: 14px; padding: .9rem 1rem 1rem; background: color-mix(in srgb, var(--hd-primary) 3%, var(--hd-surface)); }
.route-box legend { float: left; width: 100%; font-size: .84rem; font-weight: 700; padding: 0; margin: 0 0 .6rem; color: var(--hd-primary); }
.route-box legend + * { clear: left; }
.route-box legend i { margin-right: .35rem; }

/* ---- v1.8 public link not available ------------------------------------ */
.link-off { text-align: center; }
.link-off-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: rgba(91, 71, 224, .1); color: var(--hd-primary); font-size: 1.7rem; margin-bottom: 1rem; }
.link-off-hint { display: flex; gap: .6rem; text-align: left; margin-top: 1.2rem; padding: .8rem .9rem; border-radius: 12px; background: var(--hd-bg); font-size: .84rem; color: var(--hd-muted); }
.link-off-hint i { color: var(--hd-primary); font-size: 1.1rem; }
.link-off-hint b { color: var(--hd-ink); display: block; }
[data-bs-theme="dark"] .link-off-hint b { color: #fff; }
.plink { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--hd-line); }
.plink:first-child { border-top: 0; padding-top: 0; }
.plink-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(91, 71, 224, .1); color: var(--hd-primary); }
.plink b { display: block; font-size: .9rem; }
.plink code { font-size: .78rem; word-break: break-all; }
.plink-state { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; margin-left: .4rem; }
.plink-state.on { background: rgba(5, 150, 105, .13); color: #047857; }
.plink-state.off { background: rgba(220, 38, 38, .1); color: #b91c1c; }
.plink-why { font-size: .78rem; color: var(--hd-muted); margin-top: .2rem; }
.plink-acts { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 575.98px) { .plink { grid-template-columns: auto minmax(0, 1fr); } .plink-acts { grid-column: 1 / -1; justify-content: flex-start; } }

/* ---- v1.8 payments: UPI QR and renewal -------------------------------- */
.upi-pay { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.2rem; align-items: start; padding: 1rem; border-radius: 14px; background: var(--hd-bg); }
.upi-qr { background: #fff; border-radius: 12px; padding: .5rem; box-shadow: var(--hd-shadow); }
.upi-qr svg { width: 100%; height: auto; display: block; }
.upi-steps ol { padding-left: 1.1rem; font-size: .85rem; margin-bottom: .7rem; }
.upi-steps li { margin-bottom: .25rem; }
.upi-vpa { display: flex; align-items: center; gap: .5rem; font-size: .84rem; margin-top: .3rem; flex-wrap: wrap; }
.upi-vpa span { color: var(--hd-muted); min-width: 52px; }
.upi-vpa b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; word-break: break-all; }
@media (max-width: 575.98px) { .upi-pay { grid-template-columns: 1fr; } .upi-qr { max-width: 230px; margin: 0 auto; } }
.renew { border: 0; overflow: hidden; }
.renew-top { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; padding: 1.2rem 1.3rem; background: var(--hd-hero); color: #fff; }
.renew-top h2 { font-family: var(--hd-display); font-weight: 500; font-size: 1.35rem; margin: 0; }
.renew-top p { margin: .2rem 0 0; opacity: .85; font-size: .88rem; }
.renew-days { text-align: center; padding: .5rem 1rem; border-radius: 14px; background: rgba(255, 255, 255, .14); min-width: 120px; }
.renew-days b { display: block; font-family: var(--hd-display); font-size: 1.9rem; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.renew-days span { font-size: .75rem; opacity: .85; }
.renew-body { padding: 1.1rem 1.3rem 1.3rem; }
.renew-cycles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; }
.renew-opt { position: relative; display: block; margin: 0; cursor: pointer; }
.renew-opt input { position: absolute; opacity: 0; }
.renew-opt > span { display: block; height: 100%; padding: .85rem 1rem; border: 1.5px solid var(--hd-line); border-radius: 14px; transition: border-color .15s, background .15s; }
.renew-opt input:checked + span { border-color: var(--hd-primary); background: rgba(91, 71, 224, .06); }
.renew-opt input:focus-visible + span { outline: 2px solid var(--hd-primary); outline-offset: 2px; }
.renew-opt b { display: block; font-size: .95rem; }
.renew-opt .amt { font-family: var(--hd-display); font-size: 1.3rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.renew-opt small { display: block; color: var(--hd-muted); font-size: .78rem; }
.renew-gw { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; margin-top: .4rem; }
.renew-gw .renew-opt > span { padding: .6rem .8rem; font-size: .84rem; display: flex; gap: .55rem; align-items: center; }
.renew-gw i { font-size: 1.1rem; color: var(--hd-primary); }
.renew-label { font-size: .78rem; font-weight: 600; color: var(--hd-muted); margin: 1rem 0 .1rem; }
