:root {
    color-scheme: light dark;
    --primary: #4682b4;
    --primary-dark: #3a6d94;
    --primary-light: #e8f0fe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #cffafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --bg: #f1f5f9;
    --bg-card: white;
    --bg-sidebar: #1e3a5f;
    --bg-content: #f1f5f9;
    --chrome-gradient: linear-gradient(90deg, #192f4d 0%, #1e3a5f 36%, #2d5a7b 72%, #4682b4 100%);
    --app-toolbar-height: 64px;
    --border: var(--gray-200);
    --text: var(--gray-800);
    --text-muted: var(--gray-500);
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 40px;
    --space-4xl: 56px;

    /* Font sizes */
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 22px;
    --text-3xl: 28px;
    --text-4xl: 36px;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --transition: all 0.2s ease;
}

/* Dark mode */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-content: #0f172a;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748b;
    --gray-400: #94a3b8;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #e2e8f0;
    --gray-900: #f1f5f9;
    --primary-light: #1e3a5f;
    --success-light: #14532d;
    --danger-light: #7f1d1d;
    --warning-light: #78350f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

.container {
    display: flex;
    height: 100vh;
    padding-top: var(--app-toolbar-height);
}

/* Sidebar */
.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #1e3a5f 0%, #2d5a7b 100%);
    color: #ffffff;
    padding: 0;
    border-right: none;
    box-shadow: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--app-toolbar-height));
}

.user-info {
    padding: 16px 20px;
    background: rgba(0,0,0,0.15);
    color: #ffffff;
}

.user-info a {
    color: #ffffff;
    text-decoration: underline;
}

.company-name {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.user-id {
    font-size: 12px;
    opacity: 0.85;
}

.logo {
    padding: 16px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.logo h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 12px;
    color: var(--gray-500);
}

nav {
    margin-top: 12px;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    color: #ffffff;
    text-decoration: none;
    transition: var(--transition);
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    padding-left: 20px;
}

.nav-item.active {
    background: #4682b4;
    color: #ffffff;
    border-left: 3px solid #ffffff;
    font-weight: 600;
}

/* Chevron for parent nav items */
.nav-parent::after {
    content: '\203A';
    font-size: 18px;
    font-weight: 300;
    transition: transform 0.2s ease;
    color: var(--gray-400);
}

.nav-parent.expanded::after {
    transform: rotate(90deg);
}

.nav-submenu {
    display: none;
    padding-left: 8px;
    margin-left: 16px;
    border-left: 2px solid rgba(255,255,255,0.2);
    overflow: hidden;
    transition: var(--transition);
}

.nav-submenu.expanded {
    display: block;
}

.nav-subitem {
    display: block;
    padding: 9px 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 6px;
    margin-bottom: 1px;
}

.nav-subitem:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    padding-left: 20px;
}

.nav-subitem.active {
    background: #4682b4;
    color: #ffffff;
    font-weight: 600;
    border-left: 2px solid #ffffff;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-bottom: 70px;
}

/* Dark mode toggle */
.dark-toggle {
    margin: auto 8px 12px;
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.dark-toggle:hover {
    background: var(--gray-100);
    color: var(--text);
}

header {
    display: none;
}

.mobile-only-header {
    display: none;
    background: var(--bg-card);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.global-app-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    min-height: var(--app-toolbar-height);
    height: var(--app-toolbar-height);
    padding: 0;
    background: var(--chrome-gradient);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-sm);
}

.topbar-user-info {
    flex: 0 0 200px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 20px;
    background: transparent;
    color: #ffffff;
}

.topbar-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-user-info a {
    color: #ffffff;
    cursor: pointer;
    font-size: 11px;
    text-decoration: underline;
}

.global-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
    padding: 12px 24px;
    margin-left: auto;
}

.global-asset-search {
    max-width: 620px;
}

.global-scan-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
}

.global-app-toolbar .btn-add-item,
.global-app-toolbar .global-scan-button,
.global-app-toolbar .btn-search {
    height: 34px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

.global-app-toolbar .btn-add-item:hover,
.global-app-toolbar .global-scan-button:hover,
.global-app-toolbar .btn-search:hover {
    background: rgba(255, 255, 255, 0.24);
}

.global-app-toolbar .btn-clear-search {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.26);
    color: #ffffff;
}

.global-app-toolbar .global-asset-search input[type="text"] {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(255, 255, 255, 0.55);
    color: #0f172a;
}

header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

#content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-content);
    display: flex;
    flex-direction: column;
}

/* Assets page layout */
.assets-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.assets-table-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.assets-table-wrap table {
    font-size: var(--text-sm);
}

.assets-table-wrap tbody td {
    padding: 1px var(--space-sm) !important;
    line-height: 1.2;
}

.assets-table-wrap tbody td:first-child {
    padding-top: 1px !important;
    padding-bottom: 0 !important;
}

.assets-table-wrap thead th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 3;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 var(--border), 0 4px 0 var(--bg-card);
    padding: var(--space-sm) var(--space-sm);
    font-size: var(--text-xs);
}

.assets-table-wrap thead th:first-child {
    border-top-left-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-lg);
    box-shadow: -10px 0 0 0 var(--bg-card);
}

.assets-table-wrap thead th:last-child {
    border-top-right-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    box-shadow: 10px 0 0 0 var(--bg-card);
}

/* Dashboard stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}



.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--card-accent, var(--gray-300)), var(--card-accent, var(--gray-300)));
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-content .stat-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}

/* Chart cards */
.charts-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    height: 400px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.chart-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.chart-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gray-800);
    flex-shrink: 0;
}

.chart-items {
    overflow-y: auto;
    flex: 1;
}

.chart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    border-radius: var(--radius);
    transition: var(--transition);
}

.chart-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.chart-item:last-child {
    border-bottom: none;
}

.chart-label {
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
}

.chart-label[style*="cursor"] {
    transition: color 0.15s ease;
}

.chart-label[style*="cursor"]:hover {
    color: var(--primary);
    text-decoration: underline;
}

.stat-label[style*="cursor"]:hover {
    color: var(--primary);
    text-decoration: underline;
}

.chart-value {
    font-weight: 700;
    color: var(--gray-800);
    font-size: 14px;
    background: var(--gray-100);
    padding: 2px 10px;
    border-radius: 12px;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-available {
    background: var(--success-light);
    color: var(--success);
}

.badge-checked-out {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-broken {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-disposed {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Modal overlay + animations */
.modal-overlay {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    width: 480px;
    max-width: calc(100% - 32px);
    max-height: calc(100vh - 10vh);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.modal-overlay.image-modal {
    background: rgba(0,0,0,0.85);
    z-index: 2000;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.asset-edit-field {
    margin-bottom: var(--space-lg);
}

.asset-edit-modal {
    width: 800px;
    margin: 20px;
}

.asset-edit-field label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.asset-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--space-xl);
}

.asset-edit-wide {
    grid-column: 1 / -1;
}

.asset-edit-photo {
    margin-bottom: var(--space-lg);
    grid-column: 1 / -1;
}

.asset-edit-image-preview {
    width: 120px;
    height: 120px;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.asset-edit-image-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.asset-edit-photo-actions {
    display: flex;
    gap: var(--space-sm);
}

.asset-edit-photo-actions .btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (min-width: 769px) {
    .asset-edit-modal {
        width: min(820px, calc(100vw - 48px));
        max-height: calc(100vh - 48px);
        margin: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .asset-edit-modal .modal-header {
        padding: 12px 18px;
        flex-shrink: 0;
    }

    .asset-edit-modal .modal-header h3 {
        font-size: 16px;
    }

    .asset-edit-body {
        padding: 14px 18px;
        overflow-y: auto;
    }

    .asset-edit-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 18px;
    }

    .asset-edit-field {
        margin-bottom: 10px;
    }

    .asset-edit-field label {
        display: block;
        margin-bottom: 4px;
        font-weight: 600;
        font-size: var(--text-sm);
    }

    .asset-edit-field .form-input,
    .asset-edit-photo .form-input {
        min-height: 32px;
        padding: 6px 9px;
        font-size: var(--text-sm);
    }

    .asset-edit-wide,
    .asset-edit-photo {
        grid-column: 1 / -1;
    }

    .asset-edit-wide textarea {
        min-height: 58px;
    }

    .asset-edit-photo {
        margin-bottom: 4px;
    }

    .asset-edit-image-preview {
        width: 72px;
        height: 72px;
        min-height: 72px;
        margin-bottom: 6px;
    }

    .asset-edit-image-thumb {
        width: 72px;
        height: 72px;
        object-fit: cover;
    }

    .asset-edit-photo-actions {
        display: flex;
        gap: 8px;
    }

    .asset-edit-photo-actions .btn {
        padding: 6px 12px;
        font-size: var(--text-sm);
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .asset-edit-footer {
        padding: 10px 18px;
        flex-shrink: 0;
    }

    .asset-edit-footer .btn {
        padding: 7px 14px;
    }
}

.form-section {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gray-100);
}

.form-section:first-child {
    margin-top: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Button spinner */
.btn-spinner,
.search-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading skeletons */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.skeleton-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
}

.skeleton-line-lg {
    height: 28px;
    border-radius: 4px;
}

.skeleton-row {
    display: flex;
    gap: 12px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.skeleton-row > div {
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}



/* Table styles */
tr {
    transition: var(--transition);
}

tbody td {
    padding: 5px 12px 0px !important;
}

tbody td:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

tbody td:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

thead th {
    padding: 8px 12px !important;
}

tbody tr:nth-child(even) {
    background: var(--gray-100);
}

tbody tr:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    position: relative;
    z-index: 1;
}

/* Sortable column headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px !important;
}

th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 6px;
    color: var(--gray-400);
    font-size: 12px;
}

th.sortable.sort-asc::after {
    content: '↑';
    color: var(--primary);
}

th.sortable.sort-desc::after {
    content: '↓';
    color: var(--primary);
}

th.sortable:hover {
    background: var(--gray-200);
}

/* Thumbnail placeholder */
.thumb-placeholder {
    width: 25px;
    height: 25px;
    background: var(--gray-100);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 12px;
}

/* Table action buttons */
.btn-action-edit, .btn-action-remove {
    padding: 2px 10px;
    border: 1px solid;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
    margin-right: 4px;
}

.btn-action-edit {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-action-edit:hover {
    background: var(--primary);
    color: white;
}

.btn-action-remove {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-action-remove:hover {
    background: var(--danger);
    color: white;
}

.btn-action-restore {
    padding: 5px 14px;
    border: 1px solid var(--success);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
    color: var(--success);
    margin-right: 4px;
}

.btn-action-restore:hover {
    background: var(--success);
    color: white;
}

.btn-action-checkout {
    padding: 2px 0;
    border: 1px solid var(--gray-600);
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
    color: var(--gray-600);
    margin-right: 4px;
    width: 65px;
    text-align: center;
}

.btn-action-checkout:hover {
    background: var(--gray-600);
    color: white;
}

.btn-action-checkin {
    padding: 2px 0;
    border: 1px solid var(--success);
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
    background: transparent;
    color: var(--success);
    margin-right: 4px;
    width: 65px;
    text-align: center;
}

.btn-action-checkin:hover {
    background: var(--success);
    color: white;
}

.cls-tile .btn-action-edit,
.cls-tile .btn-action-remove,
.cls-tile .btn-action-restore {
    padding: 2px 10px;
    font-size: 11px;
    border-radius: 14px;
}

.asset-thumbnail {
    border-radius: 6px;
}

/* Count-up animation */
.count-up {
    display: inline-block;
}

@keyframes countPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Lightbox gallery */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-counter {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    margin-top: 8px;
}

/* Filter chips */
.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    min-height: 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--gray-200);
    color: var(--text);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    animation: fadeIn 0.2s ease;
}

.filter-chip-x {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.filter-chip-x:hover {
    opacity: 1;
}

/* Donut chart */
.donut-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 0;
}

.donut {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    flex-shrink: 0;
}

.donut-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex: 1;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

.donut-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Button ripple */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: 0s;
}

/* Page transition */
#content > * {
    animation: contentFade 0.2s ease;
}

/* Setup nav buttons hover */
.setup-nav-btn:hover {
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px);
    background: var(--primary-light) !important;
}

@keyframes contentFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card.just-loaded .stat-value {
    animation: countPulse 0.4s ease;
}

/* Asset card view (mobile) */
.asset-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.asset-card:active {
    box-shadow: var(--shadow-md);
}

.asset-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asset-card-thumb {
    flex-shrink: 0;
}

.asset-card-thumb img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.asset-card-info {
    flex: 1;
    min-width: 0;
}

.asset-card-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-900);
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.asset-card-id {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.asset-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.asset-card-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asset-card-detail span:first-child {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.asset-card-detail span:last-child {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.asset-card-actions {
    display: flex;
    gap: 8px;
}

.asset-card-chevron {
    font-size: 22px;
    color: var(--gray-400);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    line-height: 1;
}

.asset-card.collapsed .asset-card-chevron {
    transform: rotate(0deg);
}

.asset-card:not(.collapsed) .asset-card-chevron {
    transform: rotate(90deg);
}

.asset-card-expand {
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.25s ease;
    opacity: 1;
    margin-top: 8px;
}

.asset-card.collapsed .asset-card-expand {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.btn-card-edit, .btn-card-delete, .btn-card-restore {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.btn-card-edit {
    background: var(--primary);
    color: white;
}

.btn-card-delete {
    background: var(--danger);
    color: white;
}

.btn-card-restore {
    background: var(--success);
    color: white;
}

/* Assets toolbar */
.assets-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.assets-toolbar .assets-search-row {
    grid-column: 1 / -1;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .assets-page {
        overflow: visible;
    }

    .assets-table {
        display: none;
    }

    .assets-table-wrap {
        overflow-x: hidden;
    }

    .assets-toolbar {
        padding: 10px;
        gap: 8px;
    }

    .assets-toolbar-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px !important;
    }

    .assets-toolbar-actions > button {
        width: 100%;
        justify-content: center;
        padding: 6px 8px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    .assets-pagination.pagination {
        display: grid !important;
        grid-template-columns: minmax(52px, auto) minmax(52px, auto) minmax(0, 1fr) minmax(52px, auto) minmax(52px, auto);
        align-items: center;
        gap: 6px !important;
        max-width: 100%;
        overflow: hidden;
    }

    .assets-pagination.pagination .pagination-btn {
        min-width: 0;
        width: 100%;
        padding: 6px 8px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    .assets-pagination.pagination .page-info {
        min-width: 0;
        text-align: center;
        font-size: 12px !important;
        overflow-wrap: anywhere;
    }

    .report-page.report-detail-mode {
        padding-top: 0;
    }

    .report-detail-toolbar {
        width: auto;
        position: static;
        background: var(--bg-content) !important;
        box-shadow: none;
        row-gap: 8px;
    }

    .report-header-row {
        position: static;
        width: auto;
        background: var(--bg-content) !important;
        box-shadow: none;
        gap: 6px 8px !important;
    }

    .report-detail-controls {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) 36px 132px;
        gap: 6px;
    }

    .report-detail-controls .btn,
    .report-detail-controls .form-input {
        font-size: 13px !important;
        padding: 5px 8px !important;
    }

    .report-detail-controls #groupBySelect {
        width: 132px !important;
        min-width: 132px;
        max-width: 132px;
    }

    .report-filter-btn {
        width: 36px;
        min-width: 36px;
        flex-basis: 36px;
    }

    .report-search-control {
        flex: 1 1 180px;
        min-width: 0;
    }

    .report-search-input {
        width: 100%;
        min-width: 0;
    }

    .report-drill-toolbar {
        align-items: flex-start;
        gap: 8px;
    }

    .report-drill-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .report-drill-actions > .btn {
        width: 100%;
        padding: 6px 8px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    .report-page .pagination {
        display: grid !important;
        grid-template-columns: minmax(52px, auto) minmax(52px, auto) minmax(0, 1fr) minmax(52px, auto) minmax(52px, auto);
        align-items: center;
        gap: 6px !important;
        max-width: 100%;
        overflow: hidden;
    }

    .report-page .pagination .pagination-btn {
        min-width: 0;
        width: 100%;
        padding: 6px 8px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    .report-page .pagination span {
        min-width: 0;
        text-align: center;
        font-size: 12px !important;
        overflow-wrap: anywhere;
    }
}

.btn-add-item {
    padding: 8px 24px;
    background: #4682b4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.assets-filters {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
}

.assets-filters select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 13px;
}

.assets-search-row {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.assets-search-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text);
}

.global-asset-search input[type="text"] {
    min-width: 280px;
}

.btn-search {
    padding: 8px 20px;
    background: #4682b4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.btn-clear-search {
    padding: 8px 14px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: var(--gray-400);
    line-height: 1;
}

.assets-pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.assets-pagination select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 13px;
}

.assets-pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.assets-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.assets-pagination .page-info {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Reports */
.report-tabbar {
    display: inline-flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}

.report-tabbar .report-tab {
    padding: 9px 18px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: 600;
}

.report-tabbar .report-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.report-page {
    position: relative;
}

.report-header-row {
    background: var(--bg-content);
    padding-bottom: 2px;
}

.report-header-row .report-tabbar {
    order: 1;
}

#reportPrintJobs {
    order: 2;
    margin-left: auto !important;
}

#reportSaveControls {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: wrap;
}

.report-detail-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 0;
    margin-bottom: var(--space-sm);
    background: var(--bg-content);
    padding-top: 2px;
    padding-bottom: 2px;
    position: relative;
}

.report-detail-controls,
.report-output-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.report-detail-controls {
    display: grid;
    grid-template-columns: max-content 34px 136px;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow: visible;
}

.report-detail-controls .btn,
.report-detail-controls .form-input {
    height: 31px;
    min-height: 31px;
    padding: 4px 8px !important;
    font-size: var(--text-xs) !important;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.1;
}

.report-detail-controls #selectColumns {
    border-radius: var(--radius);
    white-space: nowrap;
}

.report-detail-controls #groupBySelect {
    width: 136px !important;
    min-width: 136px;
    max-width: 136px;
    border-left: 1px solid var(--border);
    border-radius: var(--radius);
}

.report-toolbar-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

.report-search-control {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 0 100%;
    min-width: 220px;
    order: 3;
}

.report-detail-controls {
    order: 1;
}

.report-output-actions {
    order: 2;
}

@media (min-width: 769px) {
    .report-detail-toolbar {
        padding-bottom: 40px;
    }

    .report-output-actions .report-search-control {
        position: absolute;
        left: 0;
        right: 0;
        top: 39px;
        width: 100%;
    }
}

.report-search-btn {
    height: 28px;
    min-height: 28px;
    padding: 5px 10px !important;
    font-size: var(--text-xs) !important;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.report-search-input {
    height: 28px;
    min-height: 28px;
    min-width: 0;
    flex: 1;
    padding: 5px 8px !important;
    font-size: var(--text-xs) !important;
}

.report-clear-search {
    height: 28px;
    min-height: 28px;
    padding: 4px 10px !important;
    font-size: 18px !important;
    line-height: 1;
}

.report-filter-btn {
    width: 34px;
    min-width: 34px;
    flex: 0 0 34px;
    height: 31px;
    padding: 0 !important;
    border-left: 1px solid var(--border);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#saveReport,
#saveAsReport,
#resetReport,
#reportPrintJobs,
#printDetail,
#exportDetail {
    height: 28px;
    min-height: 28px;
    padding: 5px 10px !important;
    font-size: var(--text-xs) !important;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.15;
}

#deleteReport {
    height: 28px;
    min-height: 28px;
    padding: 5px 8px !important;
    font-size: var(--text-xs) !important;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.15;
}

#savedReportSelect {
    height: 28px;
    min-height: 28px;
    width: 180px !important;
    min-width: 180px !important;
    max-width: none;
    flex: 0 0 180px;
    padding: 5px 8px !important;
    font-size: var(--text-xs) !important;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.15;
}

.report-drill-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.report-drill-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: nowrap;
}

.filter-multi-btn {
    padding: 6px 10px !important;
    font-size: var(--text-xs) !important;
    white-space: nowrap;
}

.filter-toggle-btn,
.report-filter-btn,
.filter-multi-btn {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.filter-toggle-btn.active-filter,
.report-filter-btn.active-filter,
.filter-multi-btn.active-filter {
    background: var(--bg-card) !important;
    border-color: #b91c1c !important;
    color: #dc2626 !important;
}

.filter-toggle-btn.active-filter svg,
.report-filter-btn.active-filter svg {
    stroke: #dc2626 !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mobile-only-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .report-page {
        --report-mobile-header-offset: 76px;
        --report-mobile-tabs-height: 76px;
        --report-mobile-toolbar-height: 72px;
        padding-top: 0;
    }

    .report-page.report-detail-mode {
        padding-top: 0;
    }

    .report-page.report-detail-mode #reportContent > div:not(.report-detail-toolbar):first-child {
        margin-top: 0;
    }

    .report-page:not(.report-detail-mode) .report-summary-loading {
        padding-top: 20px !important;
    }

    .report-page:not(.report-detail-mode) #reportContent > div[style*="grid-template-columns"] {
        margin-top: 0 !important;
    }

    .assets-page {
        --asset-mobile-header-offset: 76px;
        --asset-mobile-tabs-height: 36px;
        --asset-mobile-toolbar-height: 112px;
        --asset-mobile-pagination-offset: 0px;
        padding-top: 0;
        overflow: visible;
    }

    .asset-tabs-row {
        position: static;
        background: var(--bg-content) !important;
        box-shadow: none;
        isolation: isolate;
    }

    .asset-tabs-row .asset-tab {
        padding: 8px 16px !important;
        font-size: 12px !important;
        line-height: 1.1;
    }

    .assets-table {
        display: none;
    }

    .assets-toolbar {
        flex-direction: column;
        gap: 4px;
        padding: 2px 0 0;
        margin-bottom: var(--space-sm);
        position: static;
        background: var(--bg-content) !important;
        border-color: transparent;
        border-radius: 0;
        box-shadow: none;
        isolation: isolate;
    }

    .btn-add-item {
        width: auto;
        height: 28px;
        min-height: 28px;
        padding: 4px 9px;
        font-size: 12px;
        line-height: 1.15;
    }

    .assets-toolbar-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px !important;
    }

    .assets-toolbar-actions > button {
        width: 100%;
        height: 28px;
        min-height: 28px;
        justify-content: center;
        padding: 4px 8px !important;
        font-size: 12px !important;
        line-height: 1.15;
        white-space: nowrap;
    }

    .assets-toolbar-actions > .assets-secondary-action,
    .assets-toolbar-actions > #mobileFilterBtn {
        width: auto;
        grid-column: auto;
    }

    .assets-toolbar-actions > .assets-secondary-action {
        background: #4682b4 !important;
        border-color: #4682b4 !important;
        color: #fff !important;
    }

    .report-detail-toolbar {
        width: auto;
        position: static;
        background: var(--bg-content) !important;
        box-shadow: none;
        isolation: isolate;
        row-gap: 8px;
    }

    .report-output-actions .report-search-control {
        position: static;
        width: auto;
    }

    .report-header-row {
        position: static;
        width: auto;
        background: var(--bg-content) !important;
        box-shadow: none;
        isolation: isolate;
        gap: 6px 8px !important;
    }

    .report-page:not(.report-detail-mode) .report-tabbar {
        background: var(--bg-content) !important;
    }

    .report-page .report-tab {
        background: var(--bg-card) !important;
        border-bottom: 3px solid transparent !important;
        color: var(--text) !important;
        padding: 8px 16px !important;
        font-size: 12px !important;
        line-height: 1.1;
    }

    .report-page .report-tab.active {
        color: #4682b4 !important;
        border-bottom-color: var(--gray-600) !important;
    }

    .report-page #saveReport,
    .report-page #saveAsReport,
    .report-page #resetReport,
    .report-page #selectColumns,
    .report-page #reportDetailSearchBtn,
    .report-page #printDetail,
    .report-page #exportDetail {
        background: #4682b4 !important;
        border-color: #4682b4 !important;
        color: #fff !important;
    }

    .report-detail-controls {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) 36px 132px;
        gap: 6px;
    }

    .report-detail-controls .btn,
    .report-detail-controls .form-input {
        font-size: 16px !important;
        padding: 4px 7px !important;
    }

    .report-detail-controls #groupBySelect {
        width: 132px !important;
        min-width: 132px;
        max-width: 132px;
        height: 42px;
        min-height: 42px;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        line-height: normal;
    }

    .report-filter-btn {
        width: 36px;
        min-width: 36px;
        flex-basis: 36px;
    }

    .report-search-control {
        order: 0;
        flex: 1 1 130px;
        min-width: 0;
    }

    .report-search-btn {
        padding: 5px 8px !important;
    }

    .report-search-input {
        width: 100%;
        min-width: 0;
        font-size: 16px !important;
    }

    .report-drill-toolbar {
        align-items: flex-start;
        gap: 8px;
    }

    .report-drill-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .report-drill-actions > .btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding: 7px 8px !important;
    }

    .report-drill-actions > .btn:first-child:nth-last-child(3) {
        grid-column: 1 / -1;
    }

    .report-page .pagination {
        position: fixed;
        left: 0;
        right: 0;
        bottom: env(safe-area-inset-bottom, 0px);
        z-index: 24;
        width: auto;
        justify-content: space-between !important;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 0;
        padding: 5px 8px !important;
        box-shadow: var(--shadow-md);
        flex-wrap: nowrap;
        transform: translateZ(0);
        backface-visibility: hidden;
    }

    .report-page .pagination .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .report-page .pagination span {
        font-size: 12px !important;
        white-space: nowrap;
    }

    .report-page .assets-table-wrap {
        padding-bottom: 44px;
    }

    .assets-filters {
        display: none !important;
    }

    .mobile-only-filter {
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
    }

    .assets-filters select {
        width: 100%;
        padding: 10px 8px;
        font-size: 13px;
    }

    .global-app-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        height: 158px;
        min-height: 158px;
    }

    .container {
        padding-top: 158px;
    }

    .topbar-user-info {
        flex: 0 0 auto;
        min-height: var(--app-toolbar-height);
        padding: 12px 20px;
    }

    .global-toolbar-actions {
        align-items: stretch;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 12px 10px;
    }

    .global-app-toolbar .btn-add-item,
    .global-scan-button {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        min-width: 0;
        width: auto;
    }

    .global-app-toolbar .btn-search {
        flex: 0 0 auto;
    }

    .assets-search-row {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }

    .assets-search-row input[type="text"] {
        padding: 7px 10px;
        font-size: 12px;
    }

    .global-asset-search input[type="text"] {
        min-width: 0;
        font-size: 16px;
    }

    .assets-pagination {
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--asset-mobile-pagination-offset);
        z-index: 25;
        width: auto;
        justify-content: space-between;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 0;
        padding: 5px 8px;
        box-shadow: var(--shadow-md);
    }

    .assets-table-wrap {
        padding-bottom: 44px;
    }

    .assets-pagination select {
        padding: 6px 8px;
        font-size: 12px;
    }

    .assets-pagination button {
        padding: 6px 10px;
        font-size: 12px;
    }

    .assets-pagination .page-info {
        font-size: 12px;
    }

    .android-device .asset-tabs-row,
    .android-device .assets-toolbar,
    .android-device .assets-toolbar > div,
    .android-device .assets-toolbar-actions,
    .android-device .assets-search-row,
    .android-device .report-header-row,
    .android-device .report-detail-toolbar,
    .android-device .report-tabbar,
    .android-device .report-detail-controls,
    .android-device .report-output-actions,
    .android-device .report-search-control {
        color-scheme: only light;
    }

    [data-theme="dark"] .main-content > header,
    [data-theme="dark"] .mobile-only-header,
    [data-theme="dark"] .global-app-toolbar,
    [data-theme="dark"] .asset-tabs-row,
    [data-theme="dark"] .assets-toolbar,
    [data-theme="dark"] .report-header-row,
    [data-theme="dark"] .report-detail-toolbar {
        background: #070b2a !important;
        border-color: #26336f !important;
    }

    [data-theme="dark"] .asset-tabs-row,
    [data-theme="dark"] .report-header-row {
        box-shadow: 0 -12px 0 12px #070b2a, 0 6px 0 #070b2a !important;
    }

    [data-theme="dark"] .assets-toolbar,
    [data-theme="dark"] .report-detail-toolbar {
        box-shadow: 0 -6px 0 6px #070b2a !important;
    }

    [data-theme="dark"] .assets-toolbar > div,
    [data-theme="dark"] .assets-toolbar-actions,
    [data-theme="dark"] .assets-search-row,
    [data-theme="dark"] .global-asset-search,
    [data-theme="dark"] .report-tabbar,
    [data-theme="dark"] .report-detail-controls,
    [data-theme="dark"] .report-output-actions,
    [data-theme="dark"] .report-search-control {
        background: #070b2a !important;
    }

    [data-theme="dark"] .assets-toolbar .btn-outline,
    [data-theme="dark"] .assets-toolbar .filter-toggle-btn,
    [data-theme="dark"] .assets-toolbar .btn-clear-search,
    [data-theme="dark"] .assets-search-row input[type="text"],
    [data-theme="dark"] .report-detail-toolbar .btn-outline,
    [data-theme="dark"] .report-detail-toolbar .report-filter-btn,
    [data-theme="dark"] .report-detail-toolbar .btn-clear-search,
    [data-theme="dark"] .report-detail-toolbar .form-input,
    [data-theme="dark"] .report-search-input {
        background: #11184a !important;
        border-color: #5f77d8 !important;
        color: #f4f7ff !important;
    }

    [data-theme="dark"] .assets-toolbar .filter-toggle-btn.active-filter,
    [data-theme="dark"] .report-detail-toolbar .report-filter-btn.active-filter,
    [data-theme="dark"] .report-detail-toolbar .filter-multi-btn.active-filter {
        background: #11184a !important;
        border-color: #f87171 !important;
        color: #f87171 !important;
    }

    [data-theme="dark"] .assets-toolbar .filter-toggle-btn.active-filter svg,
    [data-theme="dark"] .report-detail-toolbar .report-filter-btn.active-filter svg {
        stroke: #f87171 !important;
    }

    [data-theme="dark"] .asset-tabs-row .asset-tab,
    [data-theme="dark"] .report-page .report-tab {
        background: #11184a !important;
        color: #e6ecff !important;
    }

    [data-theme="dark"] .asset-tabs-row .asset-tab.active,
    [data-theme="dark"] .report-page .report-tab.active {
        color: #ffffff !important;
        border-bottom-color: #8ea2ff !important;
    }

    .modal-box {
        width: 95% !important;
        margin: 10px !important;
        max-height: 95vh !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* Site footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.86);
    border-top: none;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    background: var(--chrome-gradient);
}

.site-footer a {
    color: #ffffff;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
    color: white;
}

.site-footer-copy {
    text-align: center;
}

.site-footer .dark-toggle {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}


/* Users table - smaller buttons, side by side */
.config-tab ~ * .btn-action-edit,
.config-tab ~ * .btn-action-remove,
.config-tab ~ * .btn-action-restore {
    padding: 2px 10px;
    font-size: 11px;
    border-radius: 14px;
    display: inline-block;
}

.btn-action-edit, .btn-action-remove, .btn-action-restore {
    display: inline-block !important;
    vertical-align: middle;
}

/* Classification tiles hover effect */
.cls-tile {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cls-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* =========================================================================
   Scanner Overlay
   ========================================================================= */

.scan-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease;
}

.scan-overlay-inner {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

.scan-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.scan-close-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 24px;
    color: var(--text);
    transition: var(--transition);
    line-height: 1;
}

.scan-close-btn:hover {
    background: var(--gray-100);
    color: var(--danger);
}

.scan-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.scan-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    overflow: hidden;
}

.scan-video-element {
    width: 100%;
    height: 100%;
}

.scan-targeting-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 1;
}

.scan-instruction {
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.scan-history-toggle {
    margin: 0 16px 12px;
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    transition: var(--transition);
}

.scan-history-toggle:hover {
    background: var(--primary-light);
}

.scan-history-panel {
    margin: 0 16px 16px;
    padding: 12px;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
}

.scan-history-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 13px;
}

.scan-history-entry:last-child {
    border-bottom: none;
}

/* Toolbar scan button */
.btn-scan {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-scan:hover {
    opacity: 0.9;
}

/* Form field scan button (📷 next to inputs) */
.btn-scan-field {
    min-width: 36px;
    min-height: 36px;
    padding: 4px 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-scan-field:hover {
    background: var(--gray-100);
    color: var(--primary);
    border-color: var(--primary);
}

/* Scan confirmation / create dialog backdrop */
.scan-confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

/* Scan confirmation dialog box */
.scan-confirmation-dialog-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    max-width: 400px;
    width: calc(100% - 32px);
    animation: slideUp 0.25s ease;
}

/* Scan confirmation title */
.scan-confirmation-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

/* Scan confirmation value and format rows */
.scan-confirmation-value,
.scan-confirmation-format {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    word-break: break-all;
}

/* Scan confirmation button container */
.scan-confirmation-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

/* Scan confirmation primary button */
.scan-confirmation-btn-primary {
    padding: 8px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.scan-confirmation-btn-primary:hover {
    opacity: 0.9;
}

/* Scan confirmation secondary button */
.scan-confirmation-btn-secondary {
    padding: 8px 20px;
    background: none;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.scan-confirmation-btn-secondary:hover {
    background: var(--gray-100);
}

/* Asset ID uniqueness warning */
.scan-uniqueness-warning {
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--warning);
    background: var(--warning-light);
    border-radius: var(--radius);
    line-height: 1.4;
}

/* Mobile: full-screen overlay */
@media (max-width: 768px) {
    .scan-overlay {
        align-items: stretch;
        justify-content: stretch;
    }

    .scan-overlay-inner {
        max-width: none;
        max-height: none;
        height: 100%;
        border-radius: 0;
    }

    .btn-scan {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-scan-field {
        min-width: 44px;
        min-height: 44px;
    }

    .scan-confirmation-dialog-content {
        max-width: none;
        margin: 16px;
    }
}

/* =========================================================================
   Component Classes — Design Token System
   ========================================================================= */

/* Button base and variants */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-base);
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

/* Form input */
.form-input {
    width: 100%;
    padding: 10px var(--space-md);
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(70,130,180,0.15);
}

.password-requirements {
    margin: 5px 0 0;
    color: var(--gray-500);
    font-size: var(--text-xs);
    line-height: 1.35;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table thead th {
    padding: var(--space-md);
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table tbody td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    color: var(--text);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-card);
    box-shadow: 0 1px 0 var(--border);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.pagination-btn {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.pagination-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
