/* Ultra-Attractive Space ERP Design System - Light & Dark Mode */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root, [data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-gradient: radial-gradient(ellipse at 50% 0%, #172033 0%, #0b0f19 75%);
    --sidebar-bg: #0f1626;
    --sidebar-border: rgba(56, 189, 248, 0.18);
    --header-bg: rgba(15, 22, 38, 0.92);
    --card-bg: #131c2e;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.04);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-cyan: #38bdf8;
    --accent-purple: #c084fc;
    --accent-indigo: #818cf8;
    --accent-emerald: #34d399;
    --accent-amber: #fbbf24;
    --accent-rose: #f43f5e;
    --input-bg: #090e18;
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: #38bdf8;
    --table-header-bg: #182338;
    --table-row-hover: rgba(56, 189, 248, 0.06);
    --badge-glow: 0 0 12px rgba(56, 189, 248, 0.35);
}

[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-gradient: radial-gradient(ellipse at 50% 0%, #e2e8f0 0%, #f1f5f9 80%);
    --sidebar-bg: #ffffff;
    --sidebar-border: #cbd5e1;
    --header-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 10px 25px -5px rgba(148, 163, 184, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-cyan: #0284c7;
    --accent-purple: #9333ea;
    --accent-indigo: #4f46e5;
    --accent-emerald: #059669;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-focus: #0284c7;
    --table-header-bg: #f8fafc;
    --table-row-hover: rgba(2, 132, 199, 0.05);
    --badge-glow: 0 0 10px rgba(2, 132, 199, 0.2);
}

/* Universal Theme Color Utilities - Crisp High-Contrast Visibility in Light & Dark Mode */
.text-info, .text-cyan {
    color: var(--accent-cyan) !important;
}
.text-purple {
    color: var(--accent-purple) !important;
}
.text-indigo {
    color: var(--accent-indigo) !important;
}
.text-success, .text-emerald {
    color: var(--accent-emerald) !important;
}
.text-warning, .text-amber {
    color: var(--accent-amber) !important;
}
.text-danger, .text-rose {
    color: var(--accent-rose) !important;
}
.text-secondary {
    color: var(--text-secondary) !important;
}
.text-muted {
    color: var(--text-muted) !important;
}
.text-primary {
    color: var(--text-primary) !important;
}

/* Light mode specific element text contrast overrides */
[data-theme="light"] a.text-info,
[data-theme="light"] a.text-cyan,
[data-theme="light"] .text-info {
    color: #0284c7 !important; /* Deep ocean blue for perfect contrast on light background */
}

[data-theme="light"] a.text-info:hover,
[data-theme="light"] a.text-cyan:hover {
    color: #0369a1 !important;
}

[data-theme="light"] .table-space th {
    color: #334155 !important;
    background-color: #f1f5f9 !important;
    border-bottom-color: #cbd5e1 !important;
}

[data-theme="light"] .table-space td {
    color: #0f172a !important;
    border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .form-label {
    color: #334155 !important;
}

/* Base Body Styles */
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Canvas Space Overlay */
#space-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

/* App Wrapper Layout */
#app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Modal Backdrop & Stacking Fix */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

/* Mobile Sidebar Backdrop Overlay */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1035;
    display: none;
}

#sidebar-overlay.show {
    display: block;
}

/* Sidebar Styles */
#sidebar {
    width: 270px;
    min-width: 270px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
}

#sidebar.collapsed {
    width: 80px;
    min-width: 80px;
}

#sidebar.collapsed .sidebar-text,
#sidebar.collapsed .sidebar-heading,
#sidebar.collapsed .dropdown-chevron {
    display: none !important;
}

#sidebar.collapsed .nav-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#sidebar.collapsed .sidebar-submenu {
    padding-left: 0 !important;
}

#sidebar.collapsed .sidebar-submenu .nav-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#sidebar.collapsed .sidebar-header {
    padding: 0 0.5rem !important;
    justify-content: center !important;
}

#sidebar.collapsed .sidebar-brand-text {
    display: none !important;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.3rem;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.4);
    animation: cosmicGlow 4s infinite alternate ease-in-out;
}

@keyframes cosmicGlow {
    0% { box-shadow: 0 0 15px rgba(56, 189, 248, 0.4); transform: scale(1); }
    100% { box-shadow: 0 0 25px rgba(192, 132, 252, 0.6); transform: scale(1.03); }
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.75rem;
}

.sidebar-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 800;
    padding: 0.85rem 1rem 0.35rem 1rem;
}

.nav-item {
    margin-bottom: 0.35rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-link i {
    font-size: 1.2rem;
    transition: transform 0.25s ease, color 0.25s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.08));
    transform: translateX(4px);
}

.nav-link:hover i {
    transform: scale(1.18);
    color: var(--accent-cyan);
}

/* Active Parent State (e.g. Masters dropdown when open) */
.nav-link.active-parent {
    color: var(--accent-cyan) !important;
    background: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-weight: 700;
}

.nav-link.active-parent i {
    color: var(--accent-cyan) !important;
}

/* Highly Attractive Vibrant Active Page State (Dashboard, Customers, Colors, Fabrics, etc.) */
.nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0284c7 0%, #3b82f6 50%, #8b5cf6 100%) !important;
    box-shadow: 0 8px 24px -4px rgba(2, 132, 199, 0.45), 0 0 15px rgba(139, 92, 246, 0.3) !important;
    font-weight: 700;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 4px;
    background: #38bdf8;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px #38bdf8;
}

.nav-link.active i,
.nav-link.active .sidebar-text {
    color: #ffffff !important;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.nav-link.active i {
    transform: scale(1.18);
}

/* Sidebar Submenu */
.sidebar-submenu {
    padding-left: 2.25rem;
    list-style: none;
    margin: 0.25rem 0;
}

.sidebar-submenu .nav-link {
    padding: 0.5rem 0.8rem;
    font-size: 0.86rem;
}

.sidebar-submenu .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.45) !important;
}

.sidebar-submenu .nav-link.active i,
.sidebar-submenu .nav-link.active .sidebar-text {
    color: #ffffff !important;
}

/* Main Content Area */
#main-content {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-content.expanded {
    margin-left: 80px;
}

/* Top Header Bar */
#top-header {
    height: 70px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.toggle-sidebar-btn {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.12));
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.toggle-sidebar-btn:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(99, 102, 241, 0.3));
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    transform: scale(1.06);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* Highlighted Header Suite Brand Badge */
.space-header-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem;
    border-radius: 50rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(192, 132, 252, 0.12) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.12);
    font-size: 0.88rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .space-header-title-badge {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(147, 51, 234, 0.08) 100%);
    border: 1px solid rgba(2, 132, 199, 0.25);
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.1);
}

.space-header-title-badge:hover {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
    border-color: var(--accent-cyan);
    transform: translateY(-1px);
}

.space-header-title-badge .space-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: #ffffff;
    font-size: 0.8rem;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.space-header-title-badge .space-title-text {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.theme-toggle-btn {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(129, 140, 248, 0.15));
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: var(--accent-amber);
    height: 42px;
    padding: 0 1.2rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .theme-toggle-btn {
    color: var(--accent-indigo);
    border-color: rgba(99, 102, 241, 0.35);
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* Cosmic Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(147, 51, 234, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title-gradient {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Space Cards */
.card-space {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card-space:hover {
    border-color: rgba(56, 189, 248, 0.25);
}

/* Module Stat Card Styling */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.6;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 15px 35px -10px rgba(56, 189, 248, 0.2);
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.stat-card-cyan .stat-card-icon { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); border: 1px solid rgba(56, 189, 248, 0.3); }
.stat-card-purple .stat-card-icon { background: rgba(192, 132, 252, 0.15); color: var(--accent-purple); border: 1px solid rgba(192, 132, 252, 0.3); }
.stat-card-emerald .stat-card-icon { background: rgba(52, 211, 153, 0.15); color: var(--accent-emerald); border: 1px solid rgba(52, 211, 153, 0.3); }
.stat-card-amber .stat-card-icon { background: rgba(251, 191, 36, 0.15); color: var(--accent-amber); border: 1px solid rgba(251, 191, 36, 0.3); }
.stat-card-indigo .stat-card-icon { background: rgba(129, 140, 248, 0.15); color: var(--accent-indigo); border: 1px solid rgba(129, 140, 248, 0.3); }

/* Search & Filter Toolbar */
.space-toolbar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

.space-input, .space-select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.space-input:focus, .space-select:focus {
    background-color: var(--input-bg);
    border-color: var(--input-focus);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
    outline: none;
}

/* Highly Attractive Multi-Stop Gradient Primary Button */
.btn-space-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px;
    padding: 0.68rem 1.4rem;
    font-weight: 700;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    box-shadow: 0 6px 20px -2px rgba(6, 182, 212, 0.45), 0 0 12px rgba(99, 102, 241, 0.3) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-space-primary:hover {
    color: #ffffff !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 28px -4px rgba(6, 182, 212, 0.6), 0 0 18px rgba(99, 102, 241, 0.45) !important;
}

/* Highly Attractive Glass Secondary Button */
.btn-space-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    color: var(--text-primary) !important;
    border-radius: 12px;
    padding: 0.65rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-space-secondary:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2)) !important;
    border-color: var(--accent-cyan) !important;
    color: var(--text-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.25) !important;
}

/* Vibrant Table Action Button Hover States */
.btn-group .btn-space-secondary:hover i.bi-eye {
    color: #38bdf8 !important;
}

.btn-group .btn-space-secondary:hover i.bi-pencil-square {
    color: #c084fc !important;
}

.btn-group .btn-space-secondary:hover i.bi-trash-fill,
.btn-group .btn-space-secondary:hover i.bi-trash {
    color: #f43f5e !important;
}

/* Space Table Styling */
.table-space-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table-space {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-primary);
}

.table-space th {
    background: var(--table-header-bg);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
}

.table-space td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
    font-size: 0.92rem;
}

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

.table-space tbody tr:hover {
    background-color: var(--table-row-hover);
}

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

/* Hide Scrollbar for Slider Track */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
    min-width: 0;
}

.slider-nav-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--card-bg);
    color: var(--text-primary);
}

.slider-nav-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent-cyan) !important;
    color: var(--accent-cyan) !important;
}

/* Space Filter Pills */
.space-pill {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary) !important;
    border-radius: 50px;
    padding: 0.5rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    flex: 0 0 auto;
    width: fit-content;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: var(--card-shadow);
}

.space-pill:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan) !important;
    transform: translateY(-2px);
}

.space-pill.active {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #6366f1 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px -2px rgba(6, 182, 212, 0.45), 0 0 12px rgba(99, 102, 241, 0.3) !important;
}

.space-pill .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.6em;
    border-radius: 20px;
    font-weight: 700;
}

.space-pill.active .badge {
    background-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

/* Badges */
.space-badge {
    padding: 0.4em 0.85em;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.space-badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.space-badge-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.space-badge-info {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.space-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.space-badge-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.space-badge-purple {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Pagination Overrides */
nav .pagination {
    margin-bottom: 0;
    gap: 0.35rem;
}

nav p.small.text-muted {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-muted) !important;
}

nav p.small.text-muted .fw-semibold {
    color: var(--text-primary);
    font-weight: 700 !important;
}

.pagination .page-item .page-link {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 10px !important;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}

.pagination .page-item.disabled .page-link {
    background: var(--card-bg);
    border-color: var(--card-border);
    color: var(--text-muted);
    opacity: 0.5;
}

.pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    background: var(--table-row-hover);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Mobile responsive adjustments */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-270px);
    }
    #sidebar.show-mobile {
        transform: translateX(0);
    }
    #main-content, #main-content.expanded {
        margin-left: 0 !important;
    }
}

@media (max-width: 575.98px) {
    #top-header {
        padding: 0 0.75rem;
    }
    .theme-toggle-btn {
        padding: 0 0.75rem;
    }
}
