/* ============================================
   ENTERPRISE THEME - Apex Integrated Services
   Tender Management System
   Premium SaaS Enterprise Design System
   ============================================ */

/* ============================================
   1. GOOGLE FONTS IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   2. CSS VARIABLES / ROOT
   ============================================ */
:root {
    /* Layout */
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 64px;

    /* Primary Colors */
    --primary: #0c1652;
    --primary-light: #1d2b72;
    --primary-dark: #09103a;

    /* Accent Colors */
    --brand-gold: #fdce22;
    --brand-gold-soft: #f6df86;
    --brand-ink: #1f252a;
    --accent-rgb: 184, 137, 17;
    --accent: #b88911;
    --accent-hover: #9b700d;
    --accent-dark: #7d5a08;
    --accent-light: rgba(var(--accent-rgb), 0.14);
    --accent-lighter: rgba(var(--accent-rgb), 0.07);

    /* Surface & Background */
    --surface: #f7f4ea;
    --surface-hover: #efe5c8;
    --card-bg: #ffffff;

    /* Text Colors */
    --text-primary: #1f252a;
    --text-secondary: #4f5b66;
    --text-muted: #7a8592;
    --text-inverse: #ffffff;

    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    /* Status Colors */
    --success: #10b981;
    --success-dark: #059669;
    --success-light: rgba(16, 185, 129, 0.1);

    --warning: #f59e0b;
    --warning-dark: #d97706;
    --warning-light: rgba(245, 158, 11, 0.1);

    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: rgba(239, 68, 68, 0.1);

    --info: #3b82f6;
    --info-dark: #2563eb;
    --info-light: rgba(59, 130, 246, 0.1);

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --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 -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);

    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Legacy Variable Aliases */
    --bg-body: var(--surface);
    --bg-card: var(--card-bg);
    --bg-sidebar: var(--primary);
    --bg-topbar: var(--card-bg);
    --text-sidebar: rgba(255, 255, 255, 0.7);
    --text-sidebar-active: #ffffff;
    --success-bg: var(--success-light);
    --warning-bg: var(--warning-light);
    --danger-bg: var(--danger-light);
    --info-bg: var(--info-light);
    --accent-glow: rgba(var(--accent-rgb), 0.18);
}


/* ============================================
   3. GLOBAL RESET & TYPOGRAPHY
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.1rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

/* Paragraph */
p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Small text & muted text */
small,
.text-small {
    font-size: 0.8rem;
}

.text-xs {
    font-size: 0.7rem;
}

.text-sm {
    font-size: 0.8125rem;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

/* Focus ring */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Selection */
::selection {
    background-color: var(--accent);
    color: var(--text-inverse);
}


/* ============================================
   4. LAYOUT WRAPPER
   ============================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}


/* ============================================
   5. SIDEBAR STYLING
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--primary);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Sidebar Brand / Logo Area */
.sidebar-brand {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand-gold) 0%, #efb81a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.24);
}

.sidebar-brand .brand-name,
.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
}

.sidebar-brand .brand-sub,
.sidebar-brand-subtitle {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.sidebar-brand img {
    max-width: 42px;
    height: auto;
    filter: brightness(1.1);
}

/* Sidebar Navigation Container */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
}

/* Sidebar Section Labels */
.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 20px 20px 6px;
    margin: 0;
    line-height: 1;
}

/* Sidebar Nav Links */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.65);
    padding: 0.6rem 1rem;
    margin: 1px 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.835rem;
    font-weight: 450;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-link:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.sidebar .nav-link.active {
    color: var(--primary-dark);
    background: linear-gradient(135deg, var(--brand-gold) 0%, #efb81a 100%);
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.28);
    font-weight: 600;
}

.sidebar .nav-link.active:hover {
    background: linear-gradient(135deg, #f8c625 0%, var(--accent) 100%);
}

/* Sidebar Nav Link Icons */
.sidebar .nav-link i,
.sidebar .nav-link .nav-icon {
    width: 18px;
    font-size: 0.9rem;
    opacity: 0.75;
    text-align: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.sidebar .nav-link.active i,
.sidebar .nav-link.active .nav-icon {
    opacity: 1;
}

.sidebar .nav-link:hover i,
.sidebar .nav-link:hover .nav-icon {
    opacity: 0.9;
}

/* Sidebar Nav Badge (notification counts) */
.sidebar .nav-link .nav-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    min-width: 22px;
    text-align: center;
}

.sidebar .nav-link.active .nav-badge {
    background: rgba(9, 16, 58, 0.14);
    color: var(--primary-dark);
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.75rem 1rem;
}

/* Sidebar Scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Sidebar Footer / User Area (Bottom) */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-user {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user .user-avatar,
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.sidebar-user .user-info,
.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name,
.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role,
.sidebar-user-role {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-action {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    cursor: pointer;
}

.sidebar-user-action:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-brand-subtitle,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-action,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-sub,
.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    margin: 1px 8px;
    padding: 0.7rem;
}

.sidebar.collapsed .nav-link i,
.sidebar.collapsed .nav-link .nav-icon {
    margin-right: 0;
}


/* ============================================
   6. TOP HEADER BAR
   ============================================ */
.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
    gap: 16px;
}

/* Topbar Left Section */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.topbar-toggle,
.sidebar-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.1rem;
}

.topbar-toggle:hover,
.sidebar-toggle:hover {
    background: var(--surface);
    color: var(--text-primary);
}

/* Topbar Breadcrumb */
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.835rem;
    color: var(--text-muted);
}

.topbar-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.topbar-breadcrumb a:hover {
    color: var(--accent);
}

.topbar-breadcrumb .separator {
    color: var(--border-dark);
    font-size: 0.7rem;
}

.topbar-breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Topbar Right Section */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Topbar Search */
.topbar-search {
    position: relative;
}

.topbar-search input {
    width: 280px;
    padding: 8px 14px 8px 38px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--surface);
    font-size: 0.835rem;
    color: var(--text-primary);
    transition: var(--transition);
    font-family: var(--font-family);
}

.topbar-search input::placeholder {
    color: var(--text-muted);
}

.topbar-search input:focus {
    background: var(--card-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
    width: 340px;
    outline: none;
}

.topbar-search i,
.topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

/* Topbar Icon Buttons */
.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    font-size: 1.05rem;
}

.topbar-icon-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

/* Topbar Notification Badge */
.topbar-notification-badge,
.topbar-icon-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--card-bg);
}

.topbar-notification-badge.has-count {
    width: auto;
    height: auto;
    padding: 0 5px;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
    top: 2px;
    right: 0px;
    line-height: 16px;
    border-radius: var(--radius-full);
}

/* Topbar Divider */
.topbar-divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
    margin: 0 4px;
}

/* Topbar User */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.topbar-user:hover {
    background: var(--surface);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.topbar-user-info {
    line-height: 1.3;
}

.topbar-username {
    font-size: 0.835rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.topbar-user-chevron {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-left: 4px;
}


/* ============================================
   7. MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    background: var(--surface);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100vw - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
    box-sizing: border-box;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100vw - var(--sidebar-collapsed-width));
    max-width: calc(100vw - var(--sidebar-collapsed-width));
}

.content-wrapper {
    padding: 24px 28px;
    max-width: 1600px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-left {
    flex: 1;
}

.page-header h1,
.page-header h2,
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.page-header .page-subtitle,
.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 2px;
    margin-bottom: 0;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    font-size: 0.8rem;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--border-dark);
    content: "\203A";
    font-size: 0.9rem;
}


/* ============================================
   8. CARD STYLING
   ============================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 24px;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--card-bg) !important;
    background-image: none !important;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header .card-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header .card-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Card header with gradient accent bar */
.card-header-accent {
    border-top: 3px solid var(--accent);
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 14px 20px;
}

/* Stats Cards */
.stat-card {
    border-left: 4px solid transparent;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card .stat-content .stat-value,
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card .stat-content .stat-label,
.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-card .stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.stat-card .stat-trend.up {
    color: var(--success);
    background: var(--success-light);
}

.stat-card .stat-trend.down {
    color: var(--danger);
    background: var(--danger-light);
}

/* Stat Card Variants */
.stat-card.stat-primary {
    border-left-color: var(--accent);
}

.stat-card.stat-primary .stat-icon,
.stat-card .stat-icon.bg-primary-soft {
    background: var(--accent-light);
    color: var(--accent);
}

.stat-card.stat-success {
    border-left-color: var(--success);
}

.stat-card.stat-success .stat-icon,
.stat-card .stat-icon.bg-success-soft {
    background: var(--success-light);
    color: var(--success);
}

.stat-card.stat-warning {
    border-left-color: var(--warning);
}

.stat-card.stat-warning .stat-icon,
.stat-card .stat-icon.bg-warning-soft {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-card.stat-danger {
    border-left-color: var(--danger);
}

.stat-card.stat-danger .stat-icon,
.stat-card .stat-icon.bg-danger-soft {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-card.stat-info {
    border-left-color: var(--info);
}

.stat-card.stat-info .stat-icon,
.stat-card .stat-icon.bg-info-soft {
    background: var(--info-light);
    color: var(--info);
}

/* Legacy stats-card support */
.stats-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
}


/* ============================================
   9. TABLE STYLING
   ============================================ */
.table {
    font-size: 0.835rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 0;
}

.table > thead > tr > th,
.table thead th {
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    border-top: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table > tbody > tr > td,
.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table > tbody > tr:hover > td,
.table-hover tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.04);
}

.table > tbody > tr:last-child > td {
    border-bottom: none;
}

/* Remove Bootstrap striping */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: transparent;
}

/* Table Actions Column */
.table-actions {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    align-items: center;
}

.table-actions .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Table Inside Cards */
.card .table {
    margin-bottom: 0;
}

.card .table thead th:first-child {
    padding-left: 20px;
}

.card .table tbody td:first-child {
    padding-left: 20px;
}

.card .table thead th:last-child {
    padding-right: 20px;
}

.card .table tbody td:last-child {
    padding-right: 20px;
}

/* Inline formset / table-form */
.table .form-control,
.table .form-select {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Table Row Link */
.table tbody tr.clickable-row {
    cursor: pointer;
}

.table tbody tr.clickable-row:hover {
    background: var(--accent-lighter);
}

/* Responsive Table Wrapper */
.table-responsive {
    border-radius: var(--radius-lg);
    border: none;
    overflow: hidden;
}

/* Bootstrap override */
.table > :not(caption) > * > * {
    border-bottom-color: var(--border-light);
    box-shadow: none;
}

.table-primary {
    background-color: var(--accent-light);
}


/* ============================================
   10. BUTTON STYLING
   ============================================ */
.btn {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.835rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    background-image: none !important;
}

.btn:active {
    transform: scale(0.98);
}

/* Button Sizes */
.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 0.95rem;
    border-radius: var(--radius);
}

.btn-xs {
    padding: 3px 8px;
    font-size: 0.72rem;
}

/* Primary Button */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 1px 3px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* Outline Primary */
.btn-outline-primary {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

/* Success Button */
.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: white;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.btn-success:hover,
.btn-success:focus {
    background: var(--success-dark);
    border-color: var(--success-dark);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-outline-success {
    border-color: var(--success);
    color: var(--success);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover,
.btn-danger:focus {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.btn-outline-danger {
    border-color: var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* Warning Button */
.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover,
.btn-warning:focus {
    background: var(--warning-dark);
    border-color: var(--warning-dark);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.btn-outline-warning {
    border-color: var(--warning);
    color: var(--warning);
    background: transparent;
}

.btn-outline-warning:hover {
    background: var(--warning-light);
    border-color: var(--warning);
    color: #b45309;
}

/* Info Button */
.btn-info {
    background: var(--info);
    border-color: var(--info);
    color: white;
}

.btn-info:hover,
.btn-info:focus {
    background: var(--info-dark);
    border-color: var(--info-dark);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

/* Light Button */
.btn-light {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-light:hover,
.btn-light:focus {
    background: var(--surface);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

/* Secondary Button */
.btn-secondary {
    background: #e2e8f0;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: #cbd5e1;
    border-color: var(--border-dark);
    color: var(--text-primary);
}

/* Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

.btn-icon.btn-lg {
    width: 44px;
    height: 44px;
}

/* Button Group */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}


/* ============================================
   11. BADGE STYLING (Soft badges)
   ============================================ */
.badge {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

.badge.bg-success {
    background: var(--success-light) !important;
    color: var(--success) !important;
}

.badge.bg-warning {
    background: var(--warning-light) !important;
    color: #b45309 !important;
}

.badge.bg-danger {
    background: var(--danger-light) !important;
    color: var(--danger) !important;
}

.badge.bg-info {
    background: var(--info-light) !important;
    color: var(--info) !important;
}

.badge.bg-primary {
    background: var(--accent-light) !important;
    color: var(--accent) !important;
}

.badge.bg-secondary {
    background: #f1f5f9 !important;
    color: var(--text-secondary) !important;
}

.badge.bg-dark {
    background: rgba(15, 23, 42, 0.1) !important;
    color: var(--primary) !important;
}

/* Badge with dot */
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}


/* ============================================
   12. FORM STYLING
   ============================================ */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    padding: 9px 14px;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
    font-family: var(--font-family);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
    outline: none;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--surface);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Form Label */
.form-label {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Form Help Text */
.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Checkbox & Radio */
.form-check-input {
    border-color: var(--border-dark);
    transition: var(--transition-fast);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Form Switch */
.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    border-radius: var(--radius-full);
}

/* Input Group */
.input-group .form-control {
    border-radius: var(--radius-sm);
}

.input-group-text {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
}

/* Textarea */
textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* Validation States */
.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--danger-light);
}

.form-control.is-valid {
    border-color: var(--success);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px var(--success-light);
}

.invalid-feedback {
    font-size: 0.75rem;
    color: var(--danger);
}

.valid-feedback {
    font-size: 0.75rem;
    color: var(--success);
}

/* Form Floating */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.25rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating > label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Fieldset & Legend */
fieldset {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

legend {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 8px;
    width: auto;
}


/* ============================================
   13. ALERT STYLING
   ============================================ */
.alert {
    border-radius: var(--radius);
    border: none;
    font-size: 0.875rem;
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 4px solid transparent;
    font-weight: 450;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-left-color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-left-color: var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-left-color: var(--danger);
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border-left-color: var(--info);
}

.alert .alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert .btn-close {
    filter: none;
    opacity: 0.5;
    font-size: 0.7rem;
    padding: 8px;
}

.alert .btn-close:hover {
    opacity: 0.8;
}


/* ============================================
   14. PAGINATION
   ============================================ */
.pagination {
    gap: 4px;
    margin-bottom: 0;
}

.page-item .page-link,
.page-link {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 0.835rem;
    font-weight: 500;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    font-family: var(--font-family);
    min-width: 36px;
    text-align: center;
}

.page-item .page-link:hover,
.page-link:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.page-item.active .page-link {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.page-item.disabled .page-link {
    background: var(--surface);
    color: var(--text-muted);
    box-shadow: none;
    opacity: 0.6;
}


/* ============================================
   15. PROGRESS BARS
   ============================================ */
.progress {
    height: 8px;
    border-radius: 10px;
    background: var(--border-light);
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    background: var(--accent);
    transition: width 0.6s ease;
}

.progress-bar.bg-success {
    background: var(--success) !important;
}

.progress-bar.bg-warning {
    background: var(--warning) !important;
}

.progress-bar.bg-danger {
    background: var(--danger) !important;
}

.progress-bar.bg-info {
    background: var(--info) !important;
}

/* Thin Progress */
.progress.progress-thin {
    height: 4px;
}

/* Large Progress */
.progress.progress-lg {
    height: 12px;
}

/* Progress with label */
.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.78rem;
}

.progress-label .progress-title {
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-label .progress-value {
    color: var(--text-primary);
    font-weight: 600;
}


/* ============================================
   16. MODAL
   ============================================ */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    background: var(--card-bg);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    background: var(--card-bg);
}

.modal-backdrop.show {
    opacity: 0.4;
}

/* Modal Sizes */
.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 720px;
}

.modal-xl {
    max-width: 960px;
}


/* ============================================
   17. DROPDOWN
   ============================================ */
.dropdown-menu {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    margin-top: 4px;
    font-size: 0.835rem;
    min-width: 180px;
    animation: dropdownFade 0.15s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.835rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--surface);
    color: var(--text-primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--accent-light);
    color: var(--accent);
}

.dropdown-item i {
    width: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.dropdown-item:hover i {
    color: var(--text-secondary);
}

.dropdown-divider {
    margin: 4px 0;
    border-color: var(--border-color);
}

.dropdown-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 14px 4px;
}


/* ============================================
   18. NAV TABS & PILLS
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 4px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 18px;
    margin-bottom: -2px;
    transition: var(--transition-fast);
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-dark);
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
    font-weight: 600;
}

/* Nav Pills */
.nav-pills {
    gap: 4px;
}

.nav-pills .nav-link {
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.835rem;
    font-weight: 500;
    padding: 8px 16px;
    transition: var(--transition-fast);
}

.nav-pills .nav-link:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.nav-pills .nav-link.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}


/* ============================================
   19. TOOLTIP & POPOVER
   ============================================ */
.tooltip-inner {
    background: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    padding: 6px 12px;
    font-family: var(--font-family);
    max-width: 250px;
}

.popover {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-family);
}

.popover-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 10px 14px;
}

.popover-body {
    padding: 12px 14px;
    font-size: 0.835rem;
    color: var(--text-secondary);
}


/* ============================================
   20. TOAST / NOTIFICATION
   ============================================ */
.toast {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-family);
    font-size: 0.875rem;
}

.toast-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.835rem;
    padding: 10px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.toast-body {
    padding: 12px 14px;
    color: var(--text-secondary);
}


/* ============================================
   21. ACCORDION
   ============================================ */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius) !important;
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-button {
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 14px 18px;
    background: var(--card-bg);
    border: none;
    box-shadow: none;
}

.accordion-button:not(.collapsed) {
    color: var(--accent);
    background: var(--accent-lighter);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
    border-color: transparent;
}

.accordion-button::after {
    background-size: 1rem;
}

.accordion-body {
    padding: 16px 18px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}


/* ============================================
   22. LIST GROUP
   ============================================ */
.list-group-item {
    border-color: var(--border-color);
    padding: 12px 18px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.list-group-item:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.list-group-item.active {
    background: var(--accent);
    border-color: var(--accent);
}

.list-group-item-action:hover {
    background: var(--accent-lighter);
    color: var(--text-primary);
}


/* ============================================
   23. CUSTOM UTILITY CLASSES
   ============================================ */

/* Text Colors */
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

/* Background Colors */
.bg-accent { background-color: var(--accent) !important; }
.bg-accent-light,
.bg-accent-soft { background-color: var(--accent-light) !important; }
.bg-surface { background-color: var(--surface) !important; }

/* Border Colors */
.border-accent { border-color: var(--accent) !important; }

/* Shadows */
.shadow-accent { box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.2) !important; }
.shadow-none { box-shadow: none !important; }

/* Hover Lift Effect */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

/* Truncate */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Font Weight Utilities */
.fw-medium { font-weight: 500; }
.fw-450 { font-weight: 450; }

/* Gap Utilities */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 24px; }


/* ============================================
   24. EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i,
.empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h5,
.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state p,
.empty-state-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 400px;
    margin: 8px auto 20px;
    line-height: 1.6;
}

.empty-state .btn {
    margin-top: 8px;
}


/* ============================================
   25. STATUS INDICATOR DOTS
   ============================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    flex-shrink: 0;
}

.status-dot.active,
.status-dot.success {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-dot.pending,
.status-dot.warning {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-dot.inactive,
.status-dot.muted {
    background: var(--text-muted);
}

.status-dot.danger,
.status-dot.error {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-dot.info {
    background: var(--info);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Pulsing status dot */
.status-dot.pulse {
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}


/* ============================================
   26. DATA DISPLAY COMPONENTS
   ============================================ */

/* Key-Value Pairs */
.data-pair {
    margin-bottom: 16px;
}

.data-pair-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.data-pair-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--card-bg);
    z-index: 1;
}

.timeline-item .timeline-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-item .timeline-content {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Activity Feed */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    font-size: 0.835rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.activity-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}


/* ============================================
   27. CHART / WIDGET CONTAINERS
   ============================================ */
.chart-container {
    position: relative;
    padding: 16px 0;
}

.chart-container canvas {
    max-width: 100%;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.widget-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.widget-action {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.widget-action:hover {
    color: var(--accent-hover);
}


/* ============================================
   28. ANIMATIONS
   ============================================ */

/* Fade In */
.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide Up (page load) */
.content-wrapper > * {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Right */
.animate-slide-right {
    animation: slideRight 0.3s ease;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
.animate-scale-in {
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spinner */
.spinner-border {
    border-color: var(--accent);
    border-right-color: transparent;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, #e2e8f0 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ============================================
   29. SCROLLBAR GLOBAL
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}


/* ============================================
   30. BOOTSTRAP OVERRIDES
   ============================================ */

/* Remove all Bootstrap gradients */
.bg-primary { background-color: var(--accent) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-info { background-color: var(--info) !important; }

.text-primary { color: var(--accent) !important; }
.border-primary { border-color: var(--accent) !important; }

/* Override link colors */
.link-primary {
    color: var(--accent) !important;
}

.link-primary:hover {
    color: var(--accent-hover) !important;
}

/* Override Bootstrap close button */
.btn-close:focus {
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

/* Override container fluid */
.container-fluid {
    padding: 0;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Override Bootstrap container width for large screens */
@media (min-width: 1400px) {
    .content-wrapper .container-fluid {
        max-width: 1400px;
    }
}


/* ============================================
   31. RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1200px) {
    .content-wrapper {
        padding: 20px;
    }

    .topbar-search input {
        width: 220px;
    }

    .topbar-search input:focus {
        width: 260px;
    }
}

@media (max-width: 991.98px) {
    /* Sidebar hidden on tablet/mobile */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }

    .sidebar.show,
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        left: 0;
    }

    /* Main content full width */
    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
        padding: 16px;
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    .topbar-search {
        display: none;
    }

    .topbar-user-info {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Content adjustments */
    .content-wrapper {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header h1,
    .page-header h2,
    .page-title {
        font-size: 1.25rem;
    }

    /* Topbar adjustments */
    .topbar {
        padding: 0 16px;
    }

    .topbar-divider {
        display: none;
    }

    /* Table responsive */
    .table-responsive {
        font-size: 0.8rem;
    }

    /* Cards */
    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 14px 16px;
    }

    /* Stat cards stacked */
    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    /* Modal adjustments */
    .modal-body {
        padding: 16px;
    }

    .modal-header,
    .modal-footer {
        padding: 14px 16px;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper,
    .main-content {
        padding: 12px;
    }

    .topbar {
        padding: 0 12px;
    }

    .topbar-search {
        display: none;
    }

    .btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    .page-header h1,
    .page-header h2,
    .page-title {
        font-size: 1.15rem;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    .topbar-icon-btn {
        width: 36px;
        height: 36px;
    }
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1045;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show,
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}


/* ============================================
   32. PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .topbar,
    .sidebar-toggle,
    .sidebar-overlay,
    .page-header-actions,
    .topbar-icon-btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        margin-top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    body {
        background: white !important;
        color: #000 !important;
        font-size: 12px;
    }

    .content-wrapper {
        padding: 0 !important;
    }

    .btn {
        display: none !important;
    }
}


/* ============================================
   33. DARK MODE SUPPORT (Optional toggle)
   ============================================ */
[data-theme="dark"] {
    --surface: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
    --border-dark: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --bg-body: var(--surface);
    --bg-card: var(--card-bg);
}

[data-theme="dark"] .topbar {
    background: var(--card-bg);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .table thead th {
    background: var(--primary);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-light {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary {
    background: var(--primary-light);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] .page-link {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg);
}

[data-theme="dark"] .accordion-button {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .list-group-item {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}


/* ============================================
   34. ENTERPRISE PAGE COMPONENTS
   ============================================ */

/* Content Padding for main-content */
.main-content {
    padding: 24px 28px;
}

@media (max-width: 991.98px) {
    .main-content {
        padding: 16px;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 12px;
    }
}

/* Info Grid - Used on detail pages for key-value data display */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.info-grid .info-item {
    padding: 0;
}

.info-grid .info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-grid .info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.info-grid .info-value.text-lg {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Section Header inside cards */
.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--accent);
    font-size: 0.85rem;
}

/* Detail Page Header */
.detail-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 28px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.detail-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(var(--accent-rgb), 0.08);
    border-radius: 50%;
}

.detail-header .detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
}

.detail-header .detail-subtitle {
    font-size: 0.875rem;
    opacity: 0.8;
    position: relative;
}

.detail-header .detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    font-size: 0.78rem;
    font-weight: 500;
    color: white;
    margin-top: 12px;
}

.detail-header .detail-actions {
    position: relative;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-header .detail-actions .btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    backdrop-filter: blur(10px);
}

.detail-header .detail-actions .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Quick Stats Row - Compact stat cards for module dashboards */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quick-stat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    text-decoration: none !important;
    color: inherit !important;
}

.quick-stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-stat .quick-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.quick-stat .quick-stat-content {
    flex: 1;
    min-width: 0;
}

.quick-stat .quick-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.quick-stat .quick-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Filter Card */
.filter-card {
    margin-bottom: 24px;
}

.filter-card .card-body {
    padding: 16px 20px;
}

.filter-card .form-label {
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.filter-card .btn {
    margin-top: auto;
}

/* Confirm Delete Card */
.confirm-delete-card {
    max-width: 560px;
    margin: 40px auto;
    text-align: center;
}

.confirm-delete-card .delete-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 20px;
}

.confirm-delete-card .delete-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-delete-card .delete-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-delete-card .delete-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* News Ticker */
.news-ticker-container {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1000;
    background: var(--primary-dark);
    border-top: 2px solid var(--accent);
    overflow: hidden;
}

.news-ticker {
    height: 48px;
    overflow: hidden;
    position: relative;
}

.news-ticker-content {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: scroll-left 45s linear infinite;
    padding: 0 24px;
}

.news-ticker-content:hover {
    animation-play-state: paused;
}

.news-item {
    display: inline-flex;
    align-items: center;
    margin-right: 60px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8125rem;
    font-weight: 450;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.news-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.news-item-icon {
    margin-right: 8px;
    font-size: 0.875rem;
    opacity: 0.9;
}

.news-item-text {
    font-weight: 500;
    margin-right: 10px;
}

.news-item-time {
    font-size: 0.65rem;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 7px;
    border-radius: 10px;
}

.news-separator {
    color: rgba(255, 255, 255, 0.25);
    margin: 0 20px;
    font-size: 1rem;
}

.news-item.tender-status .news-item-icon { color: var(--success); }
.news-item.quotation-created .news-item-icon { color: var(--accent); }
.news-item.purchase-order-created .news-item-icon { color: var(--warning); }
.news-item.items-received .news-item-icon { color: #8b5cf6; }
.news-item.items-delivered .news-item-icon { color: #06d6a0; }
.news-item.project-completed .news-item-icon { color: var(--success); }
.news-item.invoice-submitted .news-item-icon { color: #f97316; }
.news-item.payment-received .news-item-icon { color: var(--success); }
.news-item.system-alert .news-item-icon { color: var(--danger); }

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@media (max-width: 991.98px) {
    .news-ticker-container { left: 0; }
}

/* Form Tips / Info Boxes */
.form-tip {
    background: var(--info-light);
    border-left: 4px solid var(--info);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.835rem;
    color: #1e40af;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-tip i {
    color: var(--info);
    margin-top: 2px;
    flex-shrink: 0;
}

/* Form Section */
.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--accent-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title i {
    color: var(--accent);
}

/* Detail Sidebar */
.detail-sidebar .card {
    margin-bottom: 16px;
}

.detail-sidebar .sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.835rem;
}

.detail-sidebar .sidebar-item:last-child {
    border-bottom: none;
}

.detail-sidebar .sidebar-item i {
    width: 18px;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
}

.detail-sidebar .sidebar-item .sidebar-label {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.detail-sidebar .sidebar-item .sidebar-value {
    color: var(--text-primary);
    font-weight: 500;
    margin-left: auto;
    text-align: right;
}

/* Amount Display - for financial values */
.amount-lg {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.amount-md {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.amount-sm {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.amount-positive { color: var(--success) !important; }
.amount-negative { color: var(--danger) !important; }

/* Border-left colored cards (Account dashboard style) */
.card-accent-primary { border-left: 4px solid var(--accent) !important; }
.card-accent-success { border-left: 4px solid var(--success) !important; }
.card-accent-warning { border-left: 4px solid var(--warning) !important; }
.card-accent-danger { border-left: 4px solid var(--danger) !important; }
.card-accent-info { border-left: 4px solid var(--info) !important; }

/* FAB (Floating Action Button) */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.fab-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.5);
    background: var(--accent-hover);
}

/* Overdue styling */
.text-overdue {
    color: var(--danger) !important;
    font-weight: 600;
}

/* Action Bar (bottom of forms) */
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
}

.form-actions .btn-primary {
    min-width: 140px;
}

/* View Toggle */
.view-toggle {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 4px;
    display: inline-flex;
}

.view-toggle .btn {
    border-radius: var(--radius-sm);
}

/* Table Row with link */
.table tbody tr[data-href] {
    cursor: pointer;
}

.table tbody tr[data-href]:hover {
    background: var(--accent-lighter);
}

/* Scrollable Card Body */
.scrollable-card-body {
    max-height: 400px;
    overflow-y: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto;
}

/* Amount Display Variants */
.amount-positive { color: var(--success) !important; font-weight: 600; }
.amount-negative { color: var(--danger) !important; font-weight: 600; }

/* Info Grid Enhancement */
.info-grid .row {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.info-grid .row:last-child {
    border-bottom: none;
}

.info-grid label,
.info-grid .info-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-grid .info-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Badge Subtle Variants */
.badge.bg-primary-subtle { background: var(--accent-light) !important; color: var(--accent-dark) !important; }
.badge.bg-success-subtle { background: var(--success-light) !important; color: var(--success-dark) !important; }
.badge.bg-warning-subtle { background: var(--warning-light) !important; color: var(--warning-dark) !important; }
.badge.bg-danger-subtle { background: var(--danger-light) !important; color: var(--danger-dark) !important; }
.badge.bg-info-subtle { background: var(--info-light) !important; color: var(--info-dark) !important; }

/* Card with subtle top border accent */
.card-top-accent {
    border-top: 3px solid var(--accent);
}

/* Responsive stat-card grid improvements */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 0.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .page-header > div:last-child {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
}

/* =====================================================================
   Section 36: Enterprise Form System
   ===================================================================== */

/* Form labels - prevent wrapping and truncation */
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Form controls consistent sizing */
.form-control,
.form-select {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 38px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-lighter);
}

.form-control[readonly] {
    background: var(--surface-alt, #f1f5f9);
    color: var(--text-secondary);
    border-style: dashed;
}

/* Formset item cards */
.item-form,
.labor-form {
    background: var(--surface);
    border: 1.5px solid var(--border-color) !important;
    border-radius: var(--radius) !important;
    padding: 1.25rem !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.item-form:hover,
.labor-form:hover {
    border-color: var(--accent-light, #7dd3fc) !important;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.08);
}

.item-form.saved {
    border-left: 3px solid var(--success) !important;
}

/* Input groups */
.input-group .form-control {
    border-radius: var(--radius-sm);
}

.input-group-text {
    font-size: 0.8125rem;
    background: var(--surface-alt, #f1f5f9);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Card headers in forms */
.card-header h5 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Summary sidebar */
.card-body .row .col-8,
.card-body .row .col-4 {
    font-size: 0.875rem;
}

/* Small uppercase labels used in form grids */
.form-label.small.fw-semibold.text-muted.text-uppercase {
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

/* Responsive form grid fixes */
@media (max-width: 992px) {
    .form-label {
        white-space: normal;
        font-size: 0.75rem;
    }

    .item-form .row,
    .labor-form .row {
        gap: 0.5rem 0;
    }
}

@media (max-width: 576px) {
    .item-form,
    .labor-form {
        padding: 0.875rem !important;
    }

    .item-form .col-lg-2,
    .item-form .col-lg-3,
    .labor-form .col-lg-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Delete confirmation cards */
.card-accent-danger .card-body {
    border-top: 3px solid var(--danger);
}

/* Better select dropdowns */
select.form-control,
select.form-select {
    cursor: pointer;
    appearance: auto;
}

/* Form section dividers */
.card-body hr {
    border-color: var(--border-light);
    opacity: 0.6;
    margin: 1rem 0;
}

/* Alert within forms */
.card-body .alert {
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

/* Tooltip-style info for form fields */
.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Better spacing for stacked form rows */
.card-body .row.g-3 {
    --bs-gutter-y: 1rem;
}

/* Action buttons row in forms */
.card-body .d-flex.justify-content-between {
    padding-top: 0.5rem;
}

.card-body .d-flex.gap-2 .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ============================================
   Section 37: Workflow Stepper
   Project execution tracker with sequential steps
   ============================================ */

.workflow-stepper {
    position: relative;
    padding: 0;
}

.workflow-progress-bar {
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.workflow-progress-bar .progress-fill {
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--brand-gold, #fdce22), var(--accent, #b88911));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.workflow-progress-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}

.workflow-progress-summary .progress-label {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.workflow-step {
    display: flex;
    gap: 1rem;
    position: relative;
    padding-bottom: 0.25rem;
}

.workflow-step:last-child {
    padding-bottom: 0;
}

.workflow-step:last-child .step-connector {
    display: none;
}

/* Step number/icon column */
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 44px;
}

.step-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.step-connector {
    width: 2px;
    flex: 1;
    min-height: 20px;
    margin: 4px 0;
    border-radius: 2px;
    transition: background 0.3s ease;
}

/* Step content */
.step-content {
    flex: 1;
    padding-bottom: 1.25rem;
    min-width: 0;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.step-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    margin: 0;
    line-height: 1.3;
}

.step-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.step-description {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.step-details {
    font-size: 0.8125rem;
    color: var(--text-secondary, #475569);
    font-weight: 500;
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 8px;
    display: inline-block;
}

.step-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.step-actions .btn {
    font-size: 0.8125rem;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Status: Completed */
.workflow-step.step-completed .step-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.workflow-step.step-completed .step-connector {
    background: #10b981;
}

.workflow-step.step-completed .step-title {
    color: var(--text-primary, #0f172a);
}

.workflow-step.step-completed .step-badge {
    background: #ecfdf5;
    color: #059669;
}

/* Status: Current (active step) */
.workflow-step.step-current .step-icon {
    background: linear-gradient(135deg, var(--brand-gold, #fdce22), var(--accent, #b88911));
    color: var(--primary-dark, #09103a);
    border-color: var(--accent, #b88911);
    box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.35);
    animation: stepPulse 2s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.35); }
    50% { box-shadow: 0 2px 20px rgba(var(--accent-rgb), 0.5); }
}

.workflow-step.step-current .step-connector {
    background: linear-gradient(to bottom, var(--accent, #b88911), #e2e8f0);
}

.workflow-step.step-current .step-title {
    color: var(--accent-dark, #7d5a08);
}

.workflow-step.step-current .step-badge {
    background: #fff3c5;
    color: var(--accent-dark, #7d5a08);
}

/* Status: In Progress */
.workflow-step.step-in_progress .step-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.workflow-step.step-in_progress .step-connector {
    background: linear-gradient(to bottom, #f59e0b, #e2e8f0);
}

.workflow-step.step-in_progress .step-title {
    color: #d97706;
}

.workflow-step.step-in_progress .step-badge {
    background: #fffbeb;
    color: #d97706;
}

/* Status: Upcoming */
.workflow-step.step-upcoming .step-icon {
    background: var(--bg-secondary, #f1f5f9);
    color: #94a3b8;
    border-color: #e2e8f0;
}

.workflow-step.step-upcoming .step-connector {
    background: #e2e8f0;
}

.workflow-step.step-upcoming .step-title {
    color: #94a3b8;
}

.workflow-step.step-upcoming .step-description {
    color: #cbd5e1;
}

.workflow-step.step-upcoming .step-badge {
    background: #f1f5f9;
    color: #94a3b8;
}

/* Status: Not Applicable */
.workflow-step.step-not_applicable .step-icon {
    background: #f8fafc;
    color: #cbd5e1;
    border-color: #e2e8f0;
    border-style: dashed;
}

.workflow-step.step-not_applicable .step-connector {
    background: #e2e8f0;
    border-style: dashed;
}

.workflow-step.step-not_applicable .step-title {
    color: #cbd5e1;
    text-decoration: line-through;
}

.workflow-step.step-not_applicable .step-badge {
    background: #f8fafc;
    color: #cbd5e1;
}

/* Skipped */
.workflow-step.step-skipped .step-icon {
    background: #fef3c7;
    color: #d97706;
    border-color: #fbbf24;
    border-style: dashed;
}

.workflow-step.step-skipped .step-connector {
    background: #fde68a;
    border-style: dashed;
}

.workflow-step.step-skipped .step-title {
    color: #92400e;
    text-decoration: line-through;
    text-decoration-color: #d97706;
}

.workflow-step.step-skipped .step-description {
    color: #b45309;
    opacity: 0.6;
}

.workflow-step.step-skipped .step-badge,
.badge-skipped {
    background: #fef3c7;
    color: #d97706;
}

/* Skip/Unskip Button */
.btn-skip-step {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-skip-step:hover {
    background: #fef3c7;
    color: #d97706;
    border-color: #fbbf24;
}

.workflow-step.step-skipped .btn-skip-step {
    background: #dbeafe;
    color: #2563eb;
    border-color: #93c5fd;
}

.workflow-step.step-skipped .btn-skip-step:hover {
    background: #bfdbfe;
    color: #1d4ed8;
    border-color: #60a5fa;
}

/* Workflow card header */
.workflow-card .card-header {
    background: linear-gradient(135deg, var(--primary-dark, #020617) 0%, var(--primary, #0f172a) 100%);
    color: #fff;
    border: none;
    padding: 1.25rem 1.5rem;
}

.workflow-card .card-header h5 {
    color: #fff;
    margin: 0;
}

.workflow-card .card-header .workflow-header-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.workflow-card .card-header .workflow-header-stats .stat {
    text-align: center;
}

.workflow-card .card-header .workflow-header-stats .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.workflow-card .card-header .workflow-header-stats .stat-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.7);
}

/* Responsive */
@media (max-width: 767.98px) {
    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .step-actions {
        flex-direction: column;
    }
    .step-actions .btn {
        width: 100%;
        text-align: center;
    }
    .workflow-card .card-header {
        flex-direction: column;
        gap: 1rem;
    }
}
