/* ============================================================
   DREAMS ERP SYSTEM - Design System
   Ported from dSuite | Primary: #ff5b74 | Secondary: #60b8c3
   ============================================================ */

/* ---- Google Fonts (loaded in header.php via <link>) ---- */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
    /* Brand Colors */
    --primary:            #ff5b74;
    --primary-light:      #ff7a8a;
    --primary-dark:       #e54a63;

    --secondary:          #60b8c3;
    --secondary-light:    #7bc4cc;
    --secondary-dark:     #4a9ca6;

    /* Neutrals */
    --bg:                 #f8fafc;
    --bg-alt:             #f1f5f9;
    --text:               #0f172a;
    --text-light:         #334155;
    --muted:              #475569;
    --card:               #ffffff;
    --border:             #e2e8f0;
    --border-light:       #f1f5f9;

    /* Semantic */
    --success:            #10b981;
    --success-light:      #34d399;
    --warning:            #f59e0b;
    --warning-light:      #fbbf24;
    --danger:             #ef4444;
    --danger-light:       #f87171;
    --info:               #3b82f6;
    --info-light:         #60a5fa;

    /* Gray scale */
    --gray-50:            #f9fafb;
    --gray-100:           #f3f4f6;
    --gray-200:           #e5e7eb;
    --gray-300:           #d1d5db;
    --gray-400:           #9ca3af;
    --gray-500:           #6b7280;
    --gray-600:           #4b5563;
    --gray-700:           #374151;
    --gray-800:           #1f2937;
    --gray-900:           #111827;

    /* Shadows */
    --shadow-sm:  0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow:     0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

    /* Typography — compact (dSuite-style) */
    --text-xs:    0.5625rem;  /* 9px  */
    --text-sm:    0.5625rem;   /* 9px  */
    --text-base:  0.625rem;    /* 10px */
    --text-lg:    0.6875rem;   /* 11px */
    --text-xl:    0.75rem;     /* 12px */

    /* Radius */
    --radius-sm:  0.375rem;   /* 6px */
    --radius:     0.5rem;     /* 8px */
    --radius-md:  0.75rem;    /* 12px */
    --radius-lg:  1rem;       /* 16px */
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar */
    --sidebar-width:      260px;
    --sidebar-collapsed:  90px;
    --header-height:      52px;

    /* Legacy aliases */
    --card-shadow:        var(--shadow);
    --border-radius:      var(--radius);
}

/* ============================================================
   BASE RESET & TYPOGRAPHY
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0 !important;
    padding: 0 !important;
}
body {
    font-family: 'Montserrat', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 10px;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 14px; }
h2 { font-size: 13px; }
h3 { font-size: 12px; }
h4 { font-size: 11px; }
h5 { font-size: 10px; }
h6 { font-size: 9px; }
/* Override Bootstrap defaults */
.fs-1 { font-size: 14px !important; }
.fs-2 { font-size: 13px !important; }
.fs-3 { font-size: 12px !important; }
.fs-4 { font-size: 11px !important; }
.fs-5 { font-size: 10px !important; }
.fs-6 { font-size: 9px !important; }
p, span, li, td, th, label, input, select, textarea, a { font-size: inherit; }

/* Font Awesome ensure display */
.fas,.far,.fab,.fal,.fa,
[class*="fa-"], i[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro",
                 "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    -webkit-font-smoothing: antialiased !important;
    display: inline-block !important;
}
.far { font-weight: 400 !important; }
.fab { font-family: "Font Awesome 6 Brands" !important; font-weight: 400 !important; }

/* ============================================================
   PAGE LOADER
   ============================================================ */
#pageLoader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
#pageLoader.hidden { opacity: 0; visibility: hidden; }
#pageLoader #container {
    position: relative;
    width: 60px;
    height: 60px;
}
#pageLoader #ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
#pageLoader #ring:nth-child(2) { inset: 8px; animation-duration: 0.8s; animation-direction: reverse; }
#pageLoader #ring:nth-child(3) { inset: 16px; animation-duration: 0.6s; }
#pageLoader #ring:nth-child(4) { inset: 24px; animation-duration: 0.4s; animation-direction: reverse; }
#pageLoader #h3 {
    position: absolute;
    bottom: -28px;
    width: 100%;
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Montserrat', sans-serif;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   APP SHELL
   ============================================================ */
.ds-app {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.ds-sidebar {
    width: var(--sidebar-width);
    background: var(--primary) !important;
    color: #fff !important;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: width var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    box-shadow: 2px 0 10px rgba(0,0,0,0.12);
}
.ds-sidebar::-webkit-scrollbar { width: 0; }
.ds-sidebar.collapsed { width: var(--sidebar-collapsed); }

/* Brand row */
.brand-row {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    flex-shrink: 0;
}
.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: contain;
    background: rgba(255,255,255,0.2);
    padding: 3px;
}
.brand-name {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Montserrat', sans-serif;
}
.ds-sidebar.collapsed .brand-name { display: none; }

/* Sidebar search */
.nav-search {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.nav-search-input {
    width: 100%;
    padding: 7px 12px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 10px;
    outline: none;
    transition: all var(--transition-base);
    font-family: inherit;
}
.nav-search-input::placeholder { color: rgba(255,255,255,0.5); }
.nav-search-input:focus {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.35);
}
.ds-sidebar.collapsed .nav-search { display: none; }

/* Nav container */
.ds-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0 16px;
    scrollbar-width: none;
}
.ds-nav::-webkit-scrollbar { width: 0; }

/* Nav section */
.nav-section-modern {
    margin: 2px 0;
}
.nav-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
    border-radius: 6px;
    margin: 1px 6px;
    color: rgba(255,255,255,0.9);
}
.nav-section-header:hover { background: rgba(255,255,255,0.1); }
.nav-section-icon {
    font-size: 10px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}
.nav-section-title {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    overflow: hidden;
}
.nav-section-chevron {
    font-size: 8px;
    color: rgba(255,255,255,0.5);
    transition: transform var(--transition-base);
    flex-shrink: 0;
}
.nav-section-modern.expanded .nav-section-chevron { transform: rotate(90deg); }
.ds-sidebar.collapsed .nav-section-title,
.ds-sidebar.collapsed .nav-section-chevron { display: none; }
.ds-sidebar.collapsed .nav-section-header { justify-content: center; }

/* Submenu accordion */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}
.nav-section-modern.expanded .nav-submenu {
    max-height: 1200px;
    opacity: 1;
}
.ds-sidebar.collapsed .nav-submenu { display: none; }

/* Nav items */
.nav-item-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 32px;
    color: rgba(255,255,255,0.85) !important;
    font-size: 10px;
    transition: all var(--transition-fast);
    border-radius: 6px;
    margin: 1px 6px;
    position: relative;
    white-space: nowrap;
}
.nav-item-modern:hover {
    background: rgba(255,255,255,0.1);
    color: #fff !important;
}
.nav-item-modern.active {
    background: rgba(255,255,255,0.2);
    color: #fff !important;
    font-weight: 600;
}
.nav-item-modern.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #fff;
    border-radius: 0 3px 3px 0;
}
.nav-item-icon {
    font-size: 10px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.75;
}
.nav-item-modern.active .nav-item-icon { opacity: 1; }
.nav-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-badge-pill {
    background: var(--primary-dark);
    color: #fff;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
    margin-left: auto;
}

/* Sidebar footer (user) */
.sidebar-user-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.sidebar-user-name {
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-role {
    font-size: 8px;
    color: rgba(255,255,255,0.55);
}
.sidebar-logout-btn {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    transition: color var(--transition-fast);
    flex-shrink: 0;
}
.sidebar-logout-btn:hover { color: #fff; }
.ds-sidebar.collapsed .sidebar-user-name,
.ds-sidebar.collapsed .sidebar-user-role,
.ds-sidebar.collapsed .sidebar-logout-btn { display: none; }
.ds-sidebar.collapsed .sidebar-user-footer { justify-content: center; }

/* ============================================================
   MAIN WRAP & HEADER
   ============================================================ */
.ds-main-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left var(--transition-slow);
}
.ds-sidebar.collapsed ~ .ds-main-wrap {
    margin-left: var(--sidebar-collapsed);
}

/* Header */
.ds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 900;
    gap: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

/* Header Left */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 180px;
}
.mobile-menu-toggle {
    display: none;
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 13px;
    transition: background var(--transition-fast);
    padding: 0;
}
.mobile-menu-toggle:hover { background: rgba(0,0,0,0.08); }
.header-logo img { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; }
.header-brand .brand-name {
    font-size: 10px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
}
.header-brand .brand-sub {
    font-size: 9px;
    color: #666;
    line-height: 1;
    margin-top: 2px;
}

/* Header Center - Search */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 520px;
    margin: 0 auto;
}
.qb-search-bar {
    width: 100%;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 0 10px;
    height: 32px;
    transition: all var(--transition-base);
    gap: 6px;
}
.qb-search-bar:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(96,184,195,0.15);
}
.search-icon { color: #888; flex-shrink: 0; width: 15px; height: 15px; }
.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 10px;
    color: #333;
    font-family: inherit;
    padding: 0;
}
.search-input::placeholder { color: #aaa; font-size: 10px; }

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #444;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    font-size: 12px;
    text-decoration: none;
}
.header-icon-btn:hover { background: rgba(0,0,0,0.08); color: #111; }
.notification-badge {
    position: absolute;
    top: 5px; right: 5px;
    background: #e60000;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}

/* User menu */
.qb-user-menu { position: relative; margin-left: 4px; }
.user-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--secondary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 10px;
    transition: all var(--transition-fast);
}
.user-avatar-btn:hover { background: var(--secondary-dark); transform: scale(1.05); }
.qb-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-base);
    z-index: 9999;
    pointer-events: none;
}
.qb-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
@media (min-width: 769px) {
    .qb-user-menu:hover .qb-dropdown {
        opacity: 1; visibility: visible;
        transform: translateY(0); pointer-events: auto;
    }
}
.dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.dropdown-user-name { font-size: 10px; font-weight: 600; color: #1a1a1a; margin-bottom: 2px; }
.dropdown-user-email { font-size: 9px; color: #888; }
.dropdown-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: #444;
    text-decoration: none;
    font-size: 10px;
    transition: all var(--transition-fast);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover { background: #f5f5f5; color: var(--secondary); }
.dropdown-item i { color: #888; width: 16px; text-align: center; flex-shrink: 0; }
.dropdown-item:hover i { color: var(--secondary); }

/* ============================================================
   FLASH MESSAGES / TOASTS
   ============================================================ */
.flash-container {
    padding: 8px 20px 0;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.ds-main {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.ds-content {
    flex: 1;
    padding: 20px;
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
.ds-footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff !important;
    padding: 28px 0 0;
    border-top: 3px solid transparent;
    position: relative;
    flex-shrink: 0;
}
.ds-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 28px;
    align-items: start;
}
.footer-section { display: flex; flex-direction: column; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-logo {
    width: 40px; height: 40px;
    background: #fff;
    padding: 6px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    object-fit: contain;
}
.footer-brand h3 {
    font-size: 11px; font-weight: 700; color: #fff; margin: 0;
    font-family: 'Montserrat', sans-serif;
}
.footer-brand p { color: rgba(255,255,255,0.75); font-size: 8px; margin: 0; line-height: 1.5; }
.footer-brand .brand-name { color: var(--primary) !important; font-weight: 600; }
.system-info { font-size: 8px !important; color: rgba(255,255,255,0.55) !important; font-style: italic; }
.footer-section h4 {
    color: #fff;
    font-size: 9px; font-weight: 700;
    margin: 0 0 14px;
    position: relative;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 28px; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 1px;
}
.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section li { margin-bottom: 8px; }
.footer-section a {
    color: rgba(255,255,255,0.75) !important;
    text-decoration: none;
    font-size: 9px;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 7px;
}
.footer-section a:hover { color: var(--primary) !important; transform: translateX(4px); }
.footer-section a i { width: 12px; font-size: 8px; opacity: 0.7; }
.social-links { display: flex; gap: 10px; margin-bottom: 14px; }
.social-link {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    text-decoration: none;
    font-size: 11px;
    transition: all var(--transition-base);
}
.social-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255,91,116,0.35);
}
.footer-back-top {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.footer-back-btn {
    width: 30px; height: 30px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff !important;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}
.footer-back-btn:hover { background: var(--secondary); transform: translateY(-2px); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 18px;
    padding: 10px 24px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 9px;
}
.footer-bottom p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.footer-bottom .brand-name { color: var(--primary) !important; font-weight: 600; }

/* Footer responsive */
@media (max-width: 1024px) {
    .footer-content { grid-template-columns: 1fr 1fr 1fr; }
    .footer-section:first-child { grid-column: 1 / -1; text-align: center; }
    .footer-brand { align-items: center; }
}
@media (max-width: 768px) {
    .footer-content { grid-template-columns: 1fr; gap: 28px; text-align: center; }
    .footer-brand { align-items: center; }
    .social-links { justify-content: center; }
    .footer-back-top { justify-content: center; }
    .footer-section a { justify-content: center; }
    .footer-section a:hover { transform: none; }
    .footer-section h4::after { left: 50%; transform: translateX(-50%); }
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-left .page-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 3px;
}
.page-header-left .page-breadcrumb {
    font-size: 9px;
    color: var(--gray-400);
    margin: 0;
}
.page-header-left .page-breadcrumb a { color: var(--secondary); }

/* ============================================================
   CARDS
   ============================================================ */
.erp-card, .ds-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 18px;
}
.erp-card .card-head,
.ds-card .card-head {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.erp-card .card-head .card-title,
.ds-card .card-head .card-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}
.erp-card .card-body-inner,
.ds-card .card-body-inner { padding: 18px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.stat-icon.primary   { background: rgba(255,91,116,0.1);  color: var(--primary); }
.stat-icon.secondary { background: rgba(96,184,195,0.1);  color: var(--secondary); }
.stat-icon.success   { background: rgba(16,185,129,0.1);  color: var(--success); }
.stat-icon.warning   { background: rgba(245,158,11,0.1);  color: var(--warning); }
.stat-icon.danger    { background: rgba(239,68,68,0.1);   color: var(--danger); }
.stat-icon.info      { background: rgba(59,130,246,0.1);  color: var(--info); }
.stat-icon.purple    { background: rgba(139,92,246,0.1);  color: #8b5cf6; }
.stat-info .stat-value {
    font-size: 14px; font-weight: 700;
    color: var(--gray-900); line-height: 1.1;
}
.stat-info .stat-label { font-size: 9px; color: var(--gray-400); margin-top: 2px; }
.stat-info .stat-change { font-size: 8px; margin-top: 3px; }

/* ============================================================
   TABLES
   ============================================================ */
.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}
.erp-table thead th {
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 11px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.erp-table tbody td {
    padding: 8px 11px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--gray-700);
}
.erp-table tbody tr:hover { background: var(--gray-50); }
.erp-table tbody tr:last-child td { border-bottom: none; }
/* DataTables */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    font-size: 8px; border-radius: 6px; border-color: var(--border); padding: 3px 7px;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { font-size: 8px; margin-top: 6px; }
.dataTables_wrapper .paginate_button { font-size: 9px !important; padding: 2px 6px !important; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
    font-size: 9px; font-weight: 700; color: var(--gray-500);
    margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.4px;
}
.form-control, .form-select {
    font-size: 10px;
    border-radius: var(--radius-sm);
    border-color: var(--border);
    padding: 6px 10px;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    font-family: inherit;
}
.form-control:focus, .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(96,184,195,0.12);
    outline: none;
}
.form-control.is-invalid { border-color: var(--danger); }
.input-group-text { font-size: 10px; background: var(--gray-50); border-color: var(--border); color: var(--gray-400); }
textarea.form-control { min-height: 85px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-size: 10px; font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 6px 13px;
    transition: all var(--transition-base);
    font-family: inherit;
}
.btn-sm { font-size: 9px; padding: 4px 10px; }
.btn-xs { font-size: 8px; padding: 2px 7px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary-brand { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.btn-secondary-brand:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); color: #fff; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-size: 8px; font-weight: 700; letter-spacing: 0.3px; padding: 2px 6px; border-radius: var(--radius-full); }

/* ============================================================
   USER AVATAR
   ============================================================ */
.user-avatar-sm {
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.3);
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notif-warning { border-left: 3px solid var(--warning); }
.notif-info    { border-left: 3px solid var(--info); }
.notif-success { border-left: 3px solid var(--success); }
.notif-danger  { border-left: 3px solid var(--danger); }

.notification-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}
.notification-item:hover { background: var(--gray-50); }
.notification-item.unread { background: rgba(96,184,195,0.04); border-left: 3px solid var(--secondary); }
.notification-item:last-child { border-bottom: none; }
.notif-icon {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 11px;
}
.notif-title { font-size: 10px; font-weight: 600; margin-bottom: 2px; }
.notif-message { font-size: 9px; color: var(--gray-500); margin-bottom: 3px; }
.notif-time { font-size: 8px; color: var(--gray-400); }
.notif-actions { flex-shrink: 0; align-self: center; }

/* ============================================================
   APPROVAL TIMELINE
   ============================================================ */
.approval-timeline { position: relative; padding-left: 28px; }
.approval-timeline::before {
    content: ''; position: absolute; left: 11px; top: 0; bottom: 0;
    width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
    position: absolute; left: -22px; top: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 8px; border: 2px solid #fff; z-index: 1;
}
.timeline-dot.pending  { background: var(--warning); }
.timeline-dot.approved { background: var(--success); }
.timeline-dot.rejected { background: var(--danger); }
.timeline-dot.waiting  { background: var(--gray-300); }
.timeline-body {
    background: var(--gray-50); border-radius: var(--radius-sm);
    padding: 7px 11px; border: 1px solid var(--border); font-size: 10px;
}
.timeline-body .timeline-title { font-weight: 600; font-size: 10px; }
.timeline-body .timeline-meta  { font-size: 8px; color: var(--gray-400); margin-top: 2px; }

/* ============================================================
   STATUS COLORS
   ============================================================ */
.status-pending     { color: var(--warning); }
.status-approved    { color: var(--success); }
.status-rejected    { color: var(--danger); }
.status-draft       { color: var(--gray-400); }
.status-review      { color: var(--info); }

/* ============================================================
   APPROVAL PROGRESS
   ============================================================ */
.approval-progress { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.approval-step { flex: 1; height: 4px; border-radius: 4px; background: var(--gray-200); }
.approval-step.completed { background: var(--success); }
.approval-step.current   { background: var(--warning); }
.approval-step.rejected  { background: var(--danger); }

/* ============================================================
   DASHBOARD WIDGETS
   ============================================================ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}
.quick-action-btn {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; padding: 12px 8px;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    transition: all var(--transition-base); text-align: center;
    color: var(--gray-600); text-decoration: none;
    font-family: inherit; font-size: 10px;
}
.quick-action-btn:hover {
    background: rgba(96,184,195,0.06);
    border-color: var(--secondary); color: var(--secondary);
    transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.quick-action-btn .qa-icon { font-size: 14px; color: var(--secondary); }
.quick-action-btn .qa-label { font-size: 8px; font-weight: 700; line-height: 1.2; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; padding: 13px 18px; border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}
.modal-header .modal-title { font-size: 11px; font-weight: 700; }
.modal-header .btn-close { filter: invert(1); }
.modal-body { font-size: 10px; }
.modal-footer { padding: 10px 18px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { font-size: 10px; border-radius: var(--radius); padding: 8px 13px; }

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-nav-link {
    display: flex; align-items: center;
    padding: 9px 14px; font-size: 10px; color: var(--gray-600);
    border-left: 3px solid transparent; transition: all var(--transition-fast);
}
.settings-nav-link:hover { background: rgba(96,184,195,0.07); color: var(--secondary); }
.settings-nav-link.active {
    background: rgba(96,184,195,0.1); color: var(--secondary);
    border-left-color: var(--secondary); font-weight: 600;
}
.settings-nav-link i { width: 16px; }
.card-tabs { border-bottom: none; margin: 0; gap: 4px; }
.card-tabs .nav-link {
    font-size: 10px; padding: 7px 12px; color: var(--gray-500);
    border: none; border-radius: 0; border-bottom: 2px solid transparent;
}
.card-tabs .nav-link.active {
    color: var(--secondary); border-bottom-color: var(--secondary);
    font-weight: 600; background: none;
}

/* ============================================================
   FILE DROP ZONE
   ============================================================ */
.file-drop-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 32px; text-align: center; cursor: pointer;
    transition: border-color var(--transition-base); position: relative;
}
.file-drop-zone:hover { border-color: var(--secondary); }
.file-drop-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop-content { pointer-events: none; }

/* ============================================================
   REPORT CARDS
   ============================================================ */
.report-card { transition: transform var(--transition-base), box-shadow var(--transition-base); }
.report-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ============================================================
   EXPENSE ITEMS TABLE
   ============================================================ */
#expenseTable input, #expenseTable select {
    font-size: 10px; padding: 4px 8px; height: auto;
}

/* ============================================================
   SELECT2
   ============================================================ */
/* ── Select2 global catch-all (dropdown appended to body) ── */
.select2-container * { font-size: 10px !important; }
.select2-results__options { padding: 2px 0 !important; }

/* ── Select2 full font-size override ── */
.select2-container--bootstrap-5 .select2-results__option,
.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-search__field,
.select2-container--bootstrap-5 .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection__placeholder,
.select2-container--bootstrap-5 .select2-dropdown,
.select2-results__option { font-size: 10px !important; line-height: 1.5 !important; }
.select2-container--bootstrap-5 .select2-results__option { padding: 4px 10px !important; }
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field { font-size: 10px !important; padding: 4px 8px !important; height: 28px !important; }

.select2-container--bootstrap-5 .select2-selection {
    font-size: 10px; border-color: var(--border); border-radius: var(--radius-sm);
}
.select2-container--bootstrap-5 .select2-selection--single { height: 32px !important; font-size: 10px !important; }
.select2-container--bootstrap-5 .select2-dropdown { font-size: 10px !important; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .ds-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        transition: transform var(--transition-slow);
    }
    .ds-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    }
    .ds-main-wrap { margin-left: 0 !important; }
    .ds-content { padding: 14px 12px; }
    .mobile-menu-toggle { display: flex !important; }

    /* Header: keep it tight on mobile */
    .ds-header { padding: 0 10px; gap: 6px; }
    .header-left { gap: 6px; flex-shrink: 0; }
    .header-logo img { width: 26px; height: 26px; }
    .header-brand .brand-name { display: none; }   /* hide company name text */

    /* Hide search bar on mobile — accessible via sidebar */
    .header-center { display: none !important; }

    /* Right icons: tighter, only show the important ones */
    .header-right { gap: 2px; }
    .header-icon-btn { width: 32px; height: 32px; font-size: 11px; }

    /* Hide email icon on mobile (accessible via sidebar) */
    .header-right .header-icon-btn[title="My Email"] { display: none; }

    /* Hide settings icon on mobile */
    .header-right a[href*="settings"] { display: none; }

    /* Stats */
    .stat-card { padding: 12px; }
    .stat-icon { width: 34px; height: 34px; font-size: 11px; }
    .stat-info .stat-value { font-size: 14px; }
    .quick-actions-grid { grid-template-columns: repeat(3, 1fr); }
    .qb-dropdown.open {
        position: fixed !important;
        z-index: 99999 !important;
        min-width: 200px !important;
        max-width: calc(100vw - 16px) !important;
    }
}
@media (max-width: 480px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
    .ds-content { padding: 12px 8px; }

    /* Ultra-small: also hide noticeboard icon, keep only bell + avatar */
    .header-right .header-icon-btn[title="Notice Board"] { display: none; }

    /* User avatar slightly smaller */
    .user-avatar-btn { width: 30px !important; height: 30px !important; font-size: 10px !important; }
}

/* ── Mobile search overlay ─────────────────────────────────── */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 99998;
    background: #fff;
    padding: 10px 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    align-items: center;
    gap: 8px;
}
.mobile-search-overlay.open { display: flex; }
.mobile-search-overlay input {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    outline: none;
}
.mobile-search-overlay input:focus { border-color: var(--secondary); }
.mobile-search-overlay .close-search {
    background: none;
    border: none;
    font-size: 16px;
    color: #888;
    cursor: pointer;
    padding: 4px 6px;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .ds-sidebar, .ds-header, .ds-footer,
    .sidebar-overlay, .btn:not(.no-print), .no-print { display: none !important; }
    .ds-main-wrap { margin-left: 0 !important; }
    .ds-content { padding: 0; }
    .erp-card, .ds-card, .stat-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.cursor-pointer { cursor: pointer; }
.text-tiny { font-size: 8px; }
.text-xxs  { font-size: 8px; }
.text-xs   { font-size: 9px; }
.text-sm-ui{ font-size: 10px; }
.fw-600 { font-weight: 600; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.toggle-pass { cursor: pointer; }

/* ============================================================
   BOOTSTRAP GLOBAL COMPACT OVERRIDES
   ============================================================ */
.table { font-size: 10px; }
.table th { font-size: 8px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; padding: 8px 10px; }
.table td { font-size: 10px; padding: 7px 10px; }
.table-sm th, .table-sm td { padding: 4px 8px; font-size: 9px; }
.card-header { font-size: 10px; font-weight: 700; padding: 10px 16px; }
.card-body { font-size: 10px; padding: 14px 16px; }
.card-footer { font-size: 9px; padding: 8px 16px; }
.list-group-item { font-size: 10px; padding: 8px 12px; }
.nav-link { font-size: 10px; padding: 7px 12px; }
.breadcrumb-item, .breadcrumb-item a { font-size: 9px; }
.small, small { font-size: 9px !important; }
.form-text { font-size: 9px; }
.form-check-label { font-size: 10px; }
.input-group .btn { font-size: 10px; }
.dropdown-menu { font-size: 10px; }
.dropdown-item { font-size: 10px; padding: 6px 14px; }
.dropdown-header { font-size: 9px; }
.popover { font-size: 10px; }
.tooltip { font-size: 9px; }
.modal-title { font-size: 11px !important; }
.pagination .page-link { font-size: 9px; padding: 4px 8px; }
.progress { height: 6px; }
.progress-bar { font-size: 8px; }
.col-form-label { font-size: 10px; font-weight: 600; }
select.form-control, select.form-select { font-size: 10px; }
.tab-content { font-size: 10px; }
.nav-tabs .nav-link { font-size: 10px; }
.accordion-button { font-size: 10px; padding: 10px 14px; }
.accordion-body { font-size: 10px; padding: 12px 14px; }
