/* ===== CSS Variables - Dark/Light Theme ===== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --bg-card: #111111;
    --accent-primary: #525252;
    --accent-secondary: #737373;
    --accent-gradient: linear-gradient(135deg, #404040 0%, #737373 100%);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: rgba(82, 82, 82, 0.3);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-glow: 0 0 20px rgba(115, 115, 115, 0.2);
    --shadow: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
    --radius: 8px;
    --radius-lg: 12px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-height: 56px;
    --nav-height: 64px;
}

/* Light Mode Theme */
[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e5e5e5;
    --bg-card: #fafafa;
    --accent-primary: #525252;
    --accent-secondary: #737373;
    --accent-gradient: linear-gradient(135deg, #525252 0%, #737373 100%);
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --border-color: rgba(82, 82, 82, 0.15);
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow-glow: 0 0 20px rgba(115, 115, 115, 0.15);
    --shadow: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== Reset & Base ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

/* ===== App Layout ===== */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ===== Header ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + var(--safe-top));
    padding-top: var(--safe-top);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 16px;
    z-index: 100;
    box-shadow: var(--shadow);
}

.app-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.icon-btn:active {
    background: var(--bg-tertiary);
}

.theme-toggle {
    font-size: 1.1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(180deg);
}

.scan-btn {
    background: var(--bg-tertiary);
}

/* ===== Main Content ===== */
#main-content {
    flex: 1;
    padding-top: calc(var(--header-height) + var(--safe-top));
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Views ===== */
.view {
    display: none;
    padding: 16px;
    min-height: 100%;
    animation: fadeIn 0.2s ease;
}

.view.active {
    display: block;
}

.view.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    z-index: 200;
    background: var(--bg-primary);
}

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

/* ===== Dashboard ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card.alert {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

.stat-card.warning {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-secondary);
}

.stat-card.alert .stat-number { color: var(--warning); }
.stat-card.warning .stat-number { color: var(--danger); }

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-actions h2,
.recent-activity h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card:active {
    transform: scale(0.98);
    box-shadow: none;
}

.action-icon {
    font-size: 1.75rem;
    background: var(--bg-tertiary);
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.activity-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow);
}

/* ===== Lists ===== */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background 0.2s;
}

.item-card:active {
    background: var(--bg-tertiary);
}

.item-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--bg-tertiary);
}

.item-image-placeholder {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

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

.item-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.item-meta {
    text-align: right;
}

.item-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* ===== Search & Filter ===== */
.search-bar,
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-bar input,
.filter-bar select {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
}

.search-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

.input-with-btn button {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-primary);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-control input {
    text-align: center;
    font-weight: 600;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--accent-primary);
    color: var(--text-primary);
    font-size: 1.25rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.qty-btn:active {
    background: var(--accent-secondary);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-primary);
}

.btn-primary:active {
    background: var(--accent-secondary);
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:active {
    background: var(--bg-card);
}

.full-width {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions.sticky {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    padding: 16px;
    margin: 0 -16px -16px;
}

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px + var(--safe-bottom));
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: var(--text-primary);
    border: none;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:active {
    background: var(--accent-secondary);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: var(--text-primary);
}

.alert-list {
    display: none;
}

.alert-list.active {
    display: block;
}

.alert-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg-tertiary);
}

.alert-low .alert-icon { background: rgba(245, 158, 11, 0.2); }
.alert-over .alert-icon { background: rgba(239, 68, 68, 0.2); }

.alert-details {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    color: var(--text-primary);
}

.alert-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.alert-action {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--danger);
}

/* ===== Scanner ===== */
.scanner-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-region {
    width: 280px;
    height: 180px;
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius);
    box-shadow: 0 0 0 100vmax rgba(0,0,0,0.7);
}

.scan-instruction {
    margin-top: 20px;
    color: var(--text-primary);
    font-size: 0.875rem;
    background: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 20px;
}

.scanner-close {
    position: absolute;
    top: calc(16px + var(--safe-top));
    right: 16px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0,0,0,0.6);
    color: var(--text-primary);
    font-size: 1.25rem;
    border-radius: 50%;
    cursor: pointer;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 300;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 16px calc(20px + var(--safe-bottom));
    animation: slideUp 0.3s ease;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    margin: 12px 0;
}

.search-result-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-primary);
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--bg-tertiary);
}

/* ===== Transfer Form ===== */
.transfer-form h3 {
    margin: 24px 0 12px;
    font-size: 1rem;
    color: var(--text-primary);
}

.transfer-items {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
}

.transfer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.transfer-item-info {
    flex: 1;
}

.transfer-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.transfer-item-qty {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.remove-item-btn {
    padding: 8px;
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.25rem;
    cursor: pointer;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 100;
}

.nav-item {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--accent-secondary);
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-label {
    font-size: 0.625rem;
    font-weight: 500;
}

/* ===== Toast Notifications ===== */
#toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top) + 8px);
    left: 16px;
    right: 16px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: toastSlide 0.3s ease;
    pointer-events: auto;
}

.toast.success { 
    background: rgba(34, 197, 94, 0.15); 
    border-color: var(--success);
    color: var(--success);
}
.toast.error { 
    background: rgba(239, 68, 68, 0.15); 
    border-color: var(--danger);
    color: var(--danger);
}
.toast.warning { 
    background: rgba(245, 158, 11, 0.15); 
    border-color: var(--warning);
    color: var(--warning);
}

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

/* ===== Loading ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10,10,10,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

[data-theme="light"] .loading-overlay {
    background: rgba(245,245,245,0.8);
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ===== Product Detail ===== */
.product-preview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.product-preview img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--bg-tertiary);
}

.product-preview-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.product-preview-info p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.stock-locations {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.stock-location-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.stock-location-item:last-child {
    border-bottom: none;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
    #app {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: var(--shadow-lg);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    #main-content {
        padding-left: 24px;
        padding-right: 24px;
    }
    
    .view {
        padding: 24px;
    }
}

/* ===== Navigation Dropdown ===== */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-dropdown-toggle .dropdown-arrow {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-dropdown.open .nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin: 0 0 8px 44px;
}

.nav-dropdown.open .nav-dropdown-menu {
    max-height: 300px;
}

.nav-dropdown-menu li {
    padding: 0;
}

.nav-dropdown-menu .nav-link {
    padding: 10px 16px;
    font-size: 0.875rem;
}

/* ===== Navigation Drawer ===== */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.header-content h1 {
    flex: 1;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.nav-drawer.open {
    transform: translateX(0);
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(16px + var(--safe-top)) 16px 16px;
    border-bottom: 1px solid var(--border-color);
}

.nav-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-list {
    list-style: none;
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-list li {
    padding: 0 16px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px;
    padding: 0 !important;
}

/* Nav Drawer Backdrop */
.nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* ===== Icon Styles ===== */
.icon-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.action-icon .icon-svg {
    width: 24px;
    height: 24px;
}

/* ===== Activity Items ===== */
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: var(--text-primary);
}

.activity-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ===== Report Cards ===== */
.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-card:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.report-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-icon .icon-svg {
    width: 24px;
    height: 24px;
}

.report-title {
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Location Inventory ===== */
.location-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.location-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Count Inventory Button ===== */
.btn-count-inventory {
    width: 100%;
    padding: 24px 32px;
    margin-bottom: 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s ease;
}

.btn-count-inventory:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(115, 115, 115, 0.4);
}

.btn-count-inventory:active {
    transform: translateY(0) scale(0.98);
}

/* ===== Number Pad ===== */
.number-pad {
    user-select: none;
}

.numpad-btn {
    width: 100%;
    aspect-ratio: 1;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
}

.numpad-btn:active {
    background: var(--accent-primary);
    transform: scale(0.95);
}

/* ===== Count Input ===== */
#count-input {
    -moz-appearance: textfield;
}

#count-input::-webkit-outer-spin-button,
#count-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#count-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(115, 115, 115, 0.2);
}

/* ===== Count Navigation Buttons ===== */
.count-nav-btn {
    min-width: 120px;
    min-height: 64px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.count-nav-btn .icon-svg {
    width: 24px;
    height: 24px;
}

.count-nav-btn span {
    font-size: 0.875rem;
}

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

@media (max-width: 400px) {
    .count-nav-btn {
        min-width: 100px;
        min-height: 72px;
        padding: 12px 16px;
    }
}

/* ===== Settings ===== */
.settings-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

/* ===== Print Styles ===== */
@media print {
    .app-header,
    .bottom-nav,
    .fab,
    .icon-btn,
    .theme-toggle,
    .nav-drawer {
        display: none;
    }
    
    #main-content {
        padding: 0;
    }
}
