/* COMPLIFY.PK - Regulatory Compliance & Task Management System
 * Professional SaaS Stylesheet
 * Developer: Cyntrona SMC-Private Limited (https://www.cyntrona.com)
 */

:root {
    --primary: #1e3a8a;
    --primary-hover: #1e40af;
    --primary-light: #3b82f6;
    
    /* Strict Work Status Colors per Specification */
    --status-pending: #f59e0b;       /* Yellow */
    --status-pending-bg: #fef3c7;
    --status-urgent: #ef4444;        /* Due today / Overdue: Red */
    --status-urgent-bg: #fee2e2;
    --status-completed: #10b981;     /* Completed: Green */
    --status-completed-bg: #d1fae5;
    --status-inprogress: #3b82f6;    /* In progress: Blue */
    --status-inprogress-bg: #dbeafe;
    --status-draft: #6b7280;         /* Draft: Neutral gray */
    --status-draft-bg: #f3f4f6;

    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* APP SHELL LAYOUT */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.app-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid #1e293b;
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e293b;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.brand-logo {
    background: #2563eb;
    color: white;
    font-weight: 800;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    display: block;
    line-height: 1.1;
    color: white;
}

.brand-tagline {
    font-size: 11px;
    color: #94a3b8;
    display: block;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

.sidebar-user {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.user-avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.user-role-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    background: #334155;
    color: #94a3b8;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.nav-menu {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: white;
    background: #1e3a8a;
    border-left: 3px solid #3b82f6;
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #1e293b;
    background: #0f172a;
}

.developer-tag {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

.developer-tag a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
}

/* APP MAIN WRAPPER */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* TOP NAVBAR */
.app-topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4b5563;
    padding: 6px;
}

.company-badge {
    font-weight: 700;
    font-size: 14px;
    color: #1e3a8a;
}

.platform-badge {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.timezone-indicator {
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid #a7f3d0;
}

.btn-topbar-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.btn-topbar-logout:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

/* CONTENT CONTAINER */
.app-content {
    flex: 1;
    padding: 25px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* CARDS */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.card-body {
    padding: 20px;
}

/* DASHBOARD METRICS GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.text-primary { color: #1e3a8a; }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-danger { color: #ef4444; }

/* BADGES WITH MANDATORY STATUS COLORS */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--status-completed-bg); color: #065f46; border: 1px solid #a7f3d0; }
.badge-warning { background: var(--status-pending-bg); color: #92400e; border: 1px solid #fde68a; }
.badge-danger { background: var(--status-urgent-bg); color: #991b1b; border: 1px solid #fecaca; }
.badge-info { background: var(--status-inprogress-bg); color: #1e40af; border: 1px solid #bfdbfe; }
.badge-secondary { background: var(--status-draft-bg); color: #374151; border: 1px solid #e5e7eb; }
.badge-primary { background: #dbeafe; color: #1e3a8a; }

/* TABLES */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:hover td {
    background: #f8fafc;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: #f1f5f9; color: #334155; border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }

.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }

.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    background: white;
}
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.row { display: flex; gap: 15px; }
.col { flex: 1; min-width: 0; }

/* ALERTS */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* MODALS (SCROLLABLE FORMS & WHITE HEADER TEXT ACROSS ALL PORTALS) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 640px;
    border-radius: 14px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.25);
    overflow: hidden !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    margin: auto !important;
}

.modal-dialog > form,
.modal-dialog form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    margin: 0 !important;
    width: 100%;
}

.modal-header {
    padding: 16px 22px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0 !important;
}

.modal-header h1,
.modal-header h2,
.modal-header h3,
.modal-header h4,
.modal-header h5,
.modal-header strong,
.modal-header span {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff !important;
    margin: 0;
}

.modal-close {
    font-size: 24px;
    color: #ffffff !important;
    opacity: 0.9;
    cursor: pointer;
    border: none;
    background: transparent;
    line-height: 1;
}
.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px 22px;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: calc(90vh - 135px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}
.modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8fafc !important;
    flex-shrink: 0 !important;
}

/* KANBAN BOARD */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.kanban-col {
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.kanban-col-header {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 14px;
    background: white;
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
    border-bottom: 1px solid var(--border);
}

.kanban-cards {
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* FOOTER */
.app-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 10px;
}

.cyntrona-credit-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}
.cyntrona-credit-link:hover { text-decoration: underline; }

/* SIDEBAR BACKDROP & RESPONSIVE DRAWER (MOBILE & TABLET) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.72);
    z-index: 9998;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 0.25s ease;
}
.sidebar-backdrop.active {
    display: block !important;
}

@media (max-width: 991px) {
    .app-sidebar {
        transform: translateX(-100%) !important;
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 270px !important;
        z-index: 9999 !important;
        box-shadow: 6px 0 25px rgba(0, 0, 0, 0.5) !important;
    }
    .app-sidebar.open {
        transform: translateX(0) !important;
    }
    .sidebar-close-btn {
        display: block !important;
    }
    .app-main {
        margin-left: 0 !important;
    }
    .mobile-toggle-btn {
        display: inline-block !important;
    }
}

@media (max-width: 640px) {
    .row { flex-direction: column; gap: 0; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .app-topbar { padding: 0 15px; }
    .app-content { padding: 15px; }
}


/* ==========================================================================
   MOBILE APPLICATION NATIVE UI STYLES (MATCHING ANDROID & iOS APP MOCKUP)
   ========================================================================== */

/* Top Mobile App Bar */
.mobile-app-bar {
    display: none;
    background: #0f172a;
    color: #ffffff;
    height: 56px;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.mobile-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-bar-badge {
    background: #10b981;
    color: white;
    font-weight: 900;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.mobile-bar-title {
    color: #ffffff;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.mobile-bar-title span {
    color: #10b981;
}

.mobile-bar-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mobile-company-pill {
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-live-clock {
    font-size: 11px;
    font-family: monospace;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
}

.mobile-menu-trigger {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom Mobile App Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.06);
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    padding: 6px 0;
    font-size: 10px;
    font-weight: 700;
    transition: color 0.15s ease;
    position: relative;
}

.mobile-bottom-nav .nav-item .nav-icon {
    font-size: 19px;
    line-height: 1;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item.active {
    color: #1e3a8a;
}

.mobile-bottom-nav .nav-item.active .nav-icon {
    color: #1e3a8a;
    transform: scale(1.1);
}

.mobile-bottom-nav .nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 28%;
    right: 28%;
    height: 3px;
    background: #10b981;
    border-radius: 0 0 3px 3px;
}

/* Responsive Overrides on Mobile Screens (<= 900px) */
@media (max-width: 900px) {
    .app-topbar {
        display: none !important;
    }
    .mobile-app-bar {
        display: flex !important;
    }
    .mobile-bottom-nav {
        display: flex !important;
    }
    .app-main {
        padding-bottom: 75px !important;
        margin-left: 0 !important;
    }
    .app-content {
        padding: 12px 10px !important;
    }
    .page-header {
        margin-bottom: 12px !important;
    }
    .page-title {
        font-size: 18px !important;
    }
    .page-subtitle {
        font-size: 11px !important;
    }
    .ai-chat-btn {
        bottom: 75px !important;
        right: 15px !important;
        padding: 9px 14px !important;
        font-size: 11px !important;
    }
    .ai-chat-box {
        bottom: 130px !important;
        right: 10px !important;
        width: 94vw !important;
        max-height: 480px !important;
    }
    
    /* 4-Stat 2x2 Grid on Mobile */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 15px !important;
    }
    .stat-card {
        padding: 12px !important;
        border-radius: 10px !important;
    }
    .stat-title {
        font-size: 10px !important;
    }
    .stat-value {
        font-size: 22px !important;
        margin: 2px 0 !important;
    }
    .stat-meta {
        font-size: 10px !important;
    }
}

/* MOBILE MODAL & EVIDENCE PICKER ENHANCEMENTS */
.modal-dialog form {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    height: 100%;
}

.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .modal {
        padding: 8px !important;
        align-items: flex-end !important;
    }
    .modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 94vh !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
    }
    .modal-header {
        padding: 14px 16px !important;
    }
    .modal-body {
        padding: 16px !important;
        max-height: 75vh !important;
    }
    .modal-footer {
        padding: 12px 16px !important;
        background: #f8fafc !important;
    }
    .evidence-picker-group label.btn {
        width: 100% !important;
        justify-content: center !important;
    }
    .mobile-logout-btn {
        display: inline-flex !important;
    }
}

/* SPINNER FOR INSTANT UPLOAD FEEDBACK (ISSUE 5) */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* RESPONSIVE EVIDENCE CARDS & LIGHTBOX */
.evidence-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.evidence-card:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06) !important;
}

#imageLightboxModal {
    animation: fadeIn 0.2s ease-out;
}
#lightboxImg {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    transition: transform 0.2s ease;
}
@media (max-width: 640px) {
    #lightboxImg {
        max-width: 95vw;
        max-height: 70vh;
    }
}


/* ==========================================================================
   ORGANIZED & COLORFUL SIDEBAR + QUICK ACTIONS + TINTED KPI CARDS (v4.2)
   ========================================================================== */
.app-sidebar {
    background: linear-gradient(180deg, #0b1936 0%, #081226 100%) !important;
    border-right: 1px solid rgba(56, 189, 248, 0.14) !important;
    scrollbar-width: thin;
    scrollbar-color: #1e3a8a #091328;
}
body.sidebar-theme-purple .app-sidebar {
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%) !important;
}
body.sidebar-theme-emerald .app-sidebar {
    background: linear-gradient(180deg, #062c24 0%, #091526 100%) !important;
}

.sidebar-brand {
    padding: 18px 18px !important;
    background: rgba(15, 23, 42, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sidebar-user {
    padding: 14px 18px !important;
    background: rgba(30, 58, 138, 0.22) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.user-role-badge {
    background: transparent !important;
    color: #60a5fa !important;
    padding: 0 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}
.user-role-badge::before {
    content: "★";
    color: #fbbf24;
    font-size: 12px;
}

.nav-section-label {
    padding: 14px 20px 5px 20px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: #38bdf8;
    opacity: 0.92;
    list-style: none;
}

.nav-link {
    padding: 9px 18px !important;
    margin: 2px 10px;
    border-radius: 8px;
    color: #cbd5e1 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 11px;
    transition: all 0.18s ease !important;
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.16) !important;
    color: #ffffff !important;
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-left: none !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
.nav-link.active .nav-icon,
.nav-link.active .nav-text {
    color: #ffffff !important;
}

/* Colorful Sidebar Icons & Accent Links */
.nav-icon {
    width: 24px !important;
    height: 24px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px !important;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.nav-icon-blue { color: #60a5fa; background: rgba(96, 165, 250, 0.15); }
.nav-icon-sky { color: #38bdf8; background: rgba(56, 189, 248, 0.15); }
.nav-icon-cyan { color: #22d3ee; background: rgba(34, 211, 238, 0.15); }
.nav-icon-emerald { color: #34d399; background: rgba(16, 185, 129, 0.18); }
.nav-icon-amber { color: #fbbf24; background: rgba(245, 158, 11, 0.18); }
.nav-icon-orange { color: #fb923c; background: rgba(249, 115, 22, 0.18); }
.nav-icon-purple { color: #c084fc; background: rgba(168, 85, 247, 0.18); }
.nav-icon-teal { color: #2dd4bf; background: rgba(20, 184, 166, 0.18); }
.nav-icon-danger { color: #f87171; background: rgba(239, 68, 68, 0.18); }

.nav-link-emerald:not(.active) .nav-text { color: #34d399 !important; }
.nav-link-amber:not(.active) .nav-text { color: #fbbf24 !important; }
.nav-link-orange:not(.active) .nav-text { color: #fb923c !important; }
.nav-link-danger:not(.active) .nav-text { color: #f87171 !important; }
.nav-link-danger:hover { background: rgba(239, 68, 68, 0.18) !important; }

/* Colorful Tinted KPI Stat Cards (Matching Sample Image) */
.kpi-card-modern {
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.09);
}
.kpi-card-blue {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border-top: 4px solid #2563eb;
}
.kpi-card-green {
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
    border-top: 4px solid #10b981;
}
.kpi-card-red {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border-top: 4px solid #ef4444;
}
.kpi-card-amber {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
    border-top: 4px solid #f59e0b;
}
.kpi-card-purple {
    background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
    border-top: 4px solid #7c3aed;
}
.kpi-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}
.kpi-icon-blue { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.kpi-icon-green { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }
.kpi-icon-red { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); }
.kpi-icon-amber { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.kpi-icon-purple { background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%); }

/* Colorful Quick Actions 8-Tile Grid (Matching Sample Image) */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 14px;
}
.quick-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 14px;
    border-radius: 12px;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.quick-action-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    filter: brightness(1.05);
}
.quick-action-tile .qa-icon {
    font-size: 22px;
    line-height: 1;
}
.qa-green { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); }
.qa-blue { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.qa-purple { background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%); }
.qa-amber { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.qa-orange { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); }
.qa-pink { background: linear-gradient(135deg, #db2777 0%, #ec4899 100%); }
.qa-red { background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%); }
.qa-teal { background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%); }

/* Theme Dots in Topbar */
.theme-dots-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}
.theme-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 0.15s ease;
}
.theme-dot:hover {
    transform: scale(1.2);
}
