/*  ═══════════════════════════════════════════════════════════
    OSmart Design System  v2.0
    Centralized tokens, components and layout primitives.
    ═══════════════════════════════════════════════════════════  */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {
    /* Brand */
    --os-primary: #667eea;
    --os-primary-dark: #5468d4;
    --os-secondary: #764ba2;
    --os-accent: #6366f1;

    /* Semantic */
    --os-success: #10b981;
    --os-success-dark: #059669;
    --os-warning: #f59e0b;
    --os-warning-dark: #d97706;
    --os-danger: #ef4444;
    --os-danger-dark: #dc2626;
    --os-info: #3b82f6;
    --os-info-dark: #2563eb;

    /* Neutrals */
    --os-gray-50: #f8fafc;
    --os-gray-100: #f1f5f9;
    --os-gray-200: #e2e8f0;
    --os-gray-300: #cbd5e1;
    --os-gray-400: #94a3b8;
    --os-gray-500: #64748b;
    --os-gray-600: #475569;
    --os-gray-700: #334155;
    --os-gray-800: #1e293b;
    --os-gray-900: #0f172a;

    /* Gradients */
    --os-gradient: linear-gradient(135deg, var(--os-primary) 0%, var(--os-secondary) 100%);
    --os-gradient-alt: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --os-gradient-success: linear-gradient(135deg, var(--os-success) 0%, #34d399 100%);

    /* Typography */
    --os-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --os-font-display: 'Poppins', var(--os-font-sans);
    --os-fs-xs: 0.75rem;
    /* 12px */
    --os-fs-sm: 0.875rem;
    /* 14px */
    --os-fs-base: 1rem;
    /* 16px */
    --os-fs-lg: 1.125rem;
    /* 18px */
    --os-fs-xl: 1.25rem;
    /* 20px */
    --os-fs-2xl: 1.5rem;
    /* 24px */
    --os-fs-3xl: 1.875rem;
    /* 30px */

    /* Spacing (8px grid) */
    --os-sp-1: 0.25rem;
    /* 4px  */
    --os-sp-2: 0.5rem;
    /* 8px  */
    --os-sp-3: 0.75rem;
    /* 12px */
    --os-sp-4: 1rem;
    /* 16px */
    --os-sp-5: 1.25rem;
    /* 20px */
    --os-sp-6: 1.5rem;
    /* 24px */
    --os-sp-8: 2rem;
    /* 32px */
    --os-sp-10: 2.5rem;
    /* 40px */
    --os-sp-12: 3rem;
    /* 48px */

    /* Radii */
    --os-radius-sm: 8px;
    --os-radius-md: 12px;
    --os-radius-lg: 16px;
    --os-radius-xl: 20px;
    --os-radius-full: 9999px;

    /* Shadows */
    --os-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --os-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
    --os-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --os-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --os-shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.14);
    --os-shadow-glow: 0 0 20px rgba(102, 126, 234, 0.25);

    /* Timing */
    --os-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --os-duration: 0.25s;

    /* Layout */
    --os-sidebar-w: 260px;
    --os-sidebar-w-collapsed: 72px;
    --os-navbar-h: 60px;
}


/* ── 2. BASE RESET ────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--os-font-sans);
    font-size: var(--os-fs-base);
    line-height: 1.6;
    color: var(--os-gray-700);
    background: var(--os-gray-50);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}


/* ── 3. TOP NAVBAR ────────────────────────────────────────── */
.os-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--os-navbar-h);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--os-gray-200);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 var(--os-sp-6);
    transition: box-shadow var(--os-duration) var(--os-ease);
}

.os-navbar.scrolled {
    box-shadow: var(--os-shadow-md);
}

.os-navbar__brand {
    font-family: var(--os-font-display);
    font-weight: 700;
    font-size: var(--os-fs-xl);
    background: var(--os-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--os-sp-2);
    flex-shrink: 0;
    transition: transform var(--os-duration) var(--os-ease);
}

.os-navbar__brand:hover {
    transform: scale(1.03);
}

.os-navbar__brand i {
    -webkit-text-fill-color: var(--os-primary);
    font-size: var(--os-fs-lg);
}

/* OSmart Logo Styles */
.osmart-logo-navbar {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.osmart-logo-navbar-landing {
    height: 45px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.osmart-logo-hero {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.hero-logo-container {
    text-align: center;
    margin-bottom: var(--os-sp-4);
}

.osmart-text-fallback {
    display: inline-block;
}

/* Dark mode logo adjustments */
[data-theme="dark"] .osmart-logo-navbar,
[data-theme="dark"] .osmart-logo-navbar-landing,
[data-theme="dark"] .osmart-logo-hero {
    filter: brightness(1.1);
}

.os-navbar__powered {
    font-size: var(--os-fs-xs);
    -webkit-text-fill-color: var(--os-gray-400);
    font-weight: 400;
    margin-left: var(--os-sp-1);
}

.os-navbar__spacer {
    flex: 1;
}

.os-navbar__actions {
    display: flex;
    align-items: center;
    gap: var(--os-sp-3);
}

/* Hamburger for mobile */
.os-navbar__toggle {
    display: none;
    background: none;
    border: none;
    font-size: var(--os-fs-xl);
    color: var(--os-gray-600);
    cursor: pointer;
    padding: var(--os-sp-2);
    border-radius: var(--os-radius-sm);
    transition: background var(--os-duration) var(--os-ease);
}

.os-navbar__toggle:hover {
    background: var(--os-gray-100);
}

/* Dark-mode toggle chip */
.os-theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--os-radius-full);
    border: 1px solid var(--os-gray-200);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--os-duration) var(--os-ease);
    font-size: var(--os-fs-sm);
    color: var(--os-gray-600);
}

.os-theme-toggle:hover {
    background: var(--os-gray-100);
    border-color: var(--os-gray-300);
    transform: rotate(15deg);
}


/* ── 4. VERTICAL SIDEBAR ─────────────────────────────────── */
.os-sidebar {
    position: fixed;
    top: var(--os-navbar-h);
    left: 0;
    width: var(--os-sidebar-w);
    height: calc(100vh - var(--os-navbar-h));
    background: var(--os-gray-900);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    transition: transform var(--os-duration) var(--os-ease), width var(--os-duration) var(--os-ease);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.os-sidebar::-webkit-scrollbar {
    width: 5px;
}

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

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

/* User info at top of sidebar */
.os-sidebar__user {
    padding: var(--os-sp-5) var(--os-sp-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: var(--os-sp-3);
    flex-shrink: 0;
}

.os-sidebar__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--os-radius-full);
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--os-fs-lg);
    flex-shrink: 0;
}

.os-sidebar__user-name {
    font-weight: 600;
    color: white;
    font-size: var(--os-fs-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-sidebar__user-role {
    font-size: var(--os-fs-xs);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section headers */
.os-sidebar__section {
    padding: var(--os-sp-4) var(--os-sp-5) var(--os-sp-2);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    overflow: hidden;
}

/* Nav items */
.os-sidebar__nav {
    list-style: none;
    margin: 0;
    padding: var(--os-sp-1) var(--os-sp-2);
    flex: 1;
}

.os-sidebar__nav li {
    margin-bottom: 2px;
}

.os-sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--os-sp-3);
    padding: var(--os-sp-2) var(--os-sp-3);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: var(--os-fs-sm);
    font-weight: 500;
    border-radius: var(--os-radius-sm);
    transition: all var(--os-duration) var(--os-ease);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.os-sidebar__link i {
    width: 20px;
    text-align: center;
    font-size: var(--os-fs-sm);
    flex-shrink: 0;
    opacity: 0.8;
    transition: all var(--os-duration) var(--os-ease);
}

.os-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
}

.os-sidebar__link:hover i {
    opacity: 1;
}

.os-sidebar__link.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    font-weight: 600;
}

.os-sidebar__link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--os-primary);
    border-radius: 0 3px 3px 0;
}

.os-sidebar__link.active i {
    opacity: 1;
    color: var(--os-primary);
}

/* Sidebar sub-menu (collapsed by default) */
.os-sidebar__sub {
    list-style: none;
    padding: 0 0 0 var(--os-sp-10);
    margin: 0;
    display: none;
}

.os-sidebar__sub.open {
    display: block;
}

.os-sidebar__sub .os-sidebar__link {
    font-size: var(--os-fs-xs);
    padding: 6px var(--os-sp-3);
    color: rgba(255, 255, 255, 0.55);
}

.os-sidebar__sub .os-sidebar__link:hover {
    color: white;
}

.os-sidebar__sub .os-sidebar__link.active {
    color: white;
    background: rgba(102, 126, 234, 0.15);
}

/* Toggle arrow for expandable sections */
.os-sidebar__toggle {
    cursor: pointer;
}

.os-sidebar__toggle .os-chevron {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform var(--os-duration) var(--os-ease);
    color: rgba(255, 255, 255, 0.3);
}

.os-sidebar__toggle.open .os-chevron {
    transform: rotate(90deg);
}

/* Badge in sidebar */
.os-sidebar__badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: var(--os-radius-full);
    font-weight: 700;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Sidebar overlay (mobile) */
.os-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1019;
    opacity: 0;
    transition: opacity var(--os-duration) var(--os-ease);
}

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


/* ── 5. MAIN CONTENT AREA ────────────────────────────────── */
.os-main {
    margin-left: var(--os-sidebar-w);
    margin-top: var(--os-navbar-h);
    min-height: calc(100vh - var(--os-navbar-h));
    padding: var(--os-sp-6);
    transition: margin-left var(--os-duration) var(--os-ease);
    display: flex;
    flex-direction: column;
}


/* ── 6. PAGE HEADER ───────────────────────────────────────── */
.os-page-header {
    margin-bottom: var(--os-sp-6);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--os-sp-4);
}

.os-page-header__left {
    min-width: 0;
    flex: 1;
}

.os-page-header__breadcrumb {
    font-size: var(--os-fs-xs);
    color: var(--os-gray-400);
    margin-bottom: var(--os-sp-1);
    display: flex;
    align-items: center;
    gap: var(--os-sp-1);
}

.os-page-header__breadcrumb a {
    color: var(--os-gray-500);
    text-decoration: none;
}

.os-page-header__breadcrumb a:hover {
    color: var(--os-primary);
}

.os-page-header__title {
    font-family: var(--os-font-display);
    font-size: var(--os-fs-2xl);
    font-weight: 700;
    color: var(--os-gray-800);
    margin: 0;
    line-height: 1.3;
}

.os-page-header__subtitle {
    font-size: var(--os-fs-sm);
    color: var(--os-gray-500);
    margin-top: var(--os-sp-1);
}

.os-page-header__actions {
    display: flex;
    align-items: center;
    gap: var(--os-sp-2);
    flex-shrink: 0;
}


/* ── 7. ENHANCED CARDS ────────────────────────────────────── */
.os-card {
    background: white;
    border: 1px solid var(--os-gray-200);
    border-radius: var(--os-radius-lg);
    box-shadow: var(--os-shadow-sm);
    transition: box-shadow var(--os-duration) var(--os-ease);
    overflow: hidden;
}

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

.os-card__header {
    background: var(--os-gradient-alt);
    color: white;
    padding: var(--os-sp-4) var(--os-sp-5);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.os-card__header h6,
.os-card__header h5 {
    color: white;
    margin: 0;
    font-weight: 600;
}

.os-card__body {
    padding: var(--os-sp-5);
}

/* Stat card variant */
.os-stat-card {
    background: white;
    border: 1px solid var(--os-gray-200);
    border-radius: var(--os-radius-lg);
    padding: var(--os-sp-5);
    box-shadow: var(--os-shadow-sm);
    transition: all var(--os-duration) var(--os-ease);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: var(--os-sp-4);
}

.os-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--os-gradient);
    transform: scaleX(0);
    transition: transform var(--os-duration) var(--os-ease);
    transform-origin: left;
}

.os-stat-card:hover {
    box-shadow: var(--os-shadow-lg);
    transform: translateY(-2px);
}

.os-stat-card:hover::before {
    transform: scaleX(1);
}

.os-stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--os-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--os-fs-xl);
    color: white;
    flex-shrink: 0;
}

.os-stat-card__icon.primary {
    background: var(--os-gradient);
}

.os-stat-card__icon.success {
    background: var(--os-gradient-success);
}

.os-stat-card__icon.warning {
    background: linear-gradient(135deg, var(--os-warning), var(--os-warning-dark));
}

.os-stat-card__icon.danger {
    background: linear-gradient(135deg, var(--os-danger), var(--os-danger-dark));
}

.os-stat-card__icon.info {
    background: linear-gradient(135deg, var(--os-info), var(--os-info-dark));
}

.os-stat-card__value {
    font-family: var(--os-font-display);
    font-size: var(--os-fs-2xl);
    font-weight: 700;
    color: var(--os-gray-800);
    line-height: 1;
    margin-bottom: var(--os-sp-1);
}

.os-stat-card__label {
    font-size: var(--os-fs-xs);
    color: var(--os-gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ── 8. BUTTONS ───────────────────────────────────────────── */
.os-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--os-sp-2);
    padding: var(--os-sp-2) var(--os-sp-4);
    border-radius: var(--os-radius-sm);
    font-size: var(--os-fs-sm);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--os-duration) var(--os-ease);
    text-decoration: none;
    line-height: 1.5;
}

.os-btn:hover {
    transform: translateY(-1px);
}

.os-btn:active {
    transform: translateY(0);
}

.os-btn--primary {
    background: var(--os-gradient-alt);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.os-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    color: white;
}

.os-btn--outline {
    background: transparent;
    color: var(--os-gray-600);
    border: 1px solid var(--os-gray-300);
}

.os-btn--outline:hover {
    background: var(--os-gray-50);
    border-color: var(--os-gray-400);
    color: var(--os-gray-700);
}

.os-btn--sm {
    padding: 4px var(--os-sp-3);
    font-size: var(--os-fs-xs);
}

.os-btn--lg {
    padding: var(--os-sp-3) var(--os-sp-6);
    font-size: var(--os-fs-base);
}


/* ── 9. BADGES ────────────────────────────────────────────── */
.os-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--os-radius-full);
    font-size: var(--os-fs-xs);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.os-badge--primary {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.2);
}

.os-badge--success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.os-badge--warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.2);
}

.os-badge--danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.2);
}

.os-badge--info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.2);
}

.os-badge--neutral {
    background: var(--os-gray-100);
    color: var(--os-gray-600);
    border-color: var(--os-gray-200);
}


/* ── 10. TABLES ───────────────────────────────────────────── */
.os-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.os-table thead th {
    position: sticky;
    top: 0;
    background: var(--os-gray-50);
    padding: var(--os-sp-3) var(--os-sp-4);
    font-size: var(--os-fs-xs);
    font-weight: 600;
    color: var(--os-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--os-gray-200);
    z-index: 2;
    text-align: left;
}

.os-table tbody td {
    padding: var(--os-sp-3) var(--os-sp-4);
    border-bottom: 1px solid var(--os-gray-100);
    vertical-align: middle;
    font-size: var(--os-fs-sm);
    color: var(--os-gray-700);
}

.os-table tbody tr {
    transition: background var(--os-duration) var(--os-ease);
}

.os-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

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

/* Empty state */
.os-empty-state {
    text-align: center;
    padding: var(--os-sp-12) var(--os-sp-6);
    color: var(--os-gray-400);
}

.os-empty-state i {
    font-size: 3rem;
    opacity: 0.4;
    margin-bottom: var(--os-sp-4);
    display: block;
}

.os-empty-state p {
    font-size: var(--os-fs-sm);
    margin: 0;
}


/* ── 11. FORMS ────────────────────────────────────────────── */
.os-form-label {
    font-size: var(--os-fs-sm);
    font-weight: 600;
    color: var(--os-gray-700);
    margin-bottom: var(--os-sp-1);
    display: block;
}

.os-form-control {
    width: 100%;
    padding: var(--os-sp-2) var(--os-sp-3);
    border: 1px solid var(--os-gray-300);
    border-radius: var(--os-radius-sm);
    font-size: var(--os-fs-sm);
    color: var(--os-gray-800);
    background: white;
    transition: all var(--os-duration) var(--os-ease);
}

.os-form-control:focus {
    outline: none;
    border-color: var(--os-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.os-form-control::placeholder {
    color: var(--os-gray-400);
}


/* ── 12. FOOTER ───────────────────────────────────────────── */
.os-footer {
    background: var(--os-gray-900);
    color: var(--os-gray-400);
    padding: var(--os-sp-4) var(--os-sp-6);
    font-size: var(--os-fs-xs);
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--os-sp-2);
}

.os-footer a {
    color: var(--os-gray-400);
    text-decoration: none;
    transition: color var(--os-duration);
}

.os-footer a:hover {
    color: var(--os-primary);
}

.os-footer__brand {
    color: var(--os-gray-300);
}

.os-footer__brand i {
    color: var(--os-primary);
}


/* ── 13. DARK MODE ────────────────────────────────────────── */
[data-theme="dark"] {
    --os-gray-50: #0f172a;
    --os-gray-100: #1e293b;
    --os-gray-200: #334155;
    --os-gray-300: #475569;
    --os-gray-400: #64748b;
    --os-gray-500: #94a3b8;
    --os-gray-600: #cbd5e1;
    --os-gray-700: #e2e8f0;
    --os-gray-800: #f1f5f9;
    --os-gray-900: #020617;
}

[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .os-navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: #1e293b;
}

[data-theme="dark"] .os-sidebar {
    background: #020617;
}

[data-theme="dark"] .os-card,
[data-theme="dark"] .os-stat-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .os-form-control {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .os-table thead th {
    background: #1e293b;
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme="dark"] .os-table tbody td {
    border-bottom-color: #1e293b;
    color: #cbd5e1;
}

[data-theme="dark"] .os-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

[data-theme="dark"] .os-footer {
    background: #020617;
}


/* ── 14. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 991.98px) {
    .os-navbar__toggle {
        display: block;
    }

    .os-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .os-sidebar.show {
        transform: translateX(0);
    }

    .os-main {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    /* Hide desktop footer on mobile - completely remove it */
    .os-footer,
    footer.os-footer,
    body footer.os-footer {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        margin-left: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        width: 0 !important;
        max-width: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }
    
    .os-footer *,
    footer.os-footer * {
        display: none !important;
        visibility: hidden !important;
    }
    
    .os-main {
        padding: var(--os-sp-4);
    }

    .os-page-header {
        flex-direction: column;
    }

    .os-page-header__title {
        font-size: var(--os-fs-xl);
    }

    .os-stat-card {
        padding: var(--os-sp-4);
    }

    .os-stat-card__value {
        font-size: var(--os-fs-xl);
    }

    .os-stat-card__icon {
        width: 40px;
        height: 40px;
        font-size: var(--os-fs-base);
    }
}

@media (min-width: 1400px) {
    .os-main {
        padding: var(--os-sp-8);
    }
}


/* ── 15. ANIMATIONS ───────────────────────────────────────── */
@keyframes os-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes os-slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes os-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes os-shimmer {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.os-animate-in {
    animation: os-fade-in 0.35s var(--os-ease) both;
}

/* Skeleton loader */
.os-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--os-gray-200);
    border-radius: var(--os-radius-sm);
}

.os-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    animation: os-shimmer 1.5s infinite;
}

/* Loading overlay */
.os-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    z-index: 20000;
    align-items: center;
    justify-content: center;
}

.os-loading-overlay .spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--os-accent);
    border-radius: 50%;
    animation: os-spin 0.8s linear infinite;
}


/* ── 16. UTILITY CLASSES ──────────────────────────────────── */
.os-text-gradient {
    background: var(--os-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.os-text-xs {
    font-size: var(--os-fs-xs);
}

.os-text-sm {
    font-size: var(--os-fs-sm);
}

.os-text-lg {
    font-size: var(--os-fs-lg);
}

.os-text-xl {
    font-size: var(--os-fs-xl);
}

.os-text-2xl {
    font-size: var(--os-fs-2xl);
}

.os-mt-0 {
    margin-top: 0;
}

.os-mb-4 {
    margin-bottom: var(--os-sp-4);
}

.os-mb-6 {
    margin-bottom: var(--os-sp-6);
}

.os-gap-3 {
    gap: var(--os-sp-3);
}

.os-gap-4 {
    gap: var(--os-sp-4);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Print */
@media print {

    .os-navbar,
    .os-sidebar,
    .os-sidebar-overlay,
    .os-footer,
    .os-loading-overlay {
        display: none !important;
    }

    .os-main {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

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

    .os-card__header {
        background: #f5f5f5 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}


/* ── 17. BACKWARD COMPATIBILITY ───────────────────────────── */
/* Map old class names used in child templates to new design tokens */
.card {
    border-radius: var(--os-radius-lg);
    border-color: var(--os-gray-200);
}

.card:hover {
    transform: none;
}

/* Remove old lift on all cards */
.card-header {
    border-radius: var(--os-radius-lg) var(--os-radius-lg) 0 0 !important;
}

/* Status badges used across templates */
.status-badge {
    padding: 4px 12px;
    border-radius: var(--os-radius-full);
    font-weight: 600;
    font-size: var(--os-fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

.status-submitted {
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
}

.status-approved {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
}

.status-packed {
    background: rgba(59, 130, 246, 0.12);
    color: #1e40af;
}

.status-shipped {
    background: rgba(6, 182, 212, 0.12);
    color: #0e7490;
}

.status-delivered {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.status-rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.status-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
}

.status-in-progress,
.status-in_progress {
    background: rgba(59, 130, 246, 0.12);
    color: #1e40af;
}

/* Badge soft compatibility */
.badge-soft {
    border-radius: var(--os-radius-full);
    padding: 3px 10px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
}

.badge-soft-primary {
    color: #4f46e5;
    border-color: rgba(79, 70, 229, 0.25);
    background: rgba(79, 70, 229, 0.06);
}

.badge-soft-success {
    color: #059669;
    border-color: rgba(5, 150, 105, 0.25);
    background: rgba(5, 150, 105, 0.07);
}

.badge-soft-warning {
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.25);
    background: rgba(245, 158, 11, 0.1);
}

.badge-soft-danger {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.25);
    background: rgba(239, 68, 68, 0.08);
}

/* KPI card compatibility */
.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--os-radius-sm);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.kpi-submitted {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.kpi-approved {
    background: linear-gradient(135deg, #10b981, #059669);
}

.kpi-packed {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.kpi-shipped {
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
}

.kpi-delivered {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.kpi-cancelled {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.kpi-inprog {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.kpi-completed {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.kpi-today {
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
}

/* KPI card container */
.kpi-card {
    border: 0;
    border-radius: var(--os-radius-lg);
    box-shadow: var(--os-shadow-sm);
    color: var(--os-gray-800);
    background: #fff;
    transition: all var(--os-duration) var(--os-ease);
}

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

.kpi-num {
    font-family: var(--os-font-display);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--os-gray-800);
}

.kpi-label {
    font-size: var(--os-fs-sm);
    color: var(--os-gray-500);
}

/* Soft-style badge (used in items.html, etc.) */
.os-badge-soft {
    border-radius: var(--os-radius-full);
    padding: 3px 12px;
    font-size: var(--os-fs-xs);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* Row fade-in animation for tables */
.os-row-anim {
    animation: os-fade-in 0.35s var(--os-ease) both;
}

/* Stagger animations — use animation-delay attribute inline or via JS */
@keyframes os-row-slide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toolbar bar for filter rows */
.os-toolbar {
    background: white;
    border: 1px solid var(--os-gray-200);
    border-radius: var(--os-radius-lg);
    padding: var(--os-sp-4) var(--os-sp-5);
    box-shadow: var(--os-shadow-xs);
}

/* Jobs page — remove full-page gradient when inside sidebar layout */
.os-main .jobs-container {
    background: transparent;
    min-height: auto;
    padding: 0;
}

/* Bootstrap card normalizations inside os-main */
.os-main .card {
    border-radius: var(--os-radius-lg);
    border-color: var(--os-gray-200);
    box-shadow: var(--os-shadow-sm);
}

.os-main .card .card-header {
    border-bottom: 1px solid var(--os-gray-200);
}

.os-main .card .card-body .table th {
    font-size: var(--os-fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--os-gray-500);
}

/* Dark mode extras */
[data-theme="dark"] .kpi-card {
    background: #1e293b;
}

[data-theme="dark"] .kpi-num {
    color: var(--os-gray-800);
}

[data-theme="dark"] .os-toolbar {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .os-badge-soft {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.25);
}