:root {
    --brand-primary: #6d5dfc;
    --brand-secondary: #12b8a6;
    --brand-accent: #8b7cff;
    --card-radius: 18px;
    --sidebar-width: 254px;
    --sidebar-collapsed: 76px;
    --topbar-height: 72px;
    --bg: #090b10;
    --surface: #11141b;
    --surface-raised: #151922;
    --surface-soft: #0d1016;
    --surface-hover: #1a1f2b;
    --border: rgba(255, 255, 255, .075);
    --border-strong: rgba(255, 255, 255, .13);
    --text: #f2f4f8;
    --text-soft: #c4c9d4;
    --muted: #89909f;
    --positive: #42d3b3;
    --negative: #ff7088;
    --warning: #f2b84b;
    --blue: #59a7ff;
    --shadow: 0 22px 60px rgba(0, 0, 0, .18);
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-bs-theme="light"] {
    --bg: #f4f5f8;
    --surface: #fff;
    --surface-raised: #fff;
    --surface-soft: #f7f8fa;
    --surface-hover: #f0f1f5;
    --border: rgba(20, 25, 35, .08);
    --border-strong: rgba(20, 25, 35, .14);
    --text: #171a22;
    --text-soft: #474d5a;
    --muted: #737b8b;
    --shadow: 0 22px 60px rgba(31, 35, 48, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand-primary) 36%, transparent); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 20px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1040; width: var(--sidebar-width); display: flex; flex-direction: column; background: color-mix(in srgb, var(--surface) 96%, transparent); border-right: 1px solid var(--border); transition: width .25s ease, transform .25s ease; }
.sidebar-header { height: var(--topbar-height); flex: 0 0 var(--topbar-height); padding: 0 17px 0 19px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark, .brand-image { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 12px; overflow: hidden; }
.brand-mark { color: #fff; font-size: 17px; background: linear-gradient(145deg, var(--brand-accent), var(--brand-primary)); box-shadow: 0 8px 24px color-mix(in srgb, var(--brand-primary) 34%, transparent); }
.brand-image img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 16px; font-weight: 750; letter-spacing: -.03em; white-space: nowrap; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; }
.sidebar-nav { flex: 1; padding: 14px 11px 24px; overflow-y: auto; overflow-x: hidden; }
.nav-caption { display: block; margin: 19px 12px 7px; color: color-mix(in srgb, var(--muted) 78%, transparent); font-size: 9px; line-height: 1; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; white-space: nowrap; }
.nav-caption:first-child { margin-top: 5px; }
.sidebar .nav-link { position: relative; min-height: 39px; margin: 2px 0; padding: 9px 11px; display: flex; align-items: center; gap: 12px; border-radius: 11px; color: var(--muted); font-size: 13px; font-weight: 540; white-space: nowrap; transition: color .16s ease, background .16s ease, transform .16s ease; }
.sidebar .nav-link i { width: 19px; flex: 0 0 19px; text-align: center; font-size: 16px; }
.sidebar .nav-link:hover { color: var(--text); background: var(--surface-hover); transform: translateX(2px); }
.sidebar .nav-link.active { color: #fff; background: linear-gradient(115deg, color-mix(in srgb, var(--brand-primary) 26%, var(--surface)), color-mix(in srgb, var(--brand-primary) 9%, var(--surface))); }
.sidebar .nav-link.active::before { content: ''; position: absolute; left: -11px; width: 3px; height: 19px; border-radius: 0 3px 3px 0; background: var(--brand-accent); box-shadow: 0 0 14px var(--brand-primary); }
[data-bs-theme="light"] .sidebar .nav-link.active { color: var(--brand-primary); }
.sidebar-footer { padding: 13px; border-top: 1px solid var(--border); }
.workspace-chip { padding: 10px; display: flex; align-items: center; gap: 10px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.workspace-chip > div { min-width: 0; display: flex; flex-direction: column; }
.workspace-chip strong { overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-chip small { margin-top: 3px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 10px color-mix(in srgb, var(--positive) 70%, transparent); }
.sidebar-backdrop { display: none; }

.main-area { min-height: 100vh; margin-left: var(--sidebar-width); display: flex; flex-direction: column; transition: margin .25s ease; }
.topbar { position: sticky; top: 0; z-index: 1020; height: var(--topbar-height); flex: 0 0 var(--topbar-height); padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(18px); }
.topbar-start, .topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-start { flex: 1; min-width: 0; }
.icon-button { width: 38px; height: 38px; padding: 0; display: inline-grid; flex: 0 0 38px; place-items: center; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); background: var(--surface); transition: .16s ease; }
.icon-button:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }
.global-search { position: relative; width: min(500px, 48vw); }
.global-search > i { position: absolute; top: 50%; left: 14px; z-index: 2; color: var(--muted); transform: translateY(-50%); }
.global-search input { width: 100%; height: 38px; padding: 0 57px 0 39px; border: 1px solid transparent; border-radius: 11px; color: var(--text); background: var(--surface); transition: .2s ease; }
.global-search input::placeholder { color: var(--muted); }
.global-search input:focus { outline: none; border-color: color-mix(in srgb, var(--brand-primary) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 13%, transparent); }
.global-search kbd { position: absolute; top: 8px; right: 9px; padding: 3px 7px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: var(--surface-soft); font-family: inherit; font-size: 9px; }
.search-results { position: absolute; top: 47px; left: 0; right: 0; max-height: 420px; overflow: auto; padding: 7px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface-raised); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.search-result { padding: 10px; display: flex; align-items: center; gap: 11px; border-radius: 10px; }
.search-result:hover { background: var(--surface-hover); }
.search-result > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-accent); background: color-mix(in srgb, var(--brand-primary) 14%, transparent); }
.search-result > span { min-width: 0; display: flex; flex-direction: column; }
.search-result strong { font-size: 12px; }
.search-result small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.search-result em { margin-left: auto; color: var(--muted); font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.profile-button { height: 43px; padding: 4px 7px 4px 5px; display: flex; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; color: var(--text); background: transparent; }
.profile-button:hover { border-color: var(--border); background: var(--surface); }
.avatar, .mini-avatar { display: inline-grid; place-items: center; border: 1px solid color-mix(in srgb, var(--brand-primary) 35%, transparent); color: color-mix(in srgb, var(--brand-accent) 75%, white); background: linear-gradient(145deg, color-mix(in srgb, var(--brand-primary) 30%, var(--surface)), color-mix(in srgb, var(--brand-primary) 9%, var(--surface))); font-weight: 700; }
.avatar { width: 33px; height: 33px; flex: 0 0 33px; border-radius: 10px; font-size: 12px; }
.profile-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.profile-copy strong { max-width: 120px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.profile-button > i { color: var(--muted); font-size: 9px; }
.notification-button { position: relative; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 1.5px solid var(--surface); border-radius: 50%; background: var(--negative); }
.dropdown-menu { --bs-dropdown-bg: var(--surface-raised); --bs-dropdown-border-color: var(--border-strong); --bs-dropdown-link-color: var(--text-soft); --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface-hover); min-width: 210px; padding: 7px; border-radius: 13px; box-shadow: var(--shadow); }
.dropdown-item { padding: 9px 10px; border-radius: 8px; font-size: 12px; }
.dropdown-item i { margin-right: 7px; }
.dropdown-divider { border-color: var(--border); }
.notification-menu { width: min(380px, 92vw); overflow: hidden; }
.dropdown-title { padding: 16px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); }
.dropdown-title strong { font-size: 13px; }
.dropdown-title span { color: var(--muted); font-size: 10px; }
.notification-item { padding: 13px 15px; display: flex; gap: 10px; border-bottom: 1px solid var(--border); }
.notification-item:last-child { border: 0; }
.notification-item.unread { background: color-mix(in srgb, var(--brand-primary) 5%, transparent); }
.notification-item > i { color: var(--brand-accent); }
.notification-item div { display: flex; flex-direction: column; }
.notification-item strong { font-size: 11px; }
.notification-item small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.empty-mini { padding: 28px 16px; color: var(--muted); text-align: center; font-size: 11px; }

.page-content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 31px clamp(20px, 3vw, 42px) 60px; flex: 1; }
.app-footer { padding: 17px clamp(20px, 3vw, 42px); display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.page-heading { margin-bottom: 25px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 6px 0 5px; color: var(--text); font-size: clamp(28px, 3vw, 40px); font-weight: 700; line-height: 1.08; letter-spacing: -.045em; }
.page-heading h1 span { color: var(--muted); font-weight: 500; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-accent); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .14em; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.record-count { color: var(--muted); font-size: 10px; }
.live-pill { padding: 7px 10px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); background: var(--surface); font-size: 9px; }
.live-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 10px var(--positive); }
.btn { --bs-btn-font-size: 11px; --bs-btn-font-weight: 650; min-height: 38px; padding: 9px 14px; border-radius: 10px; }
.btn-primary { --bs-btn-bg: var(--brand-primary); --bs-btn-border-color: var(--brand-primary); --bs-btn-hover-bg: color-mix(in srgb, var(--brand-primary) 87%, white); --bs-btn-hover-border-color: transparent; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand-primary) 22%, transparent); }
.btn-soft { border: 1px solid var(--border); color: var(--text-soft); background: var(--surface-soft); }
.btn-soft:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-hover); }
.btn-link { color: var(--muted); text-decoration: none; }
.btn-link:hover { color: var(--text); }
.surface { border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--surface); box-shadow: var(--shadow); }
.surface-heading { padding: 22px 23px 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.surface-heading h2 { margin: 6px 0 0; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.surface-heading a, .surface-heading > span { color: var(--muted); font-size: 9px; }
.surface-heading a:hover { color: var(--brand-accent); }

.metric-grid { margin-bottom: 19px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--card-radius); background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, var(--brand-primary)), var(--surface)); transition: transform .18s ease, border-color .18s ease; }
.metric-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.metric-top { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; }
.metric-icon { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; font-size: 14px; }
.metric-icon.violet { color: #9b8dff; background: rgba(109,93,252,.13); }
.metric-icon.teal { color: var(--positive); background: rgba(66,211,179,.1); }
.metric-icon.blue { color: var(--blue); background: rgba(89,167,255,.1); }
.metric-icon.amber { color: var(--warning); background: rgba(242,184,75,.1); }
.metric-trend { padding: 4px 7px; border-radius: 6px; font-size: 8px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.metric-trend.positive { color: var(--positive); background: rgba(66,211,179,.08); }
.metric-trend.warning { color: var(--warning); background: rgba(242,184,75,.08); }
.metric-trend.neutral { color: var(--muted); background: var(--surface-soft); }
.metric-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.metric-card > strong { display: block; overflow: hidden; font-size: clamp(22px, 2.3vw, 30px); line-height: 1.1; letter-spacing: -.045em; text-overflow: ellipsis; }
.metric-card > small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; }
.dashboard-grid { margin-bottom: 19px; display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(270px, .75fr); gap: 19px; }
.bottom-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); }
.revenue-total { display: flex; flex-direction: column; align-items: flex-end; }
.revenue-total small { color: var(--muted); font-size: 8px; }
.revenue-total strong { margin-top: 4px; font-size: 15px; }
.bar-chart { height: 245px; padding: 28px 25px 22px; display: flex; align-items: flex-end; gap: clamp(9px, 2vw, 22px); border-top: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, var(--border) 50px); }
.bar-column { position: relative; height: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.bar-track { width: min(34px, 68%); height: 100%; display: flex; align-items: flex-end; border-radius: 7px; background: color-mix(in srgb, var(--brand-primary) 6%, transparent); overflow: hidden; }
.bar-track span { width: 100%; min-height: 5px; border-radius: 7px 7px 3px 3px; background: linear-gradient(to top, var(--brand-primary), var(--brand-accent)); box-shadow: 0 -10px 28px color-mix(in srgb, var(--brand-primary) 24%, transparent); transition: height .5s ease; }
.bar-column small { color: var(--muted); font-size: 8px; }
.bar-value { position: absolute; top: -4px; opacity: 0; padding: 4px 6px; border-radius: 6px; color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow); font-size: 8px; white-space: nowrap; transition: opacity .15s ease; }
.bar-column:hover .bar-value { opacity: 1; }
.timeline-list { padding: 3px 20px 16px; }
.timeline-item { min-height: 52px; display: flex; align-items: center; gap: 10px; }
.timeline-date { width: 31px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.timeline-date strong { font-size: 14px; }
.timeline-date small { margin-top: 4px; color: var(--muted); font-size: 7px; }
.timeline-line { width: 1px; align-self: stretch; background: var(--border); }
.timeline-item > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.timeline-item > div strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item > div small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.timeline-item > i { color: var(--muted); font-size: 8px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-primary) 10%, transparent); }
.activity-list { padding: 0 20px 17px; }
.activity-item { padding: 10px 0; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border: 0; }
.activity-icon, .ticket-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-accent); background: color-mix(in srgb, var(--brand-primary) 10%, transparent); font-size: 11px; }
.activity-item > div { display: flex; flex-direction: column; }
.activity-item strong { font-size: 9px; text-transform: capitalize; }
.activity-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }

.responsive-table { width: 100%; overflow-x: auto; }
.responsive-table table { width: 100%; border-collapse: collapse; }
.responsive-table th { padding: 11px 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--muted); background: var(--surface-soft); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.responsive-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-soft); font-size: 10px; vertical-align: middle; }
.responsive-table tbody tr { transition: background .15s ease, opacity .22s ease; }
.responsive-table tbody tr:hover { background: color-mix(in srgb, var(--surface-hover) 62%, transparent); }
.responsive-table tbody tr:last-child td { border-bottom: 0; }
.entity-cell { display: flex; align-items: center; gap: 10px; }
.mini-avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; font-size: 10px; }
.entity-cell > span { display: flex; flex-direction: column; }
.entity-cell strong { max-width: 170px; overflow: hidden; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.entity-cell small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.status-badge { padding: 4px 7px; display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; font-size: 8px; font-weight: 600; white-space: nowrap; }
.status-badge i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status-badge.positive { color: var(--positive); background: rgba(66,211,179,.09); }
.status-badge.negative { color: var(--negative); background: rgba(255,112,136,.09); }
.status-badge.warning { color: var(--warning); background: rgba(242,184,75,.09); }
.status-badge.neutral { color: var(--muted); background: color-mix(in srgb, var(--muted) 9%, transparent); }
.row-action { width: 29px; height: 29px; padding: 0; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; }
.row-action:hover { border-color: var(--border); color: var(--text); background: var(--surface-hover); }
.row-action.danger:hover { color: var(--negative); }
.row-action.positive-action:hover { color: var(--positive); border-color: rgba(66,211,179,.25); background: rgba(66,211,179,.07); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; }
.row-actions form { display: contents; }

.resource-surface { overflow: hidden; }
.table-toolbar { min-height: 66px; padding: 13px 16px; display: flex; align-items: center; gap: 9px; }
.filter-search { position: relative; width: min(330px, 40vw); }
.filter-search i { position: absolute; top: 50%; left: 12px; color: var(--muted); transform: translateY(-50%); }
.filter-search input { width: 100%; height: 36px; padding: 0 12px 0 35px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--surface-soft); font-size: 10px; }
.filter-search input:focus { border-color: var(--brand-primary); outline: none; }
.table-toolbar .form-select { width: 155px; }
.toolbar-spacer { flex: 1; }
.resource-table td:first-child { color: var(--text); font-weight: 600; }
.actions-column { width: 100px; }
.pagination-bar { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.pagination-bar > div { display: flex; gap: 5px; }
.empty-state { min-height: 280px; padding: 35px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-state > span { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 14px; color: var(--brand-accent); background: var(--surface-soft); font-size: 18px; }
.empty-state h3 { margin: 14px 0 5px; color: var(--text-soft); font-size: 13px; }
.empty-state p { margin: 0 0 14px; font-size: 10px; }
.empty-state.compact { min-height: 135px; padding: 18px; }
.empty-state.compact > i { color: var(--brand-accent); font-size: 20px; }
.empty-state.compact p { margin: 8px 0 0; }
.empty-inline { padding: 28px; color: var(--muted); text-align: center; font-size: 10px; }

.form-heading { align-items: flex-start; }
.back-link { margin-bottom: 11px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.back-link:hover { color: var(--text); }
.resource-form { padding: 25px; }
.form-section-heading { margin-bottom: 25px; padding-bottom: 21px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.form-section-icon { width: 39px; height: 39px; display: grid; flex: 0 0 39px; place-items: center; border-radius: 12px; color: var(--brand-accent); background: color-mix(in srgb, var(--brand-primary) 12%, transparent); }
.form-section-heading h2 { margin: 0; font-size: 14px; }
.form-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.form-label { margin-bottom: 7px; color: var(--text-soft); font-size: 9px; font-weight: 650; text-transform: uppercase; letter-spacing: .055em; }
.form-control, .form-select { min-height: 39px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background-color: var(--surface-soft); font-size: 11px; }
.form-control:focus, .form-select:focus { border-color: color-mix(in srgb, var(--brand-primary) 64%, transparent); color: var(--text); background-color: var(--surface-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent); }
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2389909f' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.form-text { color: var(--muted); font-size: 8px; }
textarea.form-control { resize: vertical; }
.switch-field { min-height: 61px; margin: 0; padding: 12px 14px 12px 52px; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.switch-field .form-check-input { margin-left: -38px; }
.switch-field label { display: flex; flex-direction: column; }
.switch-field strong { color: var(--text-soft); font-size: 10px; }
.switch-field small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.form-check-input:checked { border-color: var(--brand-primary); background-color: var(--brand-primary); }
.form-actions { margin: 28px -25px -25px; padding: 17px 25px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border); background: var(--surface-soft); border-radius: 0 0 var(--card-radius) var(--card-radius); }
.hv-alert { padding: 13px 15px; display: flex; gap: 12px; border: 1px solid rgba(255,112,136,.18); border-radius: 11px; color: var(--negative); background: rgba(255,112,136,.07); font-size: 10px; }
.hv-alert strong { font-size: 10px; }
.hv-alert ul { margin: 5px 0 0; padding-left: 16px; color: color-mix(in srgb, var(--negative) 78%, var(--text)); }

.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: 18px; }
.settings-nav { position: sticky; top: calc(var(--topbar-height) + 18px); padding: 13px; }
.settings-nav .nav-caption { margin: 8px 9px 12px; }
.settings-tab { width: 100%; padding: 11px 9px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; }
.settings-tab > i { width: 28px; height: 28px; display: grid; flex: 0 0 28px; place-items: center; border-radius: 8px; background: var(--surface-soft); }
.settings-tab > span { display: flex; flex-direction: column; }
.settings-tab strong { font-size: 10px; }
.settings-tab small { margin-top: 3px; font-size: 8px; }
.settings-tab:hover { color: var(--text); background: var(--surface-hover); }
.settings-tab.active { color: var(--text); background: color-mix(in srgb, var(--brand-primary) 11%, transparent); }
.settings-tab.active > i { color: var(--brand-accent); background: color-mix(in srgb, var(--brand-primary) 15%, transparent); }
.settings-hint { margin-top: 15px; padding: 13px; display: flex; gap: 9px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.settings-hint > i { color: var(--positive); }
.settings-hint p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.settings-hint strong { color: var(--text-soft); }
.settings-content { min-width: 0; }
.settings-panel { padding: 25px; }
.settings-panel[hidden] { display: none; }
.settings-panel.active { display: block; animation: panelIn .22s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.settings-save { position: sticky; bottom: 13px; z-index: 10; margin-top: 14px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--border-strong); border-radius: 14px; background: color-mix(in srgb, var(--surface-raised) 90%, transparent); box-shadow: 0 14px 40px rgba(0,0,0,.2); backdrop-filter: blur(16px); }
.settings-save > span { color: var(--muted); font-size: 9px; }
.settings-save > span i { margin-right: 6px; color: var(--positive); }
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.upload-card { position: relative; min-height: 76px; padding: 11px; display: flex; align-items: center; gap: 11px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-soft); cursor: pointer; transition: .16s ease; }
.upload-card:hover { border-color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 5%, var(--surface-soft)); }
.upload-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-preview { width: 50px; height: 50px; display: grid; flex: 0 0 50px; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); background: var(--surface); }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-card > span:nth-of-type(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.upload-card strong { font-size: 10px; }
.upload-card small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.upload-card > i { color: var(--muted); }
.settings-divider { margin: 25px 0; height: 1px; background: var(--border); }
.color-field { display: flex; align-items: center; gap: 7px; }
.color-field input[type="color"] { width: 39px; height: 39px; flex: 0 0 39px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.range-field { min-height: 39px; display: flex; align-items: center; gap: 13px; }
.range-field output { min-width: 34px; color: var(--muted); font-size: 9px; }
.form-range::-webkit-slider-thumb { background: var(--brand-primary); }
.info-banner { margin-bottom: 22px; padding: 14px; display: flex; gap: 11px; border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, transparent); border-radius: 12px; color: var(--brand-accent); background: color-mix(in srgb, var(--brand-primary) 7%, transparent); }
.info-banner div { color: var(--text-soft); }
.info-banner strong { font-size: 10px; }
.info-banner p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.hv-toast { min-width: 310px; border: 1px solid var(--border-strong); border-radius: 13px; color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow); }
.hv-toast .toast-body { padding: 10px; display: flex; align-items: center; gap: 9px; font-size: 10px; }
.toast-icon { width: 28px; height: 28px; display: grid; flex: 0 0 28px; place-items: center; border-radius: 8px; }
.toast-icon.positive { color: var(--positive); background: rgba(66,211,179,.1); }
.toast-icon.negative { color: var(--negative); background: rgba(255,112,136,.1); }
.hv-modal { border: 1px solid var(--border-strong); border-radius: 18px; color: var(--text); background: var(--surface-raised); }
.pix-qr { min-height: 210px; margin: 6px auto 18px; display: grid; place-items: center; }
.pix-qr img, .pix-qr canvas { padding: 10px; border-radius: 10px; background: #fff; }
.pix-code { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; word-break: break-all; }
.muted-copy { color: var(--muted); }

.guest-body { min-height: 100vh; overflow-x: hidden; background: #090a0f; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(390px, .75fr); color: #f2f4f8; background: #090a0f; }
.login-story { position: relative; overflow: hidden; padding: 40px clamp(35px, 6vw, 88px); display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 14% 15%, rgba(109,93,252,.27), transparent 31%), radial-gradient(circle at 80% 72%, rgba(18,184,166,.13), transparent 29%), linear-gradient(145deg,#0d1018,#090a0f); }
.login-story::before { content: ''; position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(to bottom right, black, transparent 75%); }
.login-story::after { content: ''; position: absolute; right: -90px; bottom: -150px; width: 420px; height: 420px; border: 1px solid rgba(139,124,255,.16); border-radius: 50%; box-shadow: 0 0 0 70px rgba(109,93,252,.025), 0 0 0 140px rgba(109,93,252,.018); }
.brand-guest { position: relative; z-index: 1; align-self: flex-start; }
.story-copy { position: relative; z-index: 1; max-width: 690px; padding: 80px 0 55px; }
.story-copy h1 { margin: 16px 0 19px; font-size: clamp(42px, 5.7vw, 78px); font-weight: 700; line-height: .98; letter-spacing: -.065em; }
.story-copy h1 span { color: #898e9e; }
.story-copy p { max-width: 610px; margin: 0; color: #979dad; font-size: clamp(14px, 1.5vw, 18px); line-height: 1.65; }
.story-metrics { position: relative; z-index: 1; padding-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; border-top: 1px solid rgba(255,255,255,.08); }
.story-metrics > div { display: flex; align-items: flex-start; gap: 10px; }
.story-metrics i { color: #9b8dff; }
.story-metrics span { display: flex; flex-direction: column; }
.story-metrics strong { font-size: 10px; }
.story-metrics small { margin-top: 5px; color: #717887; font-size: 8px; }
.login-panel { padding: 40px clamp(28px, 5vw, 70px); display: grid; place-items: center; border-left: 1px solid rgba(255,255,255,.07); background: #0e1016; }
.login-card { width: min(390px, 100%); }
.login-card h2 { margin: 9px 0 7px; font-size: 27px; font-weight: 680; letter-spacing: -.04em; }
.login-card .form-label { color: #c4c9d4; }
.login-card .form-control { height: 46px; padding-left: 40px; border-color: rgba(255,255,255,.09); color: #f2f4f8; background: #090b10; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; top: 50%; left: 14px; z-index: 2; color: #6f7685; transform: translateY(-50%); }
.password-toggle { position: absolute; top: 50%; right: 10px; z-index: 2; padding: 5px; border: 0; color: #747b89; background: none; transform: translateY(-50%); }
.login-options { margin: 12px 0 20px; display: flex; justify-content: space-between; color: #747b89; font-size: 9px; }
.login-options input { accent-color: var(--brand-primary); }
.login-submit { width: 100%; height: 47px; display: flex; align-items: center; justify-content: center; gap: 9px; }
.login-foot { margin: 27px 0 0; color: #666d7b; font-size: 8px; text-align: center; }
.signup-callout { margin-top: 17px; padding: 13px; display: flex; align-items: center; justify-content: space-between; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; color: #7c8392; background: rgba(255,255,255,.025); font-size: 9px; }
.signup-callout a { color: #a99fff; font-weight: 650; }
.register-page { min-height: 100vh; display: grid; grid-template-columns: minmax(340px,.7fr) minmax(540px,1.3fr); color: #f2f4f8; background: #090a0f; }
.register-brand { position: relative; overflow: hidden; padding: 42px clamp(30px,5vw,70px); display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 22% 18%,rgba(109,93,252,.3),transparent 34%),linear-gradient(145deg,#111521,#090a0f); }
.register-brand::after { content:''; position:absolute; right:-160px; bottom:-170px; width:430px; height:430px; border:1px solid rgba(139,124,255,.18); border-radius:50%; box-shadow:0 0 0 75px rgba(109,93,252,.025),0 0 0 150px rgba(109,93,252,.015); }
.register-brand > div { position: relative; z-index: 1; }
.register-brand h1 { max-width: 460px; margin: 14px 0; font-size: clamp(38px,5vw,64px); line-height: 1; letter-spacing: -.06em; }
.register-brand p { max-width: 480px; color: #9198a8; line-height: 1.7; }
.register-brand ul { position: relative; z-index: 1; margin: 0; padding: 0; display: grid; gap: 11px; list-style: none; color: #aab0be; font-size: 10px; }
.register-brand li { display:flex; align-items:center; gap:8px; }.register-brand li i{color:var(--positive)}
.register-panel { padding: 35px clamp(24px,5vw,72px); display: grid; place-items: center; background: #0e1016; }
.register-card { width: min(690px,100%); padding: 30px; border: 1px solid rgba(255,255,255,.08); border-radius: 20px; background: #11141b; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.register-card h2 { margin: 8px 0 5px; font-size: 27px; letter-spacing: -.04em; }.register-terms{margin:14px 0 0;color:#68707f;font-size:8px;text-align:center}

.portal-body { min-height: 100vh; background: radial-gradient(circle at 50% -20%, color-mix(in srgb, var(--brand-primary) 11%, transparent), transparent 36%), var(--bg); }
.portal-topbar { position: sticky; top: 0; z-index: 1020; height: 74px; padding: 0 max(24px, calc((100vw - 1280px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(18px); }
.portal-topbar nav { display: flex; align-self: stretch; gap: 27px; }
.portal-topbar nav a { position: relative; display: flex; align-items: center; color: var(--muted); font-size: 10px; font-weight: 600; }
.portal-topbar nav a:hover, .portal-topbar nav a.active { color: var(--text); }
.portal-topbar nav a.active::after { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; border-radius: 2px; background: var(--brand-primary); }
.portal-topbar form { display: contents; }
.portal-main { max-width: 1280px; min-height: calc(100vh - 130px); margin: auto; padding: 46px 24px 70px; }
.portal-hero { margin-bottom: 33px; display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; }
.portal-hero h1 { margin: 8px 0 7px; font-size: clamp(34px, 4vw, 50px); letter-spacing: -.055em; }
.portal-hero p { margin: 0; color: var(--muted); font-size: 12px; }
.portal-hero-actions { display: flex; gap: 9px; }
.portal-metrics { margin-bottom: 19px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.portal-metrics article { padding: 17px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--border); border-radius: var(--card-radius); background: var(--surface); }
.portal-metrics article > div { display: flex; flex-direction: column; }
.portal-metrics small { color: var(--muted); font-size: 9px; }
.portal-metrics strong { margin-top: 3px; font-size: 18px; }
.portal-grid { margin-bottom: 19px; display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(250px, .7fr); gap: 19px; }
.portal-grid.tables { grid-template-columns: 1.15fr .85fr; }
.service-card-grid { padding: 6px 20px 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.service-mini-card { padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.service-mini-card > div:first-child { display: flex; justify-content: space-between; align-items: center; }
.service-orb { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-accent); background: color-mix(in srgb, var(--brand-primary) 11%, transparent); }
.service-mini-card h3 { margin: 14px 0 5px; font-size: 11px; }
.service-mini-card p { margin: 0 0 15px; color: var(--muted); font-size: 9px; }
.service-mini-card > div:last-child { padding-top: 10px; display: flex; justify-content: space-between; border-top: 1px solid var(--border); }
.service-mini-card > div:last-child small { color: var(--muted); font-size: 8px; }
.service-mini-card > div:last-child strong { font-size: 9px; }
.portal-notice { position: relative; overflow: hidden; padding: 25px; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--brand-primary) 22%, transparent), transparent 48%), var(--surface); }
.notice-icon { width: 42px; height: 42px; margin-bottom: 24px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, var(--brand-accent), var(--brand-primary)); box-shadow: 0 12px 35px color-mix(in srgb, var(--brand-primary) 25%, transparent); }
.portal-notice h2 { margin: 8px 0 9px; font-size: 20px; letter-spacing: -.035em; }
.portal-notice p { margin: 0 0 20px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.ticket-list { padding: 0 20px 15px; }
.ticket-item { padding: 11px 0; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.ticket-item:last-child { border: 0; }
.ticket-item > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.ticket-item strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ticket-item small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.portal-footer { padding: 20px 24px; display: flex; justify-content: center; gap: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 8px; }

.error-page { min-height: 60vh; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-code { color: var(--brand-accent); font-size: clamp(70px,12vw,150px); font-weight: 750; line-height: 1; letter-spacing: -.09em; opacity: .32; }
.error-page h1 { margin: -12px 0 8px; font-size: 24px; letter-spacing: -.04em; }
.error-page p { margin: 0 0 22px; color: var(--muted); }
.system-grid { margin-bottom: 19px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 19px; }
.backup-list { padding: 2px 17px 15px; }
.backup-item { padding: 11px 5px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.backup-item:last-child { border: 0; }
.backup-item > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-accent); background: color-mix(in srgb, var(--brand-primary) 10%, transparent); }
.backup-item > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.backup-item strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.backup-item small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.backup-item > i { color: var(--muted); }
.logs-card code { color: var(--brand-accent); font-size: 8px; }
.permissions-card { margin-top: 19px; overflow: hidden; }.permission-accordion{padding:0 17px 17px}.permission-accordion .accordion-item{border-color:var(--border);background:transparent}.permission-accordion .accordion-button{padding:13px 10px;color:var(--text);background:transparent;font-size:10px;box-shadow:none}.permission-accordion .accordion-button::after{filter:grayscale(1);opacity:.6}.permission-accordion .accordion-body{padding:12px 5px}.permission-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.permission-grid label{padding:9px;display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:9px;background:var(--surface-soft);cursor:pointer}.permission-grid input{accent-color:var(--brand-primary)}.permission-grid span{display:flex;flex-direction:column}.permission-grid strong{font-size:8px}.permission-grid small{margin-top:2px;color:var(--muted);font-size:7px;text-transform:uppercase}.warning-banner{border-color:rgba(242,184,75,.2);color:var(--warning);background:rgba(242,184,75,.07)}
.portal-ticket-form { max-width: 900px; }
.ticket-workspace{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,.65fr);align-items:start;gap:18px}.conversation-card{overflow:hidden}.conversation-list{padding:20px;display:grid;gap:16px}.conversation-message{display:flex;align-items:flex-start;gap:11px}.conversation-message>div{min-width:0;flex:1;padding:13px 15px;border:1px solid var(--border);border-radius:4px 13px 13px 13px;background:var(--surface-soft)}.conversation-message.client-message>div{background:color-mix(in srgb,var(--brand-primary) 7%,var(--surface-soft))}.conversation-message.private-message>div{border-color:rgba(242,184,75,.2);background:rgba(242,184,75,.06)}.conversation-message header{display:flex;align-items:center;gap:8px}.conversation-message header strong{font-size:9px}.conversation-message header span{padding:2px 5px;border-radius:5px;color:var(--warning);background:rgba(242,184,75,.1);font-size:6px;text-transform:uppercase}.conversation-message time{margin-left:auto;color:var(--muted);font-size:7px}.conversation-message p{margin:8px 0 0;color:var(--text-soft);font-size:10px;line-height:1.65}.ticket-reply-card{position:sticky;top:calc(var(--topbar-height) + 18px);padding:0 18px 18px}.ticket-reply-card .surface-heading{margin:0 -18px}.private-check{padding:10px;display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:10px;background:var(--surface-soft)}.private-check input{accent-color:var(--brand-primary)}.private-check span{display:flex;flex-direction:column}.private-check strong{font-size:9px}.private-check small{margin-top:2px;color:var(--muted);font-size:7px}.portal-ticket-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(270px,.5fr);align-items:start;gap:18px}.portal-reply{position:sticky;top:92px;padding:21px}.portal-reply h2{margin:8px 0 16px;font-size:17px}.portal-reply>p{margin:13px 0 0;color:var(--muted);font-size:8px;text-align:center}
.portal-domains{margin-bottom:19px}.domain-card-grid{padding:4px 18px 20px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.domain-card-grid>.empty-state{grid-column:1/-1}.domain-card{min-width:0;padding:13px;display:flex;align-items:center;gap:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft)}.domain-orb{width:34px;height:34px;display:grid;flex:0 0 34px;place-items:center;border-radius:10px;color:var(--brand-accent);background:color-mix(in srgb,var(--brand-primary) 11%,transparent)}.domain-card>div{min-width:0;display:flex;flex:1;flex-direction:column}.domain-card strong{overflow:hidden;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.domain-card small{margin-top:4px;color:var(--muted);font-size:7px}.domain-input{display:flex;align-items:center}.domain-input>span{height:39px;padding:0 10px;display:flex;align-items:center;border:1px solid var(--border);border-right:0;border-radius:10px 0 0 10px;color:var(--muted);background:var(--surface-soft);font-size:10px}.domain-input .form-control{border-radius:0 10px 10px 0}
.nav-beta { margin-left: 5px; padding: 2px 4px; border-radius: 4px; color: var(--brand-accent); background: color-mix(in srgb, var(--brand-primary) 12%, transparent); font-size: 6px; text-transform: uppercase; }
.ai-hero { position: relative; min-height: 270px; margin-bottom: 18px; padding: 38px; display: flex; align-items: center; overflow: hidden; background: radial-gradient(circle at 78% 50%, color-mix(in srgb,var(--brand-primary) 22%,transparent),transparent 30%),var(--surface); }
.ai-hero > div:first-child { position: relative; z-index: 2; max-width: 680px; }
.ai-orb { width: 45px; height: 45px; margin-bottom: 25px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg,var(--brand-accent),var(--brand-primary)); box-shadow: 0 15px 40px color-mix(in srgb,var(--brand-primary) 35%,transparent); }
.ai-hero h2 { margin: 9px 0 12px; font-size: clamp(25px,4vw,42px); line-height: 1.08; letter-spacing: -.05em; }
.ai-hero p { max-width: 600px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.ai-signal { position: absolute; right: 7%; display: flex; align-items: center; gap: 9px; transform: rotate(-8deg); }
.ai-signal span { width: 7px; border-radius: 8px; background: linear-gradient(to top,var(--brand-primary),var(--brand-accent)); box-shadow: 0 0 20px color-mix(in srgb,var(--brand-primary) 40%,transparent); }
.ai-signal span:nth-child(1),.ai-signal span:nth-child(5){height:55px}.ai-signal span:nth-child(2),.ai-signal span:nth-child(4){height:110px}.ai-signal span:nth-child(3){height:165px}
.ai-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.ai-card { padding: 20px; }
.ai-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--brand-accent); background: color-mix(in srgb,var(--brand-primary) 11%,transparent); }
.ai-card h3 { margin: 18px 0 7px; font-size: 12px; }.ai-card p{min-height:35px;margin:0;color:var(--muted);font-size:9px;line-height:1.55}.ai-card small{display:block;margin-top:18px;color:var(--positive);font-size:7px;text-transform:uppercase;letter-spacing:.08em}
.file-summary { margin-bottom: 15px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }.file-summary article{padding:14px;display:flex;align-items:center;gap:11px;border:1px solid var(--border);border-radius:var(--card-radius);background:var(--surface)}.file-summary article>div{display:flex;flex-direction:column}.file-summary strong{font-size:12px}.file-summary small{margin-top:3px;color:var(--muted);font-size:8px}
.file-grid { padding: 13px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }.file-grid>.empty-state{grid-column:1/-1}.file-card{min-width:0;padding:13px;display:flex;align-items:center;gap:11px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft)}.file-type{width:36px;height:36px;display:grid;flex:0 0 36px;place-items:center;border-radius:10px;color:var(--brand-accent);background:color-mix(in srgb,var(--brand-primary) 10%,transparent)}.file-copy{min-width:0;display:flex;flex:1;flex-direction:column}.file-copy strong{overflow:hidden;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.file-copy small{margin-top:3px;color:var(--muted);font-size:7px}
.report-grid { margin-bottom:18px;display:grid;grid-template-columns:1fr 1fr;gap:18px}.donut-list{padding:2px 20px 18px}.donut-list>div{padding:9px 0;display:grid;grid-template-columns:1fr 100px 55px;align-items:center;gap:10px}.donut-list>div>span{height:6px;overflow:hidden;border-radius:6px;background:var(--surface-soft)}.donut-list>div>span i{display:block;width:var(--width);height:100%;border-radius:6px;background:linear-gradient(90deg,var(--brand-primary),var(--brand-accent))}.donut-list strong{font-size:9px}.donut-list small{color:var(--muted);font-size:8px;text-align:right}.export-grid{padding:5px 18px 20px;display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.export-grid>a{padding:13px;display:flex;align-items:center;gap:9px;border:1px solid var(--border);border-radius:11px;background:var(--surface-soft)}.export-grid>a>i:first-child{color:var(--brand-accent)}.export-grid>a>i:last-child{margin-left:auto;color:var(--muted)}.export-grid span{display:flex;flex-direction:column}.export-grid strong{font-size:9px}.export-grid small{margin-top:3px;color:var(--muted);font-size:7px}

body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .main-area { margin-left: var(--sidebar-collapsed); }
body.sidebar-collapsed .brand-copy, body.sidebar-collapsed .sidebar .nav-link span, body.sidebar-collapsed .nav-caption, body.sidebar-collapsed .workspace-chip > div { opacity: 0; pointer-events: none; }
body.sidebar-collapsed .sidebar .nav-link { justify-content: center; gap: 0; }
body.sidebar-collapsed .sidebar .nav-link i { width: 19px; }
body.sidebar-collapsed .workspace-chip { justify-content: center; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid, .bottom-grid { grid-template-columns: 1fr; }
    .settings-layout { grid-template-columns: 210px minmax(0,1fr); }
    .portal-grid, .portal-grid.tables { grid-template-columns: 1fr; }
    .system-grid { grid-template-columns: 1fr; }
    .ticket-workspace,.portal-ticket-layout{grid-template-columns:1fr}.ticket-reply-card,.portal-reply{position:static}
    .permission-grid { grid-template-columns: repeat(2,1fr); }
    .ai-grid { grid-template-columns: repeat(2,1fr); }
    .export-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: none; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1035; background: rgba(0,0,0,.48); backdrop-filter: blur(2px); }
    .sidebar.mobile-open + .sidebar-backdrop { display: block; }
    .main-area, body.sidebar-collapsed .main-area { margin-left: 0; }
    .login-page { grid-template-columns: 1fr; }
    .register-page { grid-template-columns: 1fr; }.register-brand{min-height:360px}.register-brand ul{display:none}
    .login-story { min-height: 48vh; padding: 30px; }
    .story-copy { padding: 70px 0 35px; }
    .story-metrics { display: none; }
    .login-panel { padding: 60px 25px; border: 0; }
    .register-panel{padding:45px 18px}.register-card{padding:22px}
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
    .settings-nav .nav-caption, .settings-hint { display: none; }
    .settings-tab { padding: 9px; flex-direction: column; text-align: center; }
    .settings-tab small { display: none; }
    .portal-topbar nav { display: none; }
}

@media (max-width: 720px) {
    .topbar { padding: 0 13px; }
    .global-search { width: auto; flex: 1; }
    .global-search kbd, .profile-copy, .profile-button > i { display: none; }
    .profile-button { padding: 4px; }
    .page-content { padding: 23px 14px 45px; }
    .page-heading, .portal-hero { align-items: flex-start; flex-direction: column; }
    .dashboard-heading .heading-actions, .heading-actions { width: 100%; justify-content: space-between; }
    .page-heading h1 { font-size: 31px; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .metric-card { padding: 14px; }
    .metric-top { margin-bottom: 17px; }
    .metric-card > strong { font-size: 20px; }
    .dashboard-grid { gap: 13px; }
    .surface-heading { padding: 18px 16px 12px; }
    .bar-chart { padding-inline: 14px; gap: 5px; }
    .table-toolbar { align-items: stretch; flex-wrap: wrap; }
    .filter-search { width: 100%; }
    .table-toolbar .form-select { flex: 1; width: auto; }
    .toolbar-spacer { display: none; }
    .resource-form, .settings-panel { padding: 18px; }
    .form-actions { margin: 24px -18px -18px; padding: 14px 18px; }
    .upload-grid { grid-template-columns: 1fr; }
    .settings-nav { grid-template-columns: repeat(2, 1fr); }
    .settings-save { align-items: stretch; flex-direction: column; }
    .settings-save > span { display: none; }
    .portal-topbar { padding: 0 15px; }
    .portal-topbar .brand-copy { display: none; }
    .portal-main { padding: 32px 14px 55px; }
    .portal-metrics { grid-template-columns: 1fr; }
    .service-card-grid { grid-template-columns: 1fr; padding-inline: 14px; }
    .portal-hero-actions { width: 100%; }
    .portal-hero-actions .btn { flex: 1; }
    .app-footer { align-items: center; flex-direction: column; text-align: center; }
    .ai-grid,.file-grid,.report-grid,.file-summary { grid-template-columns: 1fr; }
    .domain-card-grid{grid-template-columns:1fr}
    .permission-grid { grid-template-columns: 1fr; }
    .ai-signal { opacity: .35; }
}

@media (max-width: 450px) {
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 142px; }
    .topbar-actions { gap: 5px; }
    .topbar-actions > .icon-button:first-child { display: none; }
    .story-copy h1 { font-size: 41px; }
    .login-story { min-height: 55vh; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
