/* Watch Inventory Management System - Main Styles */
/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #111111;
    --primary-dark: #000000;
    --primary-light: #555555;
    --secondary-color: #555555;
    --success-color: #111111;
    --warning-color: #555555;
    --danger-color: #111111;
    --bg-color: #FFFFFF;
    --surface-color: #FFFFFF;
    --border-color: #E5E5E5;
    --text-primary: #111111;
    --text-secondary: #555555;
    --hover-bg: rgba(0, 0, 0, 0.05);
    --active-bg: rgba(0, 0, 0, 0.1);
    --focus-outline: #111111;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --error-red: #DC2626;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-color);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: #FAFAFA;
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-header .logo {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto 10px;
}

.sidebar-header .user-info {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    margin: 2px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.nav-link-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.nav-link-icon svg {
    width: 18px;
    height: 18px;
}

.nav-section-title {
    padding: 20px 20px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    max-width: 1800px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

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

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

.kpi-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
}

.kpi-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.kpi-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.kpi-card-change {
    font-size: 12px;
    color: var(--text-secondary);
}

.kpi-card-change.positive {
    color: var(--primary-color);
}

.kpi-card-change.negative {
    color: var(--primary-color);
}

.kpi-card.warning {
    border-left: 4px solid var(--secondary-color);
}

.kpi-card.danger {
    border-left: 4px solid var(--primary-color);
}

/* Cards */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: #FAFAFA;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
}

.form-label.required::after {
    content: " *";
    color: var(--primary-color);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: #FAFAFA;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-error {
    color: var(--error-red);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--error-red);
    box-shadow: 0 0 0 1px var(--error-red);
}

.form-help {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.input-group {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: #FFFFFF;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-primary:active:not(:disabled) {
    background: var(--primary-dark);
}

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

.btn-secondary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.btn-secondary:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: var(--primary-color);
    color: #FFFFFF;
    border: none;
}

.btn-success:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-success:active:not(:disabled) {
    background: var(--primary-dark);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.btn-danger:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

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

.btn-outline:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

.btn-outline:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Icon-only button */
.btn-icon {
    padding: 6px;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon.btn-sm {
    padding: 4px;
    min-width: 28px;
    height: 28px;
}

.btn-icon.btn-sm svg {
    width: 14px;
    height: 14px;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
}

.table thead {
    background: #FAFAFA;
    border-bottom: 2px solid var(--border-color);
}

.table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.table th.sortable {
    cursor: pointer;
    user-select: none;
}

.table th.sortable:hover {
    background: var(--border-color);
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

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

.table-actions {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.badge-success {
    background: #F5F5F5;
    color: var(--primary-color);
}

.badge-warning {
    background: #F5F5F5;
    color: var(--secondary-color);
}

.badge-danger {
    background: #F5F5F5;
    color: var(--primary-color);
}

.badge-info {
    background: var(--primary-color);
    color: #FFFFFF;
}

.badge-secondary {
    background: #F5F5F5;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

/* Filter Bar */
.filter-bar {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: #FFFFFF;
    border-radius: 16px;
    font-size: 12px;
}

.filter-chip-remove {
    cursor: pointer;
    margin-left: 4px;
    font-weight: bold;
}

/* Modal - Overlay style (used by modal.js) */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

/* Modal - Direct style (used by inline modals) */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal content container */
.modal-overlay .modal,
.modal .modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Reset for nested modal inside overlay */
.modal-overlay .modal {
    display: block;
    position: static;
    inset: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #FAFAFA;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Modal sizes */
.modal-small {
    max-width: 400px;
}

.modal-medium {
    max-width: 550px;
}

.modal-large {
    max-width: 700px;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    min-width: 300px;
    padding: 15px 20px;
    background: var(--surface-color);
    border-left: 4px solid;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left-color: var(--primary-color);
}

.notification.error {
    border-left-color: var(--primary-color);
}

.notification.warning {
    border-left-color: var(--secondary-color);
}

.notification.info {
    border-left-color: var(--primary-color);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 0;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

/* QR Scanner */
.qr-scanner-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.qr-scanner-video {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
}

.qr-scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed var(--text-primary);
    border-radius: var(--radius);
    pointer-events: none;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.quick-action-btn {
    padding: 20px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.quick-action-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--text-primary);
}

.quick-action-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.quick-action-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.quick-action-label {
    font-weight: 500;
    font-size: 14px;
}

/* Utilities */
.text-center {
    text-align: center;
}

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

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.mt-3 {
    margin-top: 30px;
}

.mb-1 {
    margin-bottom: 10px;
}

.mb-2 {
    margin-bottom: 20px;
}

.mb-3 {
    margin-bottom: 30px;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

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

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 {
    gap: 10px;
}

.gap-2 {
    gap: 20px;
}

/* Print Styles */
@media print {
    .sidebar,
    .page-header,
    .filter-bar,
    .btn,
    .notification-container {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .card {
        border: none;
        box-shadow: none;
    }
}

/* ========================================
   ALERT CENTER
   ======================================== */

.alert-center {
    position: relative;
    margin-bottom: 10px;
}

.alert-bell {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
}

.alert-bell:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.alert-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary-color);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.alert-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 320px;
    max-height: 400px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.alert-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.alert-mark-all {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

.alert-mark-all:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.alert-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.alert-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

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

.alert-item-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

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

.alert-item-message {
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.alert-item-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.alert-dismiss {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

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

/* Severity-based left border */
.alert-item.alert-critical {
    border-left: 3px solid var(--primary-color);
}

.alert-item.alert-warning {
    border-left: 3px solid var(--secondary-color);
}

.alert-item.alert-info {
    border-left: 3px solid var(--primary-color);
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

/* Hamburger trigger - hidden on desktop, shown via JS on mobile */
.mobile-nav-trigger {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 150;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    line-height: 0;
}

.mobile-nav-trigger svg {
    width: 20px;
    height: 20px;
}

.mobile-nav-trigger:active {
    background: var(--hover-bg);
}

/* Backdrop overlay */
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    /* === Viewport overflow prevention === */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .app-container {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* === EXISTING (Phase 30): Sidebar & Navigation === */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-top: 60px;
        overflow-x: hidden;
        max-width: 100vw;
        width: 100%;
    }

    .mobile-nav-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* === Content Layout === */
    .page-header {
        margin-bottom: 15px;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .page-header p {
        font-size: 13px;
    }

    /* === Card Headers (stacking pattern) === */
    .card-header.flex-between,
    .card-header > .flex-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .card-header .btn-group {
        width: 100%;
    }

    .card {
        max-width: 100%;
        overflow-x: hidden;
    }

    .card-body {
        padding: 15px;
        overflow-x: auto;
    }

    /* === Forms (single-column collapse) === */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .input-group {
        flex-wrap: wrap;
    }

    .form-group {
        margin-bottom: 12px;
    }

    /* === Buttons === */
    .btn-group {
        flex-wrap: wrap;
    }

    .btn-group .btn {
        flex-shrink: 0;
    }

    /* === Tables === */
    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .table th {
        white-space: normal;
    }

    .table-container {
        -webkit-overflow-scrolling: touch;
        max-width: calc(100vw - 30px);
        overflow-x: auto;
    }

    .table .btn-icon {
        min-width: 36px;
        min-height: 36px;
    }

    /* === Tabs (horizontal scroll) === */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        scrollbar-width: thin;
        gap: 0;
    }

    .tab {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: 12px;
    }

    /* === Dashboard Grid === */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-card {
        padding: 15px;
    }

    .kpi-card-value {
        font-size: 24px;
    }

    .kpi-card-label {
        font-size: 12px;
    }

    /* === Quick Actions === */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-action-btn {
        padding: 15px;
    }

    /* === Modals (near full-width) === */
    .modal-overlay .modal,
    .modal .modal-content {
        width: 95% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 20px);
        margin: 10px auto;
    }

    .modal-body {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }

    /* === Notifications === */
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .notification {
        min-width: auto;
        max-width: 100%;
    }

    /* === Filter Bar === */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .filter-bar .form-select,
    .filter-bar .form-input {
        width: 100% !important;
        min-width: auto !important;
    }

    /* === Flex-between utility === */
    .flex-between {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Phone-specific adjustments */
@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .kpi-card-value {
        font-size: 20px;
    }

    .page-header h2 {
        font-size: 18px;
    }

    /* Further reduce table cell padding on phones */
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 11px;
    }

    .table th {
        font-size: 10px;
        letter-spacing: 0;
    }

    /* Hide columns marked as hide-on-mobile */
    .table .hide-on-mobile {
        display: none;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .mobile-nav-backdrop {
        transition: none !important;
    }
}
