/* ============================================================
   DeveInventory — Complete CSS Framework
   Modern Enterprise SaaS Design System
   ============================================================ */

/* ── 1. CSS Variables ────────────────────────────────────── */
:root {
    --navy: #16324F;
    --primary: #2563EB;
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-600: #1D4ED8;
    --primary-700: #1E40AF;
    --teal: #0F766E;
    --teal-50: #F0FDFA;
    --bg: #F5F7FA;
    --white: #FFFFFF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --text: #1F2937;
    --text-secondary: #374151;
    --muted: #64748B;
    --success: #16A34A;
    --success-50: #F0FDF4;
    --warning: #F59E0B;
    --warning-50: #FFFBEB;
    --danger: #DC2626;
    --danger-50: #FEF2F2;
    --info: #0284C7;
    --info-50: #F0F9FF;
    --sidebar-bg: #FFFFFF;
    --sidebar-text: #1F2937;
    --sidebar-hover: #EFF6FF;
    --sidebar-active: #DBEAFE;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    --radius-full: 9999px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 68px;
    --topbar-height: 56px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --z-sidebar: 30;
    --z-topbar: 20;
    --z-dropdown: 50;
    --z-modal-backdrop: 60;
    --z-modal: 70;
    --z-toast: 80;
    --z-drawer: 55;
}

/* ── 2. Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    height: 100%;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

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

img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

p { margin: 0 0 0.5rem; }

/* ── Scrollbar Styling ───────────────────────────────────── */
::-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;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

/* ── 2. Layout ───────────────────────────────────────────── */

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    height: 100vh;
    padding: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-sidebar);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item-label,
.sidebar.collapsed .sidebar-footer-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 0.25rem;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.5rem;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
}

.sidebar.collapsed .sidebar-footer {
    align-items: center;
    padding: 0.5rem;
}

.sidebar.collapsed .sidebar-footer .sidebar-footer-text {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.5rem;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--teal));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 700;
    color: #0F172A;
    font-size: 15px;
    transition: opacity var(--transition-fast);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94A3B8;
    padding: 0.5rem 0.6rem 0.25rem;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    color: #334155;
    text-decoration: none;
    border-radius: var(--radius-lg);
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-item i {
    width: 18px;
    text-align: center;
    color: #64748B;
    font-size: 14px;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.nav-item span {
    transition: opacity var(--transition-fast);
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #0F172A;
}
.nav-item:hover i { color: var(--primary); }

.nav-item.active {
    background: var(--sidebar-active);
    color: #1E3A8A;
    font-weight: 600;
}
.nav-item.active i { color: var(--primary); }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 0.75rem 0.6rem;
    margin-top: auto;
    flex-shrink: 0;
}

/* Main layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-slow);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-search {
    max-width: 320px;
    width: 100%;
    position: relative;
}

.topbar-search input {
    width: 100%;
    height: 36px;
    padding: 0 0.75rem 0 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: all var(--transition-fast);
}

.topbar-search input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

.warehouse-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.warehouse-selector:hover {
    border-color: #D1D5DB;
    background: var(--bg);
}

.scan-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.scan-btn:hover {
    background: #1E3A5F;
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.notification-badge-count {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-dropdown:hover {
    background: var(--bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--teal));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.user-role {
    font-size: 11px;
    color: var(--muted);
}

.sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg);
    border-color: #D1D5DB;
}

/* Main Content */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--topbar-height));
}

.main-content {
    padding: 1.25rem;
    flex: 1;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

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

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

.breadcrumb .separator {
    color: var(--border);
    font-size: 10px;
}

.breadcrumb .current {
    color: var(--text);
    font-weight: 500;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.page-subtitle {
    color: var(--muted);
    margin: 0.15rem 0 0;
    font-size: 13px;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

/* ── 3. Card System ──────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-body {
    padding: 1.25rem;
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* Stat Card */
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-fast);
}

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-50); color: var(--primary); }
.stat-icon.green { background: var(--success-50); color: var(--success); }
.stat-icon.amber { background: var(--warning-50); color: var(--warning); }
.stat-icon.red { background: var(--danger-50); color: var(--danger); }
.stat-icon.teal { background: var(--teal-50); color: var(--teal); }
.stat-icon.info { background: var(--info-50); color: var(--info); }

.stat-body {
    min-width: 0;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.2rem;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* Summary Card */
.summary-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
}

.summary-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.summary-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
}

.summary-card-footer {
    margin-top: 0.75rem;
    font-size: 12px;
    color: var(--muted);
}

/* Grid helpers */
.grid { display: grid; gap: 1rem; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* ── 4. Table System ─────────────────────────────────────── */
.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-modern thead th {
    background: #F9FAFB;
    padding: 0.6rem 0.9rem;
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    user-select: none;
}

.table-modern thead th.sortable {
    cursor: pointer;
}

.table-modern thead th.sortable:hover {
    color: var(--text);
}

.table-modern thead th.sorted-asc::after {
    content: ' \25B2';
    font-size: 9px;
}

.table-modern thead th.sorted-desc::after {
    content: ' \25BC';
    font-size: 9px;
}

.table-modern tbody td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

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

.table-modern tbody tr:hover {
    background: #F9FAFB;
}

.table-modern tbody tr.selected {
    background: var(--primary-50);
}

.table-modern td.text-right,
.table-modern th.text-right {
    text-align: right;
}

.table-modern td.text-center,
.table-modern th.text-center {
    text-align: center;
}

/* Sticky header */
.table-responsive-wrapper {
    overflow-x: auto;
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Table Actions */
.table-actions {
    white-space: nowrap;
    text-align: right;
}

.table-actions .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius-md);
}

.table-actions .btn-icon:hover {
    background: var(--bg);
    color: var(--text);
}

/* Table cell helpers */
.table-cell-main {
    font-weight: 500;
    color: var(--text);
}

.table-cell-sub {
    font-size: 12px;
    color: var(--muted);
}

.table-cell-mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Responsive table → card */
.table-responsive-card {
    display: none;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.55rem;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
    line-height: 1.4;
}

.badge-success {
    background: var(--success-50);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-50);
    color: #D97706;
}

.badge-danger {
    background: var(--danger-50);
    color: var(--danger);
}

.badge-info {
    background: var(--info-50);
    color: var(--info);
}

.badge-secondary {
    background: #F1F5F9;
    color: var(--muted);
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ── 5. Form System ──────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    display: block;
    width: 100%;
    height: 38px;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: all var(--transition-fast);
}

.form-control::placeholder {
    color: #9CA3AF;
}

.form-control:hover {
    border-color: #D1D5DB;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

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

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.form-control-sm {
    height: 32px;
    font-size: 12px;
    padding: 0 0.6rem;
}

.form-control-lg {
    height: 44px;
    font-size: 15px;
    padding: 0 1rem;
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    padding: 0.5rem 0.75rem;
    resize: vertical;
}

.form-select {
    display: block;
    width: 100%;
    height: 38px;
    padding: 0 2rem 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text);
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748B'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    background-size: 12px;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}

.form-select:hover {
    border-color: #D1D5DB;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1;
    min-width: 0;
}

.input-group .form-control:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 13px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.input-group-text:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    border-right: 0;
}

.input-group-text:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-left: 0;
}

.input-group .btn {
    border-radius: 0;
}

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

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-label {
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

/* Switch toggle */
.form-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.form-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.form-switch .switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #D1D5DB;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.form-switch .switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-switch input:checked + .switch-slider {
    background: var(--primary);
}

.form-switch input:checked + .switch-slider::before {
    transform: translateX(18px);
}

/* Step Form */
.step-form {
    padding: 0;
}

.step-form-header {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.step-item-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--white);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.step-item-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    transition: color var(--transition-fast);
}

.step-item-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    min-width: 16px;
    transition: background var(--transition-fast);
}

.step-item.active .step-item-number {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

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

.step-item.completed .step-item-number {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-item.completed .step-item-label {
    color: var(--text);
}

.step-item.completed + .step-item-line,
.step-item-line.completed {
    background: var(--success);
}

.step-form-body {
    padding: 1.5rem;
}

.step-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #F9FAFB;
}

/* ── 6. Button System ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

.btn:disabled {
    opacity: 0.55;
    pointer-events: none;
}

.btn i {
    font-size: 14px;
}

/* Primary */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
}

/* Success */
.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #15803D;
    border-color: #15803D;
}

/* Warning */
.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #D97706;
    border-color: #D97706;
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #B91C1C;
    border-color: #B91C1C;
}

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

.btn-info:hover {
    background: #0369A1;
    border-color: #0369A1;
}

/* Secondary */
.btn-secondary {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.btn-secondary:hover {
    background: #1E3A5F;
    border-color: #1E3A5F;
}

/* Dark */
.btn-dark {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.btn-dark:hover {
    background: #030712;
    border-color: #030712;
}

/* Outline */
.btn-outline {
    background: var(--white);
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: #D1D5DB;
}

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

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

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

.btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg);
}

/* Sizes */
.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 12px;
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: 0.6rem 1.25rem;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

/* Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 15px;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg);
    border-color: #D1D5DB;
    color: var(--primary);
}

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

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

.btn-icon.active,
.btn-icon[aria-expanded="true"] {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-100);
}

/* Button Group */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border-right: 0;
}

.btn-group .btn:last-child {
    border-right: 1px solid transparent;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

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

/* Block Button */
.btn-block {
    display: flex;
    width: 100%;
}

/* Loading state */
.btn.is-loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ── 7. Modal / Drawer / Bottom Sheet ────────────────────── */

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    backdrop-filter: blur(2px);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    z-index: var(--z-modal);
    transform: translateY(10px) scale(0.98);
    transition: transform var(--transition-base);
}

.modal-backdrop.active .modal {
    transform: translateY(0) scale(1);
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-sm { max-width: 380px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Drawer */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: var(--z-drawer);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    backdrop-filter: blur(2px);
}

.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.drawer-backdrop.active .drawer {
    transform: translateX(0);
}

.drawer-left {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

.drawer-backdrop.active .drawer-left {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.drawer-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.drawer-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.drawer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: #F9FAFB;
}

/* Bottom Sheet */
.bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: var(--z-modal-backdrop);
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.bottom-sheet-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    z-index: var(--z-modal);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.bottom-sheet-backdrop.active .bottom-sheet {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: #D1D5DB;
    border-radius: 2px;
    margin: 0.6rem auto 0;
    flex-shrink: 0;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.bottom-sheet-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.bottom-sheet-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── 8. Alert System ─────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 13px;
    margin-bottom: 0.75rem;
    border: 1px solid transparent;
}

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

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

.alert-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 0.15rem;
}

.alert-message {
    color: inherit;
    opacity: 0.9;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.alert-close:hover { opacity: 1; }

.alert-success {
    background: var(--success-50);
    color: #166534;
    border-color: #BBF7D0;
}

.alert-danger {
    background: var(--danger-50);
    color: #991B1B;
    border-color: #FECACA;
}

.alert-warning {
    background: var(--warning-50);
    color: #92400E;
    border-color: #FDE68A;
}

.alert-info {
    background: var(--info-50);
    color: #075985;
    border-color: #BAE6FD;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    min-width: 300px;
    max-width: 420px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content { flex: 1; }

.toast-success .toast-icon { color: var(--success); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover { color: var(--text); }

/* ── 9. Utility Classes ──────────────────────────────────── */

/* Text colors */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-navy { color: var(--navy) !important; }
.text-teal { color: var(--teal) !important; }
.text-white { color: #fff !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-bold { font-weight: 600 !important; }
.text-sm { font-size: 12px !important; }
.text-xs { font-size: 11px !important; }
.text-lg { font-size: 16px !important; }
.text-xl { font-size: 20px !important; }
.text-2xl { font-size: 24px !important; }
.text-mono { font-family: var(--font-mono) !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-nowrap { white-space: nowrap !important; }
.text-break { word-break: break-word; }

/* Background soft colors */
.bg-success-soft { background: var(--success-50) !important; color: #166534; }
.bg-danger-soft { background: var(--danger-50) !important; color: #991B1B; }
.bg-warning-soft { background: var(--warning-50) !important; color: #92400E; }
.bg-info-soft { background: var(--info-50) !important; color: #075985; }
.bg-primary-soft { background: var(--primary-50) !important; color: var(--primary-600); }
.bg-teal-soft { background: var(--teal-50) !important; color: var(--teal); }
.bg-navy-soft { background: #F0F4F8 !important; color: var(--navy); }
.bg-light { background: #F9FAFB !important; }
.bg-white { background: var(--white) !important; }

/* Border radius */
.rounded { border-radius: var(--radius-md) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-10 { border-radius: 10px !important; }
.rounded-14 { border-radius: 14px !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }
.rounded-0 { border-radius: 0 !important; }

/* Shadows */
.shadow-xs { box-shadow: var(--shadow-xs) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-none { box-shadow: none !important; }

/* Gap */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.25rem !important; }
.gap-6 { gap: 1.5rem !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-inline { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }
.d-inline-block { display: inline-block !important; }

/* Flex */
.flex-row { flex-direction: row !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.items-start { align-items: flex-start !important; }
.items-center { align-items: center !important; }
.items-end { align-items: flex-end !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }

/* Spacing */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }
.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Width / Height */
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.min-h-screen { min-height: 100vh !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.overflow-x-auto { overflow-x: auto !important; }

/* Position */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.sticky { position: sticky !important; }

/* Mobile visibility */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* ── 10. Login Page ──────────────────────────────────────── */
.page-auth {
    background: linear-gradient(135deg, #0b1220 0%, #16324F 60%, #0F766E 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.page-auth::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.page-auth::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(15,118,110,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--white);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 0.25rem;
}

.auth-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 13px;
    color: var(--muted);
}

.auth-footer a {
    font-weight: 500;
}

/* ── 12. Loading States ──────────────────────────────────── */

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 12px;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-title {
    height: 20px;
    width: 40%;
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-xl);
}

.skeleton-table-row {
    height: 40px;
    margin-bottom: 0.5rem;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.spinner-white {
    border-color: rgba(255,255,255,0.3);
    border-top-color: #fff;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* Page loading */
.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

/* ── 13. Animations ──────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

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

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

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(-5%); }
    50% { transform: translateY(0); }
}

/* Animation utilities */
.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-slide-in-right { animation: slideInRight 0.3s ease; }
.animate-slide-in-up { animation: slideInUp 0.3s ease; }
.animate-slide-in-down { animation: slideInDown 0.3s ease; }
.animate-scale-in { animation: scaleIn 0.2s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Smooth transitions for interactive elements */
a, button, input, select, textarea, .card, .btn, .nav-item, .dropdown-item {
    transition-property: color, background-color, border-color, box-shadow, opacity, transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

/* ── 15. Scrollbar Styling (additional) ──────────────────── */
.sidebar::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 2px;
}

.sidebar:hover::-webkit-scrollbar-thumb,
.drawer-body:hover::-webkit-scrollbar-thumb,
.modal-body:hover::-webkit-scrollbar-thumb {
    background: #E2E8F0;
}

/* ── 16. DataTables Integration ──────────────────────────── */
table.dataTable {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 13px;
}

table.dataTable thead th {
    background: #F9FAFB;
    padding: 0.6rem 0.9rem;
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    user-select: none;
}

table.dataTable tbody td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

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

table.dataTable tbody tr:hover {
    background: #F9FAFB;
}

table.dataTable tbody tr.selected {
    background: var(--primary-50);
}

/* DataTables search & length */
.dataTables_wrapper .dataTables_length {
    font-size: 13px;
    color: var(--muted);
}

.dataTables_wrapper .dataTables_length select {
    height: 32px;
    padding: 0 1.5rem 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--white);
    outline: none;
}

.dataTables_wrapper .dataTables_filter {
    font-size: 13px;
}

.dataTables_wrapper .dataTables_filter input {
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 13px;
    outline: none;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.dataTables_wrapper .dataTables_info {
    font-size: 12px;
    color: var(--muted);
    padding: 0.75rem 0;
}

/* DataTables Pagination */
.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: 0 2px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg);
    border-color: #D1D5DB;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:active {
    transform: scale(0.96);
}

/* DataTables top bar */
.dataTables_wrapper .dataTables_top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

/* DataTables processing */
.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.95);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    font-size: 13px;
    z-index: 5;
}

/* ── 17. Chart Containers ────────────────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 200px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-container-sm {
    aspect-ratio: 2 / 1;
    min-height: 150px;
}

.chart-container-lg {
    aspect-ratio: 21 / 9;
    min-height: 250px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    font-size: 12px;
    color: var(--muted);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ── 18. Dropdown ────────────────────────────────────────── */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all var(--transition-fast);
    margin-top: 4px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-left {
    left: 0;
    right: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    font-size: 13px;
    color: var(--text);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

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

.dropdown-item:hover {
    background: var(--bg);
}

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

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger i {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: var(--danger-50);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.dropdown-header {
    padding: 0.35rem 0.65rem;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── 19. Pagination ──────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination .page-item {
    display: inline-flex;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination .page-link:hover {
    background: var(--bg);
    border-color: #D1D5DB;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    font-size: 12px;
    color: var(--muted);
    margin-right: 0.75rem;
}

/* ── 20. Empty State ─────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--muted);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--muted);
    max-width: 360px;
    margin-bottom: 1rem;
}

.empty-state-icon-lg {
    width: 80px;
    height: 80px;
    font-size: 36px;
}

.empty-state-icon-sm {
    width: 48px;
    height: 48px;
    font-size: 22px;
}

/* ── Additional UI Components ────────────────────────────── */

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tab-item {
    padding: 0.65rem 1rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab-item:hover {
    color: var(--text);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    padding: 1rem 0;
}

/* Progress Bar */
.progress {
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.progress-bar-success { background: var(--success); }
.progress-bar-warning { background: var(--warning); }
.progress-bar-danger { background: var(--danger); }

/* Tooltip */
.tooltip-wrapper {
    position: relative;
}

.tooltip-wrapper:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.3rem 0.6rem;
    background: #1E293B;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-md);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 20;
}

/* Tag / Chip */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.tag-primary { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.tag-success { background: var(--success-50); color: var(--success); border-color: #BBF7D0; }
.tag-danger { background: var(--danger-50); color: var(--danger); border-color: #FECACA; }
.tag-warning { background: var(--warning-50); color: #D97706; border-color: #FDE68A; }

.tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    font-size: 10px;
    cursor: pointer;
    line-height: 1;
    border: none;
    color: inherit;
}

.tag-remove:hover {
    background: rgba(0,0,0,0.2);
}

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

/* Avatar */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--teal));
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.avatar-xl { width: 56px; height: 56px; font-size: 20px; }

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid var(--white);
    margin-left: -8px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* Dropdown */
.dropdown-inline {
    position: relative;
    display: inline-flex;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    border-color: #D1D5DB;
    background: var(--bg);
}

.filter-chip.active {
    border-color: var(--primary);
    background: var(--primary-50);
    color: var(--primary);
}

/* ── Quick Filters Row ───────────────────────────────────── */
.quick-filters {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0;
    overflow-x: auto;
}

/* ── Content Sections ────────────────────────────────────── */
.content-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.app-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    background: var(--white);
    margin-top: auto;
}

/* ── List styles ─────────────────────────────────────────── */
.list-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.list-group-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background var(--transition-fast);
}

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

.list-group-item:hover {
    background: #F9FAFB;
}

.list-group-item.active {
    background: var(--primary-50);
}

/* ── Code / Pre ──────────────────────────────────────────── */
code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: #F1F5F9;
    padding: 0.15rem 0.35rem;
    border-radius: var(--radius-sm);
    color: #E11D48;
}

pre {
    background: #1E293B;
    color: #E2E8F0;
    padding: 1rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1199px) {
    .grid-cols-5 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 991px) {
    /* Sidebar: hidden by default, overlay when open */
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        z-index: calc(var(--z-sidebar) + 5);
        width: 280px;
        height: 100vh;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        display: flex;
        animation: slideInLeft 0.25s ease;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: calc(var(--z-sidebar) + 4);
    }

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

    /* Sidebar toggle button visible */
    .sidebar-toggle {
        display: inline-flex;
    }

    /* Main content: full width */
    .main-wrapper {
        margin-left: 0 !important;
    }

    .main-wrapper.sidebar-collapsed {
        margin-left: 0 !important;
    }

    /* Desktop-only elements hidden */
    .desktop-only {
        display: none !important;
    }

    /* Mobile-only elements shown */
    .mobile-only {
        display: flex !important;
    }

    /* Page header stacks */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-actions {
        width: 100%;
    }

    /* Reduce padding */
    .main-content {
        padding: 0.75rem;
    }

    /* Table becomes card layout on mobile */
    .table-responsive-card {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .table-responsive-card .table-card-item {
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 0.85rem;
        box-shadow: var(--shadow-xs);
    }

    .table-responsive-card .table-card-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.25rem 0;
        gap: 0.5rem;
    }

    .table-responsive-card .table-card-label {
        font-size: 11px;
        color: var(--muted);
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        flex-shrink: 0;
    }

    .table-responsive-card .table-card-value {
        font-size: 13px;
        color: var(--text);
        font-weight: 500;
        text-align: right;
    }

    .table-responsive-card .table-card-actions {
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-light);
        margin-top: 0.35rem;
        display: flex;
        gap: 0.35rem;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .grid-cols-5 {
        grid-template-columns: 1fr;
    }

    /* Drawer full width */
    .drawer {
        width: 100vw;
    }

    /* Chart container */
    .chart-container {
        aspect-ratio: 4 / 3;
    }

    /* Filter bar scrolls */
    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    /* Topbar search limited */
    .topbar-search {
        max-width: 200px;
    }

    /* User info hidden */
    .user-info {
        display: none;
    }

    /* Bottom sticky action bar for forms */
    .bottom-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        border-top: 1px solid var(--border);
        padding: 0.65rem 1rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        z-index: 15;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    }

    /* Modal adjustments */
    .modal {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        border-radius: var(--radius-lg);
    }

    .modal-lg,
    .modal-xl {
        max-width: calc(100vw - 1rem);
    }

    /* Bottom sheet visible */
    .bottom-sheet-backdrop {
        display: block;
    }

    /* Breadcrumb may overflow */
    .breadcrumb {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }

    /* Reduce stat card size */
    .stat-card {
        padding: 0.85rem;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Card body smaller */
    .card-body {
        padding: 1rem;
    }

    /* Page title */
    .page-title {
        font-size: 18px;
    }

    /* Warehouse selector hidden */
    .warehouse-selector {
        display: none;
    }
}

@media (max-width: 575px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 0.5rem;
    }

    .topbar {
        padding: 0 0.5rem;
    }

    .topbar-search {
        max-width: 150px;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .auth-card {
        padding: 1.25rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .drawer-header,
    .drawer-body,
    .drawer-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ── Print Styles ────────────────────────────────────────── */
@media print {
    .sidebar,
    .topbar,
    .sidebar-toggle,
    .sidebar-overlay,
    .bottom-action-bar,
    .btn,
    .page-actions,
    .filter-bar,
    .quick-filters,
    .pagination,
    .toast-container,
    .modal-backdrop,
    .drawer-backdrop {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12px;
    }

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

    .main-content {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #D1D5DB;
        page-break-inside: avoid;
    }

    .table-modern {
        font-size: 11px;
    }

    .table-modern thead th {
        background: #F3F4F6 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a { color: #000; text-decoration: underline; }

    .badge {
        border: 1px solid #ccc;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================================
   2026 UI Refresh — Soft Enterprise Inventory Experience
   Shared visual layer for every master, transaction and report.
   ============================================================ */
:root {
    --bg: #f6f8fb;
    --surface-soft: #f8fafc;
    --surface-blue: #f3f7ff;
    --surface-teal: #f1faf8;
    --border: #e7ebf0;
    --border-strong: #d8e0e9;
    --text: #172033;
    --text-secondary: #42526a;
    --muted: #718096;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 13px;
    --radius-xl: 17px;
    --shadow-xs: 0 1px 2px rgba(22, 50, 79, .03);
    --shadow-sm: 0 2px 8px rgba(22, 50, 79, .055);
    --shadow-md: 0 8px 24px rgba(22, 50, 79, .075);
    --sidebar-width: 264px;
    --topbar-height: 66px;
}

body {
    background:
        radial-gradient(circle at 100% 0, rgba(37, 99, 235, .045), transparent 26rem),
        var(--bg);
    color: var(--text);
    letter-spacing: -.005em;
}

::selection { background: #dbeafe; color: #16324f; }

.sidebar {
    padding: 14px 12px;
    border-right-color: rgba(216, 224, 233, .82);
    box-shadow: 4px 0 22px rgba(22, 50, 79, .035);
}

.sidebar-brand {
    padding: 5px 7px 15px;
    margin-bottom: 7px;
    border-bottom: 1px solid #eef1f5;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, #2563eb, #167f79);
    box-shadow: 0 7px 16px rgba(37, 99, 235, .2);
}

.sidebar-title { font-size: 15px; letter-spacing: -.025em; }
.nav-section { margin-bottom: 10px; }
.nav-section-title {
    padding: 10px 10px 5px;
    color: #98a5b7;
    font-size: 10px;
    letter-spacing: .11em;
}

.nav-item {
    position: relative;
    min-height: 39px;
    padding: 8px 10px;
    margin-bottom: 3px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #536176;
}

.nav-item i {
    width: 20px;
    color: #8090a5;
    font-size: 13px;
}

.nav-item:hover {
    color: #173b67;
    background: #f4f8ff;
    border-color: #e8f0fd;
    transform: translateX(2px);
}

.nav-item.active {
    color: #174da8;
    background: linear-gradient(90deg, #edf4ff, #f4f8ff);
    border-color: #dce9ff;
    box-shadow: inset 3px 0 #2563eb;
}

.nav-item.active i { color: #2563eb; }
.sidebar-footer { border-top-color: #eef1f5; }
.sidebar-collapse-btn { border-radius: 10px; }

.topbar {
    padding: 0 22px;
    background: rgba(255, 255, 255, .92);
    border-bottom-color: rgba(216, 224, 233, .8);
    box-shadow: 0 4px 18px rgba(22, 50, 79, .035);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.sidebar-toggle,
.btn-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5d6b7e;
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 11px;
}

.sidebar-toggle:hover,
.btn-icon:hover {
    color: #2563eb;
    background: #eff6ff;
    border-color: #d8e7ff;
    transform: translateY(-1px);
}

.topbar-search { max-width: 400px; }
.topbar-search .input-group {
    overflow: hidden;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    background: #f8fafc;
    transition: .2s ease;
}
.topbar-search .input-group:focus-within {
    background: #fff;
    border-color: #aac7fb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
}
.topbar-search .input-group-text,
.topbar-search .form-control { border: 0 !important; background: transparent !important; }
.topbar-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.avatar-circle {
    background: linear-gradient(145deg, #dbeafe, #ccfbf1);
    color: #174a77;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .09);
}

.main-content { padding: 24px 26px 38px; }
.page-title,
.main-content h1.h3 {
    color: #172a43;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.035em;
}
.page-subtitle { color: #7b8899; font-size: 13px; margin-top: 3px; }

.card {
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 14px rgba(22, 50, 79, .055);
    transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.card:hover { border-color: #dbe4ee; box-shadow: 0 10px 28px rgba(22, 50, 79, .075); }
.card-header {
    min-height: 54px;
    padding: 14px 18px;
    background: transparent;
    border-bottom: 1px solid #edf0f4;
}
.card-body { padding: 18px; }
.stat-card,
.summary-card {
    border-color: #e6ebf1;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(22, 50, 79, .05);
}
.stat-card:hover,
.summary-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(22, 50, 79, .09); }
.stat-icon { border-radius: 13px; }
.stat-value,
.summary-card-value { color: #142b46; letter-spacing: -.035em; }

.btn {
    min-height: 36px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .005em;
    box-shadow: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 4px 11px rgba(37, 99, 235, .17);
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; box-shadow: 0 7px 16px rgba(37, 99, 235, .22); }
.btn-outline-primary { color: #245cc5; border-color: #bed2f7; background: #f8fbff; }
.btn-outline-secondary { color: #556579; border-color: #dce3eb; background: #fff; }
.btn-danger { background: #dc4545; border-color: #dc4545; }
.btn-group-sm > .btn,
.btn-sm { min-height: 32px; border-radius: 9px; }

.form-label {
    margin-bottom: 6px;
    color: #45556c;
    font-size: 12px;
    font-weight: 600;
}
.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 40px;
    color: #23324a;
    background-color: #fbfcfe;
    border: 1px solid #dfe6ee;
    border-radius: 10px;
    font-size: 13px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.form-control:hover,
.form-select:hover { border-color: #c9d4e1; }
.form-control:focus,
.form-select:focus {
    background: #fff;
    border-color: #78a5f5;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
}
.form-text { color: #8a97a8; font-size: 11.5px; }
.input-group-text { color: #718096; background: #f8fafc; border-color: #dfe6ee; }

.table-responsive,
.dataTables_wrapper { border-radius: 12px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table-modern,
.dataTable { color: #354359; font-size: 12.5px; }
.table-modern thead th,
.dataTable thead th {
    padding: 12px 14px !important;
    color: #65748a;
    background: #f7f9fc !important;
    border-top: 1px solid #edf0f4 !important;
    border-bottom: 1px solid #e4e9ef !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap;
}
.table-modern tbody td,
.dataTable tbody td {
    padding: 12px 14px !important;
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
}
.table-modern tbody tr,
.dataTable tbody tr { transition: background .14s ease; }
.table-modern tbody tr:hover,
.dataTable tbody tr:hover { background: #f7faff !important; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #dfe6ee;
    border-radius: 9px;
    background: #fbfcfe;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 0 !important;
    border-radius: 8px !important;
}
.page-item .page-link { color: #52647b; border-color: #e5eaf0; }
.page-item.active .page-link { background: #2563eb; border-color: #2563eb; }

.badge {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .015em;
}
.bg-success { background-color: #2d9b69 !important; }
.bg-warning { background-color: #f5b94b !important; }
.bg-danger { background-color: #dc5a5a !important; }
.bg-info { background-color: #3c9fca !important; }
.bg-secondary { background-color: #7d8ba0 !important; }

.dropdown-menu {
    padding: 7px;
    border: 1px solid #e3e9f0;
    border-radius: 13px;
    box-shadow: 0 16px 38px rgba(22, 50, 79, .14);
}
.dropdown-item { padding: 8px 10px; border-radius: 8px; color: #435268; font-size: 12.5px; }
.dropdown-item:hover { color: #174da8; background: #f1f6ff; }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 24px 70px rgba(22, 50, 79, .2); }
.modal-header { border-bottom-color: #edf0f4; }
.modal-footer { border-top-color: #edf0f4; background: #fafbfd; }
.alert { border: 1px solid transparent; border-radius: 12px; font-size: 12.5px; }
.alert-success { color: #176342; background: #effaf5; border-color: #d5f0e2; }
.alert-danger { color: #9f3131; background: #fff3f3; border-color: #f5dada; }
.alert-warning { color: #8a5b0a; background: #fffaeb; border-color: #f7e9bd; }
.alert-info { color: #17617f; background: #f0f9fd; border-color: #d2edf7; }

@media (max-width: 991.98px) {
    .main-content { padding: 18px 16px 88px; }
    .topbar { padding: 0 14px; }
    .topbar-search { max-width: min(360px, 48vw); }
}

@media (max-width: 575.98px) {
    :root { --topbar-height: 60px; }
    .main-content { padding: 14px 10px 86px; }
    .topbar { gap: 7px; padding: 0 10px; }
    .topbar-search { max-width: none; flex: 1; }
    .topbar-actions { gap: 4px; }
    .topbar-actions .btn-icon { width: 36px; height: 36px; }
    .page-title,
    .main-content h1.h3 { font-size: 20px; }
    .card { border-radius: 14px; }
    .card-body { padding: 14px; }
    .d-flex.justify-content-between.align-items-center.mb-3,
    .d-flex.justify-content-between.align-items-center.mb-4 {
        align-items: flex-start !important;
        gap: 12px;
        flex-wrap: wrap;
    }
    .d-flex.justify-content-between.align-items-center.mb-3 > .btn,
    .d-flex.justify-content-between.align-items-center.mb-4 > .btn { width: 100%; }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter { text-align: left !important; margin-bottom: 10px; }
    .dataTables_wrapper .dataTables_filter input { width: calc(100vw - 110px); }
    .btn { min-height: 40px; }
}

/* ============================================================
   Modern dimensional UI — soft depth, no purple, enterprise safe
   ============================================================ */
:root {
    --depth-shadow: 0 16px 34px rgba(15, 50, 79, .09), 0 3px 8px rgba(15, 50, 79, .05);
    --depth-shadow-hover: 0 22px 46px rgba(15, 50, 79, .14), 0 6px 14px rgba(15, 50, 79, .07);
}

.sidebar-logo,
.nav-item i,
.btn-icon i,
.page-header i,
.card-header i {
    filter: drop-shadow(0 2px 3px rgba(15, 50, 79, .12));
}
.nav-item i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: linear-gradient(145deg, #fff, #f1f5f9);
    box-shadow: 0 3px 7px rgba(15, 50, 79, .07), inset 0 1px 0 #fff;
}
.nav-item.active i {
    color: #fff;
    border-color: rgba(15,118,110,.18);
    background: linear-gradient(145deg, #14b8a6, #0f766e);
    box-shadow: 0 6px 14px rgba(15,118,110,.24), inset 0 1px 0 rgba(255,255,255,.24);
}

.dashboard-modern { max-width: 1680px; margin: 0 auto; }
.dashboard-hero {
    position: relative;
    padding: 22px 24px;
    overflow: hidden;
    border: 1px solid rgba(37,99,235,.10);
    border-radius: 18px;
    background:
        radial-gradient(circle at 88% 16%, rgba(56,189,248,.18), transparent 24%),
        radial-gradient(circle at 72% 110%, rgba(20,184,166,.14), transparent 30%),
        linear-gradient(135deg, #fff 0%, #f8fbff 58%, #f0fdfa 100%);
    box-shadow: var(--depth-shadow);
}
.dashboard-hero::after {
    content: '';
    position: absolute;
    right: 7%; top: -58px;
    width: 170px; height: 170px;
    border: 28px solid rgba(37,99,235,.045);
    border-radius: 50%;
    pointer-events: none;
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero h1 { color: #16324f; letter-spacing: -.035em; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: #0f766e; font-size: 10.5px; font-weight: 800; letter-spacing: .11em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 5px rgba(22,163,74,.11); animation: livePulse 2s infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 9px rgba(22,163,74,0); } }

.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 14px;
    border: 1px solid #e5eaf0;
    border-radius: 13px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 5px 16px rgba(15,50,79,.045);
    backdrop-filter: blur(12px);
}
.toolbar-copy { display: flex; align-items: center; gap: 11px; color: #16324f; }
.toolbar-copy > i { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; border-radius: 10px; background: linear-gradient(145deg,#38bdf8,#2563eb); box-shadow: 0 7px 15px rgba(37,99,235,.22); }
.toolbar-copy span { display: flex; flex-direction: column; font-size: 12px; }
.toolbar-copy small { color: #64748b; font-size: 11px; }
.period-switch { display: flex; padding: 3px; border-radius: 9px; background: #eef2f7; }
.period-btn { min-width: 42px; height: 30px; border: 0; border-radius: 7px; color: #64748b; background: transparent; font-size: 11px; font-weight: 800; transition: .18s ease; }
.period-btn.active { color: #fff; background: linear-gradient(145deg,#2563eb,#1d4ed8); box-shadow: 0 5px 12px rgba(37,99,235,.22); }

.modern-kpi-card {
    --rx: 0deg; --ry: 0deg;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-color: rgba(226,232,240,.85) !important;
    border-radius: 16px !important;
    background: linear-gradient(145deg,rgba(255,255,255,.98),rgba(248,250,252,.92)) !important;
    box-shadow: var(--depth-shadow) !important;
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(0);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.modern-kpi-card::after { content:''; position:absolute; inset:auto -28px -52px auto; width:120px; height:120px; border-radius:50%; background:radial-gradient(circle,rgba(37,99,235,.09),transparent 68%); }
.modern-kpi-card:hover { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-5px); border-color: rgba(37,99,235,.18) !important; box-shadow: var(--depth-shadow-hover) !important; }
.modern-kpi-card .card-body { min-height: 108px; padding: 18px; }
.modern-kpi-card .rounded-circle {
    width: 50px; height: 50px; padding: 0 !important;
    display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 14px !important;
    background: linear-gradient(145deg,#fff,#edf4ff) !important;
    box-shadow: 0 10px 19px rgba(15,50,79,.11), inset 0 1px 0 #fff;
}
.modern-kpi-card .fs-4 { color: #16324f; font-size: 22px !important; letter-spacing: -.035em; }
.modern-kpi-card .card-body > div:last-child { min-width: 0; }
.modern-kpi-card .fs-4 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modern-kpi-card .kpi-value-compact { font-size: clamp(15px, 1.25vw, 19px) !important; }
.modern-kpi-card .small { color: #64748b !important; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .035em; }

.dashboard-panel {
    overflow: hidden;
    border-color: rgba(226,232,240,.9) !important;
    border-radius: 16px !important;
    box-shadow: var(--depth-shadow) !important;
    transition: transform .2s ease, box-shadow .2s ease !important;
}
.dashboard-panel:hover { transform: translateY(-3px); box-shadow: var(--depth-shadow-hover) !important; }
.dashboard-panel .card-header { padding: 16px 18px; background: linear-gradient(180deg,#fff,#fbfdff) !important; }
.dashboard-panel .card-header i { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 9px; background: #eff6ff; }
.dashboard-panel canvas { transition: filter .2s ease; }
.dashboard-panel:hover canvas { filter: saturate(1.08); }

/* The same dimensional language is reused across list, CRUD and detail pages. */
.app-page:not(.route-dashboard) .main-content > .card,
.app-page:not(.route-dashboard) .main-content .container-fluid > .card {
    border-radius: 15px;
    box-shadow: 0 10px 28px rgba(15,50,79,.065);
}
.app-page .table-responsive { scrollbar-color: #cbd5e1 transparent; }
.app-page .dataTable tbody tr { transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.app-page .dataTable tbody tr:hover { transform: translateY(-1px); box-shadow: 0 5px 13px rgba(15,50,79,.055); }
.app-page .btn-primary { background: linear-gradient(145deg,#2563eb,#1d4ed8); border-color:#2563eb; box-shadow:0 6px 13px rgba(37,99,235,.19); }
.app-page .btn-primary:hover { background:linear-gradient(145deg,#1d4ed8,#1e40af); box-shadow:0 9px 18px rgba(37,99,235,.25); transform:translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
    .modern-kpi-card, .dashboard-panel, .live-dot { animation: none !important; transition: none !important; transform: none !important; }
}
@media (max-width: 767.98px) {
    .dashboard-hero { padding: 18px 16px; }
    .dashboard-toolbar { align-items: flex-start; }
    .toolbar-copy small { display: none; }
    .modern-kpi-card .card-body { min-height: 92px; }
}

/* ============================================================
   Visible component transformation
   Route-aware rules intentionally override Bootstrap utilities used by
   legacy views, so the refreshed design is consistent on every screen.
   ============================================================ */
.app-page .main-content > .container-fluid { padding: 0; }
.app-page .main-content > .d-flex:first-child,
.app-page .main-content > .container-fluid > .d-flex:first-child {
    min-height: 54px;
    margin-bottom: 18px !important;
}

/* Dashboard: distinct KPI tiles instead of generic Bootstrap cards */
.route-dashboard .dashboard-kpis .card {
    position: relative;
    overflow: hidden;
    min-height: 116px;
    border: 1px solid #e4ebeF !important;
    border-radius: 12px !important;
    background: linear-gradient(145deg, #ffffff 60%, #f4fbfa) !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .055) !important;
}
.route-dashboard .dashboard-kpis .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #0d9488;
}
.route-dashboard .dashboard-kpis > div:nth-child(2) .card::before { background: #0284c7; }
.route-dashboard .dashboard-kpis > div:nth-child(3) .card::before { background: #10b981; }
.route-dashboard .dashboard-kpis > div:nth-child(4) .card::before { background: #f59e0b; }
.route-dashboard .dashboard-kpis .card-body { padding: 18px !important; }
.route-dashboard .dashboard-kpis .rounded-circle {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
}
.route-dashboard .dashboard-kpis h4,
.route-dashboard .dashboard-kpis .fs-4 {
    margin-top: 3px;
    color: #1a2332;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.035em;
}
.route-dashboard .card.border-0.shadow-sm:not(.h-100),
.route-dashboard .row:nth-of-type(n+3) .card {
    border: 1px solid #e8ecf1 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .055) !important;
}
.route-dashboard .card-header.border-0 {
    padding: 16px 18px 8px !important;
    border-bottom: 1px solid #f1f4f8 !important;
}

/* Shared list page shell */
.route-items .main-content > .card,
.route-categories .main-content > .card,
.route-units .main-content > .card,
.route-suppliers .main-content > .card,
.route-customers .main-content > .card,
.route-warehouses .main-content > .card,
.route-locations .main-content > .card,
.route-barcode .main-content > .card,
.route-receiving .main-content > .card,
.route-stock-out .main-content > .card,
.route-sales .main-content > .card,
.route-transfers .main-content > .card,
.route-returns .main-content > .card,
.route-adjustments .main-content > .card,
.route-stock-count .main-content > .card,
.route-settings-audit-log .main-content > .card {
    overflow: hidden;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .045);
}

/* DataTables gets a real toolbar, framed dataset and compact pagination */
.app-page .dataTables_wrapper > .row:first-child {
    align-items: center;
    margin: -16px -16px 0 !important;
    padding: 13px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e8ecf1;
}
.app-page .dataTables_wrapper > .row:nth-child(2) { margin: 0 -16px; }
.app-page .dataTables_wrapper > .row:last-child {
    align-items: center;
    margin: 0 -16px -16px !important;
    padding: 12px 16px;
    background: #fbfcfd;
    border-top: 1px solid #eef1f5;
}
.app-page .dataTables_wrapper .dataTables_length label,
.app-page .dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}
.app-page .dataTables_wrapper .dataTables_filter input {
    width: 230px;
    height: 36px;
    margin-left: 0;
    padding: 7px 11px 7px 34px;
    border: 1px solid #dde5ed;
    border-radius: 7px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 11px center;
}
.app-page table.dataTable { margin: 0 !important; border-collapse: collapse !important; }
.app-page table.dataTable thead th {
    height: 44px;
    padding: 10px 13px !important;
    color: #55657a;
    background: #f5f8fa !important;
    border-bottom: 1px solid #dfe6ed !important;
}
.app-page table.dataTable tbody td { height: 48px; padding: 10px 13px !important; }
.app-page table.dataTable tbody tr:nth-child(even) { background: #fcfdfe; }
.app-page .dataTables_info { padding-top: 0 !important; color: #7b899c; font-size: 11.5px; }
.app-page .pagination { gap: 4px; justify-content: flex-end; margin: 0; }
.app-page .pagination .page-link {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 7px !important;
    color: #64748b;
    background: #fff;
}
.app-page .pagination .page-item.active .page-link {
    color: #fff;
    background: #0d9488;
    border-color: #0d9488;
    box-shadow: 0 2px 5px rgba(13, 148, 136, .2);
}

/* Filters become a clearly separated control surface */
.app-page .filter-bar,
.app-page .filter-panel,
.app-page .advanced-filter {
    padding: 14px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e6ebf1;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .035);
}
.app-page .filter-chip {
    min-height: 32px;
    color: #526176;
    background: #f8fafc;
    border-color: #e2e8f0;
    border-radius: 7px;
}
.app-page .filter-chip.active { color: #0f766e; background: #f0fdfa; border-color: #99d8d1; }

/* CRUD pages: calm form canvas with visible section hierarchy */
.app-page[class*="route-"][class*="-create"] .main-content > form,
.app-page[class*="route-"][class*="-edit"] .main-content > form {
    max-width: 1180px;
    margin-inline: auto;
}
.app-page[class*="route-"][class*="-create"] .card,
.app-page[class*="route-"][class*="-edit"] .card {
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .045);
}
.app-page[class*="route-"][class*="-create"] .card-header,
.app-page[class*="route-"][class*="-edit"] .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e8ecf1;
}
.app-page[class*="route-"][class*="-create"] .card-header h5,
.app-page[class*="route-"][class*="-edit"] .card-header h5,
.app-page[class*="route-"][class*="-create"] .card-header h6,
.app-page[class*="route-"][class*="-edit"] .card-header h6 {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .app-page .dataTables_wrapper > .row:first-child { gap: 8px; }
    .app-page .dataTables_wrapper .dataTables_filter,
    .app-page .dataTables_wrapper .dataTables_filter label,
    .app-page .dataTables_wrapper .dataTables_filter input { width: 100%; }
    .app-page .dataTables_wrapper > .row:last-child { gap: 10px; }
    .app-page .pagination { justify-content: flex-start; flex-wrap: wrap; }
}

/* ============================================================
   Board-style application shell (structural, not cosmetic)
   ============================================================ */
.app-page { overflow: hidden; }
.app-page .main-wrapper,
.app-page .main-wrapper.sidebar-collapsed {
    width: 100%;
    height: 100vh;
    margin-left: 0;
    overflow: hidden;
}
.app-page .main-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 26px clamp(20px, 3vw, 40px) 42px;
}

.app-page .sidebar {
    width: 276px;
    max-width: calc(100vw - 32px);
    padding: 12px;
    z-index: 1060;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 12px 0 36px rgba(16, 24, 40, .14);
}
.app-page .sidebar.open {
    width: 276px;
    transform: translateX(0);
}
.app-page .sidebar.collapsed { width: 276px; }
.app-page .sidebar.collapsed .sidebar-title,
.app-page .sidebar.collapsed .nav-item span,
.app-page .sidebar.collapsed .nav-section-title,
.app-page .sidebar.collapsed .nav-item-label,
.app-page .sidebar.collapsed .sidebar-footer-text {
    width: auto;
    opacity: 1;
    overflow: visible;
}
.app-page .sidebar.collapsed .nav-item,
.app-page .sidebar.collapsed .sidebar-brand { justify-content: flex-start; }
.app-page .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: block;
    pointer-events: none;
    background: rgba(15, 23, 42, .2);
    opacity: 0;
    backdrop-filter: blur(1px);
    transition: opacity .2s ease;
}
.app-page .sidebar-overlay.active { pointer-events: auto; opacity: 1; }

/* Desktop navigation is visible and expanded by default. */
@media (min-width: 992px) {
    .app-page .sidebar {
        width: var(--sidebar-width);
        max-width: none;
        transform: translateX(0);
        box-shadow: none;
    }
    .app-page .main-wrapper,
    .app-page .main-wrapper.sidebar-collapsed {
        width: auto;
        margin-left: var(--sidebar-width);
    }
    .app-page .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }
    .app-page .main-wrapper.sidebar-collapsed {
        margin-left: var(--sidebar-collapsed-width);
    }
    .app-page .sidebar.collapsed .sidebar-title,
    .app-page .sidebar.collapsed .nav-item span,
    .app-page .sidebar.collapsed .nav-section-title,
    .app-page .sidebar.collapsed .nav-item-label,
    .app-page .sidebar.collapsed .sidebar-collapse-btn span {
        width: 0;
        opacity: 0;
        overflow: hidden;
    }
    .app-page .sidebar.collapsed .nav-item,
    .app-page .sidebar.collapsed .sidebar-brand,
    .app-page .sidebar.collapsed .sidebar-collapse-btn {
        justify-content: center;
    }
    .app-page .sidebar-overlay { display: none; }
}

.board-topbar {
    position: relative;
    height: 60px;
    gap: 16px;
    padding: 0 clamp(20px, 3vw, 40px);
    z-index: 1040;
}
.board-topbar .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.app-launcher-btn {
    width: 32px;
    height: 32px;
    display: grid;
    grid-template-columns: repeat(3, 3px);
    grid-template-rows: repeat(3, 3px);
    place-content: center;
    gap: 3px;
    padding: 0;
    color: #fff;
    background: #0d9488;
    border: 0;
    border-radius: 5px;
    transition: background .15s ease;
}
.app-launcher-btn:hover { background: #0f766e; }
.app-launcher-btn span { width: 3px; height: 3px; background: currentColor; border-radius: 50%; }
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    text-decoration: none;
}
.topbar-brand:hover { color: var(--text); }
.topbar-brand-mark {
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f766e;
    background: #ccfbf1;
    border-radius: 7px;
    font-size: 13px;
}
.topbar-brand-copy { display: flex; flex-direction: column; line-height: 1.12; }
.topbar-brand-copy strong { color: #242b36; font-size: 14px; letter-spacing: -.015em; }
.topbar-brand-copy small { max-width: 190px; color: #94a3b8; font-size: 9.5px; white-space: nowrap; }
.board-topbar .search-box {
    flex: 1;
    max-width: 480px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    margin-left: clamp(8px, 2vw, 28px);
    color: #94a3b8;
    background: #f4f6f9;
    border: 1px solid #e8ecf1;
    border-radius: 9px;
}
.board-topbar .search-box:focus-within {
    background: #fff;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px #ccfbf1;
}
.board-topbar .search-box input {
    flex: 1;
    min-width: 40px;
    height: auto;
    padding: 0;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12.5px;
}
.board-topbar .search-box kbd {
    padding: 2px 6px;
    color: #94a3b8;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font: 10px/1.4 inherit;
}
.board-topbar .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.topbar-warehouse,
.topbar-scan { height: 34px; gap: 7px; white-space: nowrap; }
.topbar-chevron { margin-left: 3px; color: #94a3b8; font-size: 8px; }
.topbar-user-btn {
    padding: 0;
    background: none;
    border: 0;
    border-radius: 50%;
}
.topbar-user-btn .avatar-circle {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}
.notification-dropdown { min-width: 310px; }
.empty-notification {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    color: #94a3b8;
    font-size: 12px;
}
.empty-notification i { font-size: 22px; }
.user-menu { min-width: 210px; }
.user-menu-header { display: flex; flex-direction: column; gap: 2px; }
.user-menu-header span { color: #94a3b8; font-size: 11px; text-transform: capitalize; }
.user-menu .dropdown-item { display: flex; align-items: center; gap: 9px; }
.user-menu form { margin: 0; }

/* Board-like page hierarchy */
.app-page .main-content > .d-flex:first-child,
.app-page .main-content > .container-fluid > .d-flex:first-child {
    padding: 0;
    margin-bottom: 24px !important;
    background: transparent;
    border: 0;
}
.app-page .page-title,
.route-dashboard .main-content h1.h3 { font-size: 24px; line-height: 1.2; }
.app-page .page-subtitle { font-size: 13px; }
.app-page .main-content > .card { padding: 0; }

@media (max-width: 900px) {
    .topbar-brand-copy small,
    .board-topbar .search-box kbd,
    .topbar-warehouse { display: none !important; }
    .board-topbar .search-box { margin-left: 4px; }
}
@media (max-width: 600px) {
    .board-topbar { gap: 8px; padding: 0 10px; }
    .topbar-brand-mark,
    .topbar-brand-copy { display: none; }
    .board-topbar .search-box { margin-left: 0; }
    .board-topbar .search-box input::placeholder { color: transparent; }
    .app-page .main-content { padding: 18px 10px 80px; }
}

/* ============================================================
   FlowBoard-inspired refinement
   Keeps the inventory information architecture while matching the
   calmer, flatter and teal-led visual language used by localhost/board.
   ============================================================ */
:root {
    --bg: #f4f6f9;
    --white: #ffffff;
    --border: #e8ecf1;
    --border-light: #f1f4f8;
    --text: #1a2332;
    --text-secondary: #64748b;
    --muted: #94a3b8;
    --primary: #0d9488;
    --primary-50: #f0fdfa;
    --primary-100: #ccfbf1;
    --primary-600: #0f766e;
    --primary-700: #115e59;
    --teal: #0d9488;
    --teal-50: #f0fdfa;
    --sidebar-hover: #f8fafc;
    --sidebar-active: #f0fdfa;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .035);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, .075);
    --sidebar-width: 252px;
    --topbar-height: 60px;
}

body { background: var(--bg); letter-spacing: 0; }
.sidebar {
    padding: 10px 11px;
    border-right: 1px solid var(--border);
    box-shadow: none;
}
.sidebar-brand { padding: 8px 8px 14px; border-bottom: 0; }
.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    box-shadow: none;
}
.sidebar-title { color: var(--text); font-size: 16px; }
.nav-section-title { color: var(--muted); font-size: 10.5px; letter-spacing: .07em; }
.nav-item {
    min-height: 38px;
    padding: 8px 11px;
    color: var(--text-secondary);
    border: 0;
    border-radius: 7px;
}
.nav-item:hover { color: var(--text); background: #f8fafc; transform: none; }
.nav-item.active {
    color: #0f766e;
    background: #f0fdfa;
    border: 0;
    box-shadow: none;
}
.nav-item.active i { color: #0d9488; }

.topbar {
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: none;
}
.sidebar-toggle {
    width: 34px;
    height: 34px;
    color: #fff;
    background: #0d9488;
    border: 0;
    border-radius: 6px;
}
.sidebar-toggle:hover { color: #fff; background: #0f766e; transform: none; }
.topbar-search { max-width: 440px; }
.topbar-search .input-group {
    height: 38px;
    background: #f8fafc;
    border-color: #e2e8f0;
    border-radius: 8px;
}
.topbar-search .input-group:focus-within {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.btn-icon {
    width: 34px;
    height: 34px;
    color: #64748b;
    background: transparent;
    border-color: transparent;
    border-radius: 7px;
}
.btn-icon:hover { color: var(--text); background: #f8fafc; border-color: transparent; transform: none; }
.avatar-circle { background: #ccfbf1; color: #0f766e; box-shadow: none; }

.main-content { padding: 22px 24px 34px; }
.page-title,
.main-content h1.h3 { color: var(--text); font-size: 22px; letter-spacing: -.025em; }
.page-subtitle { color: var(--text-secondary); }
.card,
.stat-card,
.summary-card {
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    box-shadow: var(--shadow-xs);
}
.card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.stat-card:hover,
.summary-card:hover { transform: none; box-shadow: var(--shadow-sm); }
.card-header { min-height: 50px; padding: 13px 16px; border-color: var(--border-light); }
.card-body { padding: 16px; }
.stat-icon { border-radius: 9px; }

.btn { min-height: 36px; border-radius: 7px; font-weight: 600; box-shadow: none; }
.btn:hover { transform: none; }
.btn-primary,
.btn-primary:focus {
    color: #fff;
    background: #0d9488;
    border-color: #0d9488;
    box-shadow: none;
}
.btn-primary:hover { background: #0f766e; border-color: #0f766e; box-shadow: none; }
.btn-outline-primary { color: #0f766e; background: #fff; border-color: #99d8d1; }
.btn-outline-primary:hover { color: #fff; background: #0d9488; border-color: #0d9488; }
.btn-outline-secondary { color: #475569; background: #fff; border-color: #e2e8f0; }

.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 40px;
    background-color: #f8fafc;
    border-color: #e2e8f0;
    border-radius: 8px;
}
.form-control:focus,
.form-select:focus {
    background: #fff;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.form-label { color: #475569; }

.table-modern thead th,
.dataTable thead th {
    color: #64748b;
    background: #f8fafc !important;
    border-color: #e8ecf1 !important;
    letter-spacing: .035em;
}
.table-modern tbody td,
.dataTable tbody td { border-bottom-color: #f1f4f8; }
.table-modern tbody tr:hover,
.dataTable tbody tr:hover { background: #f8fafc !important; }
.page-item.active .page-link { background: #0d9488; border-color: #0d9488; }
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus { border-color: #0d9488; box-shadow: 0 0 0 3px rgba(13, 148, 136, .1); }

.dropdown-menu { border-color: var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, .12); }
.dropdown-item { border-radius: 6px; }
.dropdown-item:hover { color: #0f766e; background: #f0fdfa; }
.modal-content { border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .14); }
.badge { font-weight: 600; }

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

@media (max-width: 575.98px) {
    .main-content { padding: 12px 10px 82px; }
    .topbar { padding: 0 10px; }
    .card { border-radius: 10px; }
}
