/* Paulinian Knowledge Hub — Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@500;600;700&display=swap');

:root {
    /* ── Brand Colors ── */
    --pkh-dark:        #0B3D2E;
    --pkh-forest:      #14532D;
    --pkh-emerald:     #1F6B4F;
    --pkh-green-mid:   #2d7a4f;
    --pkh-green-light: #52b788;
    --pkh-gold:        #D4AF37;
    --pkh-gold-light:  #F4E4A6;
    --pkh-gold-dark:   #B8960C;

    /* ── Layout ── */
    --sidebar-width:           260px;
    --sidebar-collapsed-width: 64px;
    --topbar-height:           60px;

    /* ── Light Mode Surfaces ── */
    --bg-body:      #EEF2F0;
    --bg-card:      #ffffff;
    --bg-topbar:    #ffffff;
    --text-primary: #0d2b1e;
    --text-muted:   #6b7280;
    --border-color: #e2e8e4;
    --shadow-sm:    0 1px 3px rgba(11,61,46,.08), 0 1px 2px rgba(11,61,46,.04);
    --shadow-md:    0 4px 12px rgba(11,61,46,.10), 0 2px 6px rgba(11,61,46,.06);
    --shadow-lg:    0 10px 30px rgba(11,61,46,.14), 0 4px 12px rgba(11,61,46,.08);

    /* ── Gradients ── */
    --grad-sidebar: linear-gradient(180deg, #0B3D2E 0%, #14532D 60%, #1F6B4F 100%);
    --grad-gold:    linear-gradient(135deg, #D4AF37 0%, #B8960C 100%);
    --grad-green:   linear-gradient(135deg, #0B3D2E 0%, #1F6B4F 100%);
    --grad-card:    linear-gradient(135deg, #0B3D2E 0%, #14532D 50%, #1F6B4F 100%);

    /* ── Legacy aliases (keep existing component styles working) ── */
    --primary-color:   var(--pkh-emerald);
    --primary-dark:    var(--pkh-forest);
    --primary-light:   var(--pkh-green-light);
    --secondary-color: #6c757d;
    --success-color:   var(--pkh-emerald);
    --danger-color:    #dc3545;
    --warning-color:   var(--pkh-gold);
    --info-color:      var(--pkh-green-light);
    --spud-green:      var(--pkh-forest);
    --spud-green-dark: var(--pkh-dark);
    --spud-gold:       var(--pkh-gold);
    --spud-gold-dark:  var(--pkh-gold-dark);
    --gradient-primary: var(--grad-card);
    --gradient-gold:    var(--grad-gold);
    --gradient-green:   var(--grad-green);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
    --bg-body:      #0a1810;
    --bg-card:      #152b1e;
    --bg-topbar:    #112218;
    --text-primary: #e8f5ee;
    --text-muted:   #7a9e90;
    --border-color: #1e3d2e;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.30);
    --shadow-md:    0 4px 12px rgba(0,0,0,.35);
    --shadow-lg:    0 10px 30px rgba(0,0,0,.40);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .fw-bold, .fw-semibold {
    font-family: 'Poppins', 'Inter', sans-serif;
}

/* ── Legacy .navbar (kept for pages that still reference it) ── */
.navbar {
    background: var(--grad-green) !important;
    box-shadow: var(--shadow-sm);
}
.navbar-logo { height: 35px; width: auto; }

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.card-header {
    background: var(--gradient-green);
    color: white;
    font-weight: 500;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

/* Stats Cards */
.stat-card {
    border-left: 3px solid;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-left-width: 4px;
    transform: translateX(2px);
}

.stat-card.primary {
    border-left-color: var(--spud-green);
    background: linear-gradient(to right, rgba(45, 122, 79, 0.03) 0%, white 8%);
}

.stat-card.success {
    border-left-color: var(--spud-green);
    background: linear-gradient(to right, rgba(45, 122, 79, 0.03) 0%, white 8%);
}

.stat-card.warning {
    border-left-color: var(--spud-gold);
    background: linear-gradient(to right, rgba(251, 191, 36, 0.03) 0%, white 8%);
}

.stat-card.info {
    border-left-color: var(--spud-gold-dark);
    background: linear-gradient(to right, rgba(217, 119, 6, 0.03) 0%, white 8%);
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.25;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 6px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--gradient-green);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--gradient-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(26, 95, 61, 0.25);
}

.btn-warning {
    background: var(--gradient-gold);
    border: none;
    color: var(--spud-green-dark);
    font-weight: 500;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: var(--spud-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
}

/* Tables */
.table {
    background-color: white;
    font-size: 0.9rem;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #495057;
    padding: 0.75rem;
    letter-spacing: 0.5px;
}

/* Badges */
.badge {
    padding: 4px 10px;
    font-weight: 500;
    font-size: 0.8rem;
}

/* Document Library */
.document-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-card:hover {
    border-color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.document-icon {
    font-size: 2.2rem;
    color: var(--spud-green);
}

/* Chat Interface */
.chat-container {
    height: 550px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
    background: var(--gradient-green);
    color: white;
}

.chat-message.ai .chat-message-avatar {
    background: var(--gradient-gold);
    color: var(--spud-green-dark);
}

.chat-message-content {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 10px;
    line-height: 1.5;
    font-size: 0.9rem;
}

.chat-message.user .chat-message-content {
    background: var(--gradient-green);
    color: white;
    border-bottom-right-radius: 3px;
}

.chat-message.ai .chat-message-content {
    background-color: white;
    border: 1px solid #dee2e6;
    border-bottom-left-radius: 3px;
}

.chat-citation {
    margin-top: 8px;
    padding: 6px 10px;
    background: linear-gradient(to right, rgba(251, 191, 36, 0.08) 0%, rgba(45, 122, 79, 0.03) 100%);
    border-left: 2px solid var(--spud-gold);
    font-size: 0.8rem;
    border-radius: 3px;
}

.chat-input-area {
    margin-top: 20px;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* File Upload Area */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.upload-area:hover {
    border-color: var(--spud-green);
    background: linear-gradient(135deg, rgba(45, 122, 79, 0.03) 0%, rgba(251, 191, 36, 0.03) 100%);
}

.upload-area.dragover {
    border-color: var(--success-color);
    background-color: #d1f2eb;
}

/* Approval Status */
.status-pending {
    color: var(--warning-color);
}

.status-approved {
    color: var(--success-color);
}

.status-rejected {
    color: var(--danger-color);
}

/* Footer */
footer {
    margin-top: auto;
    background-color: #f8f9fa !important;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f3d26 0%, #1a5f3d 40%, #2d7a4f 70%, #3a8f61 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.06) 0%, transparent 70%);
    animation: pulse 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.05); opacity: 0.6; }
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
}

.login-header {
    background: var(--gradient-green);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.login-header i {
    font-size: 2.2rem;
    color: var(--spud-gold);
    margin-bottom: 8px;
}

.login-logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.login-header p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.login-header small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.login-body {
    padding: 25px;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 15px;
    }
    
    .chat-message-content {
        max-width: 85%;
    }
    
    .document-card {
        margin-bottom: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* ═══════════════════════════════════════════════
   SIDEBAR LAYOUT
═══════════════════════════════════════════════ */
.pkh-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.pkh-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--grad-sidebar);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, transform 0.25s ease;
    z-index: 1040;
    overflow: hidden;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

/* Collapsed state (desktop) */
.pkh-layout.sidebar-collapsed .pkh-sidebar {
    width: var(--sidebar-collapsed-width);
}
.pkh-layout.sidebar-collapsed .sidebar-brand-text,
.pkh-layout.sidebar-collapsed .sidebar-user-info,
.pkh-layout.sidebar-collapsed .sidebar-link span,
.pkh-layout.sidebar-collapsed .nav-label {
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

/* Sidebar header / brand */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--topbar-height);
    flex-shrink: 0;
}
.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.3));
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s;
}
.brand-main {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pkh-gold-light);
    white-space: nowrap;
    line-height: 1.2;
}
.brand-sub {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
    line-height: 1.3;
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.nav-section { padding: 4px 0 8px; }

.nav-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 8px 20px 4px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, padding 0.25s ease;
    position: relative;
    border-radius: 0;
}
.sidebar-link i {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    transition: color 0.18s;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.09);
    color: #ffffff;
}
.sidebar-link.active {
    background: rgba(212,175,55,0.18);
    color: var(--pkh-gold-light);
    border-right: 3px solid var(--pkh-gold);
}
.sidebar-link.active i { color: var(--pkh-gold); }

/* Tooltip for collapsed sidebar */
.pkh-layout.sidebar-collapsed .sidebar-link {
    padding: 12px;
    justify-content: center;
}
.pkh-layout.sidebar-collapsed .sidebar-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(11,61,46,0.95);
    color: #fff;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(212,175,55,0.3);
}

/* Nav badge (pending count) */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pkh-gold);
    color: var(--pkh-dark);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Sidebar user footer */
.sidebar-user-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--grad-gold);
    color: var(--pkh-dark);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Poppins', sans-serif;
}
.sidebar-user-info {
    flex: 1;
    overflow: hidden;
    transition: opacity 0.2s;
}
.sidebar-user-name {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    display: block;
    color: rgba(255,255,255,0.45);
    font-size: 0.7rem;
    white-space: nowrap;
}
.sidebar-logout-btn {
    color: rgba(255,255,255,0.45);
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color 0.2s;
    text-decoration: none;
}
.sidebar-logout-btn:hover { color: #ff6b6b; }

.pkh-layout.sidebar-collapsed .sidebar-user-footer {
    padding: 12px;
    justify-content: center;
}

/* Mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
    backdrop-filter: blur(2px);
}
.pkh-layout.sidebar-open .sidebar-overlay { display: block; }

/* ── Main wrapper ── */
.pkh-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
    min-width: 0;
}
.pkh-layout.sidebar-collapsed .pkh-main {
    margin-left: var(--sidebar-collapsed-width);
}

/* ═══════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════ */
.pkh-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    transition: background 0.3s;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.topbar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.35rem;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--bg-body); color: var(--pkh-emerald); }

.topbar-page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.topbar-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    position: relative;
}
.topbar-icon-btn:hover { background: var(--bg-body); color: var(--pkh-emerald); }

/* Notification dot */
.notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: #dc3545;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--bg-topbar);
}

/* User button (topbar) */
.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 5px 10px 5px 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.topbar-user-btn:hover { border-color: var(--pkh-emerald); background: var(--bg-body); }

.topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--grad-green);
    color: var(--pkh-gold-light);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}
.topbar-avatar-lg {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
    border-radius: 50%;
    background: var(--grad-green);
    color: var(--pkh-gold-light);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}
.topbar-user-text {
    flex-direction: column;
    line-height: 1.15;
}
.topbar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}
.topbar-user-role {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.topbar-chevron {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* User dropdown */
.user-dropdown .user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

/* Notification dropdown */
.notif-dropdown {
    width: 320px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-body);
}
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    font-size: 1.5rem;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-body); }
.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(31,107,79,0.12);
    color: var(--pkh-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.notif-title { font-size: 0.82rem; font-weight: 500; margin: 0 0 2px; line-height: 1.4; }
.notif-time  { font-size: 0.72rem; color: var(--text-muted); margin: 0; }

/* ═══════════════════════════════════════════════
   CONTENT AREA
═══════════════════════════════════════════════ */
.content-area {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

/* Flash messages inside main */
.flash-message {
    margin: 12px 20px 0;
    border-radius: 8px;
}

/* Footer inside sidebar layout */
.pkh-main footer {
    background: var(--bg-topbar) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 16px 24px !important;
    margin-top: auto;
}
[data-theme="dark"] .pkh-main footer { background: var(--bg-topbar) !important; }

/* ═══════════════════════════════════════════════
   CARDS — dark mode support
═══════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease, background 0.3s;
    border-radius: 10px;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-header {
    background: var(--grad-card);
    color: white;
    font-weight: 600;
    border: none;
    padding: 12px 16px;
    font-size: 0.9rem;
    border-radius: 10px 10px 0 0 !important;
}

/* ═══════════════════════════════════════════════
   MOBILE RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .pkh-sidebar {
        transform: translateX(-100%);
    }
    .pkh-layout.sidebar-open .pkh-sidebar {
        transform: translateX(0);
    }
    .pkh-main {
        margin-left: 0 !important;
    }
    .pkh-layout.sidebar-collapsed .pkh-sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }
    .pkh-layout.sidebar-collapsed.sidebar-open .pkh-sidebar {
        transform: translateX(0);
    }
    .content-area { padding: 16px; }
    .topbar-page-title { display: none; }
}

/* ═══════════════════════════════════════════════
   DARK MODE — component overrides
═══════════════════════════════════════════════ */
[data-theme="dark"] .card { border: 1px solid var(--border-color); }
[data-theme="dark"] .table { color: var(--text-primary); background: var(--bg-card); }
[data-theme="dark"] .table thead th { background: var(--bg-body); border-color: var(--border-color); color: var(--text-muted); }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-primary);
}
[data-theme="dark"] .dropdown-menu {
    background: var(--bg-card);
    border-color: var(--border-color);
}
[data-theme="dark"] .dropdown-item { color: var(--text-primary); }
[data-theme="dark"] .dropdown-item:hover { background: var(--bg-body); }
[data-theme="dark"] .modal-content { background: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .modal-body, [data-theme="dark"] .modal-footer { background: var(--bg-card); color: var(--text-primary); }
[data-theme="dark"] .chat-messages { background: var(--bg-body); border-color: var(--border-color); }
[data-theme="dark"] .chat-message.ai .chat-message-content { background: var(--bg-card); border-color: var(--border-color); color: var(--text-primary); }
[data-theme="dark"] .upload-area { background: var(--bg-body); border-color: var(--border-color); }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .stat-card.primary,
[data-theme="dark"] .stat-card.success,
[data-theme="dark"] .stat-card.warning,
[data-theme="dark"] .stat-card.info { background: var(--bg-card); }

/* ═══════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(11,61,46,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(11,61,46,0.45); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
