/* Solid Bold Reference Design CSS */
:root {
    --primary-navy: #0f172a;
    --card-blue: #0f2b4c;
    --card-green: #008751;
    --card-orange: #f58320;
    --card-red: #d91b3e;

    /* Semantic Variables - Light Theme Defaults */
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-panel: #ffffff;
    --bg-light: #f8fafc;
    --text-main: #333333;
    --text-muted: #64748b;
    --text-title: #0f172a;
    --border-color: #e2e8f0;
    --sidebar-bg: #ffffff;
    --sidebar-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    --header-bg: #ffffff;
    --alert-info-bg: #eff6ff;
    --alert-info-text: #1e40af;
    --alert-info-border: #dbeafe;
    --modal-header-clean-bg: #f8fafc;
    --btn-clean-primary-bg: #0f172a;
    --btn-clean-primary-text: #ffffff;
    --btn-clean-secondary-bg: #f1f5f9;
    --btn-clean-secondary-text: #64748b;
    --btn-clean-secondary-hover-bg: #e2e8f0;
    --btn-clean-secondary-hover-text: #0f172a;
    --btn-outline-primary-border: #0f172a;
    --btn-outline-primary-text: #0f172a;
}

/* Dark Mode Overrides */
.dark-mode {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-panel: #1e293b;
    --bg-light: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-title: #f8fafc;
    --border-color: #334155;
    --sidebar-bg: #1e293b;
    --sidebar-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
    --header-bg: #1e293b;
    --alert-info-bg: rgba(30, 64, 175, 0.1);
    --alert-info-text: #93c5fd;
    --alert-info-border: rgba(30, 64, 175, 0.3);
    --modal-header-clean-bg: #1e293b;
    --btn-clean-primary-bg: #3b82f6;
    --btn-clean-primary-text: #ffffff;
    --btn-clean-secondary-bg: rgba(241, 245, 249, 0.1);
    --btn-clean-secondary-text: #94a3b8;
    --btn-clean-secondary-hover-bg: rgba(241, 245, 249, 0.2);
    --btn-clean-secondary-hover-text: #f8fafc;
    --btn-outline-primary-border: #3b82f6;
    --btn-outline-primary-text: #3b82f6;
}

body {
    font-family: 'Outfit', 'Inter', sans-serif !important;
    background-color: var(--bg-body) !important;
    color: var(--text-main);
}

/* Header Section */
.intelligence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-top: 16px;
}

.header-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-title);
    margin: 0;
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.header-pills {
    display: flex;
    gap: 12px;
}

.header-pill {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
}

.pill-icon-red {
    color: #d91b3e;
}

.pill-icon-blue {
    color: #2196f3;
}

/* Solid Cards */
.card-solid {
    border-radius: 12px;
    color: white;
    padding: 24px;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    border: none;
}

.card-solid:hover {
    transform: translateY(-3px);
}

.card-solid-blue {
    background-color: var(--card-blue);
}

.card-solid-green {
    background-color: var(--card-green);
}

.card-solid-orange {
    background-color: var(--card-orange);
}

.card-solid-red {
    background-color: var(--card-red);
}

.solid-card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 8px;
}

.solid-card-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.solid-card-sub {
    font-size: 12px;
    opacity: 0.8;
}

.solid-card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Dark Chart Section */
.chart-dark-container {
    background-color: var(--primary-navy);
    border-radius: 12px;
    padding: 24px;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    min-height: 400px;
}

.chart-header-dark {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title-dark {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-dot {
    width: 10px;
    height: 10px;
    background: #2196f3;
    border-radius: 50%;
}

/* White Side Panel */
.panel-white {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 100%;
    border: 1px solid var(--border-color);
}

.panel-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
}

.panel-value-lg {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-title);
}

.panel-footer-value {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
}

/* Threshold Table */
.table-threshold {
    margin-top: 32px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-threshold-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 13px;
    color: #d91b3e;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.table-custom th {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
}

.table-custom td {
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.text-danger-custom {
    color: #d91b3e;
}

.text-index-label {
    font-size: 11px;
    font-weight: 800;
    background: rgba(217, 27, 62, 0.1);
    color: #d91b3e;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Sidebar Customization (Global Overrides) */
.main-sidebar {
    background: var(--sidebar-bg) !important;
    box-shadow: var(--sidebar-shadow) !important;
    border-right: 1px solid var(--border-color) !important;
}

.nav-link {
    color: var(--text-main) !important;
    font-weight: 500 !important;
    font-size: 14px;
    padding: 12px 16px !important;
}

.nav-link:hover {
    background: var(--bg-light) !important;
    color: var(--text-title) !important;
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.1) !important;
    color: #4f46e5 !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.dark-mode .nav-link.active {
    background: rgba(79, 70, 229, 0.2) !important;
    color: #818cf8 !important;
}

.brand-link {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 20px !important;
    background: var(--sidebar-bg) !important;
}

.user-panel {
    border-bottom: 1px solid var(--border-color) !important;
}

/* Custom Icon Colors in Sidebar */
.nav-icon.fa-tachometer-alt {
    color: #3b82f6;
}

.nav-icon.fa-users {
    color: #a855f7;
}

.nav-icon.fa-code-branch {
    color: #f97316;
}

.nav-icon.fa-shopping-cart {
    color: #22c55e;
}

.nav-icon.fa-money-bill {
    color: #ef4444;
}

/* === NEW SECTIONS CSS === */
.quick-action-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    height: 100%;
    cursor: pointer;
    display: block;
    text-decoration: none !important;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.quick-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 20px;
}

.qa-icon-teal {
    background: rgba(0, 137, 123, 0.1);
    color: #00897b;
}

.qa-icon-purple {
    background: rgba(142, 36, 170, 0.1);
    color: #8e24aa;
}

.qa-icon-indigo {
    background: rgba(57, 73, 171, 0.1);
    color: #3949ab;
}

.qa-icon-orange {
    background: rgba(251, 140, 0, 0.1);
    color: #fb8c00;
}

.quick-action-text {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-title);
    display: block;
}

.bill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.bill-item:last-child {
    border-bottom: none;
}

.bill-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.bill-info h6 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.bill-info small {
    font-size: 11px;
    color: var(--text-muted);
}

.bill-amount {
    font-weight: 800;
    font-size: 13px;
    color: var(--text-title);
}

.status-dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.status-paid {
    background-color: #10b981;
}

.status-pending {
    background-color: #f59e0b;
}

.status-overdue {
    background-color: #ef4444;
}

.section-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    margin-top: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-title);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.btn-view-all {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    text-decoration: none;
}

/* === AUTH PAGE STYLES === */
.login-page,
.register-page {
    background-color: var(--bg-body) !important;
    font-family: 'Outfit', sans-serif !important;
}

.login-box,
.register-box {
    width: 400px !important;
}

.card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    background-color: var(--bg-card) !important;
}

.card-header {
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 24px !important;
    text-align: center;
}

.login-card-body,
.register-card-body {
    padding: 32px 40px !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
}

.login-logo a,
.register-logo a {
    font-weight: 800 !important;
    color: var(--text-title) !important;
    font-size: 28px !important;
    letter-spacing: -0.5px !important;
}

.btn-primary {
    background-color: var(--primary-navy) !important;
    border-color: var(--primary-navy) !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    padding: 12px !important;
    transition: all 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.form-control {
    height: 48px !important;
    background-color: var(--bg-light) !important;
    color: var(--text-main) !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    padding-left: 16px !important;
    font-weight: 500 !important;
}

.form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.input-group-text {
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-light) !important;
    color: var(--text-muted) !important;
}

/* === DATA TABLES & LISTS GLOBAL OVERRIDE === */
.content-wrapper {
    background: var(--bg-body) !important;
}

.card-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--text-title) !important;
}

.table thead th {
    background-color: var(--bg-light) !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    border-bottom: 2px solid var(--border-color) !important;
    padding: 12px 24px !important;
}

.table tbody td {
    padding: 16px 24px !important;
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.badge {
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}

/* === PREMIUM MINIMALIST UI (CLEAN DESIGN) === */

.alert-info {
    background-color: var(--alert-info-bg) !important;
    color: var(--alert-info-text) !important;
    border: 1px solid var(--alert-info-border) !important;
}

/* 1. Stats Cards */
.stats-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.stats-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stats-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-title);
    line-height: 1.1;
    margin-bottom: 2px;
}

.stats-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Icon Variations */
.icon-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.icon-green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.icon-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.icon-navy {
    background: rgba(15, 23, 42, 0.1);
    color: var(--primary-navy);
}

.icon-purple {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.icon-orange {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

/* 2. Custom Table Card */
.custom-table-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-clean thead th {
    background: var(--bg-light) !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.table-clean tbody td {
    background-color: var(--bg-card) !important;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

/* 3. Modal Clean Design */
.modal-content-clean {
    border: none !important;
    border-radius: 24px !important;
    background-color: var(--bg-card) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.modal-header-clean {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 24px 32px !important;
    background: var(--modal-header-clean-bg) !important;
    border-radius: 24px 24px 0 0 !important;
}

.modal-title-clean {
    font-weight: 800 !important;
    color: var(--text-title) !important;
}

.modal-body-clean {
    padding: 32px !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
}

.modal-footer-clean {
    border-top: 1px solid var(--border-color) !important;
    padding: 20px 32px !important;
    background: var(--bg-light) !important;
    border-radius: 0 0 24px 24px !important;
}

/* 4. Form Clean Elements */
.form-label-clean {
    font-weight: 600;
    color: var(--text-title);
    font-size: 13px;
    margin-bottom: 8px;
    display: block;
}

.form-control-clean {
    background: var(--bg-light) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    color: var(--text-main) !important;
}

.form-control-clean:focus {
    background: var(--bg-card) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.btn-clean-primary {
    background: var(--btn-clean-primary-bg) !important;
    color: var(--btn-clean-primary-text) !important;
    border: none;
    border-radius: 12px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-clean-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--btn-clean-primary-text) !important;
}

.btn-clean-secondary {
    background: var(--btn-clean-secondary-bg) !important;
    color: var(--btn-clean-secondary-text) !important;
    border: none;
    border-radius: 12px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-clean-secondary:hover {
    background: var(--btn-clean-secondary-hover-bg) !important;
    color: var(--btn-clean-secondary-hover-text) !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--btn-outline-primary-border) !important;
    color: var(--btn-outline-primary-text) !important;
    background: transparent !important;
    border-width: 2px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
}

.btn-outline-primary:hover {
    background-color: var(--btn-outline-primary-border) !important;
    color: white !important;
}

/* Overwrite Navbar for dark mode */
.main-header {
    background-color: var(--header-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.dark-mode .main-header {
    background-color: var(--bg-card) !important;
}

.dark-mode .navbar-light .navbar-nav .nav-link {
    color: var(--text-main) !important;
}

.dark-mode .navbar-light .navbar-nav .nav-link:hover {
    color: var(--text-title) !important;
}

/* Global Fix for hardcoded dark colors (Primary Navy, Dark Grey, etc.) in dark mode */
.dark-mode [style*="color: #0f172a"],
.dark-mode [style*="color:#0f172a"],
.dark-mode [style*="color: rgb(15, 23, 42)"],
.dark-mode [style*="color: #333"],
.dark-mode [style*="color:#333"],
.dark-mode [style*="color: #333333"],
.dark-mode [style*="color:#333333"] {
    color: var(--text-title) !important;
}

.dark-mode [style*="background-color: #0f172a"],
.dark-mode [style*="background-color:#0f172a"] {
    background-color: var(--bg-light) !important;
    color: var(--text-main) !important;
}

/* Search bar styling */
.dark-mode .sidebar-search-block .form-control-sidebar {
    background-color: var(--bg-light) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

.bg-info-soft {
    background-color: #f0f9ff !important;
}

.bg-red-soft {
    background-color: #fef2f2 !important;
}

.text-blue-dark {
    color: #1e40af !important;
}

.text-success-dark {
    color: #166534 !important;
}

.text-warning-dark {
    color: #9a3412 !important;
}

.text-info-dark {
    color: #075985 !important;
}

/* 6. Folder Card Clean */
.folder-card-clean {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.folder-card-clean:hover {
    transform: translateY(-2px);
    border-color: #f59e0b;
    /* Amber/Warning for folders */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.folder-card-clean .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* 7. Action Buttons Clean */
.action-btn.btn-clean-secondary {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn.btn-clean-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.action-btn.btn-clean-primary {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #3b82f6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn.btn-clean-primary:hover {
    background: #dbeafe;
    color: #2563eb;
}

/* 8. Badge Clean Variants */
.badge-clean-secondary {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.badge-clean-primary {
    background: #eff6ff;
    color: #3b82f6;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
}