/* Incentra Core Layout & Executive Royal Purple Foundation */
h1:focus { outline: none; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --royal: #6d28d9;
    --royal-deep: #5b21b6;
    --royal-hover: #4c1d95;
    --royal-vibrant: #7c3aed;
    --royal-soft: #f5f3ff;
    --royal-tint: #ede9fe;
    --royal-border: #ddd6fe;
    --royal-glow: rgba(124, 58, 237, 0.18);
    --royal-shadow: 0 1px 2px rgba(15, 13, 28, 0.04), 0 4px 14px rgba(91, 33, 182, 0.04);
    --royal-shadow-hover: 0 10px 26px rgba(91, 33, 182, 0.11), 0 2px 6px rgba(15, 13, 28, 0.05);

    /* Legacy token aliases mapped to Royal Purple so all existing components inherit seamlessly */
    --green: var(--royal);
    --green-dark: var(--royal-hover);
    --sage: var(--royal-soft);

    /* Cool Violet-Slate Neutrals */
    --ink: #0f0d1c;
    --ink-secondary: #2d2844;
    --muted: #5b5675;
    --line: #e4e2f0;
    --line-strong: #cfcbe3;
    --border: var(--line);
    --background: #faf9fe;
    --white: #ffffff;
    --surface-subtle: #f4f2fb;

    /* Semantic Status Palette */
    --emerald: #059669;
    --emerald-ink: #047857;
    --emerald-bg: #ecfdf5;
    --emerald-border: #a7f3d0;
    --amber: #d97706;
    --amber-ink: #b45309;
    --amber-bg: #fffbeb;
    --amber-border: #fde68a;
    --rose: #dc2626;
    --rose-ink: #b91c1c;
    --rose-bg: #fef2f2;
    --rose-border: #fecaca;
    --indigo-ink: #4338ca;
    --indigo-bg: #eef2ff;
    --indigo-border: #c7d2fe;

    /* Typography & Motion */
    --font: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--royal-vibrant); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .brand { font-family: var(--font); }
h1 { font-size: 32px; line-height: 1.25; letter-spacing: -1.1px; font-weight: 750; color: var(--ink); }
h2 { font-size: 17px; letter-spacing: -0.4px; font-weight: 750; color: var(--ink); }
h3 { font-size: 15px; color: var(--ink); }
svg { vertical-align: middle; flex-shrink: 0; }

input, select, textarea {
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 11px 12px;
    width: 100%;
    outline: none;
    transition: border-color 0.18s var(--ease-smooth), box-shadow 0.18s var(--ease-smooth), background-color 0.18s var(--ease-smooth);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--royal-vibrant);
    box-shadow: 0 0 0 3px var(--royal-glow);
}
input::placeholder, textarea::placeholder { color: #8c86a6; }
textarea { resize: vertical; line-height: 1.65; }
label { display: block; font-size: 13px; font-weight: 600; margin: 18px 0 8px; color: var(--ink-secondary); }
form > label:first-child { margin-top: 0; }
small, .small { font-size: 12px; }
code, .mono { font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 11px; }
.muted { color: var(--muted); }
.green-text, .royal-text { color: var(--royal-vibrant); }
.eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: var(--royal);
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* Application Shell & Sidebar */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 242px;
    background: var(--white);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 28px 18px 0;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    overflow-y: auto;
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1.5px;
    padding: 0 9px;
    margin-bottom: 30px;
    color: var(--ink);
}
.brand-dot { margin-left: -9px; color: var(--royal-vibrant); }
.brand-mark {
    background: linear-gradient(135deg, var(--royal-vibrant) 0%, var(--royal-deep) 100%);
    color: #f5f3ff;
    font-size: 28px;
    font-style: italic;
    font-family: Georgia, serif;
    font-weight: bold;
    width: 34px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    line-height: 1;
    padding-right: 3px;
}
.workspace-label {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    background: var(--surface-subtle);
    padding: 11px 9px;
    border-radius: 8px;
    margin: 0 3px 28px;
    font-size: 11px;
}
.workspace-label > div { flex: 1; min-width: 0; }
.workspace-label strong { font-size: 11px; color: var(--ink); }
.workspace-label small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.workspace-avatar {
    display: grid;
    place-items: center;
    width: 29px;
    height: 30px;
    background: var(--royal-tint);
    color: var(--royal-deep);
    border: 1px solid var(--royal-border);
    border-radius: 7px;
    font-weight: 700;
}
.nav-caption {
    font-size: 9px;
    color: #847ea0;
    letter-spacing: 1.2px;
    padding: 0 13px;
    margin: 23px 0 12px;
}
.sidebar > .nav-caption { margin-top: 0; }
.sidebar nav > a {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--muted);
    padding: 11px 13px;
    margin: 3px 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}
.sidebar nav > a:hover { background: var(--royal-soft); color: var(--ink); }
.sidebar nav > a.active {
    background: var(--royal-tint);
    color: var(--royal-deep);
    font-weight: 700;
}
.sidebar nav svg { width: 17px; height: 17px; }
.tiny-label {
    margin-left: auto;
    background: var(--royal-tint);
    color: var(--royal-deep);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9px;
    font-weight: 700;
}
.sidebar-bottom { margin-top: auto; padding-top: 20px; }
.assistant-mini {
    display: block;
    padding: 17px;
    background: linear-gradient(135deg, var(--royal-soft) 0%, var(--royal-tint) 100%);
    border: 1px solid var(--royal-border);
    border-radius: 10px;
    margin-bottom: 21px;
}
.assistant-mini .ai-icon { margin-bottom: 10px; width: 30px; height: 30px; border-radius: 8px; }
.assistant-mini strong { display: block; font-size: 11px; color: var(--royal-deep); }
.assistant-mini p { color: var(--muted); font-size: 10px; margin: 5px 0 14px; }
.assistant-mini > span:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--royal);
    font-size: 10px;
    font-weight: 600;
}
.profile {
    display: flex;
    align-items: center;
    gap: 9px;
    border-top: 1px solid var(--line);
    padding: 19px 1px;
}
.profile > div { flex: 1; min-width: 0; }
.profile strong { font-size: 11px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile small { font-size: 9px; color: var(--muted); }
.avatar {
    display: inline-grid;
    place-items: center;
    width: 33px;
    height: 33px;
    background: var(--royal-tint);
    color: var(--royal-deep);
    font-size: 11px;
    border-radius: 50%;
    font-weight: 600;
    flex-shrink: 0;
}
.small-avatar { width: 26px; height: 26px; font-size: 9px; }
.avatar.lavender { background: #ede9fe; color: #5b21b6; }
.avatar.peach { background: #fef3c7; color: #92400e; }
.avatar.mint { background: #ecfdf5; color: #047857; }

/* Main Content & Topbar */
.main-shell {
    margin-left: 242px;
    width: calc(100% - 242px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.topbar {
    height: 70px;
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
}
.breadcrumb { display: flex; gap: 12px; align-items: center; font-size: 11px; color: var(--muted); }
.breadcrumb strong { color: var(--ink); font-size: 11px; font-weight: 600; }
.crumb-slash { color: var(--line-strong); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.connection { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.connection i { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); position: relative; flex-shrink: 0; }
.connection i.offline { background: #9490ab; }
.demo-badge {
    font-size: 9px;
    color: var(--royal-deep);
    padding: 4px 8px;
    background: var(--royal-soft);
    border: 1px solid var(--royal-border);
    border-radius: 6px;
}
main#main-content {
    padding: 34px 36px 42px;
    max-width: 1670px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 29px;
}
.page-heading p { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Buttons & Controls */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    font-size: 11px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-weight: 600;
    background: var(--white);
    color: var(--ink);
    white-space: nowrap;
    transition: background 0.18s var(--ease-smooth), border-color 0.18s var(--ease-smooth), transform 0.18s var(--ease-spring), box-shadow 0.18s var(--ease-smooth);
}
.button:hover { background: var(--royal-soft); border-color: var(--royal-border); }
.button.primary {
    background: linear-gradient(180deg, var(--royal-vibrant) 0%, var(--royal) 100%);
    border-color: var(--royal-deep);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(91, 33, 182, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.button.primary:hover {
    background: linear-gradient(180deg, var(--royal) 0%, var(--royal-hover) 100%);
    border-color: var(--royal-hover);
}
.button.light {
    background: var(--white);
    border-color: var(--royal-border);
    color: var(--royal-deep);
}
.button.light:hover { background: var(--royal-soft); }
.button.small { padding: 6px 10px; font-size: 10px; }
.button.full { width: 100%; margin-top: 20px; }
.icon-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: inline-grid;
    place-items: center;
    padding: 7px;
    border-radius: 7px;
    transition: background 0.18s var(--ease-smooth), color 0.18s var(--ease-smooth), transform 0.18s var(--ease-spring);
}
.icon-button:hover { background: var(--royal-soft); color: var(--royal-deep); }
.button-row { display: flex; gap: 8px; align-items: center; }

/* Metrics & Overview Cards */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 24px; }
.metric-card {
    padding: 18px 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--royal-shadow);
}
.metric-label {
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
}
.metric-icon {
    color: var(--royal);
    background: var(--royal-soft);
    border-radius: 7px;
    padding: 6px;
    display: flex;
}
.metric-icon svg { width: 15px; height: 15px; }
.metric-icon.royal { background: var(--royal-tint); color: var(--royal-deep); }
.metric-icon.indigo { background: var(--indigo-bg); color: var(--indigo-ink); }
.metric-icon.amber { background: var(--amber-bg); color: var(--amber-ink); }
.metric-icon.sage { background: var(--emerald-bg); color: var(--emerald-ink); }
.metric-value {
    font-family: var(--font);
    font-weight: 750;
    font-size: 34px;
    letter-spacing: -1px;
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin: 7px 0 10px;
}
.metric-suffix { font-family: var(--font); font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.metric-note { font-size: 9px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.green { background: var(--emerald); }
.royal-dot { background: var(--royal-vibrant); }
.amber-dot { background: var(--amber); }

/* Panels & Activity Bar Chart */
.overview-middle { display: grid; grid-template-columns: 1.85fr 1fr; gap: 23px; margin-bottom: 25px; }
.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--royal-shadow);
}
.padded { padding: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; }
.panel-heading p { font-size: 10px; color: var(--muted); margin-top: 5px; }
.subtle-pill {
    font-size: 10px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface-subtle);
}
.chart-legend { display: flex; gap: 17px; margin-left: 25px; font-size: 9px; color: var(--muted); }
.chart-legend > span { display: flex; gap: 5px; align-items: center; }
.legend-dot { width: 7px; height: 7px; display: inline-block; border-radius: 2px; }
.chart-legend .legend-dot.green, .legend-dot.created-dot { background: var(--royal-vibrant); }
.pale { background: #c4b5fd; }
.bar-chart {
    display: flex;
    gap: 5%;
    height: 180px;
    padding: 20px 30px 25px;
    margin: 0 18px 18px;
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(to top, transparent 0, transparent 35px, #f1effa 36px, transparent 37px);
}
.chart-day { height: 100%; flex: 1; display: flex; position: relative; justify-content: center; }
.bar-pair { height: 100%; width: 100%; display: flex; gap: 5px; align-items: flex-end; max-width: 38px; }
.bar { width: 50%; min-height: 2px; border-radius: 4px 4px 0 0; position: relative; }
.bar.created { background: linear-gradient(180deg, var(--royal-vibrant) 0%, var(--royal-deep) 100%); }
.bar.resolved { background: #ddd6fe; }
.bar span {
    opacity: 0;
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 22px;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    pointer-events: none;
    transition: opacity 0.15s var(--ease-smooth), transform 0.15s var(--ease-spring);
}
.bar:hover span { opacity: 1; }
.day-label { position: absolute; bottom: -25px; font-size: 9px; color: var(--muted); }

/* AI Insight Card */
.insight-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--royal-border);
    border-radius: 12px;
    padding: 25px 27px;
    background: radial-gradient(ellipse at 100% 0%, #ddd6fe 0%, transparent 68%), linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
}
.insight-card:after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: 50%;
    right: -100px;
    top: 80px;
    pointer-events: none;
}
.insight-label {
    display: flex;
    gap: 8px;
    align-items: center;
    letter-spacing: 1.4px;
    font-size: 9px;
    font-weight: 700;
    color: var(--royal-deep);
    margin-bottom: 15px;
}
.insight-card h2 { font-size: 24px; line-height: 1.25; letter-spacing: -0.7px; color: #1e1040; }
.insight-card p { font-size: 11px; line-height: 1.65; color: #4c436b; margin-top: 12px; max-width: 290px; }
.insight-stat { display: flex; gap: 12px; align-items: center; margin: 14px 0; }
.insight-stat strong { font-size: 30px; color: var(--royal-deep); line-height: 1; }
.insight-stat span { font-size: 9px; color: #5b517a; line-height: 1.5; }
.insight-card .button { font-size: 10px; padding: 8px 12px; }

/* Tables, Badges & SLAs */
.count-badge {
    font-size: 10px;
    font-family: var(--font);
    background: var(--royal-soft);
    color: var(--royal-deep);
    padding: 3px 7px;
    margin-left: 6px;
    border: 1px solid var(--royal-border);
    border-radius: 5px;
    vertical-align: middle;
}
.text-link {
    font-size: 10px;
    font-weight: 600;
    color: var(--royal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s var(--ease-smooth);
}
.text-link:hover { color: var(--royal-hover); }
.table-scroll { overflow: auto; }
.ticket-table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; }
.ticket-table th {
    font-size: 9px;
    letter-spacing: 0.15px;
    color: var(--muted);
    font-weight: 600;
    background: var(--surface-subtle);
    padding: 12px 15px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.ticket-table th:first-child, .ticket-table td:first-child { padding-left: 24px; }
.ticket-table td { padding: 16px 15px; border-bottom: 1px solid #eeecf7; font-size: 11px; }
.ticket-table tbody tr:last-child td { border-bottom: none; }
.ticket-table tbody tr:hover { background: var(--royal-soft); }
.ticket-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s var(--ease-smooth);
}
.ticket-title:hover { color: var(--royal); }
.ticket-meta { display: flex; gap: 7px; align-items: center; font-size: 9px; color: var(--muted); margin-top: 5px; }
.ticket-meta .mono { font-size: 9px; }
.source-icon { display: flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--muted); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    line-height: 1.4;
    padding: 4px 7px;
    border-radius: 5px;
    background: var(--surface-subtle);
    color: var(--muted);
    white-space: nowrap;
}
.badge.status:before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge.new { background: var(--indigo-bg); color: var(--indigo-ink); }
.badge.inprogress { background: var(--amber-bg); color: var(--amber-ink); }
.badge.waitingoncustomer { background: var(--royal-soft); color: var(--royal-deep); }
.badge.resolved, .badge.closed { background: var(--emerald-bg); color: var(--emerald-ink); }
.badge.priority { background: transparent; padding-left: 0; font-size: 9px; color: var(--muted); }
.badge.priority:before {
    content: '';
    height: 8px;
    width: 3px;
    background: currentColor;
    box-shadow: 4px -2px 0 currentColor;
    margin-right: 7px;
}
.badge.critical { color: var(--rose-ink); }
.badge.high { color: var(--amber-ink); }
.badge.normal { color: var(--royal); }
.badge.low { color: #7a7496; }

.person { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-secondary); font-size: 10px; }
.sla { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 9px; color: var(--muted); }
.sla.met { color: var(--emerald-ink); }
.sla.late { color: var(--rose-ink); }
.sla.soon { color: var(--amber-ink); }
.row-arrow { color: #9c96b8; display: inline-flex; }

/* Queue Tabs, Filter Bar & Empty States */
.queue-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding: 0 24px; }
.queue-tabs > button {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 18px 0;
    font-size: 11px;
    color: var(--muted);
    transition: color 0.18s var(--ease-smooth), border-color 0.18s var(--ease-smooth);
}
.queue-tabs > button:hover { color: var(--ink); }
.queue-tabs > button.active {
    color: var(--royal);
    border-bottom-color: var(--royal-vibrant);
    font-weight: 700;
}
.queue-tabs button span {
    background: var(--royal-tint);
    color: var(--royal-deep);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}
.filter-bar { display: flex; gap: 10px; padding: 18px 24px; }
.search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line-strong);
    background: var(--white);
    border-radius: 8px;
    padding: 0 8px 0 12px;
    flex: 1;
    color: var(--muted);
    transition: border-color 0.18s var(--ease-smooth), box-shadow 0.18s var(--ease-smooth);
}
.search-input:focus-within {
    border-color: var(--royal-vibrant);
    box-shadow: 0 0 0 3px var(--royal-glow);
}
.search-input input { border: 0; box-shadow: none; font-size: 11px; padding: 9px 0; min-width: 120px; }
.search-input input:focus { border: 0; box-shadow: none; }
.filter-bar select { font-size: 10px; width: auto; max-width: 190px; padding: 9px 25px 9px 10px; }
.table-footer {
    padding: 15px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
}
.empty-state {
    padding: 45px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: var(--muted);
}
.empty-state strong { font-size: 14px; color: var(--ink-secondary); }
.empty-state span { font-size: 11px; }

/* Notices & Forms */
.notice {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    border-radius: 8px;
    padding: 13px 16px;
    margin-bottom: 20px;
    border: 1px solid;
}
.notice.error { color: var(--rose-ink); background: var(--rose-bg); border-color: var(--rose-border); }
.notice.success { color: var(--emerald-ink); background: var(--emerald-bg); border-color: var(--emerald-border); }
.notice.info { color: var(--royal-deep); background: var(--royal-soft); border-color: var(--royal-border); }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 11px; color: var(--royal); font-weight: 600; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(230px, 1fr); gap: 40px; max-width: 1060px; }
.form-aside { padding: 25px 8px; color: var(--muted); }
.form-aside h2 { font-size: 23px; margin: 18px 0 12px; color: var(--royal-deep); }
.form-aside p { font-size: 12px; line-height: 1.8; }
.ai-icon {
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    background: var(--royal-tint);
    color: var(--royal-deep);
    border-radius: 9px;
}
.ai-icon.large { width: 48px; height: 48px; border-radius: 14px; }
.benefit-list { padding: 0; list-style: none; margin: 25px 0; }
.benefit-list li { display: flex; align-items: center; gap: 9px; margin: 16px 0; font-size: 11px; color: var(--ink-secondary); }
.benefit-list li svg { color: var(--royal-vibrant); }
.quiet-box { background: var(--surface-subtle); color: var(--muted); padding: 17px; border-radius: 8px; font-size: 11px; line-height: 1.7; border: 1px solid var(--line); }
.field-hint { color: var(--muted); font-size: 10px; margin: 7px 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

/* Ticket Detail & Conversation */
.ticket-heading { margin: 0 0 28px; }
.ticket-heading h1 { font-size: 28px; max-width: 950px; margin: 14px 0 16px; }
.ticket-heading-meta { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 11px; }
.ticket-heading-meta .badge { font-size: 10px; }
.ai-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    background: var(--royal-tint);
    color: var(--royal-deep);
    border-radius: 5px;
    font-weight: 600;
}
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; }
.detail-main { display: flex; flex-direction: column; gap: 22px; }
.detail-main .notice { margin: 0; }
.body-copy {
    white-space: pre-wrap;
    line-height: 1.85;
    font-size: 12px;
    color: var(--ink-secondary);
    margin-top: 14px;
    overflow-wrap: anywhere;
}
.requester { margin-top: 20px; }
.detail-list { margin: 20px 0; }
.detail-list dt { font-size: 10px; color: var(--muted); margin-top: 17px; }
.detail-list dd { margin: 5px 0 0; font-size: 12px; color: var(--ink-secondary); }
.detail-list dd small { display: block; font-size: 9px; margin-top: 4px; color: var(--muted); }
.detail-sidebar input, .detail-sidebar select, .detail-sidebar textarea { font-size: 11px; padding: 10px; }
.detail-sidebar label { font-size: 10px; color: var(--muted); }
.diagnostic-link { margin-top: 12px !important; }
.conversation { padding: 0 24px 24px; }
.comment { display: flex; gap: 11px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment > div { flex: 1; min-width: 0; }
.comment-heading { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.comment-heading strong { font-size: 11px; }
.comment-heading time { font-size: 9px; color: var(--muted); margin-left: auto; }
.comment.internal { background: #fefce8; border: 1px solid #fde68a; border-radius: 8px; padding: 15px; margin-top: 12px; }
.comment .body-copy { margin-top: 8px; }
.reply-form { border-top: 1px solid var(--line); padding: 20px 24px; background: var(--surface-subtle); }
.reply-form label { font-size: 11px; margin-top: 0; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.checkbox-label { display: flex; gap: 8px; align-items: center; font-size: 10px !important; color: var(--muted); margin: 0 !important; }
.checkbox-label input { width: auto; accent-color: var(--royal); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}
.time-row small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.time-form { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; align-items: end; }
.time-form input { font-size: 11px; }
.time-form label { font-size: 10px; }
.solution-card {
    background: var(--emerald-bg);
    border: 1px solid var(--emerald-border);
    border-radius: 10px;
    padding: 22px;
}
.solution-card h3 { display: flex; align-items: center; gap: 9px; color: var(--emerald-ink); }
.solution-card .body-copy { color: #1e3a2f; }
.app-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 36px 23px;
    font-size: 9px;
    color: var(--muted);
}
.app-footer a { color: var(--royal); font-weight: 600; }

/* Authentication & Story Screen */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-story {
    padding: 55px 12%;
    background: radial-gradient(circle at 15% 15%, #ede9fe 0%, transparent 55%),
                radial-gradient(circle at 90% 85%, #ddd6fe 0%, transparent 50%),
                linear-gradient(155deg, #f5f3ff 0%, #ede9fe 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.login-story .brand { padding: 0; margin-bottom: 70px; position: relative; z-index: 2; }
.login-story .eyebrow { color: var(--royal-deep); position: relative; z-index: 2; }
.login-story h1 {
    font-size: 54px;
    line-height: 1.12;
    color: #1a103d;
    letter-spacing: -2.2px;
    font-weight: 750;
    position: relative;
    z-index: 2;
}
.login-story em { font-style: normal; color: var(--royal-vibrant); }
.login-story p {
    margin: 25px 0;
    color: #4c446d;
    max-width: 380px;
    font-size: 13px;
    line-height: 1.8;
    position: relative;
    z-index: 2;
}
.login-story > small {
    color: #655d87;
    font-size: 10px;
    margin-top: auto;
    padding-top: 210px;
    position: relative;
    z-index: 2;
}
.login-decoration {
    position: absolute;
    width: 290px;
    height: 290px;
    bottom: -14px;
    right: -14px;
    z-index: 1;
}
.orbit {
    position: absolute;
    border: 1px solid rgba(109, 40, 217, 0.22);
    border-radius: 50%;
    inset: 0;
}
.orbit.two { inset: 32px; border-style: dashed; border-color: rgba(124, 58, 237, 0.28); }
.orbit.three { inset: 64px; border-color: rgba(109, 40, 217, 0.34); }
.orbit-center {
    position: absolute;
    inset: 98px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border-radius: 50%;
    color: #ffffff;
    box-shadow: 0 12px 32px rgba(91, 33, 182, 0.32), 0 0 0 8px rgba(124, 58, 237, 0.12);
}
.floating-tag {
    position: absolute;
    left: -34px;
    top: 76px;
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid var(--royal-border);
    box-shadow: 0 8px 24px rgba(91, 33, 182, 0.14);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--royal-deep);
    font-size: 12px;
    font-weight: 600;
    transform: rotate(-6deg);
}
.login-form-wrap { display: grid; place-items: center; padding: 50px; background: var(--white); }
.login-form { width: 100%; max-width: 390px; }
.login-form h2 { font-size: 32px; margin: 10px 0; letter-spacing: -1px; }
.login-form > p { font-size: 12px; }
.login-form form { margin: 28px 0 20px; }
.login-form label { font-size: 11px; }
.login-form input { font-size: 12px; padding: 13px; }
.demo-login {
    border: 1px solid var(--royal-border);
    background: var(--royal-soft);
    border-radius: 12px;
    padding: 16px;
    margin: 24px 0;
}
.demo-login strong { font-size: 11px; color: var(--royal-deep); }
.demo-login p { font-size: 10px; line-height: 2; margin-top: 8px; color: var(--muted); }
.demo-login code {
    font-size: 10px;
    color: var(--royal-deep);
    background: var(--white);
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--royal-border);
}

/* Error Banner, Cards, Admin Tables & AI Assistant */
.loading-state { text-align: center; padding: 80px; color: var(--muted); }
#blazor-error-ui {
    background: var(--amber-bg);
    color: var(--amber-ink);
    border-top: 1px solid var(--amber-border);
    bottom: 0;
    box-shadow: 0 -4px 16px rgba(15, 13, 28, 0.08);
    display: none;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 15px; top: 10px; }
.validation-message { color: var(--rose-ink); font-size: 11px; }
.list-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.section-intro { max-width: 650px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.code-block {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--surface-subtle);
    color: var(--ink-secondary);
    border: 1px solid var(--line);
    font: 11px/1.8 'Cascadia Code', 'Consolas', monospace;
    padding: 16px;
    border-radius: 8px;
    max-height: 400px;
    overflow: auto;
}
.danger-text { color: var(--rose-ink); }
.problem-card { padding: 23px; }
.problem-card h2 { font-size: 17px; margin: 16px 0 10px; }
.problem-card p { font-size: 12px; color: var(--muted); line-height: 1.8; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
.linked-tickets { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.linked-tickets a {
    font-family: 'Cascadia Code', Consolas, monospace;
    font-size: 10px;
    background: var(--royal-soft);
    color: var(--royal-deep);
    border: 1px solid var(--royal-border);
    padding: 5px 8px;
    border-radius: 6px;
    transition: background 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth);
}
.linked-tickets a:hover { background: var(--royal-tint); border-color: #c4b5fd; }
.card-footer {
    border-top: 1px solid var(--line);
    margin-top: 20px;
    padding-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}
.card-footer select { font-size: 10px; padding: 7px; width: auto; }
.plugin-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    color: var(--royal-deep);
    background: var(--royal-tint);
    margin-bottom: 18px;
}
.plugin-card h2 { font-size: 16px; }
.plugin-card p { font-size: 11px; color: var(--muted); min-height: 50px; margin: 10px 0 20px; }
.plugin-card input { font-size: 11px; }
.plugin-card .button { width: 100%; margin-top: 12px; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.data-table th {
    text-align: left;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    background: var(--surface-subtle);
    padding: 12px 20px;
}
.data-table td { border-top: 1px solid var(--line); padding: 15px 20px; color: var(--muted); }
.data-table td strong { font-size: 12px; color: var(--ink); font-weight: 600; }
.data-table td small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.settings-sections { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.setting-toggle {
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.setting-toggle label { margin: 0; }
.setting-toggle p { font-size: 10px; color: var(--muted); margin-top: 4px; }
.setting-toggle input { accent-color: var(--royal); width: 17px; height: 17px; }
.settings-sections label { font-size: 11px; }
.settings-sections input { font-size: 12px; }
.settings-sections h2 { margin-bottom: 15px; }

/* AI Chat & Composer */
.chat-layout { max-width: 900px; margin: 0 auto; }
.chat-welcome { text-align: center; padding: 28px 20px 40px; }
.chat-welcome .ai-icon { margin: 0 auto 18px; }
.chat-welcome h2 { font-size: 27px; }
.chat-welcome p { font-size: 12px; color: var(--muted); max-width: 450px; margin: 12px auto 25px; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; margin: 20px 0; }
.prompt-card {
    border: 1px solid var(--line);
    background: var(--white);
    border-radius: 12px;
    padding: 18px;
    color: var(--ink-secondary);
    text-align: left;
    font-size: 11px;
    line-height: 1.7;
}
.prompt-card svg { display: block; margin-bottom: 12px; color: var(--royal-vibrant); }
.prompt-card:hover { background: var(--royal-soft); border-color: var(--royal-border); }
.chat-messages { display: flex; flex-direction: column; gap: 22px; margin-bottom: 25px; }
.chat-message { display: flex; gap: 12px; }
.chat-message > div:last-child { flex: 1; min-width: 0; }
.chat-message h3 { font-size: 11px; margin: 0 0 7px; color: var(--muted); }
.chat-message p { font-size: 12px; line-height: 1.9; white-space: pre-wrap; color: var(--ink-secondary); }
.chat-message.user {
    background: var(--royal-soft);
    border: 1px solid var(--royal-border);
    padding: 20px;
    border-radius: 12px;
}
.chat-composer {
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 6px 20px rgba(91, 33, 182, 0.06);
    transition: border-color 0.18s var(--ease-smooth), box-shadow 0.18s var(--ease-smooth);
}
.chat-composer:focus-within {
    border-color: var(--royal-vibrant);
    box-shadow: 0 0 0 3px var(--royal-glow), 0 8px 24px rgba(91, 33, 182, 0.10);
}
.chat-composer textarea { border: 0; box-shadow: none; padding: 4px; min-height: 70px; font-size: 12px; resize: vertical; }
.chat-composer textarea:focus { border: 0; box-shadow: none; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.composer-bottom span { color: var(--muted); font-size: 10px; }
.proposal {
    background: var(--royal-soft);
    border: 1px solid var(--royal-border);
    border-radius: 10px;
    padding: 16px;
    margin-top: 15px;
}
.proposal h4 { margin: 0; color: var(--royal-deep); font-size: 11px; }
.proposal pre { max-height: 180px; overflow: auto; font-size: 10px; white-space: pre-wrap; color: var(--ink-secondary); }
.tool-chip {
    font-family: 'Cascadia Code', Consolas, monospace;
    font-size: 9px;
    background: var(--royal-tint);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--royal-deep);
    display: inline-block;
    margin: 8px 5px 0 0;
}
.scroll-output { max-height: 400px; overflow: auto; }
.pagination-note { font-size: 10px; color: var(--muted); }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--royal-deep); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

/* Responsive Breakpoints */
@media (min-width: 1500px) {
    main#main-content { padding: 42px 50px; }
    .topbar { padding: 0 50px; }
    .ticket-table td { padding-top: 19px; padding-bottom: 19px; }
    .metric-card { padding: 22px 24px; }
    .bar-chart { height: 205px; }
    .overview-middle { grid-template-columns: 2fr 1fr; }
}
@media (max-width: 1200px) {
    .sidebar { width: 210px; padding-left: 12px; padding-right: 12px; }
    .main-shell { margin-left: 210px; width: calc(100% - 210px); }
    main#main-content { padding: 28px 24px; }
    .topbar { padding: 0 24px; }
    .metric-grid { gap: 10px; }
    .metric-card { padding: 15px; }
    .metric-suffix { display: none; }
    .metric-note { font-size: 8px; }
    .list-card-grid { grid-template-columns: repeat(2, 1fr); }
    .overview-middle { grid-template-columns: 1.6fr 1fr; }
    .detail-layout { grid-template-columns: minmax(0, 1fr) 250px; }
    .padded { padding: 20px; }
    .admin-layout { grid-template-columns: 1fr; }
    .login-story h1 { font-size: 46px; }
    .ticket-title { max-width: 280px; }
    .filter-bar { flex-wrap: wrap; }
    .search-input { min-width: 200px; }
    .source-icon { display: none; }
}
@media (max-width: 900px) {
    .sidebar { width: 76px; padding: 23px 10px; }
    .brand { font-size: 0; padding: 0; justify-content: center; gap: 0; margin-bottom: 30px; }
    .brand-mark { font-size: 28px; }
    .brand-dot, .workspace-label, .nav-caption, .sidebar nav > a > .tiny-label, .assistant-mini, .profile > div, .profile > form { display: none; }
    .sidebar nav > a { font-size: 0; gap: 0; justify-content: center; padding: 14px 10px; }
    .sidebar nav svg { width: 20px; height: 20px; }
    .sidebar nav .nav-caption { display: none; }
    .profile { justify-content: center; }
    .main-shell { margin-left: 76px; width: calc(100% - 76px); }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .metric-suffix { display: block; }
    .overview-middle { grid-template-columns: 1fr; }
    .insight-card { display: none; }
    .page-heading h1 { font-size: 27px; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { order: -1; }
    .detail-sidebar form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
    .detail-sidebar form label { margin: 0; }
    .detail-sidebar .detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
    .form-layout { grid-template-columns: 1fr; }
    .form-aside { display: none; }
    .settings-sections { grid-template-columns: 1fr; }
    .login-story { padding: 45px 10%; }
    .login-story h1 { font-size: 40px; }
    .login-story .brand { font-size: 28px; justify-content: flex-start; gap: 9px; }
    .login-form-wrap { padding: 30px; }
    .breadcrumb strong { display: none; }
}
@media (max-width: 600px) {
    .topbar { padding: 0 18px; height: 58px; }
    .topbar-right .connection { display: none; }
    main#main-content { padding: 23px 16px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
    .page-heading h1 { font-size: 25px; }
    .page-heading p { font-size: 11px; }
    .eyebrow { font-size: 8px; }
    .metric-grid { gap: 9px; }
    .metric-card { padding: 13px; }
    .metric-label { font-size: 10px; }
    .metric-icon { display: none; }
    .metric-value { font-size: 27px; }
    .metric-suffix { display: none; }
    .metric-note { font-size: 8px; }
    .list-card-grid { grid-template-columns: 1fr; }
    .queue-tabs { gap: 15px; overflow: auto; padding: 0 16px; }
    .queue-tabs > button { white-space: nowrap; font-size: 10px; }
    .filter-bar { padding: 15px; }
    .filter-bar select { flex: 1; max-width: 100%; }
    .search-input { min-width: 100%; }
    .panel-heading { padding: 18px; }
    .panel-heading h2 { font-size: 15px; }
    .panel-heading p { font-size: 9px; }
    .text-link { font-size: 9px; }
    .table-footer { padding: 12px; }
    .app-footer { padding: 15px; font-size: 8px; }
    .app-footer > span { display: none; }
    .field-grid { grid-template-columns: 1fr; gap: 0; }
    .time-form { grid-template-columns: 70px 1fr; }
    .time-form button { grid-column: 1 / -1; }
    .ticket-heading h1 { font-size: 23px; }
    .ticket-heading-meta { flex-wrap: wrap; gap: 9px; }
    .reply-actions { flex-direction: column; align-items: flex-start; }
    .auth-shell { grid-template-columns: 1fr; }
    .login-story { padding: 30px; }
    .login-story .brand { margin-bottom: 30px; }
    .login-story h1 { font-size: 35px; }
    .login-story h1 br { display: none; }
    .login-story h1 em { display: inline-block; }
    .login-story p, .login-story > small, .login-decoration { display: none; }
    .login-form-wrap { padding: 30px; }
    .prompt-grid { grid-template-columns: 1fr; }
    .prompt-card { padding: 14px; }
    .prompt-card svg { display: inline-block; margin: 0 10px 0 0; }
    .chat-welcome { padding: 10px; }
    .chat-welcome h2 { font-size: 23px; }
    .composer-bottom span { max-width: 150px; }
    .detail-sidebar form { grid-template-columns: 1fr; }
    .detail-sidebar form label { margin-top: 10px; }
}

/* Searchable Select Dropdowns (lists with five or more choices throughout the workspace) */
.search-select { position: relative; min-width: 0; width: 100%; }
.search-select.open { z-index: 61; }
.select-trigger {
    font: inherit;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 11px 12px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    transition: border-color 0.18s var(--ease-smooth), box-shadow 0.18s var(--ease-smooth), background 0.18s var(--ease-smooth);
}
.select-trigger:hover { border-color: #b4add4; }
.select-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-chevron {
    color: var(--muted);
    font-size: 15px;
    line-height: 1;
    transition: transform 0.22s var(--ease-spring), color 0.18s var(--ease-smooth);
}
.select-trigger[aria-expanded=true] {
    border-color: var(--royal-vibrant);
    box-shadow: 0 0 0 3px var(--royal-glow);
}
.select-trigger[aria-expanded=true] .select-chevron {
    transform: rotate(180deg);
    color: var(--royal-vibrant);
}
.select-backdrop { position: fixed; inset: 0; z-index: 60; border: 0; background: transparent; cursor: default; }
.select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: min(420px, 80vw);
    background: var(--white);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(27, 16, 61, 0.14), 0 2px 6px rgba(15, 13, 28, 0.05);
    overflow: hidden;
    z-index: 62;
    transform-origin: top left;
}
.select-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}
.select-search input {
    border: 0 !important;
    box-shadow: none !important;
    padding: 6px 0 !important;
    font-size: 12px !important;
    width: 100%;
    min-width: 100px;
}
.select-options { max-height: 250px; overflow-y: auto; padding: 5px; }
.select-option {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    background: var(--white);
    text-align: left;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--ink-secondary);
    transition: background 0.14s var(--ease-smooth), color 0.14s var(--ease-smooth);
}
.select-option:hover, .select-option.highlighted { background: var(--royal-soft); color: var(--royal-deep); }
.select-option[aria-selected=true] { color: var(--royal); font-weight: 700; }
.select-empty { padding: 20px; font-size: 12px; color: var(--muted); text-align: center; }
.select-hint {
    border-top: 1px solid var(--line);
    font-size: 9px;
    color: var(--muted);
    padding: 8px 12px;
    background: var(--surface-subtle);
}
.panel:has(.search-select.open) { overflow: visible; position: relative; z-index: 59; }
.filter-bar > .search-select { width: 150px; flex-shrink: 0; }
.filter-bar .select-trigger { font-size: 10px; padding: 9px 10px; }
.detail-sidebar .select-trigger { font-size: 11px; padding: 10px; }
.card-footer .search-select { width: 150px; }
.card-footer .select-trigger { font-size: 10px; padding: 7px; }
.select-trigger:focus-visible { outline: 2px solid var(--royal-vibrant); outline-offset: 2px; }
@media (max-width: 600px) {
    .filter-bar > .search-select { flex: 1; min-width: 120px; }
    .select-menu { max-width: calc(100vw - 130px); }
}

/* AI Agent Workspace & Incident Intake */
.agent-workspace { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.agent-workspace .chat-layout { width: 100%; min-width: 0; }
.recent-chats { position: sticky; top: 24px; }
.recent-chat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    margin-top: 8px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
    border: 1px solid transparent;
    transition: background 0.18s var(--ease-smooth), border-color 0.18s var(--ease-smooth), transform 0.18s var(--ease-spring);
}
.recent-chat:hover, .recent-chat.selected {
    background: var(--royal-soft);
    border-color: var(--royal-border);
}
.recent-chat.selected { font-weight: 600; color: var(--royal-deep); }
.recent-chat small { color: var(--muted); font-weight: 400; }
.agent-workspace .proposal { margin-bottom: 16px; }
.agent-workspace .proposal pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1000px) {
    .agent-workspace { grid-template-columns: 1fr; }
    .recent-chats { position: static; }
    .recent-chat { display: inline-flex; max-width: 240px; vertical-align: top; margin-right: 8px; }
}

.intake-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr); gap: 24px; align-items: start; }
.intake-steps { display: flex; align-items: center; gap: 20px; margin: 0 0 26px; color: var(--muted); font-size: 12px; }
.intake-steps .current {
    color: var(--royal-deep);
    font-weight: 700;
    background: var(--royal-tint);
    padding: 4px 10px;
    border-radius: 999px;
}
.intake-welcome { padding: 20px 0 28px; }
.intake-welcome h3 { font-size: 22px; margin: 18px 0 12px; }
.intake-welcome p { font-size: 13px; line-height: 1.8; color: var(--muted); max-width: 560px; }
.intake-conversation .chat-message p { color: var(--ink-secondary); font-size: 13px; }
.intake-review h2 { font-size: 20px; }
.intake-draft-title { font-size: 21px; line-height: 1.4; margin: 22px 0 16px; }
.intake-summary { margin: 22px 0; }
.intake-summary dt { font-size: 11px; color: var(--muted); margin-top: 18px; font-weight: 600; }
.intake-summary dd {
    font-size: 13px;
    line-height: 1.7;
    margin: 5px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--ink-secondary);
}
.intake-created h2 { margin: 20px 0 10px; }
.intake-created h3 { font-size: 20px; line-height: 1.5; margin: 15px 0; }
.intake-review .checkbox-label { align-items: flex-start; font-size: 12px; color: var(--ink-secondary); }
.intake-review .checkbox-label input { width: auto; flex-shrink: 0; accent-color: var(--royal); }
@media (max-width: 1050px) {
    .intake-layout { grid-template-columns: 1fr; }
    .intake-steps { gap: 10px; flex-wrap: wrap; }
}
