/* ===== CSS Custom Properties ===== */
:root {
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.08);
    --accent-gradient: linear-gradient(135deg, #2563eb, #1d4ed8);

    --success: #16a34a;
    --success-light: rgba(22, 163, 74, 0.1);
    --warning: #d97706;
    --warning-light: rgba(217, 119, 6, 0.1);
    --danger: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.1);
    --info: #0891b2;
    --info-light: rgba(8, 145, 178, 0.1);
    --purple: #7c3aed;
    --purple-light: rgba(124, 58, 237, 0.1);

    --bg-body: #f5f7fa;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #f0f2f5;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-xs: 6px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);

    --navbar-height: 60px;
}

/* ===== Base ===== */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

h1:focus { outline: none; }

/* ===== Buttons ===== */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, #b45309);
    border: none;
    color: #fff;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
}

.btn-warning:hover {
    color: #fff;
}

.btn-dark {
    background: linear-gradient(135deg, #334155, #1e293b);
    border: none;
    box-shadow: 0 2px 4px rgba(30, 41, 59, 0.3);
}

.btn-outline-primary {
    color: var(--accent);
    border: 1.5px solid var(--accent);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--accent-light);
    color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-outline-light {
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}

.btn-outline-danger {
    color: var(--danger);
    border: 1.5px solid var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus {
    box-shadow: 0 0 0 3px var(--accent-light);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-group .btn {
    border-radius: var(--border-radius-sm);
    margin-right: 0.375rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* ===== Cards ===== */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
    transition: box-shadow 0.2s ease;
}

.card-header {
    background: var(--bg-card-hover);
    border-bottom: 1px solid var(--border-color);
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-body {
    padding: 1.25rem;
}

/* ===== Forms ===== */
.form-control, .form-select {
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

textarea.form-control {
    line-height: 1.6;
}

/* ===== Tables ===== */
.table {
    --bs-table-bg: transparent;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--accent);
    padding: 0.75rem 1rem;
    white-space: nowrap;
    background: transparent;
}

.table-light {
    --bs-table-bg: transparent;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table-hover > tbody > tr:hover > td {
    background-color: var(--accent-light);
}

.table-responsive {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

/* ===== Badges ===== */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.75em;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.badge.bg-secondary {
    background-color: #e2e8f0 !important;
    color: var(--text-secondary);
}

.badge.bg-info {
    background-color: var(--info-light) !important;
    color: var(--info);
}

.badge.bg-warning {
    background-color: var(--warning-light) !important;
    color: var(--warning);
}

.badge.bg-success {
    background-color: var(--success-light) !important;
    color: var(--success);
}

.badge.bg-danger {
    background-color: var(--danger-light) !important;
    color: var(--danger);
}

.badge.bg-primary {
    background-color: var(--accent-light) !important;
    color: var(--accent);
}

.badge.bg-dark {
    background-color: #1e293b !important;
    color: #f8fafc;
}

.badge.bg-purple {
    background-color: var(--purple-light) !important;
    color: var(--purple);
}

/* ===== Alerts ===== */
.alert {
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: 0.875rem;
    padding: 0.875rem 1.125rem;
    line-height: 1.5;
}

.alert-info {
    background-color: var(--info-light);
    color: #0e7490;
    border-left: 4px solid var(--info);
}

.alert-success {
    background-color: var(--success-light);
    color: #15803d;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: var(--danger-light);
    color: #b91c1c;
    border-left: 4px solid var(--danger);
}

.alert-light {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    border-left: 4px solid #cbd5e1;
}

/* ===== Validation ===== */
.valid.modified:not([type=checkbox]) {
    outline: none;
    border-color: var(--success);
}

.invalid {
    outline: none;
    border-color: var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* ===== Error Boundary ===== */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--border-radius-sm);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ===== Spinner ===== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: #c1c9d0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ======================================================
   LAYOUT: Customer Navbar
   ====================================================== */
.customer-navbar {
    height: var(--navbar-height);
    background: var(--accent-gradient);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.customer-navbar .brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
    font-weight: 500;
}

.customer-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ======================================================
   MOBILE: Customer Pages
   ====================================================== */
@media (max-width: 576px) {
    .customer-navbar {
        padding: 0 1rem;
    }

    .customer-navbar .user-info span {
        display: none;
    }

    .customer-content {
        padding: 1.25rem 1rem;
    }

    .page-header h2 {
        font-size: 1.25rem;
    }

    .page-header p {
        font-size: 0.8125rem;
    }

    .home-card .card-body {
        padding: 1.25rem 0.75rem !important;
    }

    .home-card .card-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }

    .home-card .card-title {
        font-size: 0.9375rem;
    }

    .home-card .card-text {
        font-size: 0.75rem;
    }

    .login-card {
        padding: 1.5rem;
        margin: 0 -0.25rem;
    }

    .login-title {
        font-size: 1.125rem;
    }

    .bankid-logo {
        height: 56px;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }

    .chat-bubble {
        max-width: 92%;
        font-size: 0.8125rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 h2 {
        font-size: 1.25rem;
    }
}

.issue-mobile-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.issue-mobile-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-top)) {
    .customer-navbar {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--navbar-height) + env(safe-area-inset-top));
    }

    .customer-content {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
}

/* ======================================================
   LAYOUT: Staff Navbar & Sidebar
   ====================================================== */
.staff-navbar {
    height: var(--navbar-height);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.staff-navbar .brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

.staff-brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.staff-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    font-weight: 500;
}

.staff-sidebar {
    width: 240px;
    min-width: 240px;
    min-height: calc(100vh - var(--navbar-height));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem 0.75rem;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

.staff-sidebar .sidebar-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.staff-sidebar .nav-link {
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.125rem;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: all 0.2s ease;
}

.staff-sidebar .nav-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent);
}

.staff-sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.08));
    color: var(--accent);
    font-weight: 600;
}

.staff-content {
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

/* ======================================================
   PAGE: Login (BankID)
   ====================================================== */
.login-container {
    max-width: 600px;
    margin: 0 auto;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
}

.bankid-logo {
    width: auto;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: block;
    object-fit: contain;
}

.login-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
}

.login-user-btn {
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-white);
    color: var(--text-primary);
    padding: 1.125rem 1rem;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
}

.login-user-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.login-user-btn .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9375rem;
    flex-shrink: 0;
}

/* ======================================================
   PAGE: Home Cards
   ====================================================== */
.home-card {
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    overflow: hidden;
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.home-card .card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.home-card .card-icon.blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: var(--accent);
}

.home-card .card-icon.green {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: var(--success);
}

.home-card .card-icon.slate {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: var(--text-secondary);
}

.home-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.home-card .card-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ======================================================
   GENERAL: Cursor, Text utilities
   ====================================================== */
.cursor-pointer {
    cursor: pointer;
}

.text-muted {
    color: var(--text-muted) !important;
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-header h2 {
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 0;
}

/* ======================================================
   SECTION: Staff Issue Detail – Interactions Column
   ====================================================== */
.interactions-column {
    max-height: calc(100vh - var(--navbar-height) - 2rem);
    overflow-y: auto;
    position: sticky;
    top: calc(var(--navbar-height) + 1rem);
}

/* ======================================================
   SECTION: Interaction Timeline
   ====================================================== */
.interaction-card {
    border: 1px solid var(--border-color);
    border-left: 4px solid #cbd5e1;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    transition: box-shadow 0.2s ease;
}

.interaction-card:hover {
    box-shadow: var(--shadow-sm);
}

.interaction-card.type-classification {
    border-left-color: var(--accent);
}

.interaction-card.type-solution {
    border-left-color: var(--success);
}

.interaction-card.type-note {
    border-left-color: var(--warning);
}

.interaction-card.type-chat {
    border-left-color: var(--purple);
}

.interaction-card.type-staff-message {
    border-left-color: var(--info);
}

.interaction-card.type-customer-message {
    border-left-color: #94a3b8;
}

.interaction-card.type-status-change {
    border-left-color: var(--warning);
}

.status-change-notice {
    background: var(--warning-light);
    border-radius: var(--border-radius-sm);
    color: var(--warning);
    font-weight: 500;
}

.chat-bubble.customer {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.chat-bubble.staff {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* ======================================================
   SECTION: Chat Box
   ====================================================== */
.chat-box {
    background: var(--bg-body);
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-sm) !important;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-bubble.user {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.chat-bubble.ai {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-sender {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* ======================================================
   PAGE: Staff Login
   ====================================================== */
.staff-login-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.staff-login-card h3 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* ======================================================
   SECTION: Info Grid (Issue Detail)
   ====================================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item .info-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.info-item .info-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ======================================================
   UTILITY: Dividers
   ====================================================== */
hr {
    border-color: var(--border-color);
    opacity: 1;
    margin: 1rem 0;
}

/* ======================================================
   UTILITY: Input Group overrides
   ====================================================== */
.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-right: 0;
}

/* ======================================================
   SECTION: Dashboard Summary Cards
   ====================================================== */
.dashboard-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    min-width: 130px;
    flex: 1;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card.accent {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}

.summary-card.accent .summary-card-value,
.summary-card.accent .summary-card-label {
    color: #fff;
}

.summary-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ======================================================
   SECTION: Age Indicator Pills
   ====================================================== */
.age-indicator {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.age-normal {
    background-color: var(--success-light);
    color: var(--success);
}

.age-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.age-critical {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* ======================================================
   SECTION: Statistics Page
   ====================================================== */
.stats-kpi-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    flex: 1;
    min-width: 160px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.chart-card h4 {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* ======================================================
   SECTION: Collapsible Sections (Dashboard)
   ====================================================== */
.collapsible-section {
    margin-bottom: 1.25rem;
}

.collapsible-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.625rem 0;
    user-select: none;
    gap: 0.25rem;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapsible-header h4 {
    margin: 0;
    font-size: 1rem;
}

.collapsible-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.collapsible-chevron.open {
    transform: rotate(90deg);
}

/* ======================================================
   SECTION: Performance Bar (Statistics)
   ====================================================== */
.perf-bar-track {
    width: 100%;
    max-width: 160px;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.perf-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ======================================================
   SECTION: Health Badges (Statistics – Staff Planning)
   ====================================================== */
.health-badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.health-ok {
    background-color: var(--success-light);
    color: var(--success);
}

.health-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.health-critical {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* ======================================================
   SECTION: Similar Issues Match Score
   ====================================================== */
.match-score {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.match-high {
    background-color: var(--success-light);
    color: var(--success);
}

.match-medium {
    background-color: var(--accent-light);
    color: var(--accent);
}

.match-low {
    background-color: var(--warning-light);
    color: var(--warning);
}

.similar-expanded-row > td {
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.similar-expanded-detail {
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--accent);
}

.similar-solution-box {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.875rem 1rem;
    color: var(--text-primary);
}
