/* ============================================================
   Decision Minds Portal — Executive UI v2.0
   Premium, CEO-ready design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --sidebar-width: 280px;
    --topbar-height: 64px;

    /* Brand palette */
    --brand: #2563eb;
    --brand-light: #3b82f6;
    --brand-dim: rgba(37, 99, 235, 0.12);
    --brand-glow: rgba(37, 99, 235, 0.28);
    --accent: #0891b2;
    --accent-dim: rgba(8, 145, 178, 0.12);

    /* Surface & background */
    --bg: #f0f4fa;
    --surface: #ffffff;
    --surface-2: #f8fafd;
    --border: #e2e8f4;
    --border-focus: #93c5fd;

    /* Text */
    --text: #0f172a;
    --text-2: #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    /* Status */
    --success: #059669;
    --success-dim: rgba(5, 150, 105, 0.12);
    --warning: #d97706;
    --warning-dim: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-dim: rgba(220, 38, 38, 0.12);

    /* Dark shell */
    --dark: #0a0f1e;
    --dark-2: #0f1830;
    --dark-3: #141f3a;
    --dark-4: #1a2a4a;
    --dark-text: #e2e8f0;
    --dark-muted: #94a3b8;
    --dark-border: rgba(255, 255, 255, 0.07);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-brand: 0 8px 24px rgba(37, 99, 235, 0.22);
    --shadow-topbar: 0 4px 24px rgba(8, 14, 32, 0.28);

    /* Gradients */
    --grad-brand: linear-gradient(135deg, #1d4ed8, #2563eb, #3b82f6);
    --grad-dark: linear-gradient(175deg, #0a0f1e 0%, #0f1830 50%, #121e38 100%);
    --grad-hero: radial-gradient(1400px 500px at 5% -15%, rgba(37, 99, 235, 0.13) 0%, transparent 55%),
        radial-gradient(900px 400px at 98% -5%, rgba(8, 145, 178, 0.10) 0%, transparent 50%);
    --grad-cta: linear-gradient(135deg, #1e40af, #2563eb);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Base Reset ─────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Manrope', 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body.portal-shell::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: var(--grad-hero);
    z-index: -1;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-light);
}

/* ── Top Navigation Bar ─────────────────────────────── */
.portal-topbar {
    z-index: 1040;
    height: var(--topbar-height);
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%) !important;
    border-bottom: 1px solid var(--dark-border);
    box-shadow: var(--shadow-topbar);
    backdrop-filter: blur(12px);
}

.portal-topbar .navbar-brand {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: #fff !important;
    gap: 0;
}

.dm-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
    margin-right: 10px;
    transition: opacity 0.18s var(--ease);
}

.dm-logo-img:hover {
    opacity: 0.88;
}

.dm-wordmark {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.3px;
}

.dm-wordmark span {
    color: #e8541a;
}

/* User avatar initials */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--grad-brand);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.portal-topbar .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.18s var(--ease);
}

.portal-topbar .nav-link:hover {
    color: #fff !important;
}

.portal-topbar .dropdown-toggle::after {
    opacity: 0.5;
    margin-left: 6px;
}

.portal-topbar .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
    min-width: 200px;
    margin-top: 8px !important;
}

.portal-topbar .dropdown-item {
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    color: var(--text-2);
    transition: background 0.15s var(--ease);
}

.portal-topbar .dropdown-item:hover {
    background: var(--brand-dim);
    color: var(--brand);
}

.portal-topbar .dropdown-item.text-danger:hover {
    background: var(--danger-dim);
    color: var(--danger);
}

.portal-topbar .dropdown-divider {
    margin: 0.3rem 0;
    border-color: var(--border);
}

/* Notification bell */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8) !important;
    transition: background 0.18s var(--ease);
}

.notif-bell:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}

.notif-bell .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--dark);
}

/* Topbar scroll shadow (class added via JS) */
.portal-topbar.scrolled {
    box-shadow: 0 6px 30px rgba(8, 14, 32, 0.38);
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: var(--grad-dark);
    border-right: 1px solid var(--dark-border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s var(--ease);
}

/* Sidebar header block */
.sidebar-brand {
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--dark-border);
}

.sidebar-panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #93c5fd;
}

/* Nav list */
.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.62rem 1.25rem;
    color: rgba(203, 213, 225, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    position: relative;
    transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
    border-radius: 0;
}

.sidebar-nav .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.7;
    transition: opacity 0.18s var(--ease), color 0.18s var(--ease);
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-left-color: rgba(147, 197, 253, 0.5);
}

.sidebar-nav .nav-link:hover i {
    opacity: 1;
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.28) 0%, rgba(37, 99, 235, 0.05) 100%);
    border-left-color: #60a5fa;
    font-weight: 600;
}

.sidebar-nav .nav-link.active i {
    opacity: 1;
    color: #60a5fa;
}

/* Active pill dot */
.sidebar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.8);
}

/* Ticket badge in nav */
.sidebar-nav .nav-link .badge {
    margin-left: auto;
    font-size: 0.62rem;
    padding: 0.22em 0.55em;
    border-radius: 999px;
}

/* Section label dividers */
.sidebar-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.85rem 1.25rem 0.25rem;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.6);
}

.sidebar-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--dark-border);
}

/* ── Layout ──────────────────────────────────────────── */
.page-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    width: calc(100% - var(--sidebar-width));
    animation: page-in 0.35s var(--ease) both;
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Auth / Login ────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 30fr 70fr;
    background: var(--dark);
}

/* Left: brand panel */
.auth-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3.5rem;
    background: var(--grad-dark);
    overflow: hidden;
}

/* Centred content block */
.auth-brand-center {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    position: relative;
    z-index: 1;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-logo-wrap {
    position: relative;
    margin-bottom: 2rem;
    display: inline-block;
}

.auth-logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
    border-radius: 16px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 24px rgba(232, 84, 26, 0.50));
}

/* Animated pulse rings around the logo */
.auth-logo-wrap::before,
.auth-logo-wrap::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 22px;
    border: 1.5px solid rgba(232, 84, 26, 0.40);
    animation: logo-pulse 2.4s ease-in-out infinite;
    pointer-events: none;
}

.auth-logo-wrap::after {
    inset: -18px;
    border-color: rgba(232, 84, 26, 0.18);
    animation-delay: 0.8s;
}

@keyframes logo-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.06);
    }
}

.auth-tagline {
    position: relative;
    z-index: 1;
}

.auth-tagline h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 0;
    letter-spacing: -0.5px;
}

.auth-tagline h2 span {
    color: #e8541a;
    font-weight: 400;
    font-size: 1.25rem;
}

.auth-divider {
    width: 36px;
    height: 2px;
    background: #e8541a;
    border-radius: 2px;
    margin: 1rem 0 0;
    opacity: 0.7;
}

.auth-tagline p {
    color: rgba(203, 213, 225, 0.65);
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 300px;
    margin-bottom: 0.75rem;
}

.auth-restricted {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem !important;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.5) !important;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 20px;
    padding: 3px 10px;
    margin-top: 0.5rem !important;
}

.auth-version {
    position: absolute;
    bottom: 1.75rem;
    left: 3.5rem;
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.3);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.auth-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(203, 213, 225, 0.8);
    font-size: 0.84rem;
    font-weight: 500;
    padding: 5px 0;
}

.auth-feature-list li i {
    color: #34d399;
    font-size: 1rem;
}

/* Right: login card */
.auth-login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafd;
    padding: 2.5rem;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.auth-card-header {
    margin-bottom: 2rem;
}

.auth-card-header h4 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.2rem;
    letter-spacing: -0.3px;
}

.auth-card-header p {
    color: var(--text-muted);
    font-size: 0.86rem;
    margin: 0;
}

/* Input with icon */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.18s;
}

.input-icon-wrap .form-control {
    padding-left: 40px;
}

.input-icon-wrap .form-control:focus+i,
.input-icon-wrap:focus-within i {
    color: var(--brand);
}

/* ── Cards ───────────────────────────────────────────── */
.portal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
    transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}

.portal-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #c7d7f0;
}

.portal-card .card-header {
    background: linear-gradient(175deg, #fdfeff 0%, #f5f8fd 100%);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    padding: 0.85rem 1.1rem;
}

.portal-card .card-body {
    background: var(--surface);
    padding: 1.1rem;
}

/* ── Stat Cards ──────────────────────────────────────── */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.4rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.22s var(--ease-bounce), box-shadow 0.22s var(--ease);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.01);
}

/* Watermark icon */
.stat-card::before {
    content: attr(data-icon);
    position: absolute;
    right: -10px;
    bottom: -14px;
    font-family: 'bootstrap-icons';
    font-size: 5rem;
    opacity: 0.13;
    line-height: 1;
}

/* Decorative circle accent */
.stat-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -20px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.stat-card .stat-number {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
}

.stat-card .stat-label {
    margin-top: 0.3rem;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
    font-weight: 600;
}

.stat-card .stat-trend {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.stat-card.primary {
    background: linear-gradient(135deg, #1e3a5f, #2255a4, #3b7dd8);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.38);
}

.stat-card.success {
    background: linear-gradient(135deg, #1e3a5f, #1a5c58, #1e8a7a);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.32);
}

.stat-card.danger {
    background: linear-gradient(135deg, #1e3a5f, #6b1e31, #b03050);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.32);
}

.stat-card.warning {
    background: linear-gradient(135deg, #1e3a5f, #5a3a10, #a06820);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.30);
}

/* ── Section Icons ───────────────────────────────────── */
.portal-section-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

/* All section icons — mid-navy matching the overall UI tone */
.portal-section-icon.blue,
.portal-section-icon.purple,
.portal-section-icon.green,
.portal-section-icon.red,
.portal-section-icon.orange,
.portal-section-icon.teal,
.portal-section-icon.pink,
.portal-section-icon.indigo {
    background: linear-gradient(135deg, #1e3a5f, #2c4e7a);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.35);
}

/* ── Page Header ─────────────────────────────────────── */
.page-header {
    margin-bottom: 1.75rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header-left h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.1rem;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

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

/* Legacy support */
.page-header h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.1rem;
    letter-spacing: -0.4px;
}

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

/* Dashboard greeting banner */
.greeting-banner {
    background: var(--grad-dark);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.greeting-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(800px 400px at 100% 50%, rgba(37, 99, 235, 0.3) 0%, transparent 60%);
    pointer-events: none;
}

.greeting-banner-text h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
    letter-spacing: -0.3px;
}

.greeting-banner-text p {
    font-size: 0.84rem;
    color: rgba(203, 213, 225, 0.75);
    margin: 0;
}

.greeting-banner-meta {
    text-align: right;
    position: relative;
    z-index: 1;
}

.greeting-banner-meta .date-time {
    font-size: 0.78rem;
    color: rgba(203, 213, 225, 0.6);
    font-weight: 500;
}

.greeting-banner-meta .date-display {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
}

/* Quick action grid */
.quick-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.85rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    cursor: pointer;
}

.quick-action-btn i {
    font-size: 1.2rem;
    color: #1e3a5f;
    transition: transform 0.22s var(--ease-bounce);
}

.quick-action-btn:hover {
    background: rgba(30, 58, 95, 0.08);
    border-color: #1e3a5f;
    color: #1e3a5f;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.quick-action-btn:hover i {
    transform: scale(1.2);
    color: #2c4e7a;
}

/* ── Tables ──────────────────────────────────────────── */
.table-portal {
    font-size: 0.86rem;
}

.table-portal thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    padding: 0.7rem 0.9rem;
}

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

.table-portal tbody tr:last-child td {
    border-bottom: none;
}

.table-hover>tbody>tr:hover>* {
    background-color: #f4f8ff;
    color: var(--text);
}

/* ── Status Badges ───────────────────────────────────── */
.badge-status-open {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
}

.badge-status-in_progress {
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}

.badge-status-waiting {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
}

.badge-status-resolved {
    background: #d1fae5;
    color: #065f46;
    font-weight: 700;
}

.badge-status-closed {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-portal {
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.84rem;
    padding: 0.5rem 1.1rem;
    transition: all 0.2s var(--ease);
}

.btn-portal-primary {
    background: linear-gradient(135deg, #1e3a5f, #2c4e7a);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(30, 58, 95, 0.30);
}

.btn-portal-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.45);
    filter: brightness(1.15);
}

/* Override Bootstrap outline-primary buttons to match mid-navy */
.btn-outline-primary {
    color: #1e3a5f;
    border-color: #1e3a5f;
    font-weight: 600;
    font-size: 0.84rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: linear-gradient(135deg, #1e3a5f, #2c4e7a);
    border-color: #1e3a5f;
    color: #fff;
    box-shadow: 0 4px 16px rgba(30, 58, 95, 0.28);
    transform: translateY(-1px);
}

/* ── Forms ───────────────────────────────────────────── */
.form-label {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--text-2);
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    padding: 0.55rem 0.85rem;
    color: var(--text);
    transition: border-color 0.18s, box-shadow 0.18s;
    background-color: var(--surface);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
    outline: none;
}

.alert {
    border-radius: var(--radius-md);
    font-size: 0.87rem;
    font-weight: 500;
    border: none;
}

/* ── Misc Components ─────────────────────────────────── */
.empty-state {
    text-align: center;
    color: var(--text-faint);
    padding: 2rem 1rem;
}

.empty-state i {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 0;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.thread-message {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.65rem;
    border: 1px solid var(--border);
}

.thread-message.own {
    background: #eff6ff;
    margin-left: 2rem;
}

.thread-message.other {
    background: var(--surface-2);
    margin-right: 2rem;
}

.thread-message.internal-note {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
}

.post-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.18s;
}

.post-card:hover {
    border-color: #b8cff0;
}

/* PolicyBot modal */
.policybot-modal {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.policybot-thread {
    min-height: 280px;
    max-height: 440px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    padding: 0.85rem;
}

.policybot-msg {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.6rem;
    background: #fff;
}

.policybot-msg.user {
    margin-left: 2rem;
    background: #ecf3ff;
    border-color: #bfd6fb;
}

.policybot-msg.assistant {
    margin-right: 2rem;
}

.policybot-msg-role {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.2rem;
}

.policybot-msg-content {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.55;
}

.policybot-citations {
    margin-top: 0.55rem;
    padding-left: 1.15rem;
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* ── Reveal Animations ───────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(20px);
}

.reveal.show {
    animation: fade-up 0.48s var(--ease) forwards;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delays for dashboard cards */
.reveal:nth-child(1) {
    animation-delay: 0.04s;
}

.reveal:nth-child(2) {
    animation-delay: 0.10s;
}

.reveal:nth-child(3) {
    animation-delay: 0.16s;
}

.reveal:nth-child(4) {
    animation-delay: 0.22s;
}

.reveal:nth-child(5) {
    animation-delay: 0.28s;
}

.reveal:nth-child(6) {
    animation-delay: 0.34s;
}

.reveal:nth-child(7) {
    animation-delay: 0.40s;
}

.reveal:nth-child(8) {
    animation-delay: 0.46s;
}

/* ── Scrollbar ───────────────────────────────────────── */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .page-content {
        margin-left: 0;
        width: 100%;
    }

    .page-header-left h1,
    .page-header h1 {
        font-size: 1.4rem;
    }

    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-login-panel {
        background: var(--dark);
    }

    .auth-card {
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
    }

    .auth-card-header h4 {
        color: #fff;
    }

    .auth-card-header p {
        color: rgba(203, 213, 225, 0.65);
    }

    .form-label {
        color: rgba(203, 213, 225, 0.8);
    }

    .quick-action-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .greeting-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .greeting-banner-meta {
        text-align: left;
    }

    .quick-action-grid {
        grid-template-columns: 1fr 1fr;
    }
}
