:root {
    --ink: #101827;
    --muted: #65758b;
    --line: #dce4ec;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --page: #eef3f7;
    --nav: #122033;
    --nav-2: #1b2b43;
    --teal: #087f8c;
    --teal-dark: #075e69;
    --blue: #2563eb;
    --gold: #d7a954;
    --green: #14804a;
    --red: #c93434;
    --orange: #c26a16;
    --shadow: 0 12px 28px rgba(16, 24, 39, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(238, 243, 247, 0.95)),
        var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--teal);
}

.topbar {
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    padding: 0 28px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 1px 0 rgba(16, 24, 39, 0.03);
}

.topbar::before {
    content: "";
    width: 10px;
    height: 28px;
    border-radius: 4px;
    background: var(--gold);
    margin-right: 12px;
}

.sidebar {
    top: 64px;
    width: 244px;
    height: calc(100vh - 64px);
    background: linear-gradient(180deg, var(--nav), var(--nav-2));
    padding: 22px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar h4 {
    margin: 4px 10px 16px;
    color: #9fb0c5;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.sidebar a {
    border-radius: var(--radius);
    color: #ecf3f8;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    padding: 10px 12px;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.main-content {
    margin-left: 244px;
    padding: 34px;
}

.page-header {
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h1 {
    color: var(--ink);
    font-size: 32px;
    line-height: 1.08;
}

.page-header p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    margin: 10px 0 0;
    max-width: 760px;
}

.btn-primary,
.btn-secondary,
.btn-danger,
button.btn-primary,
button.btn-secondary {
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 15px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.btn-primary {
    background: var(--teal);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(8, 127, 140, 0.2);
}

.btn-primary:hover {
    background: var(--teal-dark);
}

.btn-secondary {
    background: #e8edf2;
    color: var(--ink);
    margin-left: 0;
}

.btn-secondary:hover {
    background: #dce4ec;
}

.btn-danger {
    background: var(--red);
}

.dashboard-grid,
.client-stat-grid,
.analytics-grid,
.ticket-grid,
.client-detail-grid {
    gap: 16px;
}

.stat-card,
.analytics-card,
.ticket-card,
.admin-table-card,
.client-stat-card,
.client-panel,
.form-card,
.auth-card,
.notification-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card,
.analytics-card,
.ticket-card,
.client-stat-card,
.client-panel,
.form-card,
.admin-table-card {
    padding: 20px;
}

.stat-card h3,
.analytics-card h3,
.ticket-card h3,
.client-panel h2,
.admin-table-card h2 {
    color: var(--ink);
    letter-spacing: 0;
}

.stat-card h3,
.client-stat-card span,
.admin-table th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.stat-card p,
.client-stat-card strong {
    color: var(--ink);
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1;
}

.analytics-card {
    min-height: 300px;
}

.analytics-card canvas {
    max-height: 240px;
}

.admin-table th,
.admin-table td {
    padding: 14px 12px;
}

.admin-table tr:hover {
    background: #f4f8fa;
}

.table-action {
    color: var(--teal);
}

.badge,
.status-pill,
.filter-badge {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.badge.source.thnf {
    background: #f7ead0;
    color: #7a4d12;
}

.badge.source.go232go {
    background: #d9f0ef;
    color: #075e69;
}

.badge.status.open,
.status-pill.open {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.status.assigned,
.status-pill.assigned {
    background: #e0f2fe;
    color: #0369a1;
}

.badge.status.in_progress,
.status-pill.in_progress {
    background: #fef3c7;
    color: #92400e;
}

.badge.status.pending,
.status-pill.pending {
    background: #ffedd5;
    color: #c2410c;
}

.badge.status.resolved,
.badge.status.closed,
.status-pill.resolved,
.status-pill.closed {
    background: #dcfce7;
    color: #166534;
}

.status-pill.new {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-pill.reviewing {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.approved {
    background: #dcfce7;
    color: #166534;
}

.status-pill.rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.form-card {
    max-width: 760px;
}

.form-card label,
.form-group label {
    color: var(--ink);
    font-size: 13px;
}

.form-card input,
.form-card select,
.form-card textarea,
.form-group input,
.form-group select,
.form-group textarea {
    border-color: #b9c7d5;
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.14);
}

.client-ui-body {
    background:
        linear-gradient(180deg, #f8fbfc 0%, #eef3f7 40%, #e8eef4 100%);
}

.client-topbar {
    min-height: 72px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(16, 24, 39, 0.03);
    padding: 0 34px;
}

.client-brand {
    color: var(--ink);
    font-size: 16px;
    gap: 12px;
}

.client-brand::before {
    content: "";
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, var(--teal), #37a79d 52%, var(--gold) 53%);
    box-shadow: 0 8px 18px rgba(8, 127, 140, 0.18);
}

.client-brand img {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

.client-brand:has(img)::before {
    display: none;
}

.client-nav {
    gap: 4px;
}

.client-nav a {
    color: #42536a;
    border-radius: var(--radius);
}

.client-nav a:hover {
    background: #e8f3f3;
    color: var(--teal-dark);
}

.client-main {
    width: min(1160px, calc(100% - 48px));
    padding: 38px 0 56px;
}

.client-main .page-header {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.client-main .page-header h1 {
    font-size: clamp(30px, 4vw, 44px);
}

.client-portal-band {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
}

.client-portal-intro {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.client-portal-intro h2 {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.12;
}

.section-eyebrow {
    color: var(--teal-dark);
}

.client-request-row,
.client-action-list a {
    background: #f8fbfc;
    border-radius: var(--radius);
}

.client-request-row:hover,
.client-action-list a:hover {
    border-color: #8bbec0;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 22px;
    }

    .topbar {
        height: auto;
        min-height: 60px;
    }
}

@media (max-width: 760px) {
    .page-header {
        flex-direction: column;
    }

    .client-topbar {
        padding: 16px 18px;
    }

    .client-nav {
        gap: 2px 8px;
    }

    .client-main {
        width: min(100% - 28px, 1160px);
    }

    .admin-table-card {
        padding: 12px;
    }
}

/* Product UI overhaul: TicketDesk staff cockpit and TicketDesk Client. */
:root {
    --shadow-strong: 0 18px 45px rgba(16, 24, 39, 0.14);
}

.staff-ui-body {
    background:
        linear-gradient(180deg, #fbfcfe 0%, #edf4f7 44%, #f8fbfc 100%);
}

.topbar {
    height: 68px;
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 64%, #effaf8 100%);
    justify-content: space-between;
    padding: 0 30px;
}

.topbar::before {
    display: none;
}

.topbar-brand,
.topbar-meta {
    align-items: center;
    display: flex;
}

.topbar-brand {
    gap: 12px;
}

.brand-mark {
    background: linear-gradient(180deg, #d7a954, #f0c56f);
    border-radius: 4px;
    box-shadow: 0 8px 18px rgba(215, 169, 84, 0.24);
    display: inline-block;
    height: 30px;
    width: 10px;
}

.topbar-meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    gap: 12px;
}

.topbar-meta strong {
    background: #edf7f7;
    border: 1px solid #cfe7e7;
    border-radius: 999px;
    color: var(--teal-dark);
    padding: 7px 10px;
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(18, 32, 51, 0.98), rgba(19, 47, 68, 0.98)),
        var(--nav);
    box-shadow: 18px 0 45px rgba(16, 24, 39, 0.08);
    height: calc(100vh - 68px);
    top: 68px;
    width: 248px;
}

.sidebar-section-label {
    color: #9fb0c5;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    margin: 18px 10px 8px;
    text-transform: uppercase;
}

.sidebar a {
    margin-bottom: 5px;
    padding: 11px 12px;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateX(3px);
}

.main-content {
    margin-left: 248px;
    padding: 30px 34px 48px;
}

.command-header,
.queue-header,
.ai-header {
    background:
        linear-gradient(135deg, rgba(8, 127, 140, 0.12), rgba(215, 169, 84, 0.14) 48%, rgba(37, 99, 235, 0.08)),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 24px;
    position: relative;
}

.command-header::after,
.queue-header::after,
.ai-header::after {
    background: linear-gradient(90deg, var(--teal), var(--gold), #ef6f6c);
    border-radius: 999px 999px 0 0;
    bottom: 0;
    content: "";
    height: 8px;
    position: absolute;
    right: 24px;
    width: 220px;
}

.page-actions,
.hero-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--teal), #10a0a0);
    box-shadow: 0 12px 24px rgba(8, 127, 140, 0.22);
}

.btn-secondary {
    background: #e8edf2;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
}

.metric-ribbon {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(280px, 1.25fr) repeat(5, minmax(150px, 1fr));
    margin-bottom: 16px;
}

.metric-card,
.client-stat-card {
    overflow: hidden;
    position: relative;
}

.metric-card {
    min-height: 138px;
}

.feature-metric {
    min-height: 190px;
}

.metric-card::before,
.client-stat-card::before {
    background: var(--teal);
    content: "";
    inset: 0 auto 0 0;
    position: absolute;
    width: 5px;
}

.accent-blue::before {
    background: var(--blue);
}

.accent-gold::before {
    background: var(--gold);
}

.accent-green::before {
    background: var(--green);
}

.accent-red::before {
    background: var(--red);
}

.accent-purple::before {
    background: #8b5cf6;
}

.accent-teal::before {
    background: var(--teal);
}

.accent-slate::before {
    background: #52637a;
}

.sla-strip {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    margin: 0 0 20px;
}

.compact-metric {
    border-top: 4px solid #dce4ec;
    min-height: 96px;
}

.sla-track-card {
    border-top-color: var(--green);
}

.warning-card {
    border-top-color: var(--orange);
}

.breach-card {
    border-top-color: var(--red);
}

.dashboard-analytics {
    grid-template-columns: repeat(4, minmax(240px, 1fr));
}

.analytics-card {
    min-height: 300px;
}

.analytics-card canvas {
    max-height: 240px;
}

.section-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin: 24px 0 12px;
}

.section-heading h2 {
    margin: 4px 0 0;
}

.queue-tabs {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    gap: 8px;
    margin: -10px 0 20px;
    overflow-x: auto;
    padding: 8px;
}

.queue-tabs a {
    border-radius: var(--radius);
    color: #41536a;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    padding: 9px 12px;
    text-decoration: none;
}

.queue-tabs a:hover {
    background: #e7f3f3;
    color: var(--teal-dark);
}

.queue-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.ticket-card {
    min-height: 190px;
}

.ticket-card:hover {
    box-shadow: var(--shadow-strong);
    transform: translateY(-4px);
}

.admin-table-card {
    border-top: 4px solid rgba(8, 127, 140, 0.42);
}

.admin-table th {
    background: #f7fafc;
}

.client-ui-body {
    background:
        linear-gradient(180deg, rgba(5, 95, 105, 0.08) 0%, rgba(255, 255, 255, 0) 36%),
        linear-gradient(135deg, #f8fbfc 0%, #eef3f7 44%, #edf2fb 100%);
}

.client-topbar {
    background: rgba(255, 255, 255, 0.96);
    min-height: 76px;
}

.client-brand {
    font-size: 17px;
}

.client-nav a {
    font-weight: 900;
}

.client-status-strip {
    background: linear-gradient(90deg, var(--teal-dark), #164e63);
    color: #dff7f5;
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 12px;
    justify-content: center;
    padding: 8px 18px;
}

.client-status-strip strong {
    color: #ffffff;
}

.client-main {
    width: min(1200px, calc(100% - 48px));
}

.client-hero,
.client-main .page-header {
    background:
        linear-gradient(135deg, rgba(8, 127, 140, 0.13), rgba(215, 169, 84, 0.18)),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-strong);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 22px;
    padding: 28px;
}

.client-hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1;
    margin: 4px 0 12px;
}

.client-hero p {
    color: #41536a;
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
    max-width: 660px;
}

.client-portal-intro {
    background: linear-gradient(135deg, #ffffff, #f5fbfb);
}

.client-command-grid .client-stat-card,
.management-stats .client-stat-card {
    min-height: 118px;
}

.department-panel {
    margin-top: 16px;
}

.client-request-row,
.client-action-list a {
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.client-request-row:hover,
.client-action-list a:hover {
    transform: translateY(-2px);
}

.ai-capability-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    margin: 22px 0 26px;
}

.ai-card {
    min-height: 210px;
    overflow: hidden;
    position: relative;
}

.ai-card::before {
    background: linear-gradient(90deg, var(--teal), var(--gold), #ef6f6c);
    content: "";
    height: 5px;
    inset: 0 0 auto;
    position: absolute;
}

.ai-card.active {
    background:
        linear-gradient(180deg, rgba(8, 127, 140, 0.08), rgba(255, 255, 255, 0) 42%),
        #ffffff;
}

.ai-card p {
    color: var(--ink);
    font-size: clamp(20px, 1.6vw, 28px);
    font-weight: 900;
    line-height: 1.06;
    margin: 10px 0 12px;
}

.ai-card small {
    color: var(--teal-dark);
    font-weight: 900;
    text-transform: uppercase;
}

.auth-wrapper {
    background:
        linear-gradient(135deg, rgba(8, 127, 140, 0.18), rgba(215, 169, 84, 0.16)),
        var(--page);
    min-height: 100vh;
}

.auth-card {
    max-width: 460px;
}

.auth-card h1 {
    font-size: 34px;
}

@media (max-width: 1200px) {
    .metric-ribbon {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-analytics,
    .ai-capability-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .metric-ribbon,
    .sla-strip,
    .dashboard-analytics,
    .ai-capability-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .client-hero,
    .client-main .page-header {
        flex-direction: column;
    }
}

/* Modern SaaS polish pass: stronger hierarchy, colour, and customer/staff distinction. */
body {
    min-height: 100vh;
}

.staff-ui-body .main-content {
    background:
        radial-gradient(circle at 82% 0%, rgba(8, 127, 140, 0.12), transparent 28rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(239, 246, 249, 0.96));
    min-height: calc(100vh - 68px);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-brand span:last-child,
.client-brand span {
    letter-spacing: 0;
}

.sidebar {
    position: fixed;
    z-index: 20;
}

.sidebar a {
    align-items: center;
    display: flex;
    min-height: 38px;
}

.sidebar a.active,
.sidebar a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.command-header,
.queue-header,
.ai-header,
.client-hero,
.client-main .page-header {
    isolation: isolate;
}

.command-header::before,
.queue-header::before,
.ai-header::before,
.client-hero::before,
.client-main .page-header::before {
    background:
        linear-gradient(135deg, rgba(8, 127, 140, 0.16), rgba(215, 169, 84, 0.18)),
        #ffffff;
    border-radius: 999px;
    content: "";
    height: 120px;
    opacity: 0.74;
    position: absolute;
    right: -42px;
    top: -52px;
    width: 220px;
    z-index: -1;
}

.command-header h1,
.queue-header h1,
.ai-header h1,
.client-hero h1,
.client-main .page-header h1 {
    letter-spacing: 0;
}

.section-eyebrow {
    align-items: center;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    gap: 8px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.section-eyebrow::before {
    background: currentColor;
    border-radius: 999px;
    content: "";
    height: 2px;
    width: 28px;
}

.metric-card,
.analytics-card,
.ticket-card,
.client-panel,
.client-stat-card,
.form-card,
.admin-table-card {
    backdrop-filter: blur(12px);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.metric-card:hover,
.analytics-card:hover,
.client-panel:hover,
.client-stat-card:hover,
.admin-table-card:hover {
    border-color: #abc8d3;
    box-shadow: var(--shadow-strong);
}

.metric-card h3,
.client-stat-card span {
    font-weight: 900;
}

.metric-card p,
.client-stat-card strong {
    font-weight: 950;
}

.badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0;
}

.badge.priority.low {
    background: #dff8e9;
    color: #126c3f;
}

.badge.priority.medium {
    background: #fff1c7;
    color: #8a570f;
}

.badge.priority.high,
.badge.priority.urgent {
    background: #ffe0e0;
    color: #a32020;
}

.badge.sla.on_track {
    background: #dff8e9;
    color: #126c3f;
}

.badge.sla.warning {
    background: #fff1c7;
    color: #8a570f;
}

.badge.sla.breached {
    background: #ffe0e0;
    color: #a32020;
}

.ticket-card.sla-warning {
    border-color: #e4a142;
}

.ticket-card.sla-breached {
    border-color: #ef4444;
}

.ticket-card h3 {
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.ticket-meta {
    color: #44566d;
    font-size: 13px;
    line-height: 1.45;
}

.ticket-meta strong {
    color: var(--ink);
}

.filter-summary {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 0 16px;
    padding: 12px;
}

.reset-filter {
    color: var(--teal-dark);
    font-weight: 900;
    margin-left: auto;
}

.client-ui-body {
    color: var(--ink);
}

.client-topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.client-brand {
    align-items: center;
    display: flex;
    font-weight: 950;
    text-decoration: none;
}

.client-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.client-nav a {
    padding: 10px 12px;
    text-decoration: none;
}

.client-nav a[href*="create"] {
    background: #e8f6f5;
    color: var(--teal-dark);
}

.client-status-strip {
    box-shadow: 0 10px 28px rgba(5, 95, 105, 0.16);
}

.client-main {
    margin: 0 auto;
}

.client-portal-band,
.client-detail-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.client-detail-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
}

.client-panel-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.client-panel-heading h2,
.client-panel h2 {
    margin: 0 0 10px;
}

.client-request-list,
.client-action-list {
    display: grid;
    gap: 10px;
}

.client-request-row,
.client-action-list a,
.client-action-list div,
.client-attachment-row {
    border: 1px solid #e0e9ef;
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 13px;
    text-decoration: none;
}

.client-request-row strong,
.client-action-list strong {
    display: block;
    font-weight: 900;
}

.client-request-row small,
.client-action-list span,
.client-attachment-row small {
    color: var(--muted);
    display: block;
    margin-top: 3px;
}

.client-definition-list {
    display: grid;
    gap: 10px 18px;
    grid-template-columns: max-content minmax(0, 1fr);
    margin: 0;
}

.client-definition-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.client-definition-list dd {
    margin: 0;
}

.client-list-plain {
    column-gap: 18px;
    columns: 2;
    list-style: none;
    margin: 0;
    padding: 0;
}

.client-list-plain li {
    border-bottom: 1px solid #e7eef3;
    break-inside: avoid;
    padding: 10px 0;
}

.knowledge-search-card {
    display: grid;
    gap: 8px 12px;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.5fr) auto;
    max-width: 1040px;
}

.knowledge-search-card .form-actions {
    align-items: end;
    display: flex;
    gap: 8px;
}

.knowledge-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.client-ui-body .knowledge-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.client-knowledge-header {
    position: relative;
}

.knowledge-article-card {
    max-width: none;
}

.knowledge-content {
    color: #26364a;
    font-size: 16px;
    line-height: 1.7;
}

.comment-box,
.attachment-card,
.client-attachment-row {
    background: #f8fbfc;
    border: 1px solid #e1e9ef;
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 14px;
}

.attachment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 1200px) {
    .knowledge-search-card {
        grid-template-columns: 1fr;
    }

    .knowledge-search-card .form-actions {
        align-items: center;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
    }

    .staff-ui-body .main-content {
        min-height: auto;
    }

    .client-portal-band,
    .client-detail-grid {
        grid-template-columns: 1fr;
    }

    .client-topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .client-nav {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .client-request-row,
    .client-action-list a,
    .client-attachment-row {
        flex-direction: column;
    }

    .client-definition-list {
        grid-template-columns: 1fr;
    }

    .client-list-plain {
        columns: 1;
    }

    .command-header::after,
    .queue-header::after,
    .ai-header::after {
        left: 20px;
        right: auto;
        width: calc(100% - 40px);
    }
}

/* Brand system: oneTicketDesk and oneClientTicketDesk. */
.brand-compact-logo {
    display: block;
    height: 46px;
    max-width: min(360px, 48vw);
    object-fit: contain;
    width: auto;
}

.client-brand img.client-brand-lockup {
    height: 48px;
    max-height: 48px;
    max-width: min(420px, 58vw);
    object-fit: contain;
    width: auto;
}

.client-brand {
    gap: 12px;
    min-width: 0;
}

.client-brand > span:last-child {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.05;
    min-width: 0;
    overflow-wrap: anywhere;
}

.client-brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(6, 31, 39, 0.16);
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 950;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.staff-brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--gold), var(--teal));
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(6, 31, 39, 0.16);
    color: #061f27;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 950;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.auth-tenant-brand.text-only {
    justify-content: flex-start;
    margin-bottom: 24px;
}

.public-ui-body {
    background:
        radial-gradient(circle at 18% 12%, rgba(8, 127, 140, 0.18), transparent 26%),
        radial-gradient(circle at 86% 2%, rgba(215, 169, 84, 0.18), transparent 24%),
        linear-gradient(180deg, #f7fafc 0%, #eaf2f5 58%, #f8fbfc 100%);
    color: var(--ink);
    min-height: 100vh;
}

.public-topbar {
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(185, 199, 213, 0.58);
    display: flex;
    justify-content: space-between;
    padding: 18px clamp(20px, 5vw, 72px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.public-brand,
.public-nav,
.public-actions {
    align-items: center;
    display: flex;
    gap: 14px;
}

.public-brand,
.public-nav a {
    color: var(--ink);
    font-weight: 900;
    text-decoration: none;
}

.public-main {
    margin: 0 auto;
    max-width: 1420px;
    padding: clamp(36px, 6vw, 86px) clamp(20px, 5vw, 72px);
}

.public-hero {
    align-items: center;
    display: grid;
    gap: clamp(28px, 5vw, 70px);
    grid-template-columns: minmax(0, 0.95fr) minmax(440px, 1.05fr);
    min-height: min(760px, calc(100vh - 120px));
}

.public-hero-copy {
    max-width: 790px;
}

.public-hero h1,
.request-access-main h1 {
    font-size: clamp(2.9rem, 6.6vw, 6.4rem);
    line-height: 0.92;
    margin: 12px 0 20px;
    max-width: 980px;
}

.public-hero p,
.request-access-main > p,
.public-section-heading p {
    color: var(--ink-muted);
    font-size: clamp(1.02rem, 1.55vw, 1.28rem);
    max-width: 720px;
}

.public-trust-note {
    border-left: 4px solid var(--gold);
    color: var(--ink) !important;
    font-size: 0.98rem !important;
    font-weight: 800;
    margin-top: 18px;
    padding-left: 12px;
}

.product-preview {
    background:
        linear-gradient(145deg, rgba(6, 31, 39, 0.96), rgba(7, 63, 70, 0.94)),
        #061f27;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(6, 31, 39, 0.26);
    color: #eefaf7;
    overflow: hidden;
    padding: 18px;
}

.preview-toolbar {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    justify-content: space-between;
    padding: 0 0 14px;
}

.preview-toolbar span,
.preview-label,
.plan-card span {
    color: #a8c2c3;
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
}

.preview-toolbar strong {
    background: rgba(45, 212, 191, 0.16);
    border: 1px solid rgba(45, 212, 191, 0.24);
    border-radius: 999px;
    color: #a7f3d0;
    padding: 7px 10px;
}

.preview-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1.15fr 0.85fr;
    padding-top: 16px;
}

.preview-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 18px;
}

.queue-card {
    grid-row: span 2;
}

.preview-card h2 {
    color: #ffffff;
    font-size: clamp(1.15rem, 2vw, 1.7rem);
    margin: 7px 0 14px;
}

.preview-card p {
    color: #cfe3e1;
    margin: 0;
}

.preview-ticket {
    background: rgba(255, 255, 255, 0.11);
    border-left: 4px solid #2dd4bf;
    border-radius: 8px;
    display: grid;
    gap: 5px;
    margin-top: 10px;
    padding: 12px;
    transition: transform 0.18s ease, background 0.18s ease;
}

.preview-ticket:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateX(3px);
}

.preview-ticket.high {
    border-left-color: #f97316;
}

.preview-ticket.calm {
    border-left-color: #86efac;
}

.preview-ticket span {
    color: #b9d5d4;
}

.preview-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.preview-chip-row span {
    animation: softPulse 2.8s ease-in-out infinite;
    background: rgba(45, 212, 191, 0.13);
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 999px;
    color: #ccfbf1;
    font-size: 0.8rem;
    font-weight: 900;
    padding: 7px 9px;
}

.preview-chip-row span:nth-child(2) {
    animation-delay: 0.35s;
}

.preview-chip-row span:nth-child(3) {
    animation-delay: 0.7s;
}

.public-outcomes,
.trust-band,
.plan-grid,
.public-feature-grid,
.request-access-layout {
    display: grid;
    gap: 16px;
}

.public-outcomes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 20px 0 clamp(54px, 7vw, 90px);
}

.public-outcomes article,
.public-feature,
.plan-card,
.request-access-main,
.request-access-aside .aside-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(185, 199, 213, 0.72);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.public-outcomes article {
    padding: 18px;
}

.public-outcomes strong,
.public-outcomes span {
    display: block;
}

.public-outcomes strong {
    font-size: 1.18rem;
    margin-bottom: 5px;
}

.public-outcomes span,
.public-feature p,
.plan-card p,
.request-access-aside p,
.process-list span,
.form-footer p {
    color: var(--ink-muted);
}

.public-section {
    margin: clamp(54px, 7vw, 94px) 0;
}

.public-section-heading {
    max-width: 760px;
}

.public-section-heading h2 {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.98;
    margin: 8px 0 24px;
}

.buyer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.public-feature {
    min-height: 248px;
    padding: 24px;
}

.feature-number {
    color: var(--teal);
    font-size: 0.8rem;
    font-weight: 950;
}

.public-feature h3,
.plan-card h3 {
    font-size: 1.35rem;
    margin: 12px 0 10px;
}

.trust-band {
    background: rgba(6, 31, 39, 0.95);
    border-radius: 8px;
    box-shadow: 0 18px 56px rgba(6, 31, 39, 0.18);
    color: #e8fbf8;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 20px;
}

.trust-band span {
    border-left: 3px solid var(--gold);
    font-weight: 900;
    padding-left: 12px;
}

.plan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card {
    min-height: 210px;
    padding: 24px;
}

.plan-card span {
    color: var(--teal);
}

.plan-card.featured {
    background:
        linear-gradient(145deg, rgba(8, 127, 140, 0.12), rgba(215, 169, 84, 0.1)),
        rgba(255, 255, 255, 0.94);
    border-color: rgba(8, 127, 140, 0.35);
}

.request-access-layout {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
    margin: 0 auto;
    max-width: 1180px;
}

.request-access-main {
    padding: clamp(24px, 4vw, 42px);
}

.onboarding-steps {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 26px 0;
    padding: 0;
}

.onboarding-steps li {
    align-items: center;
    background: #f2f7f8;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 12px;
}

.onboarding-steps strong {
    align-items: center;
    background: var(--teal-dark);
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.onboarding-steps span {
    font-weight: 900;
}

.guided-form {
    max-width: none;
}

.form-grid.two-col {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-footer {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 18px;
}

.form-footer p {
    font-weight: 800;
    margin: 0;
}

.request-access-aside {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 110px;
}

.request-access-aside .aside-card {
    padding: 22px;
}

.process-list {
    display: grid;
    gap: 16px;
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
}

.process-list li {
    border-left: 4px solid var(--teal);
    padding-left: 12px;
}

.process-list strong,
.process-list span {
    display: block;
}

.secure-card {
    background:
        linear-gradient(145deg, rgba(6, 31, 39, 0.95), rgba(8, 70, 78, 0.92)),
        #061f27 !important;
    color: #eefaf7;
}

.secure-card p {
    color: #cce4e1;
}

.public-reveal {
    animation: publicReveal 0.72s ease both;
}

.public-reveal:nth-of-type(2) {
    animation-delay: 0.08s;
}

.public-reveal:nth-of-type(3) {
    animation-delay: 0.14s;
}

@keyframes publicReveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes softPulse {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(45, 212, 191, 0);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.08);
    }
}

@media (max-width: 1100px) {
    .public-hero,
    .request-access-layout {
        grid-template-columns: 1fr;
    }

    .request-access-aside {
        position: static;
    }

    .buyer-grid,
    .trust-band {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .public-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-outcomes,
    .plan-grid,
    .buyer-grid,
    .trust-band,
    .form-grid.two-col,
    .onboarding-steps {
        grid-template-columns: 1fr;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

    .form-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

.auth-brand-lockup {
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(6, 31, 39, 0.2);
    display: block;
    margin: 0 0 24px;
    width: 100%;
}

.header-symbol-mark {
    border-radius: 18px;
    box-shadow: 0 16px 34px rgba(6, 31, 39, 0.18);
    flex: 0 0 auto;
    height: 74px;
    width: 74px;
}

.client-symbol {
    height: 82px;
    width: 82px;
}

.client-hero .hero-actions,
.command-header .page-actions {
    align-items: center;
}

.client-brand::before {
    display: none;
}

/* Reliable clickable cards. */
.ticket-card-link,
.stat-card-link,
.client-stat-link {
    color: inherit;
    display: block;
    height: 100%;
    min-width: 0;
    text-decoration: none;
}

.ticket-card-link .ticket-card,
.stat-card-link .stat-card,
.client-stat-link .client-stat-card {
    height: 100%;
}

.ticket-card-link .ticket-card,
.stat-card-link .stat-card,
.client-stat-link .client-stat-card,
.client-request-row,
.client-action-list a,
.notification-link .notification-card {
    cursor: pointer;
    position: relative;
}

.ticket-card-link .ticket-card::after,
.stat-card-link .stat-card::after,
.client-stat-link .client-stat-card::after,
.client-request-row::after,
.client-action-list a::after {
    align-items: center;
    background: rgba(8, 127, 140, 0.1);
    border: 1px solid rgba(8, 127, 140, 0.16);
    border-radius: 999px;
    color: var(--teal-dark);
    content: "Open";
    display: inline-flex;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    opacity: 0;
    padding: 7px 9px;
    position: absolute;
    right: 14px;
    top: 14px;
    transform: translateY(-3px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.ticket-card-link:hover .ticket-card::after,
.ticket-card-link:focus-visible .ticket-card::after,
.stat-card-link:hover .stat-card::after,
.stat-card-link:focus-visible .stat-card::after,
.client-stat-link:hover .client-stat-card::after,
.client-stat-link:focus-visible .client-stat-card::after,
.client-request-row:hover::after,
.client-request-row:focus-visible::after,
.client-action-list a:hover::after,
.client-action-list a:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.ticket-card-link:focus-visible,
.stat-card-link:focus-visible,
.client-stat-link:focus-visible,
.client-request-row:focus-visible,
.client-action-list a:focus-visible {
    outline: 3px solid rgba(8, 127, 140, 0.26);
    outline-offset: 3px;
}

.ticket-card-link:hover .ticket-card,
.stat-card-link:hover .stat-card,
.client-stat-link:hover .client-stat-card {
    border-color: #85bdc2;
    box-shadow: var(--shadow-strong);
    transform: translateY(-4px);
}

.client-command-grid {
    align-items: stretch;
}

.client-command-grid .client-stat-link {
    min-height: 118px;
}

.client-command-grid .client-stat-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 248, 0.94)),
        #ffffff;
}

.ticket-card-link .ticket-card h3,
.client-request-row strong {
    padding-right: 54px;
}

.analytics-card,
.ai-card:not(.active) {
    cursor: default;
}

.ai-card.active {
    border-color: rgba(8, 127, 140, 0.26);
}

@media (max-width: 760px) {
    .brand-compact-logo {
        height: 40px;
        max-width: 76vw;
    }

    .client-brand img.client-brand-lockup {
        height: 42px;
        max-width: 78vw;
    }

    .header-symbol-mark {
        height: 62px;
        width: 62px;
    }
}

/* Tenant white-label presentation. */
.topbar-brand {
    min-width: 0;
}

.topbar-brand-text,
.auth-tenant-brand span,
.client-brand span {
    color: var(--ink);
    font-weight: 950;
    line-height: 1.1;
}

.topbar-brand-text {
    font-size: 16px;
}

.topbar-brand-logo,
.client-brand img:not(.client-brand-lockup),
.auth-tenant-brand img {
    background: #ffffff;
    border: 1px solid rgba(8, 127, 140, 0.14);
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(16, 24, 39, 0.08);
    display: block;
    height: 44px;
    object-fit: contain;
    padding: 6px;
    width: 44px;
}

.auth-tenant-brand {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(8, 127, 140, 0.1), rgba(215, 169, 84, 0.12)),
        #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
    padding: 14px;
}

.auth-tenant-brand img {
    height: 58px;
    width: 58px;
}

.auth-tenant-brand span {
    font-size: 22px;
}

.client-brand img:not(.client-brand-lockup) {
    height: 42px;
    width: 42px;
}

.client-brand span {
    font-size: 17px;
}

.client-status-strip span:last-child {
    opacity: 0.86;
}

@media (max-width: 760px) {
    .topbar-brand-logo,
    .client-brand img:not(.client-brand-lockup) {
        height: 38px;
        width: 38px;
    }

    .topbar-brand-text,
    .client-brand span {
        font-size: 15px;
    }
}
/* Queue search and client conversation controls. */
.queue-search-form,
.client-reply-form {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.queue-search-form label,
.client-reply-form label {
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.queue-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.queue-search-row input,
.client-reply-form textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font: inherit;
    padding: 12px 14px;
}

.client-reply-form textarea {
    min-height: 112px;
    resize: vertical;
}

@media (max-width: 720px) {
    .queue-search-row {
        grid-template-columns: 1fr;
    }
}
