/* Dental Practice Inventory Manager — Styles */
/* See CHANGELOG.md for version history */

/* ═══════════════════════════════════════════════════════════
   DESIGN SYSTEM
   Clean, professional UI with frosted glass and smooth animations
   ═══════════════════════════════════════════════════════════ */

/* CSS Variables for consistent theming */
:root {
    /* Primary brand color */
    --color-primary: #5B8FC4;
    --color-primary-hover: #4A7AAF;
    --color-primary-light: rgba(91, 143, 196, 0.1);
    
    /* Status colors */
    --color-success: #6EAB7E;
    --color-danger: #C4625B;
    --color-warning: #D69554;
    --color-highlight: #D4B55F;
    
    /* Neutral grays */
    --color-muted: #8E8E93;
    --color-muted-3: #C7C7CC;
    --color-muted-4: #D1D1D6;
    --color-muted-5: #E5E5EA;
    --color-muted-6: #F2F2F7;
    
    /* Backgrounds */
    --background-primary: #F5F5F7;
    --background-elevated: rgba(255, 255, 255, 0.95);
    
    /* Text */
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #86868B;
    
    /* Borders & separators */
    --separator: rgba(0, 0, 0, 0.08);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    
    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Font families */
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    --font-mono: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    
    /* Full-round radius */
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    /* SF Pro Display - Apple's signature font */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: var(--background-primary);
    color: var(--text-primary);
    padding: 0;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ═══ CONTAINER & LAYOUT ═══ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    min-height: 100vh;
}

.header {
    background: var(--background-elevated);
    color: var(--text-primary);
    padding: var(--space-4);
    text-align: center;
    border-bottom: 1px solid var(--separator);
    animation: slideDown 0.6s var(--spring);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0;
    color: var(--text-primary);
    opacity: 0.85;
}

/* ═══ GENERIC HIDDEN STATE ═══ */
/* Ensures ALL elements with class="hidden" are actually hidden.
   Uses !important to override any display rules set by ID or class selectors. */
.hidden {
    display: none !important;
}

#locationActions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
    align-items: center;
}

/* ═══ AUTHENTICATION ═══ */
.auth-section {
    background: var(--background-elevated);
    padding: var(--space-12);
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.6s var(--transition-base);
}

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

.sign-in-btn {
    background: var(--color-primary);
    color: white;
    padding: 10px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    letter-spacing: -0.2px;
    min-height: 36px;
}

.sign-in-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.sign-in-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ═══ USER INFO BAR ═══ */
.user-info {
    background: var(--background-elevated);
    padding: var(--space-3);
    border-bottom: 1px solid var(--separator);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    animation: slideDown 0.5s var(--transition-base) 0.1s both;
}

.user-info span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.user-info button {
    background: var(--color-muted-5);
    color: var(--text-primary);
    border: none;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 24px;
}

.user-info button:hover {
    background: var(--color-muted-4);
}

/* ═══ MODE TOGGLE - iOS Segmented Control Style ═══ */
.mode-toggle {
    background: #e8e8ed;
    padding: 3px;
    display: flex;
    gap: 0;
    justify-content: center;
    border-radius: 10px;
    margin: 12px 16px 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.5s var(--transition-base) 0.2s both;
}

.mode-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6e6e73;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.25s ease;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
}

.mode-btn.active {
    background: #fff;
    color: #1d1d1f;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12),
                0 1px 2px rgba(0, 0, 0, 0.08);
}

.mode-btn:hover:not(.active) {
    color: #1d1d1f;
}

/* ═══ INVENTORY SUB-TABS ═══ */

/* ═══ CLONE ITEM ═══ */
.clone-banner {
    background: #fff8e1;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: #5d4037;
}
.clone-banner-dismiss {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
}
.clone-banner-dismiss:hover { color: #333; }
.form-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-clear-form {
    background: none;
    border: 1px solid #ccc;
    color: #999;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-clear-form:hover { border-color: #999; color: #666; }
.btn-clone {
    background: #fff8e1;
    color: #5d4037;
    border: 1.5px solid #ffc107;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin-left: auto;
}
.btn-clone:hover { background: #ffecb3; }
.btn-clone-sm {
    background: #fff8e1;
    color: #5d4037;
    border: 1.5px solid #ffc107;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.btn-clone-sm:hover { background: #ffecb3; }

/* ═══ INVENTORY SUB-TABS (original) ═══ */
.inventory-subtabs {
    display: flex;
    gap: 8px;
    padding: 0 var(--space-4);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.inv-subtab {
    padding: 7px 16px;
    border: 1.5px solid #ddd;
    background: #fff;
    color: #495057;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s ease;
}

.inv-subtab:hover:not(.active) {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: #f0f2ff;
}

.inv-subtab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* ── Locations Summary Cards ──────────────────── */
.loc-summary-card {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.loc-summary-card:last-child {
    border-bottom: none;
}

.loc-summary-room {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a2e;
    min-width: 140px;
}

.loc-summary-shelves {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.loc-summary-shelf {
    font-size: 12px;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.loc-summary-none {
    font-size: 12px;
    color: #adb5bd;
    font-style: italic;
}

.loc-summary-title {
    margin-top: 16px;
}

/* ═══ STATS CARDS - iOS Widget Style ═══ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-3);
    padding: var(--space-4);
    background: transparent;
    animation: fadeIn 0.6s var(--transition-base) 0.3s both;
}

.stat-box {
    background: var(--background-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--separator);
    transition: all var(--transition-base);
    animation: scaleIn 0.4s var(--spring);
}

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

.stat-box:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.stat-box .number {
    font-size: 26px;
    font-weight: 600;
    color: var(--color-primary);
    font-family: var(--font-display);
    letter-spacing: -0.5px;
    margin-bottom: var(--space-1);
}

.stat-box .label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══ CONTENT & SECTIONS ═══ */
.content {
    padding: var(--space-4);
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    margin-bottom: var(--space-8);
    animation: fadeIn 0.5s var(--transition-base);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    letter-spacing: -0.2px;
    opacity: 0.9;
}

/* ═══ FORM SECTIONS - iOS Card Style ═══ */
.form-section {
    background: var(--background-elevated);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--separator);
    transition: all var(--transition-base);
}

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

.cart-section {
    position: relative;
    z-index: 100;
    margin-bottom: var(--space-8);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    letter-spacing: -0.1px;
    margin-bottom: 6px;
    min-height: 22px;
    display: flex;
    align-items: center;
}
.btn-link-sm {
    background: none;
    border: none;
    padding: 0 2px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    vertical-align: middle;
    opacity: 0.5;
}
.btn-link-sm:hover { opacity: 1; }

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: var(--font-text);
    background: #FAFAFA;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(91, 143, 196, 0.15);
    transform: translateY(-1px);
}

/* Required field styling */
.form-group input:required,
.form-group select:required,
.form-group textarea:required {
    border-left: 4px solid #ff3b30;
}

/* Valid required field (has content) */
.form-group input:required:valid,
.form-group select:required:valid,
.form-group textarea:required:valid {
    border-left: 4px solid #34c759;
}

/* Invalid required field when user tries to submit */
.form-group input:required:invalid,
.form-group select:required:invalid,
.form-group textarea:required:invalid {
    border-left: 4px solid #ff3b30;
}

/* When focused and invalid */
.form-group input:required:invalid:focus,
.form-group select:required:invalid:focus,
.form-group textarea:required:invalid:focus {
    border-color: #ff3b30;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-group select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

/* ═══ BUTTON SYSTEM - Refined & Muted ═══ */
.button-group {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-6);
    flex-wrap: wrap;
}

button {
    padding: 6px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-text);
    letter-spacing: -0.1px;
    position: relative;
    overflow: hidden;
    min-height: 32px;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary Button - Muted Blue */
.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Secondary Button - Subtle Gray */
.btn-secondary {
    background: var(--color-muted-5);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-muted-4);
    transform: translateY(-1px);
}

/* Danger Button - Muted Red */
.btn-danger {
    background: var(--color-danger);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
    background: #B05550;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Success Button - Muted Green */
.btn-success {
    background: var(--color-success);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    background: #5E9A6E;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Warning Button - Muted Orange */
.btn-warning {
    background: var(--color-warning);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover:not(:disabled) {
    background: #C68447;
    transform: translateY(-1px);
}

/* Info Button - Muted Purple */
.btn-info {
    background: #8B7EC8;
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-info:hover:not(:disabled) {
    background: #7B6EB8;
    transform: translateY(-1px);
}

/* ═══ TOGGLE SWITCH — purple variant ═══ */
input:checked + .toggle-slider.purple {
    background-color: #7c3aed;
}

/* ═══ BULK OPERATIONS HIDE/SHOW ═══ */
/* Hide checkboxes and select-all checkbox by default */
.item-select-checkbox,
#selectAllBrowse {
    display: none;
}

/* Show checkboxes when bulk mode is enabled */
body.bulk-mode-enabled .item-select-checkbox,
body.bulk-mode-enabled #selectAllBrowse {
    display: inline-block;
}

/* Hide bulk action toolbar by default */
.bulk-mode-only {
    display: none !important;
}

/* Show bulk toolbar when bulk mode is enabled */
body.bulk-mode-enabled .bulk-mode-only {
    display: flex !important;
}

/* ═══ SEARCH & FILTERS ═══ */
.search-filter {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.search-filter input,
.search-filter select {
    padding: 12px 16px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: var(--background-elevated);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-filter input:focus,
.search-filter select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

/* ═══ TABLES - iOS List View Style ═══ */
.table-container {
    overflow-x: auto;
    background: var(--background-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--separator);
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

/* Specific column widths to prevent white space */
th:nth-child(1), td:nth-child(1) { width: 100px; } /* DEPARTMENT */
th:nth-child(2), td:nth-child(2) { width: 180px; } /* ITEM */
th:nth-child(3), td:nth-child(3) { width: 110px; } /* MANUFACTURER */
th:nth-child(4), td:nth-child(4) { width: 100px; } /* SUPPLIER */
th:nth-child(5), td:nth-child(5) { width: 90px; }  /* MFG REF */
th:nth-child(6), td:nth-child(6) { width: 90px; }  /* SUP REF */
th:nth-child(7), td:nth-child(7) { width: 60px; }  /* UNIT */
th:nth-child(8), td:nth-child(8) { width: 60px; }  /* REQ */
th:nth-child(9), td:nth-child(9) { width: 70px; }  /* APPR */
th:nth-child(10), td:nth-child(10) { width: 70px; } /* RECV */
th:nth-child(11), td:nth-child(11) { width: 80px; } /* PRICE */
th:nth-child(12), td:nth-child(12) { width: 140px; } /* ACTIONS */

thead {
    background: var(--color-muted-6);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 8px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    border-bottom: 1px solid var(--separator);
    transition: all var(--transition-fast);
}

th:last-child {
    position: sticky;
    right: 0;
    background: var(--color-muted-6);
    z-index: 11;
    box-shadow: -2px 0 4px rgba(0,0,0,0.05);
}

th:hover {
    background: var(--color-muted-5);
    color: var(--color-primary);
}

td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--separator);
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Allow wrapping only for ITEM column */
td:nth-child(2) {
    white-space: normal;
    word-wrap: break-word;
}

/* Keep actions column visible */
td:last-child {
    position: sticky;
    right: 0;
    background: var(--background-elevated);
    box-shadow: -2px 0 4px rgba(0,0,0,0.05);
    white-space: normal;
}

tbody tr {
    transition: all var(--transition-fast);
}

tbody tr:hover {
    background: var(--color-muted-6);
}

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

/* ═══ ACTION BUTTONS & SMALL BUTTONS ═══ */
.action-buttons {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: var(--space-4);
}

.btn-small {
    padding: 4px 14px;
    font-size: 14px;
    min-height: 28px;
    min-width: auto;
    font-weight: 500;
    white-space: nowrap;
}

/* Make Edit/Delete buttons in item tables bigger */
table .btn-small {
    padding: 5px 18px !important;
    font-size: 13px !important;
    min-height: 28px !important;
    min-width: 65px !important;
    margin-right: 8px !important;
}

table .btn-small:last-child {
    margin-right: 0 !important;
}

/* Special styling for Edit/Delete buttons in Add New Item section */
#addItemSection .btn-small,
#addItemSection .action-buttons button {
    padding: 12px 40px !important;
    font-size: 15px !important;
    min-height: 40px !important;
    min-width: 100px !important;
    font-weight: 600;
}

/* Make shopping cart buttons thinner */
.btn-success,
.btn-info {
    padding: 5px 20px !important;
    min-height: 30px !important;
}

/* ═══ EMPTY STATE - iOS Style ═══ */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
    color: var(--text-secondary);
    font-size: 17px;
}

.empty-state::before {
    content: '📋';
    display: block;
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

/* ═══ LINKS - Apple Blue ═══ */
.link-cell {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.link-cell:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* ═══ LOADING SPINNER - iOS Style ═══ */
.loading {
    text-align: center;
    padding: var(--space-12);
    color: var(--text-secondary);
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--separator);
    border-top-color: var(--color-primary);
    animation: spin 0.8s linear infinite;
    margin: var(--space-6) auto;
}

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

/* ═══ SYNC INDICATOR - iOS Badge Style ═══ */
.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.sync-indicator.syncing {
    background: rgba(255, 204, 0, 0.15);
    color: #B28400;
}

.sync-indicator.synced {
    background: rgba(52, 199, 89, 0.15);
    color: #1F7A3D;
}

.sync-indicator.error {
    background: rgba(255, 59, 48, 0.15);
    color: #C0291E;
}

/* ═══ STOCK TAKING MODE - iOS Card Style ═══ */
.stock-item {
    background: var(--background-elevated);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--separator);
    transition: all var(--transition-base);
}

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

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.stock-info h3 {
    color: var(--text-primary);
    font-size: 19px;
    font-weight: 600;
    margin-bottom: var(--space-1);
    letter-spacing: -0.3px;
}

.stock-details {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ═══ COUNTER - iOS Style Round Buttons ═══ */
.stock-counter {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-3);
}

.counter-btn {
    width: 56px;
    height: 56px;
    font-size: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.counter-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.counter-btn:active {
    transform: scale(0.95);
}

.counter-display {
    font-size: 34px;
    font-weight: 700;
    min-width: 100px;
    text-align: center;
    color: var(--color-primary);
    font-family: var(--font-display);
    letter-spacing: -1px;
}

/* ═══ QUICK ORDER PANEL - iOS Card Style ═══ */
.quick-order-item {
    background: var(--background-elevated);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--separator);
    transition: all var(--transition-fast);
}

.quick-order-item:hover {
    background: var(--color-muted-6);
    transform: translateX(4px);
}

.quick-order-info {
    flex: 1;
}

.quick-order-info h4 {
    margin-bottom: var(--space-1);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.quick-order-info small {
    color: var(--text-secondary);
    font-size: 14px;
}

.quick-order-controls {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.qty-input {
    width: 80px;
    padding: 10px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    background: var(--background-elevated);
    color: var(--text-primary);
}

.qty-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.qty-label {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 70px;
    font-weight: 500;
}

/* ═══ ORDER CARDS - Refined Status Indicators ═══ */
.order-card {
    background: var(--background-elevated);
    border: 1px solid var(--separator);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    padding-left: var(--space-6);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.order-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    transition: all var(--transition-base);
}

.order-card.pending::before {
    background: var(--color-warning);
}

.order-card.approved::before {
    background: var(--color-success);
}

.order-card.completed::before {
    background: var(--color-muted);
}

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

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--separator);
}

.order-info h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.order-meta {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ═══ STATUS BADGES - Refined & Muted ═══ */
.order-status {
    padding: 5px 12px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.1px;
}

.order-status.pending {
    background: rgba(214, 149, 84, 0.15);
    color: #A87A4D;
}

.order-status.approved {
    background: rgba(110, 171, 126, 0.15);
    color: #4E7F5B;
}

.order-status.completed {
    background: rgba(142, 142, 147, 0.15);
    color: #636366;
}

.order-status.rejected {
    background: rgba(198, 40, 40, 0.15) !important;
    color: #c62828 !important;
}

.order-status.modified {
    background: rgba(110, 171, 126, 0.15);
    color: #4E7F5B;
}

.order-card.modified::before {
    background: var(--color-success);
}

/* ═══ PER-SUPPLIER PO CARDS ═══ */
.po-date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px;
}

.po-date-btn {
    min-width: 32px;
    text-align: center;
    font-weight: 700;
}

.po-date-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    min-width: 100px;
    text-align: center;
}

.po-date-all {
    margin-left: auto;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    font-weight: 600;
}

.po-date-all.active {
    background: #1565c0;
    color: white;
    border-color: #1565c0;
}

.po-status-dropdown {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    margin-left: 4px;
}

.po-snapshot-btn {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.po-snapshot-btn:hover {
    background: #bbdefb;
}

/* Snapshot viewer modal content */
.snapshot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.snapshot-table th {
    background: #e3f2fd;
    padding: 8px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid #1565c0;
}

.snapshot-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #e0e0e0;
}

.snapshot-table tr:nth-child(even) {
    background: #f8f9fa;
}

.snapshot-price-up { color: #d32f2f; font-weight: 700; }
.snapshot-price-down { color: #2e7d32; font-weight: 700; }
.snapshot-price-same { color: #555; }
.snapshot-meta { font-size: 12px; color: #666; margin-bottom: 12px; }

/* Price review modal overrides */
.price-review-modal-content {
    max-width: 900px;
    max-height: 90vh;
    padding: 0;
}

.price-review-modal-header {
    background: #1565c0;
    color: white;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-bottom: 0;
    border-bottom: none;
}

.price-review-close-btn {
    color: white;
    background: none;
    border: none;
    font-size: 28px;
    min-width: 40px;
    min-height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.price-review-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.price-review-modal-body {
    padding: 16px 20px;
    overflow-x: auto;
}

.po-supplier-card {
    border-left: 4px solid #E8913A;
}

.po-supplier-card::before {
    display: none; /* Override the generic ::before stripe since we use left border */
}

.po-supplier-title {
    font-size: 1.1em;
}

.po-supplier-name {
    color: #E8913A;
}

.po-supplier-link {
    color: #E8913A;
    text-decoration: none;
    border-bottom: 1px dashed #E8913A;
}

.po-supplier-link:hover {
    color: #c67a2e;
    border-bottom-style: solid;
}

.po-supplier-phone {
    font-size: 0.8em;
    font-weight: normal;
    color: #1565c0;
    text-decoration: none;
    margin-left: 8px;
    white-space: nowrap;
}

.po-supplier-phone:hover {
    text-decoration: underline;
}

.po-supplier-acct {
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
    margin-left: 8px;
    white-space: nowrap;
}

.po-order-title {
    font-size: 1.1em;
}

.po-supplier-table {
    table-layout: fixed;
    width: 100%;
}

.po-col-item { width: 24%; }
.po-col-dept { width: 8%; }
.po-col-mfg { width: 10%; }
.po-col-ref { width: 9%; }
.po-col-unit { width: 5%; }
.po-col-qty { width: 5%; }
.po-col-price { width: 8%; }
.po-col-total { width: 8%; }

.po-ref-cell {
    font-size: 11px;
    color: #555;
    word-break: break-all;
}

.po-btn-slip {
    background: #78909c;
    color: white;
    border-color: #607d8b;
}

.po-btn-slip:hover {
    background: #607d8b;
}

/* Packing slip viewer */
.slip-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slip-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.slip-preview-link {
    flex-shrink: 0;
    text-decoration: none;
}

.slip-preview-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.slip-preview-icon {
    width: 80px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff3e0;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-weight: 700;
    color: #e65100;
}

.slip-meta {
    flex: 1;
    min-width: 0;
}

.slip-name {
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slip-date {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.slip-delete-btn {
    flex-shrink: 0;
}

/* Drag and drop zones */
.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 14px;
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.drop-zone:hover {
    border-color: #aaa;
    color: #777;
}

.drop-zone-active {
    border-color: #4a5abb;
    background: #eef0ff;
    color: #4a5abb;
    font-weight: 600;
}

.drop-zone-sm {
    padding: 8px;
    font-size: 11px;
    margin-top: 10px;
}

.po-supplier-actions {
    margin-top: 15px;
}

.po-card-buttons {
    margin-top: 15px;
}

.po-supplier-button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 4px 0;
    padding: 6px 8px;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.po-supplier-row-label {
    font-size: 12px;
    color: #333;
    min-width: 80px;
}

.po-action-btn {
    font-size: 13px;
}

.po-btn-export {
    background: #0066cc;
    color: #fff;
}

.po-btn-copyrefs {
    background: #1b5e20;
    color: #fff;
}

.po-btn-refresh {
    background: #546e7a;
    color: #fff;
}

.po-btn-resolve {
    background: #7cb342;
    color: #fff;
}

.po-item-cell {
    min-width: 160px;
    max-width: 280px;
    word-wrap: break-word;
}

.po-item-name {
    font-size: 13px;
    display: block;
    line-height: 1.3;
}

/* Type badges (Instrument / Part) */
.type-badge-inst {
    background: #0d6efd;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
}

.type-badge-part {
    background: #6c757d;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
}

.type-badge-blks {
    background: #f9a825;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
}

.type-badge-burs {
    background: #d32f2f;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
}

.type-badge-spaced {
    margin-right: 4px;
}

/* Order card badges */
.order-badge-emailed {
    font-size: 0.75em;
    background: #bbdefb;
    color: #1565c0;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.order-badge-pdf {
    font-size: 0.75em;
    background: #e1bee7;
    color: #6a1b9a;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* Supplier status badges */
.supplier-badge {
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 3px;
    font-weight: 600;
}

.badge-price-check-sent {
    background: #fff3e0;
    color: #e65100;
}

.badge-price-check-received {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-order-placed {
    background: #e3f2fd;
    color: #1565c0;
}

/* Arrival progress badge */
.badge-arrival-progress {
    background: #fff8e1;
    color: #f57f17;
}

.badge-arrival-complete {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-arrival-waived {
    background: #fce4ec;
    color: #c62828;
    font-size: 0.65em;
}

/* Receive Items Modal */
.receive-modal-subtitle {
    font-size: 13px;
    color: #555;
    margin: 0 0 12px 0;
    padding: 0 4px;
}

.receive-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.receive-items-table th {
    background: #f5f5f5;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 2px solid #ddd;
}

.receive-items-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.receive-items-table tr.receive-row-complete {
    background: #f1f8e9;
}

.receive-items-table tr.receive-row-waived {
    background: #fafafa;
    opacity: 0.6;
}

.receive-items-table tr.receive-row-waived td {
    text-decoration: line-through;
}

.receive-qty-input {
    width: 50px;
    padding: 4px 2px;
    border: 1px solid #ccc;
    border-radius: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
}

.receive-qty-input::-webkit-inner-spin-button,
.receive-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.receive-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ccc;
}

.receive-qty-stepper .receive-qty-input {
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
}

.receive-qty-btn {
    width: 32px;
    border: none;
    background: #f0f0f0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    padding: 4px 0;
    line-height: 1;
}

.receive-qty-btn:hover {
    background: #e0e0e0;
}

.receive-qty-btn:active {
    background: #d0d0d0;
}

.receive-qty-input:focus {
    border-color: #1565c0;
    outline: none;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

.receive-waive-btn {
    font-size: 11px;
    padding: 3px 8px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
}

.receive-waive-btn:hover {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}

.receive-waive-btn.waived {
    background: #ffcdd2;
    color: #c62828;
    border-color: #ef9a9a;
}

.receive-waive-reason {
    font-size: 11px;
    color: #c62828;
    font-style: italic;
}

.receive-modal-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.receive-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

/* Receive button on PO cards */
.po-btn-receive {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.po-btn-receive:hover {
    background: #c8e6c9;
}

/* In Stock Item modal — location rows */
.instock-loc-row {
    margin: 5px 0;
    padding: 8px;
    border-radius: 4px;
}

.instock-loc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.instock-loc-qty {
    color: #4CAF50;
}

.instock-loc-photo-wrap {
    margin-top: 6px;
    position: relative;
}

.instock-loc-photo {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.instock-loc-photo:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.instock-loc-photo-btn {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    padding: 3px 10px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
}

.instock-loc-photo-btn:hover {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}

.instock-loc-add-photo {
    margin-top: 4px;
    width: 100%;
    text-align: center;
    border-style: dashed;
}

/* Clickable stock cell in Take Stock tab */
.stock-cell-clickable {
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
}

.stock-cell-clickable:hover {
    background: #e3f2fd !important;
    text-decoration: underline;
}

/* Location Quick Edit rows */
.loc-quickedit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #ddd;
}

.loc-quickedit-info {
    flex: 1;
}

.loc-quickedit-actions {
    display: flex;
    gap: 5px;
}

.loc-default-badge {
    background: #fff3cd;
    color: #856404;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    margin-left: 8px;
    font-weight: 600;
}

.loc-unsaved-badge {
    color: #ff9800;
    margin-left: 10px;
    font-size: 0.85em;
}

.loc-quickedit-photo-wrap {
    margin: 0 0 8px 0;
    padding: 0 10px;
}

.loc-quickedit-photo {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.loc-quickedit-photo:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Reject button */
.btn-reject {
    background: #ffcdd2;
    color: #c62828;
    border: none;
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* Approval form inputs */
.approval-supplier-select {
    width: 120px;
    padding: 3px;
    font-size: 0.85em;
}

.approval-qty-input {
    width: 50px;
    padding: 3px;
    font-size: 0.9em;
}

.order-combined-table {
    table-layout: fixed;
    width: 100%;
}

/* ═══ ORDER ITEMS TABLE ═══ */
.order-items-table {
    width: 100%;
    margin: var(--space-4) 0;
}

.order-items-table th {
    background: var(--color-muted-6);
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-items-table td {
    padding: 12px;
    border-bottom: 1px solid var(--separator);
    font-size: 15px;
    color: var(--text-primary);
}

.approval-input {
    width: 80px;
    padding: 10px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    background: var(--background-elevated);
    color: var(--text-primary);
}

.approval-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

/* ═══ MODALS - Readable & Refined ═══ */
.edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s var(--transition-base);
}

.edit-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

/* Generic Modal (Find Item, Transfer, Manage Locations, etc.) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: #FFFFFF;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.15);
    animation: slideUp 0.4s var(--spring);
}

.modal-content::-webkit-scrollbar-track {
    margin-block: 12px;
}

.edit-modal-content {
    background: #FFFFFF;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.15);
    animation: slideUp 0.4s var(--spring);
}

.edit-modal-content::-webkit-scrollbar-track {
    margin-block: 12px;
}

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

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--separator);
}

.edit-modal-close {
    width: 32px;
    height: 32px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.edit-modal-close:hover {
    background: var(--color-muted-5);
    color: var(--text-primary);
    transform: scale(1.1);
}

.browse-row {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.browse-row:hover {
    background: var(--color-muted-6) !important;
    transform: scale(1.005);
}

/* === TABLET STYLES (769px - 1024px) === */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Larger touch targets for buttons */
    button, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 10px 16px !important;
        font-size: 15px !important;
    }
    
    /* Table buttons need proper touch targets on iPad */
    table .btn-small {
        min-height: 40px !important;
        padding: 8px 20px !important;
        font-size: 14px !important;
        margin-right: 10px !important;
    }
    
    /* Larger form inputs for touch */
    input[type="text"], input[type="number"], input[type="email"], input[type="url"], 
    input[type="password"], input[type="search"], select, textarea {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding: 12px !important;
    }
    
    /* Table cells - bigger for touch */
    td {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
    
    th {
        padding: 12px 12px !important;
        font-size: 13px !important;
    }
    
    /* Filter bar: 3 columns on tablet portrait */
    .search-filter {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px;
    }
    
    /* Stock Taking table adjustments */
    #stockTable {
        font-size: 0.85em;
    }
    
    #stockTable th, #stockTable td {
        padding: 10px 6px;
    }
    
    #stockTable input[type="number"] {
        width: 60px !important;
        min-height: 40px;
        font-size: 14px !important;
    }
    
    /* Browse table adjustments */
    #browseTable {
        font-size: 0.85em;
    }
    
    #browseTable th, #browseTable td {
        padding: 10px 6px;
    }
    
    /* Order items table adjustments */
    .order-items-table {
        font-size: 0.85em;
    }
    
    .order-items-table th, .order-items-table td {
        padding: 10px 6px;
    }
    
    /* Mode toggle buttons - larger for touch */
    .mode-btn {
        padding: 12px 20px !important;
        font-size: 0.95em !important;
        min-height: 48px;
    }

    .inv-subtab {
        padding: 8px 14px;
        font-size: 12px;
        min-height: 40px;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.3em;
    }
    
    /* Stats cards */
    .stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Quick order panel adjustments */
    #quickOrderPanel {
        width: 380px;
    }
    
    /* Edit modal wider on tablet */
    .edit-modal-content {
        width: 90%;
        max-width: 700px;
    }
    
    /* Form grids: 2 columns on tablet */
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Checkboxes larger for touch */
    input[type="checkbox"] {
        width: 22px;
        height: 22px;
        cursor: pointer;
    }
    
    /* Table container horizontal scroll if needed */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* === MOBILE STYLES (768px and below) === */
@media (max-width: 768px) {
    .search-filter {
        grid-template-columns: 1fr;
    }

    .section > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8em;
    }

    th, td {
        padding: 8px 4px;
    }

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

    .mode-toggle {
        flex-direction: column;
    }

    .counter-btn {
        width: 60px;
        height: 60px;
    }

    .counter-display {
        font-size: 2.5em;
        min-width: 100px;
    }
}

/* ═══ SETUP INSTRUCTIONS - iOS Informational Card ═══ */
.setup-instructions {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-5);
    box-shadow: var(--shadow-md);
}

.setup-instructions h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.setup-instructions ol {
    margin-left: var(--space-5);
}

.setup-instructions li {
    margin-bottom: var(--space-3);
    color: var(--text-primary);
    line-height: 1.6;
}

.setup-instructions code {
    background: var(--color-muted-6);
    color: var(--color-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 14px;
}

/* ═══ NOTIFICATIONS - Refined Toast ═══ */
.success-notification {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    background: var(--background-elevated);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--separator);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.success-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.success-notification::before {
    content: '✓';
    width: 20px;
    height: 20px;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

/* ═══ TOGGLE SWITCH - Smaller & More Spacing ═══ */
.feature-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-4);
    background: var(--background-elevated);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
    border: 1px solid var(--separator);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-muted-4);
    transition: all var(--transition-base);
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-base);
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--color-success);
}

input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(110, 171, 126, 0.2);
}

/* ═══ ADDITIONAL APPLE POLISH ═══ */
::selection {
    background: rgba(0, 122, 255, 0.2);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-muted-4);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted-3);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ═══ EXTRACTED UTILITY CLASSES ═══ */

/* Form labels & hints */
.form-label { font-weight: bold; margin-bottom: 5px; display: block; }
.form-hint { color: #6c757d; display: block; margin-top: 5px; }
.field-label { font-size: 0.9em; display: block; margin-bottom: 5px; }
.field-label-bold { font-size: 0.85em; font-weight: 600; display: block; margin-bottom: 4px; }

/* Settings inputs */
.settings-input { width: 100%; max-width: 600px; padding: 10px; border: 1px solid #ddd; border-radius: 6px; }
.settings-input-highlight { width: 100%; max-width: 600px; padding: 10px; border: 2px solid #ffc107; border-radius: 6px; }
.settings-input-narrow { width: 100%; max-width: 400px; padding: 10px; border: 1px solid #ddd; border-radius: 6px; }
.settings-section-title { color: #8B9DC3; margin: 30px 0 15px 0; }

/* Form inputs */
.input-standard { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.input-standard-lg { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; }
.filter-control { padding: 10px; border: 2px solid #dee2e6; border-radius: 6px; font-size: 1em; }
.stock-input { width: 55px; padding: 4px; border: 1px solid #dee2e6; border-radius: 3px; text-align: center; font-size: 0.85em; }

/* Table cells */
.cell { padding: 8px; }
.cell-compact { padding: 6px; }
.cell-compact-center { padding: 6px; text-align: center; }
.cell-compact-sm { padding: 6px; font-size: 0.9em; }
.cell-clickable { cursor: pointer; text-align: center; white-space: nowrap; }

/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-center-nowrap { text-align: center; white-space: nowrap; }

/* Empty messages (simple inline replacements — distinct from .empty-state which has icon/styling) */
.empty-msg { text-align: center; color: #999; padding: 40px; }
.empty-msg-plain { text-align: center; padding: 40px; }
.empty-msg-compact { text-align: center; color: #999; padding: 20px; }
.empty-msg-lg { padding: 30px; text-align: center; }

/* Buttons (size modifiers) */
.btn-xs { padding: 6px 12px; font-size: 0.85em; }
.btn-sm-tight { padding: 5px 10px; font-size: 0.9em; }
.btn-sm { padding: 8px 15px; font-size: 0.9em; }
.btn-md { padding: 8px 20px; font-size: 0.9em; }
.btn-padded { padding: 10px 20px; }
.btn-lg { padding: 12px 30px; }
.btn-flex { flex: 1; padding: 12px; font-size: 1em; }

/* Layout */
.flex-1 { flex: 1; }
.modal-footer { display: flex; gap: 15px; padding: 20px; border-top: 1px solid #dee2e6; }
.button-group-center { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.chip-button { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.9em; padding: 6px 12px; border-radius: 6px; border: 1px solid #e0e0e0; background: white; transition: all 0.2s; }

/* Spacing */
.mb-15 { margin-bottom: 15px; }
.mb-10 { margin: 0 0 10px 0; }
.mt-10 { margin-top: 10px; }
.my-2 { margin: 2px 0; }
.m-0 { margin: 0; }

/* Typography */
.text-sm { font-size: 0.9em; }
.text-xs { font-size: 0.85em; }
.text-muted { color: #6c757d; }
.text-hint-sm { color: #6c757d; font-size: 12px; }
.text-hint-xs { color: #6c757d; font-size: 11px; }
.text-danger { color: #dc3545; }
.text-success { color: #28a745; }
.text-light { color: #888; }
.font-bold { font-weight: bold; }
.confirm-title { font-size: 1.2em; font-weight: 600; color: #333; margin-bottom: 20px; }
.section-subtitle { color: #666; font-size: 0.95em; margin-bottom: 30px; }
.heading-blue { margin: 0 0 10px 0; color: #1976D2; }

/* Cursors */
.clickable { cursor: pointer; }
.help-cursor { cursor: help; }

/* Icons */
.icon-btn { width: 18px; height: 18px; cursor: pointer; }
.icon-btn-sm { width: 16px; height: 16px; cursor: pointer; }

/* Sizing */
.min-w-100 { min-width: 100px; }
.max-w-500 { max-width: 500px; }
.col-10 { width: 10%; }
.col-12 { width: 12%; }

/* Cards */
.card-muted { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; }

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================================
   INLINE STYLE CLEANUP — All inline styles moved to classes
   ============================================================ */

/* --- Utility classes --- */
.d-flex { display: flex; }
.d-block { display: block; }
.d-grid { display: grid; }
.text-red { color: red; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.my-20 { margin: 20px 0; }
.w-100 { width: 100%; }

/* --- Header --- */
.header-row {
    display: flex;
    align-items: center;
    gap: 20px;
}
.logo-container { display: block; }
.logo-img {
    max-height: 60px;
    max-width: 150px;
}
.btn-settings {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

/* --- Crop Modal --- */
.crop-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
}
.crop-image-container {
    margin: 20px 0;
    max-height: 60vh;
    overflow: hidden;
    background: #000;
}
.crop-image {
    max-width: 100%;
    display: block;
}
.crop-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}
.crop-option-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}
.crop-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.btn-min-w-120 { min-width: 120px; }
.btn-action-lg {
    padding: 12px 30px;
    font-size: 1.1em;
}

/* --- Find Item Modal --- */
.modal-content-md { max-width: 700px; }
.modal-content-sm { max-width: 600px; }
.modal-content-lg { max-width: 800px; }
.modal-content-xl { max-width: 900px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}
.modal-title-blue { margin: 0; color: #2196F3; }
.btn-close-modal {
    padding: 10px 25px;
    font-size: 1em;
    font-weight: 600;
}
.search-input-highlight {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #2196F3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}
.hint-text {
    margin: 10px 0 0 5px;
    font-size: 0.9em;
    color: #666;
}
.results-scroll {
    max-height: 450px;
    overflow-y: auto;
    margin: 20px 0;
    padding: 10px;
}
.results-scroll-lg {
    max-height: 500px;
    overflow-y: auto;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* --- Transfer Modal --- */
.info-display {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: bold;
}
.field-hint {
    color: #666;
    display: block;
    margin-top: 5px;
}
.new-location-panel {
    display: none;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 8px;
    margin: 10px 0;
}
.grid-2fr-1fr {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

/* --- Manage Locations Modal --- */
.modal-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}
.modal-close-btn {
    cursor: pointer;
    font-size: 28px;
    color: #666;
    line-height: 1;
}
.tab-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    flex-shrink: 0;
}
.panel-flex {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.panel-flex-hidden {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
}
.filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: end;
    flex-shrink: 0;
}
.filter-row-lg {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: end;
    flex-shrink: 0;
}
.field-group-flex { flex: 1; min-width: 200px; }
.field-group-auto { flex: 0; min-width: 200px; }
.field-group-shrink { flex: 0; }
.input-standard-full {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
}
.input-filter {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
}
.list-scroll {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-height: 100px;
}
.action-bar {
    display: none;
    padding-top: 12px;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-top: 2px solid #e0e0e0;
    margin-top: 12px;
}
.action-bar-end {
    display: none;
    padding-top: 12px;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    border-top: 2px solid #e0e0e0;
    margin-top: 12px;
}
.action-counter {
    font-size: 0.9em;
    color: #666;
}
.btn-action-md { padding: 10px 30px; }
.copy-arrow {
    font-size: 1.5em;
    color: #999;
    padding-bottom: 5px;
}
.panel-scroll-auto {
    flex: 1;
    overflow-y: auto;
    display: none;
}
.overview-scroll {
    max-height: 60vh;
    overflow-y: auto;
}
.modal-footer-right {
    margin-top: 15px;
    text-align: right;
    flex-shrink: 0;
}
.btn-close-md { padding: 10px 25px; }

/* --- Settings Panel --- */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.settings-title { margin: 0; }
.btn-close-x {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    line-height: 1;
}
.settings-api-title {
    color: #8B9DC3;
    margin-bottom: 15px;
}
.form-hint-sm {
    color: #6c757d;
    display: block;
    margin-top: 4px;
}
.settings-textarea {
    width: 100%;
    max-width: 600px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-height: 80px;
}
.settings-input-phone {
    width: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* --- Admin/Status Notices --- */
.notice-success {
    display: none;
    background: #d4edda;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}
.notice-info {
    display: none;
    background: #d1ecf1;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #0c5460;
}
.notice-warning {
    display: none;
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
}
.notice-danger {
    display: none;
    background: #f8d7da;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #dc3545;
}
.text-success-dark { color: #155724; }
.text-info-dark { color: #0c5460; }
.text-warning-dark { color: #856404; }
.text-danger-dark { color: #721c24; }
.notice-detail {
    display: block;
    margin: 10px 0;
}
.input-transfer {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ffc107;
    border-radius: 4px;
    margin-top: 5px;
}
.btn-transfer {
    margin-top: 10px;
    padding: 8px 16px;
    background: #ffc107;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #856404;
}
.btn-danger-action {
    margin-top: 10px;
    padding: 10px 20px;
    background: #dc3545;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    font-size: 14px;
}
.notice-footer {
    color: inherit;
    display: block;
    margin-top: 10px;
}
.hint-warning-bold {
    color: #856404;
    display: block;
    margin-top: 5px;
    font-weight: bold;
}
.settings-desc {
    color: #6c757d;
    margin-bottom: 15px;
}
.settings-link { color: #667eea; }
.checkbox-label-flex {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.hint-indented {
    color: #6c757d;
    display: block;
    margin-top: 8px;
    margin-left: 28px;
}
.settings-actions-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}
.btn-full-lg {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}
.hint-center {
    color: #6c757d;
    display: block;
    margin-top: 8px;
    text-align: center;
}
.settings-footer-info {
    margin-top: 15px;
    font-size: 0.9em;
    color: #856404;
}

/* --- Auth Section --- */
.auth-subtitle {
    color: #6c757d;
    margin: 20px 0;
}
.auth-help {
    margin-top: 15px;
    font-size: 14px;
    color: #6c757d;
}
.btn-link-inline {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

/* --- Person Picker & PIN --- */
.overlay-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overlay-fullscreen-top {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.picker-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}
.picker-header {
    text-align: center;
    margin-bottom: 20px;
}
.picker-icon {
    font-size: 48px;
    margin-bottom: 10px;
}
.picker-title {
    margin: 0 0 5px 0;
    color: #333;
}
.picker-subtitle {
    color: #6c757d;
    margin: 0;
}
.picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.pin-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}
.pin-subtitle {
    color: #6c757d;
    margin: 0 0 20px 0;
}
.pin-input {
    width: 120px;
    text-align: center;
    font-size: 32px;
    letter-spacing: 12px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
}
.pin-error {
    color: #dc3545;
    margin: 10px 0 0 0;
    display: none;
}
.pin-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-pin-back {
    padding: 10px 24px;
    background: #e9ecef;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
}
.btn-pin-confirm {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

/* --- User Info Bar --- */
.session-badge {
    display: none;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}
.user-info .session-badge-admin,
.user-info .session-badge-supervisor {
    color: white;
}
.user-info .session-badge-requester {
    color: #333;
}
.session-badge-admin {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
.session-badge-supervisor {
    background: linear-gradient(135deg, #2196F3, #1565C0);
    color: white;
}
.session-badge-requester {
    background: #e0e0e0;
    color: #333;
}
.toggle-label-sm {
    font-size: 14px;
    color: #666;
}
.toggle-status-sm {
    font-size: 12px;
    color: #666;
    min-width: 40px;
}
.user-actions {
    display: flex;
    gap: 8px;
}

/* --- Bulk Operations --- */
.bulk-ops-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding-left: 20px;
    border-left: 2px solid #ddd;
}
.bulk-ops-label {
    font-weight: 600;
    color: #7c3aed;
}

/* --- Shopping Cart --- */
.cart-form {
    background: #e3f2fd;
    border: 3px solid #2196F3;
}
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-counter {
    background: #2196F3;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}
.cart-count-badge {
    background: #4caf50;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}
.cart-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}
.cart-items-scroll {
    height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    background: white;
    padding: 15px;
    border-radius: 6px;
}
.empty-cart-icon {
    font-size: 4em;
    color: #ccc;
}
.empty-cart-title {
    color: #6c757d;
    margin: 10px 0;
}
.empty-cart-subtitle { color: #aaa; }
.order-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
}
.form-label-blue {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2196F3;
}
.select-standard {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}
.btn-submit-lg {
    font-size: 1.1em;
    padding: 15px 30px;
}

/* --- Filters --- */
.filter-grid-6col {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}
.filter-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.checkbox-label-bold {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* --- Bulk Actions Toolbar --- */
.bulk-toolbar {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
    align-items: center;
    gap: 15px;
}
.bulk-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.btn-compact { padding: 8px 15px; }
.btn-hint { padding: 1px 6px; font-size: 11px; pointer-events: none; vertical-align: middle; }

/* --- Table Columns --- */
.col-w-3 { width: 3%; }
.col-w-5 { width: 5%; }
.col-w-6 { width: 6%; }
.col-w-7 { width: 7%; }
.col-w-14 { width: 14%; }
.col-w-16 { width: 16%; }
.col-w-22 { width: 22%; }
.col-w-25 { width: 25%; }

/* --- Order Filters --- */
.order-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-count {
    display: inline-block;
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
    font-size: 0.8em;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 4px;
    min-width: 20px;
    text-align: center;
}
.filter-count:empty { display: none; }
.mode-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.3);
}

/* --- Image Upload Buttons --- */
.upload-btn-row {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.hint-type {
    color: #6c757d;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

/* --- Locations in Add/Edit Form --- */
.locations-panel {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.add-location-panel {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    border: 2px dashed #2196F3;
}
.location-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}
.btn-add-compact {
    padding: 8px 16px;
    white-space: nowrap;
}

/* --- Missing Data Filters --- */
.missing-filters-bar {
    padding: 10px 20px;
    margin-top: -10px;
}
.missing-filters-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.missing-filters-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #666;
}
.missing-filter-count {
    font-size: 0.8em;
    color: #999;
    margin-left: auto;
}

/* --- Stock Table --- */
.clickable-sort {
    cursor: pointer;
    white-space: nowrap;
}

/* --- Department Management --- */
.panel-warning {
    display: none;
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.panel-success {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.panel-info {
    background: #d1ecf1;
    padding: 20px;
    border-radius: 8px;
}
.panel-title-warning {
    margin-top: 0;
    color: #856404;
}
.panel-title-success {
    margin-top: 0;
    color: #2e7d32;
}
.panel-title-info {
    margin-top: 0;
    color: #0c5460;
}
.panel-text-info {
    color: #0c5460;
    margin-bottom: 15px;
}
.orphaned-list-display {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}
.dept-add-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.btn-mr-10 { margin-right: 10px; }

/* --- Price Tools --- */
.panel-warning-light {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.panel-success-light {
    background: #d4edda;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.panel-text-success {
    color: #155724;
    margin-bottom: 15px;
}
.filter-grid-5col {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}
.prices-grid-scroll {
    display: none;
    margin-top: 20px;
    max-height: 600px;
    overflow-y: auto;
}
.upload-results {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 4px;
    display: none;
}
.price-log-scroll {
    display: none;
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
}

/* --- Manage Employees Modal --- */
.emp-modal-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}
.emp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}
.emp-list-scroll {
    max-height: 50vh;
    overflow-y: auto;
}
.emp-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    text-align: right;
}
.emp-form-field-label {
    font-weight: 600;
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}
.emp-form-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
.emp-form-input-sm {
    width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    letter-spacing: 4px;
    text-align: center;
}
.emp-form-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
.emp-form-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}
.btn-emp-action { padding: 8px 20px; }

/* --- Generic Reusable --- */
.flex-center-gap10 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.flex-center-gap15 {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- Additional classes from second pass --- */
.grid-4col { grid-template-columns: repeat(4, 1fr); }
.stock-display-readonly { background: #e8f5e9; cursor: not-allowed; }
.stock-label-green { color: #2e7d32; font-size: 11px; }
.mt-15 { margin-top: 15px; }

/* --- Image Hover Preview --- */
.image-hover-preview {
    display: none;
    position: fixed;
    z-index: 10000;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    pointer-events: none;
}
.image-hover-label {
    position: absolute;
    top: 5px;
    right: 10px;
    color: #999;
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
}
.image-hover-img {
    max-width: 100%;
    max-height: 300px;
    display: block;
    border-radius: 4px;
    pointer-events: none;
}
.image-hover-loading {
    display: none;
    padding: 20px;
    text-align: center;
    color: #666;
    pointer-events: none;
}
.image-hover-spinner {
    font-size: 40px;
    margin-bottom: 10px;
}
.image-hover-hint {
    font-size: 12px;
    margin-top: 5px;
}

/* --- Supplier Info Modal --- */
.supplier-modal-content {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}
.supplier-info-scroll {
    margin: 20px 0;
    overflow-y: auto;
    flex: 1;
}
.supplier-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
}
.supplier-notice-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}
.supplier-notice-list {
    margin: 10px 0 0 20px;
    font-size: 14px;
}
.supplier-footer {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}
.flex-2 { flex: 2; }
.supplier-list-scroll {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}
.btn-add-supplier {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    font-size: 15px;
}
.p-20 { padding: 20px; }
.settings-desc.mb-20 { margin-bottom: 20px; }

/* --- Employee Form (from manage employees) --- */
.emp-form-panel { padding: 0 20px 20px; }
.emp-form-card {
    background: #f0f2ff;
    border-radius: 8px;
    padding: 15px;
}
.emp-form-title {
    margin: 0 0 12px 0;
    color: #667eea;
}
.emp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* --- Image Preview Tooltip --- */
.image-preview-tooltip {
    display: none;
    position: fixed;
    z-index: 10000;
    background: white;
    border: 2px solid #8B9DC3;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 10px;
    max-width: 440px;
    cursor: pointer;
}

.preview-info-panel {
    display: none;
    padding: 6px 2px 0;
    border-top: 1px solid #eee;
    margin-top: 6px;
}

.preview-info-desc {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.35;
    margin-bottom: 3px;
}

.preview-info-ref {
    font-size: 11px;
    color: #555;
    line-height: 1.3;
}

/* Item meta line (browse table line 2) */
.item-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.item-meta-ref {
    font-size: 11px;
    color: #888;
}

.preview-info-stock {
    font-size: 11px;
    color: #2e7d32;
    font-weight: 600;
    margin-top: 3px;
    line-height: 1.3;
}

.item-meta-link {
    font-size: 10px;
    color: #8B9DC3;
    text-decoration: none;
    border: 1px solid #c8d0e0;
    padding: 0 4px;
    border-radius: 3px;
    line-height: 1.5;
}

.item-meta-link:hover {
    background: #f0f2ff;
    color: #667eea;
}

.item-meta-badge-inst {
    background: #0d6efd;
    color: white;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

.item-meta-badge-part {
    background: #6c757d;
    color: white;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

.item-meta-badge-blks {
    background: #f9a825;
    color: white;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

.item-meta-badge-burs {
    background: #d32f2f;
    color: white;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

/* --- Input Readonly --- */
.input-readonly {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
}

/* --- Employee List Panel --- */
.emp-list-panel {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
}

/* Override back-to-top to match original design */
.btn-back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

/* --- First-Run Setup Banner --- */
.first-run-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}
.first-run-icon {
    font-size: 48px;
    margin-bottom: 10px;
}
.first-run-title {
    margin: 0 0 15px 0;
    font-size: 1.4em;
}
.first-run-text {
    margin: 10px auto;
    max-width: 500px;
    line-height: 1.6;
    opacity: 0.95;
}
.first-run-list {
    text-align: left;
    max-width: 500px;
    margin: 15px auto;
    line-height: 1.8;
    opacity: 0.95;
}

/* ═══ CART REQUESTER LINE ═══ */
.cart-requester-line {
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-requester-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.cart-requester-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a5276;
}

/* ═══ BARCODE SCANNER ═══ */
.btn-global-scan {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #E8913A;
    color: white;
    border: none;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(232, 145, 58, 0.4);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-global-scan:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(232, 145, 58, 0.5); }
.btn-global-scan:active { transform: scale(0.95); }

.btn-scan-contextual {
    padding: 8px 14px;
    background: #E8913A;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-scan-contextual:hover { background: #d47a28; }

.scan-mode-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}
.scan-mode-btn:hover { background: #fff8f0; border-color: #E8913A; }
.scan-mode-btn:active { background: #fff0e0; }

/* Scanner result item card */
.scan-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 14px;
}
.scan-result-item img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}
.scan-result-item .item-info { flex: 1; }
.scan-result-item .item-name { font-weight: 600; font-size: 14px; color: #333; }
.scan-result-item .item-meta { font-size: 11px; color: #888; margin-top: 2px; }

.scan-result-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.scan-result-actions button {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: all 0.15s;
}
.scan-result-actions .btn-scan-primary {
    background: #E8913A;
    color: white;
    border-color: #E8913A;
}
.scan-result-actions .btn-scan-primary:hover { background: #d47a28; }
.scan-result-actions .btn-scan-secondary {
    background: white;
    color: #333;
}
.scan-result-actions .btn-scan-secondary:hover { background: #f5f5f5; }

.scan-barcode-display {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 6px;
    border: 1px dashed #ccc;
    margin: 8px 0;
}

.scan-location-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ── Scanner Overlay ──────────────────────── */
.scanner-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000; background: #000;
    display: flex; flex-direction: column;
}
.scanner-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: rgba(0,0,0,0.9);
}
.scanner-mode-label {
    color: #E8913A; font-weight: 700; font-size: 14px;
}
.scanner-status {
    color: rgba(255,255,255,0.5); font-size: 11px;
}
.scanner-close-btn {
    background: none; border: none; color: white;
    font-size: 28px; cursor: pointer; padding: 4px 8px;
}
.scanner-viewport {
    flex: 1; position: relative; overflow: hidden; background: #111;
}
.scanner-video {
    width: 100%; height: 100%; object-fit: cover;
}
.scanner-viewfinder {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 85%; max-width: 340px; height: 140px;
    border: 2.5px solid #E8913A; border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
}
.scanner-viewfinder-label {
    position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 13px; white-space: nowrap;
    font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.scanner-viewfinder-hint {
    position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.6); font-size: 10px; white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.scanner-corner {
    position: absolute; width: 20px; height: 20px;
}
.scanner-corner-tl { top: -2px; left: -2px; border-top: 4px solid #fff; border-left: 4px solid #fff; border-radius: 3px 0 0 0; }
.scanner-corner-tr { top: -2px; right: -2px; border-top: 4px solid #fff; border-right: 4px solid #fff; border-radius: 0 3px 0 0; }
.scanner-corner-bl { bottom: -2px; left: -2px; border-bottom: 4px solid #fff; border-left: 4px solid #fff; border-radius: 0 0 0 3px; }
.scanner-corner-br { bottom: -2px; right: -2px; border-bottom: 4px solid #fff; border-right: 4px solid #fff; border-radius: 0 0 3px 0; }
.scanner-scanline {
    position: absolute; top: 50%; left: 10%; right: 10%; height: 2px;
    background: linear-gradient(90deg, transparent, #E8913A, transparent);
    animation: scanLine 2s ease-in-out infinite;
}
.scanner-footer {
    padding: 10px 16px; background: rgba(0,0,0,0.9);
}
.scanner-manual-toggle {
    text-align: center; color: rgba(255,255,255,0.5);
    font-size: 12px; cursor: pointer; padding: 4px;
}
.scanner-manual-row {
    display: flex; gap: 8px; margin-top: 8px;
}
.scanner-manual-input {
    flex: 1; padding: 10px 14px; border: 1px solid #444;
    border-radius: 6px; background: #222; color: white; font-size: 16px;
}
.scanner-manual-submit {
    padding: 10px 16px; background: #555; color: white; border: none;
    border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.scanner-usb-hint {
    color: rgba(255,255,255,0.25); font-size: 10px;
    margin-top: 6px; text-align: center;
}

/* ── Scan Picker dialogs ─────────────────── */
.scan-picker-title {
    text-align: center; margin: 0 0 6px; font-size: 18px;
}
.scan-picker-subtitle {
    text-align: center; color: #888; font-size: 12px; margin: 0 0 20px;
}
.scan-picker-options {
    display: flex; flex-direction: column; gap: 8px;
}
.scan-mode-icon { font-size: 22px; }
.scan-mode-title { font-weight: 600; font-size: 14px; }
.scan-mode-desc { font-size: 11px; color: #888; }
.scan-picker-cancel {
    width: 100%; margin-top: 16px; padding: 10px;
    background: #f5f5f5; border: 1px solid #ddd; border-radius: 6px;
    cursor: pointer; font-size: 13px; color: #666;
}
.scan-loc-title {
    text-align: center; margin: 0 0 16px; font-size: 16px;
}
.scan-loc-subtitle {
    text-align: center; color: #888; font-size: 12px; margin: 0 0 16px;
}
.scan-loc-fields {
    display: flex; flex-direction: column; gap: 12px;
}
.scan-loc-label {
    font-size: 12px; font-weight: 600; color: #555;
    margin-bottom: 4px; display: block;
}
.scan-loc-actions {
    display: flex; gap: 8px; margin-top: 20px;
}
.scan-loc-cancel {
    flex: 1; padding: 10px; background: #f5f5f5; border: 1px solid #ddd;
    border-radius: 6px; cursor: pointer; font-size: 13px; color: #666;
}
.scan-loc-confirm {
    flex: 1; padding: 10px; background: #E8913A; color: white;
    border: none; border-radius: 6px; cursor: pointer;
    font-weight: 600; font-size: 13px;
}
.scan-loc-skip {
    flex: 1; padding: 10px; background: #6c757d; color: white;
    border: none; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.scan-result-overlay { z-index: 200001; }
.scan-result-card {
    max-width: 420px; max-height: 90vh; overflow-y: auto;
}
.scan-result-close {
    position: absolute; right: 12px; top: 8px;
    background: none; border: none; font-size: 20px;
    cursor: pointer; z-index: 1;
}
.picker-card-sm { max-width: 360px; }
.picker-card-md { max-width: 380px; }
.w-full { width: 100%; }

/* ── Splash Screen ────────────────────────── */
.splash-screen {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: opacity 0.5s ease;
}
.splash-content {
    text-align: center; max-width: 560px; padding: 40px 30px;
}
.splash-logo {
    width: 120px; height: 120px; margin-bottom: 16px;
    filter: drop-shadow(0 2px 12px rgba(232,145,58,0.3));
}
.splash-title {
    font-size: 72px; font-weight: 800; letter-spacing: 12px;
    color: #E8913A; font-family: Georgia, 'Times New Roman', serif;
    margin-bottom: 8px; text-shadow: 0 2px 20px rgba(232,145,58,0.3);
}
.splash-acronym {
    font-size: 14px; letter-spacing: 3px;
    color: rgba(255,255,255,0.7); margin-bottom: 32px; line-height: 2.2;
}
.splash-initial {
    color: #E8913A; font-weight: 700;
}
.splash-tagline {
    font-size: 13px; color: rgba(255,255,255,0.4);
    font-style: italic; margin-bottom: 40px;
}
.splash-divider {
    width: 80px; height: 2px; background: #E8913A;
    margin: 0 auto 32px; opacity: 0.5;
}
.splash-licensed-label {
    font-size: 11px; letter-spacing: 2px;
    color: rgba(255,255,255,0.35); margin-bottom: 12px;
}
.splash-licensed-logo {
    margin-bottom: 10px; display: none;
}
.splash-licensed-logo img {
    max-height: 50px; max-width: 200px; opacity: 0.85;
}
.splash-business-name {
    font-size: 18px; font-weight: 600;
    color: rgba(255,255,255,0.8); letter-spacing: 1px;
}
.splash-copyright {
    margin-top: 40px; font-size: 10px;
    color: rgba(255,255,255,0.2); line-height: 1.6;
}
.splash-continue {
    margin-top: 32px; font-size: 11px;
    color: rgba(255,255,255,0.25);
    animation: pulse 2s ease-in-out infinite;
}

/* ── Header branding ─────────────────────── */
.header-brand {
    display: flex; align-items: center; justify-content: center;
    gap: 0; flex-wrap: wrap;
}
.header-brand-title {
    color: #E8913A; font-weight: 800; letter-spacing: 3px;
    font-family: Georgia, 'Times New Roman', serif;
}
.header-brand-sep {
    font-weight: 300; font-size: 0.75em; opacity: 0.35;
    margin: 0 10px 0 7px;
}
.header-brand-sub {
    font-weight: 400; font-size: 0.75em; opacity: 0.65;
}
.header-connection {
    font-size: 10px; margin: 2px 0 0;
}

/* ── Settings close section ───────────────── */
.settings-close-section {
    padding-top: 16px; border-top: 1px solid #e0e0e0; margin-top: 20px;
}
.btn-settings-close {
    padding: 10px; font-size: 14px; font-weight: 600;
}

/* ── Auth / PIN ──────────────────────────── */
.auth-molars-brand {
    color: #E8913A; font-weight: 800; letter-spacing: 3px;
    font-family: Georgia, 'Times New Roman', serif;
}
.btn-forgot-pin {
    background: none; border: none; color: #667eea;
    font-size: 12px; cursor: pointer; margin-top: 10px;
    text-decoration: underline;
}
.pin-card-narrow { max-width: 340px; }
.pin-change-warning { color: #e67e22; font-weight: 600; }
.pin-change-fields {
    width: 100%; max-width: 260px; margin: 0 auto;
}
.pin-field-label {
    display: block; font-size: 13px; color: #666;
    margin-bottom: 4px; text-align: left;
}
.pin-input-spaced { margin-bottom: 12px; }

/* ── Email modal extras ──────────────────── */
.textarea-resizable {
    resize: vertical; min-height: 40px;
}
.notice-ready {
    background: #e8f5e9; border-color: #66bb6a;
}

/* ── Supplier/Manufacturer modal ─────────── */
.suppmfg-modal-content {
    max-width: 800px; max-height: 90vh; overflow: hidden;
    display: flex; flex-direction: column;
}
.suppmfg-header {
    background: #5c6bc0; color: white;
}
.suppmfg-header .modal-close-x { color: white; }
.suppmfg-tabs {
    display: flex; border-bottom: 2px solid #e0e0e0;
}
.suppmfg-body {
    flex: 1; overflow-y: auto; padding: 16px;
}
.suppmfg-search-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 12px;
}
.suppmfg-search-input {
    flex: 1; padding: 8px 12px; border: 1px solid #ddd;
    border-radius: 4px; margin-right: 10px;
}
.suppmfg-form-container {
    display: none; background: #f8f9fa; border: 1px solid #e0e0e0;
    border-radius: 6px; padding: 16px; margin-bottom: 14px;
}
.suppmfg-form-title {
    margin: 0 0 12px; font-size: 14px; color: #333;
}
.suppmfg-grid-2col {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.suppmfg-grid-full {
    grid-column: 1 / -1; display: grid;
    grid-template-columns: 1fr 1fr; gap: 10px;
}
.suppmfg-grid-address {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px;
}
.suppmfg-notes-row { margin-top: 10px; }
.suppmfg-online-row {
    margin-top: 12px; display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #f3e5f5; border-radius: 6px;
}
.suppmfg-online-checkbox {
    width: 18px; height: 18px; cursor: pointer;
}
.suppmfg-online-label {
    margin: 0; font-weight: 600; font-size: 13px;
    cursor: pointer; color: #6a1b9a;
}
.suppmfg-online-hint {
    color: #999; font-size: 11px; margin-left: auto;
}
.suppmfg-form-actions {
    display: flex; gap: 8px; margin-top: 12px;
}

/* Reference modals (Dept, Price History) — compact overlays */
.ref-modal-compact {
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ref-modal-list {
    flex: 1;
    overflow-y: auto;
    max-height: 50vh;
}

.ref-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.ref-modal-row:last-child {
    border-bottom: none;
}

.ref-modal-row:hover {
    background: #f8f9fa;
}

.ref-modal-row-info {
    flex: 1;
    min-width: 0;
}

.ref-modal-price-row {
    padding: 12px;
}

.ref-modal-subtitle {
    padding: 0 0 12px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 8px;
}

.ref-modal-current-price {
    font-size: 1.2em;
    font-weight: 700;
    color: #2e7d32;
    margin-top: 4px;
}

.ref-modal-hint {
    padding: 12px;
    color: #888;
    font-size: 0.85em;
}

/* Override utility (must be last to win cascade over .modal etc.) --- */
.d-none { display: none; }


/* ── Supplier Response Review ──────────────── */
@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}


/* ═══════════════════════════════════════════════════════════════
   ASSET INVENTORY — Phase 8
   ═══════════════════════════════════════════════════════════════ */

/* ── Asset Filters ──────────────────────────── */
.asset-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .asset-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .asset-filters {
        grid-template-columns: 1fr;
    }
}

/* ── Asset Actions Bar ──────────────────────── */
.asset-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.asset-count-badge {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.maintenance-badge {
    font-size: 12px;
    background: #fff3cd;
    color: #856404;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* ── Asset Table Rows ───────────────────────── */
.asset-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

.asset-row:hover {
    background-color: #f0f7ff;
}

/* ── Asset Status Badge ─────────────────────── */
.asset-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    background: var(--status-color, #6c757d);
}

/* Fallback static classes for core statuses (used if CSS var not set) */
.asset-status-in_use { --status-color: #28a745; }
.asset-status-in_storage { --status-color: #007bff; }
.asset-status-out_of_order { --status-color: #fd7e14; }
.asset-status-out_for_repair { --status-color: #dc3545; }
.asset-status-loaner_in_use { --status-color: #6f42c1; }
.asset-status-retired { --status-color: #6c757d; }

/* ── Asset Utility Classes ──────────────────── */
.btn-asset-delete { margin-left: auto; }
.repair-card-meta { font-size: 12px; color: #999; }
.part-item-notes { color: #6c757d; }
.status-log-notes { font-size: 12px; color: #495057; }
.maintenance-badge-overdue { background: #f8d7da; color: #842029; }
.maintenance-badge-upcoming { background: #fff3cd; color: #856404; }

/* ── Asset Detail Overlay ───────────────────── */
.asset-detail-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2500;
    align-items: center;
    justify-content: center;
}

.asset-detail-overlay.active {
    display: flex;
}

.asset-detail-panel {
    background: #fff;
    width: 95%;
    max-width: 900px;
    height: 92vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    overflow: hidden;
}

.asset-detail-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

.asset-detail-back {
    background: none;
    border: none;
    color: #0d6efd;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 6px;
}

.asset-detail-back:hover { text-decoration: underline; }

.asset-detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.asset-detail-title-row h2 {
    margin: 0;
    font-size: 20px;
    color: #1a1a2e;
}

.asset-detail-subtitle {
    font-size: 13px;
    color: #6c757d;
    margin-top: 2px;
}

.asset-detail-header-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.asset-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.asset-detail-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.asset-detail-section:last-child {
    border-bottom: none;
}

.asset-detail-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Photo Gallery ──────────────────────────── */
.asset-photo-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    min-height: 60px;
}

.asset-photo-card {
    position: relative;
    flex-shrink: 0;
    width: 140px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    cursor: pointer;
    background: #f8f9fa;
}

.asset-photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-photo-card-label {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    text-align: center;
}

.asset-photo-delete {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(220,53,69,0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px; height: 22px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.asset-photo-card:hover .asset-photo-delete {
    display: flex;
}

.asset-photo-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.asset-photo-empty {
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* ── Photo Fullscreen Viewer ────────────────── */
.asset-photo-viewer {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.asset-photo-viewer.active {
    display: flex;
}

.asset-photo-viewer img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.asset-photo-viewer-close {
    position: absolute;
    top: 16px; right: 20px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Info Grid ──────────────────────────────── */
.asset-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.asset-info-item {
    font-size: 13px;
}

.asset-info-label {
    color: #6c757d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.asset-info-value {
    color: #1a1a2e;
    font-weight: 500;
}

@media (max-width: 600px) {
    .asset-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Inline Forms ───────────────────────────── */
.asset-inline-form {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 14px;
    margin-top: 10px;
}

.asset-inline-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ── Warranty Display ───────────────────────── */
.asset-warranty-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
}

.asset-warranty-empty {
    color: #999;
    font-size: 13px;
    font-style: italic;
}

.warranty-expiry-ok { color: #28a745; font-weight: 600; }
.warranty-expiry-soon { color: #fd7e14; font-weight: 600; }
.warranty-expiry-expired { color: #dc3545; font-weight: 600; }

/* ── Maintenance Table ──────────────────────── */
.asset-maint-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.asset-maint-table th {
    text-align: left;
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    padding: 6px 8px;
    border-bottom: 2px solid #dee2e6;
}

.asset-maint-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.maint-due-ok { color: #28a745; }
.maint-due-soon { color: #fd7e14; font-weight: 600; }
.maint-due-overdue { color: #dc3545; font-weight: 600; }

.maint-actions { white-space: nowrap; }
.maint-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
}

/* ── Repair History Cards ───────────────────── */
.repair-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
}

.repair-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.repair-card-vendor {
    font-weight: 600;
    color: #1a1a2e;
}

.repair-status-out {
    color: #dc3545;
    font-size: 12px;
    font-weight: 600;
}

.repair-status-returned {
    color: #28a745;
    font-size: 12px;
    font-weight: 600;
}

.repair-status-cancelled {
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
}

.repair-card-body {
    font-size: 13px;
    color: #495057;
}

.repair-card-detail {
    margin: 4px 0;
}

.repair-card-sub {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #dee2e6;
    font-size: 12px;
    color: #6c757d;
}

.repair-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.repair-empty {
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* ── Linked Parts ───────────────────────────── */
.parts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.part-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.part-item-name { font-weight: 500; color: #1a1a2e; }
.part-item-type { font-size: 11px; color: #6c757d; text-transform: capitalize; }

.part-delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 14px;
}

.parts-empty {
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* ── Status Log Timeline ────────────────────── */
.status-log-timeline {
    position: relative;
    padding-left: 20px;
}

.status-log-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #dee2e6;
}

.status-log-entry {
    position: relative;
    margin-bottom: 12px;
    font-size: 13px;
}

.status-log-entry::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6c757d;
    border: 2px solid #fff;
}

.status-log-date {
    font-size: 11px;
    color: #6c757d;
}

.status-log-change {
    color: #1a1a2e;
}

.status-log-user {
    font-size: 11px;
    color: #999;
}

.status-log-empty {
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* ── Responsive Detail View ─────────────────── */
@media (max-width: 768px) {
    .asset-detail-panel {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    .asset-warranty-grid {
        grid-template-columns: 1fr;
    }
}


/* ═══════════════════════════════════════════════════════════════
   ASSET QR SCANNER & LABELS — Phase 8, Step 6
   ═══════════════════════════════════════════════════════════════ */

/* ── QR Scanner Overlay ─────────────────────── */
.asset-qr-scanner-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    z-index: 9000;
    flex-direction: column;
}

.asset-qr-scanner-overlay.active {
    display: flex;
}

.asset-qr-scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 16px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    flex-shrink: 0;
}

.asset-qr-scanner-label {
    font-size: 16px;
    font-weight: 600;
}

.asset-qr-scanner-status {
    font-size: 13px;
    color: #adb5bd;
    margin-top: 2px;
}

.asset-qr-scanner-close {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    font-size: 22px;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-qr-scanner-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-qr-scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── QR Viewfinder (square) ─────────────────── */
.asset-qr-viewfinder {
    position: absolute;
    width: 250px; height: 250px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
}

.asset-qr-viewfinder-label {
    position: absolute;
    bottom: -30px;
    left: 0; right: 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.asset-qr-corner {
    position: absolute;
    width: 24px; height: 24px;
    border-color: #0d6efd;
    border-style: solid;
    border-width: 0;
}

.asset-qr-corner-tl { top: -2px; left: -2px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 12px; }
.asset-qr-corner-tr { top: -2px; right: -2px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 12px; }
.asset-qr-corner-bl { bottom: -2px; left: -2px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 12px; }
.asset-qr-corner-br { bottom: -2px; right: -2px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 12px; }

/* ── QR Scanner Footer ──────────────────────── */
.asset-qr-scanner-footer {
    padding: 12px 16px;
    background: rgba(0,0,0,0.8);
    flex-shrink: 0;
}

.asset-qr-manual-row {
    display: flex;
    gap: 8px;
}

.asset-qr-manual-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #495057;
    background: #212529;
    color: #fff;
    font-size: 14px;
}

.asset-qr-manual-input::placeholder { color: #6c757d; }

.asset-qr-manual-submit {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: #0d6efd;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* ── QR Label Styles ────────────────────────── */
.qr-label-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px dashed #adb5bd;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #fff;
    max-width: 400px;
}

.qr-label-qr {
    flex-shrink: 0;
}

.qr-label-qr canvas,
.qr-label-qr img {
    display: block;
}

.qr-label-info {
    font-size: 13px;
    line-height: 1.4;
}

.qr-label-name {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a2e;
}

.qr-label-serial {
    color: #495057;
}

.qr-label-id {
    font-family: monospace;
    font-size: 11px;
    color: #6c757d;
}

/* ── Batch Print Grid ───────────────────────── */
.qr-batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
}

.qr-batch-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qr-batch-checkbox {
    flex-shrink: 0;
}

.qr-batch-count {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 12px;
}

.qr-print-hint {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f7ff;
    border-radius: 8px;
    font-size: 12px;
    color: #495057;
    line-height: 1.6;
}

/* ── Print Styles ───────────────────────────── */
@media print {
    /* Hide everything except labels */
    body > *:not(#assetQRPrintModal) { display: none !important; }
    #assetQRPrintModal { position: static !important; display: block !important; background: none !important; }
    #assetQRPrintModal .edit-modal-header,
    #assetQRPrintModal .button-group { display: none !important; }
    #assetQRPrintModal .edit-modal-content {
        box-shadow: none !important;
        max-height: none !important;
        max-width: none !important;
        width: 100% !important;
    }

    .qr-label-preview {
        border: 1px solid #ccc;
        break-inside: avoid;
        page-break-inside: avoid;
        margin: 4mm;
        padding: 3mm;
    }

    .qr-batch-checkbox { display: none !important; }
    .qr-batch-grid {
        max-height: none;
        overflow: visible;
    }
}


/* ═══════════════════════════════════════════════════════════════
   MAINTENANCE ALERTS & EMAIL REMINDERS — Phase 8, Step 7
   ═══════════════════════════════════════════════════════════════ */

/* ── Checkbox Label in Form ─────────────────── */
.maint-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #495057;
}

.maint-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── Email Indicator in Maintenance Table ───── */
.maint-email-on {
    color: #28a745;
    font-size: 13px;
    cursor: help;
}

.maint-email-off {
    color: #adb5bd;
    font-size: 13px;
    cursor: help;
}

/* ── Send Reminders Button ──────────────────── */
.maint-send-btn {
    margin-left: auto;
}

.maint-dashboard-send-btn {
    float: right;
    font-size: 12px;
}

/* ── Maintenance Dashboard Cards ────────────── */
.maint-dashboard-empty {
    color: #28a745;
    font-size: 14px;
    padding: 16px;
    text-align: center;
}

.maint-dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.maint-alert-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.maint-alert-card:hover {
    background: #f0f7ff;
}

.maint-alert-card-overdue {
    border-left: 4px solid #dc3545;
}

.maint-alert-card-soon {
    border-left: 4px solid #fd7e14;
}

.maint-alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

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

.maint-alert-asset {
    font-weight: 600;
    color: #1a1a2e;
}

.maint-alert-desc {
    color: #6c757d;
    font-size: 12px;
}

.maint-alert-due {
    flex-shrink: 0;
    text-align: right;
    font-size: 12px;
}

.maint-alert-due-overdue {
    color: #dc3545;
    font-weight: 600;
}

.maint-alert-due-soon {
    color: #fd7e14;
    font-weight: 600;
}

.maint-alert-email-tag {
    font-size: 11px;
    color: #6c757d;
}

.maint-reminder-status {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
}

.maint-reminder-success {
    background: #d1e7dd;
    color: #0f5132;
}

.maint-reminder-none {
    background: #f8f9fa;
    color: #6c757d;
}


/* ═══════════════════════════════════════════════════════════════
   ASSET CATEGORY & STATUS MANAGERS
   ═══════════════════════════════════════════════════════════════ */

.mgr-body {
    padding: 4px 0;
}

.modal-content-sm {
    max-width: 520px;
}

.modal-content-md {
    max-width: 680px;
}

.mgr-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mgr-add-input {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
}

.mgr-add-input-sm {
    flex: 1;
    min-width: 100px;
}

.mgr-add-input-xs {
    flex: 0 0 50px;
    min-width: 50px;
    text-align: center;
}

.mgr-color-input {
    width: 36px;
    height: 34px;
    padding: 2px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}

.mgr-list {
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mgr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    transition: background 0.15s;
}

.mgr-item:hover {
    background: #f8f9fa;
}

.mgr-item-name {
    flex: 1;
    font-weight: 500;
    color: #1a1a2e;
}

.mgr-item-count {
    font-size: 11px;
    color: #6c757d;
}

.mgr-item-key {
    font-size: 11px;
    font-family: monospace;
    color: #888;
    font-weight: 400;
}

.mgr-item-system {
    font-size: 10px;
    color: #fff;
    background: #6c757d;
    padding: 1px 6px;
    border-radius: 8px;
}

.mgr-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--status-color, #6c757d);
}

.mgr-item-actions {
    display: flex;
    gap: 4px;
}

.mgr-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
}

.mgr-item-actions button:hover {
    background: #e9ecef;
}

.mgr-empty {
    color: #999;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Inline rename input */
.mgr-rename-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #0d6efd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

/* ═══ ASSET REPORTS ═══ */
.report-tabs {
    display: flex;
    gap: 6px;
    padding: 0 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.report-tab {
    padding: 7px 14px;
    border: 1.5px solid #ddd;
    background: #fff;
    color: #495057;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s ease;
}

.report-tab:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
    background: #f0f2ff;
}

.report-tab.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.report-content {
    padding: 0 20px 10px;
    overflow-y: auto;
    max-height: 55vh;
    flex: 1;
}

.report-loading {
    text-align: center;
    color: #6c757d;
    padding: 40px;
    font-style: italic;
}

.report-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.report-summary-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.report-summary-value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}

.report-summary-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.report-table th {
    background: #f0f2ff;
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    color: #333;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
}

.report-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
}

.report-table tr:hover {
    background: #f8f9ff;
}

.report-table .text-right {
    text-align: right;
}

.report-table .total-row td {
    font-weight: 700;
    border-top: 2px solid #333;
    background: #f0f2ff;
}

.report-bar {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
    min-width: 60px;
}

.report-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.report-bar-green { background: #28a745; }
.report-bar-amber { background: #fd7e14; }
.report-bar-red { background: #dc3545; }

.report-status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
}

/* ═══ BULK EDIT SPREADSHEET ═══ */
.bulk-edit-hint {
    padding: 6px 20px 10px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.bulk-edit-table-wrap {
    overflow: auto;
    max-height: 55vh;
    margin: 0 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    flex: 1;
}

.bulk-edit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.bulk-edit-table thead th {
    background: #f0f2ff;
    padding: 7px 6px;
    font-weight: 700;
    font-size: 11px;
    color: #333;
    border-bottom: 2px solid #ccc;
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    white-space: nowrap;
}

.bulk-edit-table thead th.be-sortable {
    cursor: pointer;
    user-select: none;
}

.bulk-edit-table thead th.be-sortable:hover {
    background: #e0e4ff;
}

.be-sort-arrow,
.ba-sort-arrow {
    font-size: 10px;
    color: #4a5abb;
}

/* Bulk Add read-only cells */
.ba-readonly {
    padding: 5px 6px;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.ba-price {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ba-qty-input {
    width: 56px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ba-qty-input:focus {
    border-color: #4a5abb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 90, 187, 0.2);
}

.ba-qty-active {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.ba-row-active {
    background: #f1f8f1;
}

.be-col-qty {
    width: 60px;
    text-align: center;
}

.bulk-edit-table td {
    padding: 2px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #f0f0f0;
    vertical-align: top;
}

.bulk-edit-table td:last-child {
    border-right: none;
}

.bulk-edit-table input,
.bulk-edit-table select {
    width: 100%;
    padding: 4px 5px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 12px;
    font-family: inherit;
    background: transparent;
    box-sizing: border-box;
}

.bulk-edit-table input:focus,
.bulk-edit-table select:focus {
    border-color: #667eea;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.bulk-edit-table input.be-changed,
.bulk-edit-table select.be-changed {
    background: #fff9e6;
    border-color: #ffc107;
}

.bulk-edit-table tr:hover {
    background: #f8f9ff;
}

.be-col-dept { width: 110px; }
.be-col-item { width: 200px; }
.be-col-mfg { width: 110px; }
.be-col-sup { width: 110px; }
.be-col-ref { width: 100px; }
.be-col-sm { width: 60px; }
.be-col-type { width: 80px; }

.bulk-edit-status {
    padding: 6px 20px;
    font-size: 12px;
    min-height: 20px;
}

.bulk-edit-status.be-saving {
    color: #667eea;
    font-weight: 600;
}

.bulk-edit-status.be-done {
    color: #28a745;
    font-weight: 600;
}

.bulk-edit-status.be-error {
    color: #dc3545;
    font-weight: 600;
}

@media (max-width: 768px) {
    .bulk-edit-table-wrap {
        max-height: 45vh;
    }
    .be-col-item { width: 150px; }
}

/* ═══ BULK IMPORT ═══ */
.bulk-import-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bulk-import-panel {
    margin-top: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.bulk-import-instructions {
    margin-bottom: 12px;
    font-size: 13px;
    color: #555;
}

.bulk-import-instructions em {
    color: #c62828;
    font-style: normal;
    font-weight: 600;
}

.bulk-import-file-row {
    margin-bottom: 12px;
}

.bulk-import-file-row input[type="file"] {
    font-size: 13px;
}

.bulk-import-summary {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.bulk-import-summary.bi-ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.bulk-import-summary.bi-warn {
    background: #fff3e0;
    color: #e65100;
}

.bulk-import-summary.bi-error {
    background: #ffebee;
    color: #c62828;
}

.bulk-import-table-wrap {
    max-height: 400px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
}

.bulk-import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.bulk-import-table th {
    background: #f0f0f0;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #ccc;
    white-space: nowrap;
}

.bulk-import-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #eee;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bulk-import-table tr.bi-row-ok {
    background: white;
}

.bulk-import-table tr.bi-row-dup {
    background: #fff8e1;
}

.bulk-import-table tr.bi-row-warn {
    background: #fff8e1;
}

.bulk-import-table tr.bi-row-err {
    background: #ffebee;
}

.bulk-import-table tr.bi-row-skip {
    background: #f5f5f5;
    opacity: 0.6;
    text-decoration: line-through;
}

.bulk-import-table .bi-status-cell {
    white-space: nowrap;
    font-weight: 600;
    font-size: 11px;
}

.bi-text-ok { color: #2e7d32; }
.bi-text-warn { color: #e65100; }
.bi-text-err { color: #c62828; }

.bi-dup-actions {
    display: flex;
    gap: 4px;
}

.bi-dup-actions button {
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
    font-weight: 600;
}

.bi-dup-actions button.bi-btn-import {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

.bi-dup-actions button.bi-btn-skip {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffcc80;
}

.bi-dup-actions button.bi-btn-active {
    outline: 2px solid #1565c0;
    outline-offset: 1px;
}

.bulk-import-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.bulk-import-progress {
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
}

/* ═══ AUDIT LOG ═══ */
.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 12px;
    align-items: center;
}

.audit-filters select,
.audit-filters input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
}

.audit-filters select { min-width: 110px; }
.audit-filters input[type="text"] { min-width: 140px; }
.audit-filters input[type="date"] { min-width: 120px; }

.audit-result-count {
    font-size: 12px;
    color: #6c757d;
    margin-left: auto;
}

.audit-log-content {
    overflow-y: auto;
    max-height: 55vh;
    padding: 0 12px;
    flex: 1;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: fixed;
}

.audit-table thead th {
    background: #f0f2ff;
    padding: 7px 6px;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #333;
    border-bottom: 2px solid #ccc;
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    white-space: nowrap;
}

.audit-table td {
    padding: 5px 6px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: break-word;
}

.audit-table tr:hover {
    background: #f8f9ff;
}

.audit-col-time { white-space: nowrap; }
.audit-col-table { white-space: nowrap; }
.audit-col-action { white-space: nowrap; }
.audit-col-record { white-space: nowrap; }
.audit-col-user { max-width: 120px; word-break: break-all; }
.audit-col-changes { }

/* Keep first 4 columns tight, let User wrap, Changes expand */
.audit-table td:nth-child(-n+4) { white-space: nowrap; }
.audit-table td:nth-child(5) { max-width: 120px; word-break: break-all; }

.audit-action-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.audit-action-insert { background: #28a745; }
.audit-action-update { background: #667eea; }
.audit-action-delete { background: #dc3545; }

.audit-changes {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 10px;
    line-height: 1.4;
}

.audit-change-field {
    color: #667eea;
    font-weight: 600;
}

.audit-change-old {
    color: #dc3545;
    text-decoration: line-through;
}

.audit-change-new {
    color: #28a745;
    font-weight: 600;
}

.audit-table-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    background: #e9ecef;
    color: #495057;
}

@media (max-width: 768px) {
    .audit-filters { flex-direction: column; }
    .audit-log-content { max-height: 45vh; }
    .audit-col-user { max-width: 80px; }
}

/* ═══ ANALYTICS DASHBOARD ═══ */
.analytics-period-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.analytics-period-bar label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.analytics-period-bar select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
}

.analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.analytics-card {
    background: #fff;
    border: 1px solid #e2e6f0;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.analytics-card-value {
    font-size: 22px;
    font-weight: 800;
    color: #333;
    line-height: 1.2;
}

.analytics-card-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.analytics-card-sub {
    font-size: 11px;
    color: #667eea;
    margin-top: 2px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.analytics-panel {
    background: #fff;
    border: 1px solid #e2e6f0;
    border-radius: 10px;
    padding: 16px;
}

.analytics-panel-wide {
    grid-column: 1 / -1;
}

.analytics-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px 0;
}

.analytics-item-picker {
    margin-bottom: 10px;
}

.analytics-item-picker select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
}

.price-alerts-list {
    max-height: 250px;
    overflow-y: auto;
}

.price-alert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}

.price-alert-row:last-child {
    border-bottom: none;
}

.price-alert-item {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.price-alert-change {
    font-weight: 700;
    color: #dc3545;
    white-space: nowrap;
}

.price-alert-change.decrease {
    color: #28a745;
}

.price-alert-date {
    color: #888;
    font-size: 11px;
    white-space: nowrap;
}

.price-alert-supplier {
    color: #667eea;
    font-size: 11px;
}

.analytics-empty {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 13px;
}

.analytics-panel-desc {
    font-size: 12px;
    color: #888;
    margin: -4px 0 12px;
}

.analytics-threshold-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.analytics-threshold-bar select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.analytics-table-scroll {
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.analytics-table th {
    background: #f8f9fa;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.analytics-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.analytics-table tbody tr:hover {
    background: #f8f9fa;
}

.analytics-cell-item {
    max-width: 250px;
}

.analytics-row-critical {
    background: #fff5f5;
}

.analytics-row-critical:hover {
    background: #ffe8e8 !important;
}

.analytics-row-warning {
    background: #fffbf0;
}

.analytics-row-warning:hover {
    background: #fff5e0 !important;
}

.analytics-forecast-summary {
    padding: 10px 12px;
    background: #f0f2ff;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #333;
}

.text-warning-dark {
    color: #e68a00;
}

@media (max-width: 768px) {
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ CART TOTAL BAR ═══ */
.cart-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    margin-top: 8px;
    background: #f0f2ff;
    border-radius: 8px;
    border: 1px solid #d4d9f7;
}

.cart-total-label {
    font-size: 13px;
    color: #555;
    font-weight: 600;
}

.cart-total-value {
    font-size: 16px;
    font-weight: 800;
    color: #333;
}
