/**
 * custom.css — UpMedia Management System
 * Dark Brand Theme — Cobalt Deep Design System
 */

/* ═══════════════════════════════════════════════════════
   0. LOCAL FONT FACES
═══════════════════════════════════════════════════════ */

/* Rubik Arabic — RB Font (Regular 400) */
@font-face {
    font-family: 'Rubik';
    src: url('../../fonts/RB Font.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
/* Rubik Arabic — RB Bold (Bold 700) */
@font-face {
    font-family: 'Rubik';
    src: url('../../fonts/RB Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
/* Rubik Arabic — Light (300) */
@font-face {
    font-family: 'Rubik';
    src: url('../../fonts/ArbFONTS-Rubik-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Rubik';
    src: url('../../fonts/ArbFONTS-Rubik-LightItalic.ttf') format('truetype');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

/* Lato — English accent font */
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-LightItalic.ttf') format('truetype');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Lato';
    src: url('../../fonts/Lato-BlackItalic.ttf') format('truetype');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

/* ═══════════════════════════════════════════════════════
   1. CSS VARIABLES
═══════════════════════════════════════════════════════ */
:root {
    /* ── Brand Palette ─────────────────────────────────── */
    --primary:         #21B8CC;   /* Pixel Teal */
    --primary-dark:    #1A96A8;
    --primary-light:   rgba(33, 184, 204, 0.15);
    --secondary:       #6B8CAE;
    --success:         #4EC794;   /* Lime Green */
    --success-light:   rgba(78, 199, 148, 0.15);
    --warning:         #FBAE42;   /* Amber */
    --warning-light:   rgba(251, 174, 66, 0.15);
    --danger:          #CE6A6B;   /* Ruby */
    --danger-light:    rgba(206, 106, 107, 0.15);
    --info:            #21B8CC;
    --info-light:      rgba(33, 184, 204, 0.12);
    --purple:          #7616DE;   /* Accent Violet */
    --purple-light:    rgba(118, 22, 222, 0.15);
    --orange:          #FBAE42;
    --orange-light:    rgba(251, 174, 66, 0.15);
    --accent:          #7616DE;
    --accent-dark:     #3C0B70;

    /* ── Dark Surfaces ─────────────────────────────────── */
    --bg-body:         #041421;   /* Cobalt Deep */
    --bg-card:         #042631;   /* Cobalt Mid */

    /* ── Brand Gradient ────────────────────────────────── */
    --gradient-brand:  linear-gradient(135deg, #21B8CC 0%, #3C0B70 100%);

    /* ── Sidebar ───────────────────────────────────────── */
    --sidebar-bg:      #212E53;   /* Primary Dark Navy */
    --sidebar-text:    #7A9DB5;
    --sidebar-active:  #21B8CC;
    --sidebar-hover:   #2A3A6A;
    --sidebar-width:   260px;

    /* ── Typography ────────────────────────────────────── */
    --text-primary:    #D0E8F2;
    --text-secondary:  #7A9DB5;
    --text-muted:      #3D6070;
    --font-ar:         'Rubik', sans-serif;
    --font-en:         'Lato', sans-serif;

    /* ── Borders ───────────────────────────────────────── */
    --border-color:    rgba(255, 255, 255, 0.08);
    --border:          rgba(255, 255, 255, 0.08);

    /* ── Shadows (stronger on dark bg) ─────────────────── */
    --shadow-sm:       0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-md:       0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg:       0 10px 24px rgba(0, 0, 0, 0.6);
    --shadow-xl:       0 20px 40px rgba(0, 0, 0, 0.7);
    --card-shadow:     0 2px 8px rgba(0, 0, 0, 0.35);

    /* ── Radius ────────────────────────────────────────── */
    --radius-sm:       0.375rem;
    --radius-md:       0.5rem;
    --radius-lg:       0.75rem;
    --radius-xl:       1rem;

    --transition:      all 0.3s ease;
    --navbar-height:   64px;
}

/* ═══════════════════════════════════════════════════════
   2. GLOBAL STYLES
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ar);
    background-color: var(--bg-body);
    color: var(--text-primary);
    direction: rtl;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════
   3. LAYOUT WRAPPER
═══════════════════════════════════════════════════════ */
#wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper {
    display: flex;
    flex: 1;
    padding-top: var(--navbar-height);
}

/* ═══════════════════════════════════════════════════════
   4. TOP NAVBAR
═══════════════════════════════════════════════════════ */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 1040;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 0.75rem;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-icon {
    width: 34px;
    height: 34px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
}

/* Global search */
.global-search-form { flex: 1; max-width: 460px; }
.global-search-form .input-group { width: 100%; }
.global-search-form .form-control {
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0 !important;
    border-color: var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
}
.global-search-form .form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}
.global-search-form .form-control:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    color: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}
.btn-search {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl) !important;
    padding: 0.45rem 1rem;
    transition: var(--transition);
}
.btn-search:hover { background: var(--primary-dark); color: #fff; }

/* Notification button */
.notif-btn {
    position: relative;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}
.notif-btn:hover {
    background: var(--bg-body);
    color: var(--primary);
    border-color: var(--primary);
}
#notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* User avatar */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.navbar-user:hover {
    background: var(--bg-body);
    border-color: var(--primary);
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}
.user-info { line-height: 1.2; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); display: block; }
.user-role { font-size: 0.72rem; color: var(--text-muted); display: block; }

/* Sidebar toggle button (mobile) */
#sidebarToggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}
#sidebarToggle:hover { background: var(--bg-body); color: var(--primary); }

/* ═══════════════════════════════════════════════════════
   5. SIDEBAR
═══════════════════════════════════════════════════════ */
#sidebar {
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: #0B1A2E;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    border-left: 1px solid rgba(33,184,204,0.08);
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(33,184,204,0.25); border-radius: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }

/* Sidebar logo — brand gradient header */
.sidebar-logo {
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
    background: var(--gradient-brand);
    padding: 1.1rem 1.25rem;
    position: relative;
    overflow: hidden;
}
.sidebar-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
    pointer-events: none;
}
.sidebar-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    z-index: 1;
    background: rgba(255,255,255,0.08);
    padding: 2px;
}
.logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    font-size: 1.15rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(4px);
}
.logo-text {
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
    font-family: var(--font-en);
}
.logo-sub {
    color: rgba(255,255,255,0.72);
    font-size: 0.68rem;
    display: block;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

/* Nav items */
.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    flex: 1;
}
.nav-item { margin: 1px 0.5rem; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: #6B8CAE;
    text-decoration: none;
    font-size: 0.855rem;
    font-weight: 500;
    border-right: 3px solid transparent;
    transition: var(--transition);
    position: relative;
    border-radius: var(--radius-md);
}
.nav-link:hover {
    background: rgba(33,184,204,0.08);
    color: #A8D4E8;
    border-right-color: rgba(33,184,204,0.4);
}
.nav-link.active {
    background: rgba(33,184,204,0.14);
    color: #21B8CC;
    border-right-color: #21B8CC;
    font-weight: 600;
}
.nav-link.active .nav-icon {
    color: #21B8CC;
}
.nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    color: #3D6070;
    transition: color 0.2s;
}
.nav-link:hover .nav-icon {
    color: #21B8CC;
}
.nav-badge {
    margin-right: auto;
    background: var(--danger);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

/* Section labels */
.sidebar-section-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(33,184,204,0.45);
    padding: 1.1rem 1.5rem 0.4rem;
}

/* Submenu parent link */
.nav-link-parent {
    cursor: pointer;
    user-select: none;
}
.nav-link-parent .submenu-arrow {
    margin-right: auto;
    transition: transform 0.25s ease;
    font-size: 0.65rem;
    color: #2D4A5F;
}
.nav-link-parent[aria-expanded="true"] .submenu-arrow {
    transform: rotate(-90deg);
    color: #21B8CC;
}
/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 0.15rem 0;
    margin: 0 0.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(33,184,204,0.06);
}
.sidebar-submenu .nav-link {
    padding: 0.4rem 1rem 0.4rem 2.75rem;
    font-size: 0.8rem;
    color: #3D6070;
    border-right-color: transparent !important;
    border-radius: var(--radius-sm);
    margin: 0;
}
.sidebar-submenu .nav-link:hover {
    color: #A8D4E8;
    background: rgba(33,184,204,0.07);
}
.sidebar-submenu .nav-link.active {
    color: #21B8CC;
    background: rgba(33,184,204,0.1);
    font-weight: 600;
}
.sidebar-submenu .nav-link::before {
    content: '›';
    font-size: 0.85rem;
    margin-left: 0.4rem;
    color: #2D4A5F;
    flex-shrink: 0;
    line-height: 1;
}
.sidebar-submenu .nav-link.active::before { color: #21B8CC; }

/* Sidebar footer */
.sidebar-footer {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid rgba(33,184,204,0.1);
    flex-shrink: 0;
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    color: #CE6A6B !important;
    font-size: 0.84rem;
    text-decoration: none;
    transition: var(--transition);
}
.sidebar-footer a:hover {
    background: rgba(206,106,107,0.12);
    color: #e88a8b !important;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1029;
}
.sidebar-overlay.show { display: block; }

/* ═══════════════════════════════════════════════════════
   6. MAIN CONTENT AREA
═══════════════════════════════════════════════════════ */
.main-content {
    margin-right: var(--sidebar-width);
    flex: 1;
    min-height: calc(100vh - var(--navbar-height));
    padding: 1.5rem;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}
.breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════
   7. CARDS
═══════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}
.card-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.card-header h5, .card-header h6 { margin: 0; font-size: 1rem; }
.card-body { padding: 1.25rem; }
.card-footer {
    background: var(--bg-body);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
}

/* ═══════════════════════════════════════════════════════
   8. STAT CARDS
═══════════════════════════════════════════════════════ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: default;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-card-info { flex: 1; min-width: 0; }
.stat-card-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}
.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.2rem;
}
.stat-card-blue   .stat-card-icon { background: var(--primary-light);  color: var(--primary); }
.stat-card-green  .stat-card-icon { background: var(--success-light);  color: var(--success); }
.stat-card-purple .stat-card-icon { background: var(--purple-light);   color: var(--purple); }
.stat-card-orange .stat-card-icon { background: var(--orange-light);   color: var(--orange); }
.stat-card-teal   .stat-card-icon { background: var(--info-light);     color: var(--info); }
.stat-card-red    .stat-card-icon { background: var(--danger-light);   color: var(--danger); }
.stat-card-yellow .stat-card-icon { background: var(--warning-light);  color: var(--warning); }

/* ═══════════════════════════════════════════════════════
   9. TABLES
═══════════════════════════════════════════════════════ */
.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table {
    margin: 0;
    font-size: 0.875rem;
}
.table thead th {
    background: var(--bg-body);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}
.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: rgba(33, 184, 204, 0.05); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(0, 0, 0, 0.12); }

/* Table action buttons */
.btn-action { padding: 0.3rem 0.6rem; font-size: 0.8rem; border-radius: var(--radius-md); }
.btn-action-group { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; }

/* ═══════════════════════════════════════════════════════
   10. BADGES
═══════════════════════════════════════════════════════ */
.badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

/* Project status */
.badge-pending     { background: rgba(107, 140, 174, 0.2); color: #7A9DB5; }
.badge-in_progress { background: var(--primary-light);     color: var(--primary); }
.badge-review      { background: var(--warning-light);     color: var(--warning); }
.badge-completed   { background: var(--success-light);     color: var(--success); }
.badge-cancelled   { background: var(--danger-light);      color: var(--danger); }
.badge-done        { background: var(--success-light);     color: var(--success); }
.badge-todo        { background: rgba(107, 140, 174, 0.2); color: #7A9DB5; }

/* Invoice status */
.badge-draft    { background: rgba(107, 140, 174, 0.2); color: #7A9DB5; }
.badge-sent     { background: var(--info-light);        color: var(--info); }
.badge-paid     { background: var(--success-light);     color: var(--success); }
.badge-partial  { background: var(--warning-light);     color: var(--warning); }
.badge-overdue  { background: var(--danger-light);      color: var(--danger); }

/* Client status */
.badge-active   { background: var(--success-light);     color: var(--success); }
.badge-inactive { background: rgba(107, 140, 174, 0.2); color: #7A9DB5; }
.badge-lead     { background: var(--info-light);        color: var(--info); }

/* Priority */
.badge-low    { background: var(--success-light); color: var(--success); }
.badge-medium { background: var(--primary-light); color: var(--primary); }
.badge-high   { background: var(--orange-light);  color: var(--orange); }
.badge-urgent { background: var(--danger-light);  color: var(--danger); }

/* Role */
.badge-super_admin { background: var(--danger-light);  color: var(--danger); }
.badge-admin       { background: var(--purple-light);  color: var(--purple); }
.badge-manager     { background: var(--primary-light); color: var(--primary); }
.badge-employee    { background: var(--success-light); color: var(--success); }

/* Expense category */
.badge-salary    { background: var(--primary-light);        color: var(--primary); }
.badge-rent      { background: var(--purple-light);         color: var(--purple); }
.badge-equipment { background: rgba(107, 140, 174, 0.2);    color: #7A9DB5; }
.badge-marketing { background: var(--orange-light);         color: var(--orange); }
.badge-travel    { background: var(--success-light);        color: var(--success); }
.badge-utilities { background: var(--warning-light);        color: var(--warning); }
.badge-software  { background: var(--info-light);           color: var(--info); }
.badge-other     { background: rgba(107, 140, 174, 0.2);    color: #7A9DB5; }

/* Payment method */
.badge-cash    { background: var(--success-light); color: var(--success); }
.badge-bank    { background: var(--primary-light); color: var(--primary); }
.badge-check   { background: var(--warning-light); color: var(--warning); }
.badge-online  { background: var(--info-light);    color: var(--info); }

/* ═══════════════════════════════════════════════════════
   11. FORMS
═══════════════════════════════════════════════════════ */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    font-family: var(--font-ar);
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}
.form-control::placeholder { color: var(--text-muted); font-size: 0.82rem; }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-light); }
.invalid-feedback { font-size: 0.78rem; color: var(--danger); }
.error-message { font-size: 0.78rem; color: var(--danger); margin-top: 0.25rem; display: block; }

/* Toggle switch */
.form-check-input:checked { background-color: var(--success); border-color: var(--success); }

/* Input group icon */
.input-group-text {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════
   12. BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
    font-family: var(--font-ar);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    padding: 0.5rem 1.1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); color: #fff; }
.btn-success:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-danger:hover  { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-warning:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.7rem 1.5rem; font-size: 1rem; }
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════
   13. KANBAN BOARD
═══════════════════════════════════════════════════════ */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    min-height: 70vh;
    align-items: flex-start;
    padding-bottom: 1rem;
}
.kanban-column {
    flex: 1;
    min-width: 280px;
    max-width: 340px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}
.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.25rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}
.kanban-column-title {
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.kanban-column-count {
    background: var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: 700;
}
.kanban-column-todo        { border-top: 4px solid var(--secondary); }
.kanban-column-in_progress { border-top: 4px solid var(--primary); }
.kanban-column-review      { border-top: 4px solid var(--warning); }
.kanban-column-done,
.kanban-column-completed   { border-top: 4px solid var(--success); }
.kanban-column-pending     { border-top: 4px solid var(--secondary); }
.kanban-column-cancelled   { border-top: 4px solid var(--danger); }

.task-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    cursor: grab;
    border-right: 4px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}
.task-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px) scale(1.01);
}
.task-card:active { cursor: grabbing; }
.task-card.ui-sortable-helper {
    transform: rotate(2deg) scale(1.03);
    box-shadow: var(--shadow-xl);
    opacity: 0.9;
    cursor: grabbing;
    z-index: 9999;
}
.task-card.priority-low    { border-right-color: var(--success); }
.task-card.priority-medium { border-right-color: var(--primary); }
.task-card.priority-high   { border-right-color: var(--orange); }
.task-card.priority-urgent { border-right-color: var(--danger); }

.sortable-placeholder {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 0.6rem;
    min-height: 80px;
    background: var(--primary-light);
    opacity: 0.5;
}

.task-card-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.4rem; color: var(--text-primary); }
.task-card-project { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.task-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.task-due-date { font-size: 0.72rem; color: var(--text-muted); }
.task-due-date.overdue { color: var(--danger); font-weight: 600; }
.task-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}
.task-avatar-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════
   14. INVOICE PRINT
═══════════════════════════════════════════════════════ */
.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;    /* Keep white for print readability */
    color: #1E293B;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}
.invoice-company-name { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.invoice-number { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.invoice-table th { background: var(--bg-body) !important; }
.invoice-total-section {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}
.invoice-grand-total { font-size: 1.2rem; font-weight: 800; color: var(--primary); }

/* Invoice gradient header band (M3 item 7) */
.invoice-header-band {
    background: linear-gradient(135deg, #21B8CC 0%, #3C0B70 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}
.invoice-brand-name {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    font-family: var(--font-en);
}
.invoice-header-meta { text-align: end; }
.invoice-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    letter-spacing: 2px;
}
.invoice-number-badge {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 30px;
    padding: 0.2rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-top: 0.3rem;
}
/* T&C section */
.invoice-tc {
    border-top: 1px dashed rgba(33,184,204,0.3);
}
.invoice-tc-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.invoice-tc-list {
    list-style: disc;
    padding-right: 1.5rem;
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* Receipt thumbnail (M3 item 12) */
.receipt-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    vertical-align: middle;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.85;
}
.receipt-thumb:hover { opacity: 1; transform: scale(1.08); }
.receipt-thumb-link { text-decoration: none; }

@media print {
    #sidebar, .top-navbar, .breadcrumb, .no-print,
    footer#main-footer, .btn-print, .page-header .btn,
    #global-loader, .sidebar-overlay { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .invoice-container { box-shadow: none; padding: 1rem; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .invoice-header-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 1cm; }
}

/* ═══════════════════════════════════════════════════════
   15. CHARTS
═══════════════════════════════════════════════════════ */
.chart-container { position: relative; width: 100%; }
.chart-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════
   16. PAGINATION
═══════════════════════════════════════════════════════ */
.pagination { gap: 3px; }
.page-link {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    transition: var(--transition);
}
.page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.page-item.disabled .page-link { opacity: 0.5; }

/* ═══════════════════════════════════════════════════════
   17. NOTIFICATIONS
═══════════════════════════════════════════════════════ */
.notif-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    transition: var(--transition);
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.unread { background: rgba(33, 184, 204, 0.08); }
.notif-item.unread:hover { background: rgba(33, 184, 204, 0.12); }
.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.notif-icon-info    { background: var(--info-light);    color: var(--info); }
.notif-icon-success { background: var(--success-light); color: var(--success); }
.notif-icon-warning { background: var(--warning-light); color: var(--warning); }
.notif-icon-danger  { background: var(--danger-light);  color: var(--danger); }
.bg-primary-light   { background: rgba(33, 184, 204, 0.1) !important; }

/* Navbar notification dropdown */
.dropdown-menu-notif { min-width: 320px; max-height: 420px; overflow-y: auto; }

/* ═══════════════════════════════════════════════════════
   18. AUTH PAGES
═══════════════════════════════════════════════════════ */
body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #041421;
}
.auth-bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
.auth-bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 15, 35, 0.45);
    z-index: 1;
}
.auth-card {
    position: relative;
    z-index: 2;
    background: rgba(4, 22, 33, 0.88);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(33, 184, 204, 0.22);
    border-radius: 20px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(33, 184, 204, 0.06);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    color: var(--text-primary);
}
.auth-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 0.25rem; color: #D0E8F2; }
.auth-subtitle { font-size: 0.85rem; color: var(--text-secondary); text-align: center; margin-bottom: 1.75rem; }
.auth-card .form-label { color: #A8C8DC; font-size: 0.875rem; }
.auth-card .form-control,
.auth-card .input-group-text {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(33, 184, 204, 0.25);
    color: #D0E8F2;
}
.auth-card .form-control::placeholder { color: #5A7A8E; }
.auth-card .form-control:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 184, 204, 0.15);
    color: #D0E8F2;
}
.auth-card .input-group-text {
    color: var(--text-secondary);
}
.auth-card .text-muted { color: #5A7A8E !important; }
.auth-card a.text-muted:hover { color: var(--primary) !important; }

/* Password strength */
.password-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    margin-top: 6px;
    overflow: hidden;
}
.password-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease, background 0.4s ease;
    width: 0;
}
.strength-weak   .password-strength-fill { background: var(--danger);  width: 33%; }
.strength-medium .password-strength-fill { background: var(--warning); width: 66%; }
.strength-strong .password-strength-fill { background: var(--success); width: 100%; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-6px); }
    80%       { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease; }

/* ═══════════════════════════════════════════════════════
   19. PROFILE PAGE
═══════════════════════════════════════════════════════ */
.profile-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
}
.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--border-color);
}

/* ═══════════════════════════════════════════════════════
   20. LOADING SPINNER / OVERLAY
═══════════════════════════════════════════════════════ */
#global-loader {
    position: fixed;
    inset: 0;
    background: rgba(4, 20, 33, 0.88);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-inline {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════
   21. EMPTY STATE
═══════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.35;
    display: block;
}
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.25rem; }
.empty-state-text { font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════
   22. PROGRESS BARS
═══════════════════════════════════════════════════════ */
.progress { height: 8px; border-radius: 4px; background: var(--border-color); }
.progress-bar { border-radius: 4px; }
.progress-sm { height: 5px; }
.progress-lg { height: 12px; }

/* ═══════════════════════════════════════════════════════
   23. FILTERS ROW
═══════════════════════════════════════════════════════ */
.filters-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.filters-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-item { flex: 1; min-width: 160px; max-width: 220px; }
.filter-item.filter-search { min-width: 220px; max-width: 320px; }

/* ═══════════════════════════════════════════════════════
   24. ANIMATIONS
═══════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.fade-in  { animation: fadeIn 0.4s ease forwards; }
.slide-in { animation: slideInRight 0.4s ease forwards; }

/* Staggered children animation */
.stagger-children > *:nth-child(1) { animation: fadeIn 0.4s ease 0.05s forwards; opacity: 0; }
.stagger-children > *:nth-child(2) { animation: fadeIn 0.4s ease 0.1s  forwards; opacity: 0; }
.stagger-children > *:nth-child(3) { animation: fadeIn 0.4s ease 0.15s forwards; opacity: 0; }
.stagger-children > *:nth-child(4) { animation: fadeIn 0.4s ease 0.2s  forwards; opacity: 0; }
.stagger-children > *:nth-child(5) { animation: fadeIn 0.4s ease 0.25s forwards; opacity: 0; }
.stagger-children > *:nth-child(6) { animation: fadeIn 0.4s ease 0.3s  forwards; opacity: 0; }
.stagger-children > *:nth-child(7) { animation: fadeIn 0.4s ease 0.35s forwards; opacity: 0; }

/* ═══════════════════════════════════════════════════════
   25. DROPDOWN ENHANCEMENTS
═══════════════════════════════════════════════════════ */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    padding: 0.5rem;
}
.dropdown-item {
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}
.dropdown-item:hover { background: var(--bg-body); color: var(--primary); }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-divider { border-color: var(--border-color); margin: 0.25rem 0; }

/* ═══════════════════════════════════════════════════════
   26. ALERTS
═══════════════════════════════════════════════════════ */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(78,199,148,0.3); }
.alert-danger   { background: var(--danger-light);  color: var(--danger);  border: 1px solid rgba(206,106,107,0.3); }
.alert-warning  { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(251,174,66,0.3); }
.alert-info     { background: var(--info-light);    color: var(--info);    border: 1px solid rgba(33,184,204,0.3); }

/* ═══════════════════════════════════════════════════════
   27. TABS
═══════════════════════════════════════════════════════ */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 0.25rem;
}
.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.6rem 1rem;
    border-radius: 0;
    background: transparent;
    border-right: none !important;
}
.nav-tabs .nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}
.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}
.tab-content { padding-top: 1.25rem; }

/* ═══════════════════════════════════════════════════════
   28. FOOTER
═══════════════════════════════════════════════════════ */
#main-footer {
    margin-right: var(--sidebar-width);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════
   29. REPORTS HUB CARDS
═══════════════════════════════════════════════════════ */
.report-hub-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.report-hub-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    color: inherit;
}
.report-hub-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

/* ═══════════════════════════════════════════════════════
   30. VIEW TOGGLE & MISC
═══════════════════════════════════════════════════════ */
.view-toggle { gap: 4px; }
.view-toggle .btn { padding: 0.35rem 0.75rem; }
.view-toggle .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   31. RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .stat-card-value { font-size: 1.5rem; }
}

@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(100%);
        top: 0;
        height: 100vh;
        z-index: 1045;
    }
    #sidebar.show { transform: translateX(0); }
    .main-content { margin-right: 0; }
    #main-footer  { margin-right: 0; }
    .global-search-form { display: none !important; }
}

@media (max-width: 767.98px) {
    .main-content { padding: 1rem; }
    .stat-card { padding: 1rem; }
    .stat-card-icon { width: 44px; height: 44px; font-size: 1.1rem; }
    .stat-card-value { font-size: 1.3rem; }
    .auth-card { margin: 1rem; }
    .invoice-container { padding: 1.25rem; }
}

@media (max-width: 575.98px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .filters-row { flex-direction: column; }
    .filter-item { min-width: 100%; max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════
   32. CONTENT AREA (dashboard wrapper)
═══════════════════════════════════════════════════════ */
.content-area {
    margin-right: var(--sidebar-width);
    flex: 1;
    min-height: calc(100vh - var(--navbar-height));
}
@media (max-width: 991.98px) {
    .content-area { margin-right: 0; }
}

/* ═══════════════════════════════════════════════════════
   33. DASHBOARD — WELCOME BAR
═══════════════════════════════════════════════════════ */
.dash-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: var(--gradient-brand);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
    color: #fff;
}
.dash-welcome h4  { color: #fff; }
.dash-welcome p   { color: rgba(255,255,255,0.8); }
/* Fix M3 item 2: date text readable on gradient */
.dash-welcome .text-muted { color: rgba(255,255,255,0.72) !important; }
.btn-add-new {
    background: rgba(255,255,255,0.18);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.1rem;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    transition: var(--transition);
}
.btn-add-new:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   34. DASHBOARD — KPI CARDS
═══════════════════════════════════════════════════════ */
.kpi-card {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 1.2rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: default;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--kpi-accent, var(--primary));
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--kpi-rgb, 33,184,204), 0.35);
}

/* Color variants — UpMedia Brand Palette */
.kpi-blue    { --kpi-accent: #21B8CC; --kpi-rgb: 33,184,204; }
.kpi-green   { --kpi-accent: #4EC794; --kpi-rgb: 78,199,148; }
.kpi-teal    { --kpi-accent: #21B8CC; --kpi-rgb: 33,184,204; }
.kpi-orange  { --kpi-accent: #FBAE42; --kpi-rgb: 251,174,66; }
.kpi-red     { --kpi-accent: #CE6A6B; --kpi-rgb: 206,106,107; }
.kpi-purple  { --kpi-accent: #7B5EA7; --kpi-rgb: 123,94,167; }
.kpi-emerald { --kpi-accent: #4EC794; --kpi-rgb: 78,199,148; }

/* Icon circle */
.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: rgba(var(--kpi-rgb, 33,184,204), 0.14);
    color: var(--kpi-accent, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Text content */
.kpi-body   { flex: 1; min-width: 0; }
.kpi-value  {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--kpi-accent, var(--primary));
}
.kpi-label  {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.2rem;
}

/* Trend line below label */
.kpi-trend  {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.trend-up   { color: #4EC794; }
.trend-down { color: #CE6A6B; }

/* Full-card invisible link */
.kpi-link {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════
   35. DASHBOARD — CHART CARDS
═══════════════════════════════════════════════════════ */
.chart-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
    overflow: hidden;
    transition: var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow-md); }

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* Legend dots */
.chart-legend {
    display: flex;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    gap: 0.25rem;
}
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Completion rate badge on donut card */
.completion-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(78, 199, 148, 0.15);
    border: 2px solid rgba(78, 199, 148, 0.3);
    color: #4EC794;
    font-weight: 700;
    line-height: 1.1;
}
.completion-badge span { font-size: 0.9rem; }
.completion-badge small { font-size: 0.6rem; opacity: 0.8; }

/* ═══════════════════════════════════════════════════════
   36. DASHBOARD — QUICK ACTIONS GRID
═══════════════════════════════════════════════════════ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}
@media (max-width: 575.98px) {
    .quick-actions-grid { grid-template-columns: repeat(4, 1fr); }
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.9rem 0.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    color: var(--text-primary);
    cursor: pointer;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
}
.quick-action-item i {
    font-size: 1.25rem;
    color: var(--qa-color, var(--primary));
    transition: var(--transition);
}
.quick-action-item span { line-height: 1.2; color: var(--text-secondary); }
.quick-action-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background: rgba(var(--qa-rgb, 33,184,204), 0.1);
    border-color: rgba(var(--qa-rgb, 33,184,204), 0.3);
    color: var(--text-primary);
}
.quick-action-item:hover i { color: var(--qa-color, var(--primary)); }

/* Quick action color variants — UpMedia Brand Palette */
.qa-blue   { --qa-color: #21B8CC; --qa-rgb: 33,184,204; }
.qa-green  { --qa-color: #4EC794; --qa-rgb: 78,199,148; }
.qa-teal   { --qa-color: #21B8CC; --qa-rgb: 33,184,204; }
.qa-orange { --qa-color: #FBAE42; --qa-rgb: 251,174,66; }
.qa-red    { --qa-color: #CE6A6B; --qa-rgb: 206,106,107; }
.qa-purple { --qa-color: #7B5EA7; --qa-rgb: 123,94,167; }
.qa-gray   { --qa-color: #6B8CAE; --qa-rgb: 107,140,174; }
.qa-dark   { --qa-color: #A8C8DC; --qa-rgb: 168,200,220; }

/* ═══════════════════════════════════════════════════════
   37. DASHBOARD — TABLES
═══════════════════════════════════════════════════════ */
.dash-table thead th {
    font-size: 0.75rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.04);
}
.dash-table tbody td {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
}
.dash-link {
    color: var(--text-primary);
    font-weight: 600;
}
.dash-link:hover { color: var(--primary); }

/* Section dot before card titles */
.section-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════
   38. DASHBOARD — ENTRANCE ANIMATION
═══════════════════════════════════════════════════════ */
@keyframes animateIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: animateIn 0.45s ease both;
    animation-delay: var(--delay, 0s);
}

/* Counter number animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.counter { animation: countUp 0.6s ease both; animation-delay: var(--delay, 0.1s); }

/* ═══════════════════════════════════════════════════════
   39. DASHBOARD — RESPONSIVE OVERRIDES
═══════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .kpi-card    { padding: 1rem; }
    .kpi-value   { font-size: 1.3rem; }
    .kpi-icon    { width: 42px; height: 42px; font-size: 1.1rem; }
    .dash-welcome { padding: 1rem 1.1rem; }
    .quick-actions-grid { grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
    .quick-action-item  { padding: 0.65rem 0.25rem; font-size: 0.65rem; }
    .quick-action-item i { font-size: 1rem; }
    .chart-card-header  { padding: 0.75rem 1rem; }
}
@media (max-width: 400px) {
    .kpi-value { font-size: 1.1rem; }
    .quick-actions-grid { grid-template-columns: repeat(4, 1fr); gap: 0.3rem; }
}

/* ═══════════════════════════════════════════════════════
   40. LIVE SEARCH DROPDOWN
═══════════════════════════════════════════════════════ */
.live-search-drop {
    position: fixed;
    z-index: 9500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: none;
    min-width: 320px;
    max-height: 480px;
    overflow-y: auto;
    /* entrance */
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.live-search-drop.lsd-visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.live-search-drop::-webkit-scrollbar { width: 4px; }
.live-search-drop::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

/* Loading */
.lsd-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.lsd-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

/* Empty state */
.lsd-empty {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.lsd-empty i { font-size: 1.2rem; opacity: 0.5; }

/* Header bar */
.lsd-header {
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Scrollable list */
.lsd-list { padding: 0.4rem 0; }

/* Group label */
.lsd-group-lbl {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 1rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.lsd-group-cnt {
    background: var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* Result item */
.lsd-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.12s ease;
    cursor: pointer;
}
.lsd-item:hover, .lsd-item.lsd-on {
    background: var(--bg-body);
    color: var(--text-primary);
    text-decoration: none;
}
.lsd-item.lsd-on { background: var(--primary-light); }

/* Type icon circle */
.lsd-item-ic {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Text block */
.lsd-item-txt { flex: 1; min-width: 0; }
.lsd-item-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lsd-item-sub {
    display: block;
    font-size: 0.73rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status badge in dropdown */
.lsd-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2em 0.55em;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.lsd-badge-active      { background: var(--success-light); color: var(--success); }
.lsd-badge-inactive    { background: rgba(107,140,174,0.2); color: #7A9DB5; }
.lsd-badge-lead        { background: var(--info-light);    color: var(--info); }
.lsd-badge-pending     { background: var(--warning-light); color: var(--warning); }
.lsd-badge-in_progress { background: var(--primary-light); color: var(--primary); }
.lsd-badge-review      { background: var(--info-light);    color: var(--info); }
.lsd-badge-completed,
.lsd-badge-done        { background: var(--success-light); color: var(--success); }
.lsd-badge-cancelled   { background: var(--danger-light);  color: var(--danger); }
.lsd-badge-todo        { background: rgba(107,140,174,0.2); color: #7A9DB5; }
.lsd-badge-paid        { background: var(--success-light); color: var(--success); }
.lsd-badge-overdue     { background: var(--danger-light);  color: var(--danger); }
.lsd-badge-sent        { background: var(--info-light);    color: var(--info); }
.lsd-badge-draft       { background: rgba(107,140,174,0.2); color: #7A9DB5; }
.lsd-badge-partial     { background: var(--warning-light); color: var(--warning); }

/* Footer link */
.lsd-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    background: var(--bg-body);
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    transition: var(--transition);
}
.lsd-footer:hover { background: var(--primary-light); color: var(--primary); }

/* ═══════════════════════════════════════════════════════
   41. SEARCH PAGE
═══════════════════════════════════════════════════════ */

/* Search bar */
.search-page-bar { max-width: 760px; margin: 0 auto; }
.search-page-form {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.search-page-input-wrap {
    flex: 1;
    position: relative;
}
.search-page-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 1rem;
    z-index: 2;
}
.search-page-input {
    padding-right: 2.6rem !important;
    padding-left: 2.5rem !important;
    height: 50px;
    font-size: 1rem;
    border-radius: var(--radius-xl) !important;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}
.search-page-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-clear-btn {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    z-index: 2;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
}
.search-clear-btn:hover { color: var(--danger); background: var(--danger-light); }
.search-page-btn {
    height: 50px;
    padding: 0 1.5rem;
    border-radius: var(--radius-xl) !important;
    font-weight: 600;
    white-space: nowrap;
}

/* Meta / summary */
.search-meta { font-size: 0.88rem; color: var(--text-muted); }
.search-meta-count { }

/* Filter tabs */
.search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}
.search-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    text-decoration: none;
}
.search-tabs .nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.search-tabs .nav-link.active {
    color: var(--primary);
    background: var(--bg-card);
    border-color: var(--border-color);
    border-bottom-color: var(--bg-card);
}
.tab-count {
    background: var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}
.search-tabs .nav-link.active .tab-count {
    background: var(--primary);
    color: #fff;
}

/* Section block */
.search-section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.search-section-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.search-section-count {
    background: var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Cards grid */
.search-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.65rem;
}

/* Individual result card */
.search-result-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
}
.search-result-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text-primary);
    text-decoration: none;
}
.src-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.src-body { flex: 1; min-width: 0; }
.src-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.src-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.src-badge, .src-badges { flex-shrink: 0; }

/* Highlighted term */
mark {
    background: rgba(251, 174, 66, 0.3);
    color: #FBAE42;
    border-radius: 2px;
    padding: 0 1px;
}

/* Empty / welcome states */
.search-empty-state, .search-welcome {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}
.search-empty-state i, .search-welcome-icon {
    font-size: 3.5rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}
.search-empty-state h5, .search-welcome h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.search-empty-state p, .search-welcome p { font-size: 0.875rem; }

/* Keyboard shortcuts hint */
.search-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}
.shortcut-chip {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
kbd {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-family: monospace;
    color: var(--text-primary);
    box-shadow: 0 1px 0 var(--border-color);
}

/* Responsive */
@media (max-width: 767.98px) {
    .search-page-bar   { max-width: 100%; }
    .search-page-form  { flex-wrap: wrap; }
    .search-page-btn   { width: 100%; justify-content: center; }
    .search-cards-grid { grid-template-columns: 1fr; }
    .search-shortcuts  { display: none; }
    .live-search-drop  { min-width: 0; width: calc(100vw - 2rem) !important; left: 1rem !important; }
}

/* ═══════════════════════════════════════════════════════
   42. BOOTSTRAP DARK THEME OVERRIDES
═══════════════════════════════════════════════════════ */

/* Dropdown menus */
.dropdown-menu {
    --bs-dropdown-bg:               var(--bg-card);
    --bs-dropdown-color:            var(--text-primary);
    --bs-dropdown-border-color:     var(--border-color);
    --bs-dropdown-link-color:       var(--text-primary);
    --bs-dropdown-link-hover-color: var(--primary);
    --bs-dropdown-link-hover-bg:    rgba(255,255,255,0.05);
    background-color:               var(--bg-card);
    border-color:                   var(--border-color);
}
.dropdown-item { color: var(--text-primary); }
.dropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--primary); }
.dropdown-divider { border-color: var(--border-color); }

/* Bootstrap modals */
.modal-content {
    background:   var(--bg-card);
    border-color: var(--border-color);
    color:        var(--text-primary);
}
.modal-header { border-color: var(--border-color); }
.modal-footer { border-color: var(--border-color); }

/* Bootstrap form controls */
.form-control, .form-select {
    background-color: var(--bg-card);
    border-color:     var(--border-color);
    color:            var(--text-primary);
}
.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: rgba(255,255,255,0.04);
    color:            var(--text-muted);
}
.form-control::placeholder { color: var(--text-muted); }

/* Input group text */
.input-group-text {
    background-color: rgba(255,255,255,0.05);
    border-color:     var(--border-color);
    color:            var(--text-secondary);
}

/* Bootstrap tables on dark */
.table {
    --bs-table-color:       var(--text-primary);
    --bs-table-bg:          transparent;
    --bs-table-border-color: var(--border-color);
    color: var(--text-primary);
}
.table thead th {
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}
.table td, .table th {
    border-color: var(--border-color);
}

/* Bootstrap breadcrumb */
.breadcrumb-item.active { color: var(--text-secondary); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* Bootstrap pagination */
.page-link {
    background-color: var(--bg-card);
    border-color:     var(--border-color);
    color:            var(--text-secondary);
}
.page-item.disabled .page-link {
    background-color: rgba(255,255,255,0.04);
    border-color:     var(--border-color);
    color:            var(--text-muted);
}

/* Bootstrap list group */
.list-group-item {
    background-color: var(--bg-card);
    border-color:     var(--border-color);
    color:            var(--text-primary);
}

/* Bootstrap nav-tabs override */
.nav-tabs {
    --bs-nav-tabs-border-color: var(--border-color);
    border-bottom-color: var(--border-color);
}
.nav-tabs .nav-link { color: var(--text-secondary); }
.nav-tabs .nav-link.active {
    background-color: var(--bg-card);
    border-color: var(--border-color) var(--border-color) var(--bg-card);
    color: var(--primary);
}

/* Bootstrap progress */
.progress { background-color: rgba(255,255,255,0.08); }

/* Bootstrap utility overrides */
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.border         { border-color: var(--border-color) !important; }
.border-bottom  { border-bottom-color: var(--border-color) !important; }
.border-top     { border-top-color: var(--border-color) !important; }
.bg-light       { background-color: rgba(255,255,255,0.06) !important; }
.bg-white       { background-color: var(--bg-card) !important; }
hr              { border-color: var(--border-color); opacity: 1; }

/* Badge Bootstrap overrides */
.bg-secondary { background-color: rgba(107,140,174,0.25) !important; color: #7A9DB5 !important; }
.bg-primary   { background-color: var(--primary) !important; }
.bg-success   { background-color: var(--success) !important; }
.bg-danger    { background-color: var(--danger) !important; }
.bg-warning   { background-color: var(--warning) !important; color: #041421 !important; }
.bg-info      { background-color: var(--info) !important; }

/* Card overrides */
.card {
    --bs-card-bg:           var(--bg-card);
    --bs-card-border-color: var(--border-color);
    --bs-card-cap-bg:       var(--bg-card);
}
.card-header { color: var(--text-primary); }
.card-body   { color: var(--text-primary); }
.card-footer { background-color: rgba(255,255,255,0.03); }
