/**
 * Copyright 2026 Axiolon Labs
 * SPDX-License-Identifier: LicenseRef-AxCom-1.0
 */

/* ==========================================================================
   AxCom Admin Panel - Master Compiled Stylesheet
   ========================================================================== */

/* --- Module: 00-tokens.css --- */
/* Design Tokens & Theme Variables */
:root {
    /* Brand Primary */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-active: #1e40af;
    --color-primary-light: #eff6ff;
    --color-primary-subtle: rgba(37, 99, 235, 0.12);
    --color-primary-focus: rgba(37, 99, 235, 0.25);

    /* Backgrounds & Surfaces */
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-hover: #f1f5f9;
    --color-surface-active: #e2e8f0;
    --color-border: #e2e8f0;
    --color-border-subtle: #f1f5f9;
    --color-border-hover: #cbd5e1;
    --color-border-focus: #94a3b8;

    /* Sidebar Dark Theme Tokens */
    --sidebar-bg: #0f172a;
    --sidebar-bg-hover: rgba(255, 255, 255, 0.06);
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #f8fafc;
    --sidebar-active-bg: rgba(59, 130, 246, 0.15);
    --sidebar-active-text: #60a5fa;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    --color-text-inverse: #ffffff;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Status: Success */
    --color-success: #16a34a;
    --color-success-bg: #dcfce7;
    --color-success-text: #15803d;
    --color-success-border: #bbf7d0;

    /* Status: Warning */
    --color-warning: #d97706;
    --color-warning-bg: #fef3c7;
    --color-warning-text: #92400e;
    --color-warning-border: #fde68a;

    /* Status: Danger */
    --color-danger: #dc2626;
    --color-danger-bg: #fee2e2;
    --color-danger-text: #991b1b;
    --color-danger-border: #fecaca;

    /* Status: Info / Processing / In-Transit */
    --color-info: #4f46e5;
    --color-info-bg: #e0e7ff;
    --color-info-text: #3730a3;
    --color-info-border: #c7d2fe;

    /* Accent: Discounts */
    --color-discount: #7c3aed;
    --color-discount-bg: #f3e8ff;
    --color-discount-text: #6b21a8;
    --color-discount-border: #d8b4fe;

    /* Ratings */
    --color-star: #f59e0b;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Shapes & Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Elevation Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Z-Index Hierarchy */
    --z-modal: 1000;
    --z-toast: 2000;
}


/* --- Module: 01-base.css --- */
/* Global Resets & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: var(--font-size-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
    line-height: 1.25;
}

code {
    background-color: var(--color-surface-hover);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.825rem;
    color: var(--color-text-muted);
}

.hidden {
    display: none !important;
}


/* --- Module: 02-layout.css --- */
/* Layout & Structural Grid */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 20px 16px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    border-right: 1px solid var(--sidebar-border);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 4px 8px 16px 8px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background-color: var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-inverse);
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-inverse);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease-in-out;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.nav-item:hover {
    background-color: var(--sidebar-bg-hover);
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 90;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navigation Bar */
.top-bar {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-left h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.mobile-menu-btn {
    display: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    cursor: pointer;
    color: var(--color-text);
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.mobile-menu-btn:hover {
    background-color: var(--color-surface-hover);
}

.mobile-menu-btn svg,
.mobile-menu-btn line {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-surface-hover);
    padding: 4px 6px 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.logout-form {
    display: inline;
}

/* Content Area */
.content-area {
    padding: 28px 32px;
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.page-title-section .subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%) !important;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: none !important;
        z-index: 1050 !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3) !important;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 1040;
    }

    .sidebar-backdrop.active {
        display: block !important;
    }

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

    .mobile-menu-btn {
        display: inline-flex !important;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .content-area {
        padding: 20px 16px;
    }
}

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
    }

    .top-bar-right .user-name {
        display: none;
    }
}


/* --- Module: buttons.css --- */
/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
}

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

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

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

.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-surface-hover);
}

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

.btn-danger:hover {
    background-color: var(--color-danger-bg);
    border-color: var(--color-danger);
    color: var(--color-danger-text);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-logout {
    background-color: var(--color-surface);
    color: var(--color-danger);
    border: 1px solid var(--color-border);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
}

.btn-logout:hover {
    background-color: var(--color-danger-bg);
    border-color: var(--color-danger-border);
}


/* --- Module: tables.css --- */
/* Table Components & Utilities */
.table-container {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.table-scrollable {
    max-height: 400px;
    overflow-y: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.admin-table thead {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

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

.admin-table tbody tr:hover {
    background-color: var(--color-bg);
}

.empty-row td {
    text-align: center;
    padding: 32px 16px;
    color: var(--color-text-muted);
}

.empty-state-card {
    text-align: center;
    color: var(--color-text-muted);
    padding: 32px 16px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

/* Quantity / Value Indicators */
.qty-positive {
    color: var(--color-success);
    font-weight: 600;
}

.qty-negative {
    color: var(--color-danger);
    font-weight: 600;
}

.cell-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.cell-meta {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}


/* --- Module: forms.css --- */
/* Form Controls & Inputs */
.search-input,
.status-filter {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background-color: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.search-input {
    width: 240px;
}

.search-input:focus,
.status-filter:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-focus);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background-color: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    transition: all 0.15s ease;
}

.form-group input[disabled],
.form-group textarea[disabled] {
    background-color: var(--color-surface-hover);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.form-row {
    display: grid;
    gap: 12px;
}

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

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .form-row-4 {
        grid-template-columns: 1fr 1fr;
    }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.modal-subtitle {
    margin-bottom: 20px;
    color: var(--color-text-muted);
}

@media (max-width: 640px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }
    .search-input,
    .status-filter {
        width: 100%;
    }
}

/* Inputs outside form-group share the same control treatment. */
.form-control {
    width: 100%; min-width: 0; min-height: 38px;
    padding: 10px 12px; border: 1px solid var(--color-border);
    border-radius: 8px; background: var(--color-surface); color: var(--color-text);
    font: inherit; line-height: 1.5; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-focus); }
.form-control::placeholder { color: var(--color-text-light); }
.form-group input[type="file"] { padding: 8px; font-size: .78rem; }
.form-group input[type="file"]::file-selector-button {
    margin-right: 12px; padding: 7px 10px; border: 1px solid var(--color-border);
    border-radius: 6px; background: var(--color-bg); color: var(--color-text); font: inherit; cursor: pointer;
}


/* --- Module: modals.css --- */
/* ==========================================================================
   AxCom Admin - Modal Dialogs
   ========================================================================== */

body.modal-open {
    overflow: auto;
}

@media (max-width: 640px) {
    body.modal-open {
        overflow: hidden;
    }
}

/* Modal / Drawer Host (Right-to-Left Slide-over Panel) */
.modal-backdrop,
.modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: transparent;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    z-index: 1000;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open,
.modal.open,
.modal:not(.hidden):not([style*="display: none"]) {
    opacity: 1;
    visibility: visible;
    pointer-events: none; /* Allows interacting with underlying pages on desktop */
    display: flex !important;
}

.modal.hidden,
.modal-backdrop.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

/* Drawer Dialog Frame */
.modal-dialog {
    width: 600px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    pointer-events: auto; /* Drawer itself is fully interactive */
}

.modal-content {
    background: var(--color-surface);
    border-radius: 0;
    box-shadow: -8px 0 36px rgba(15, 23, 42, 0.18);
    padding: var(--space-6);
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    overflow-y: auto;
    position: relative;
    border: none;
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-backdrop.open .modal-content,
.modal.open .modal-content,
.modal:not(.hidden) .modal-content {
    transform: translateX(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-subtle);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.modal-subtitle {
    margin-top: var(--space-1);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
    z-index: 10;
}

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

/* Modal Footer / Actions */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-subtle);
}

@media (max-width: 640px) {
    .modal-backdrop.open,
    .modal.open {
        background: rgba(15, 23, 42, 0.6);
        pointer-events: auto; /* Backdrop touch closes on mobile */
    }
    .modal-dialog {
        width: 100%;
        max-width: 100%;
    }
    .modal-content {
        padding: var(--space-4);
        max-height: 100dvh;
    }
}

/* Drawer Navigation & Deep-Linking Components */
.drawer-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    flex-wrap: wrap;
}

.drawer-nav-target {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.drawer-nav-target code {
    background: var(--color-surface);
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--color-border);
    font-size: 0.8rem;
}

.drawer-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0 0 8px 0;
    font-size: var(--font-size-sm);
    transition: color 0.15s ease;
}

.drawer-nav-back:hover {
    color: var(--color-primary);
}

.btn-link {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--color-primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.btn-link:hover {
    color: var(--color-primary-hover);
}

body.confirmation-open { overflow: hidden; }
.confirm-dialog {
    position: fixed; inset: 0; margin: auto; width: calc(100% - 32px); max-width: 440px;
    max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px;
    border: 1px solid var(--color-border); border-radius: 16px;
    background: var(--color-surface); color: var(--color-text);
    box-shadow: 0 24px 80px rgba(18, 24, 38, .25);
}
.confirm-dialog::backdrop { background: rgba(18, 24, 38, .55); backdrop-filter: blur(3px); }
.confirm-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #b53e3e; background: #fdf0ee; margin-bottom: 18px; }
.confirm-icon svg { width: 24px; height: 24px; }
.confirm-dialog h2 { font-size: 1.15rem; letter-spacing: -.02em; }
.confirm-dialog p { font-size: .82rem; color: var(--color-text-muted); line-height: 1.7; margin-top: 12px; overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.btn-destructive { background: #b73535; border-color: #b73535; color: #fff; }
.btn-destructive:hover { background: #972b2b; border-color: #972b2b; }


/* --- Module: badges.css --- */
/* Status Badges & Pills */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.status-pending,
.status-refunding,
.status-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.status-paid,
.status-succeeded,
.status-delivered,
.status-active,
.status-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
}

.status-shipped,
.status-in_transit,
.status-in-transit,
.status-processing {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
}

.status-failed,
.status-refund_failed,
.status-chargedback,
.status-returned,
.status-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.status-refunded,
.status-canceled,
.status-cancelled,
.status-inactive {
    background-color: var(--color-surface-hover);
    color: var(--color-text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.75rem;
    font-weight: 500;
    background-color: var(--color-surface-hover);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}


/* --- Module: alerts.css --- */
/* Alert Banners & Notifications */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-spaced {
    margin-bottom: var(--space-5);
}

.alert-error {
    background-color: var(--color-danger-bg);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger-border);
}

.alert-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}

.alert-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning-border);
}

.alert-info {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
    border: 1px solid var(--color-info-border);
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    margin-left: var(--space-2);
}

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

/* Error Page / Card */
.error-card {
    max-width: 600px;
    margin: var(--space-10) auto;
    text-align: center;
    padding: var(--space-8) var(--space-6);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.error-icon-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-4);
    border-radius: var(--radius-full);
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon-wrap svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.error-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.error-detail-box {
    margin-bottom: var(--space-6);
    font-family: ui-monospace, monospace;
    font-size: var(--font-size-xs);
    background: var(--color-surface-hover);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    word-break: break-word;
}

.error-desc {
    margin-bottom: var(--space-6);
    color: var(--color-text-muted);
}

.error-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}


/* --- Module: toasts.css --- */
/* ==========================================================================
   Toast Notification Styles
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 88px;
    right: var(--space-6);
    z-index: var(--z-toast, 2000);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 420px;
    width: calc(100vw - 32px);
    pointer-events: none;
}

@media (max-width: 640px) {
    .toast-container {
        top: 80px;
        right: var(--space-4);
        left: var(--space-4);
        width: auto;
    }
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    overflow: hidden;
    animation: toast-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.hiding {
    animation: toast-slide-out 0.25s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.toast-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-1);
}

.toast-message {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    line-height: var(--line-height-normal);
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
}

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

.toast-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
}

/* Toast Variants */
.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-card) 100%);
}
.toast-error .toast-icon {
    color: var(--color-danger);
}
.toast-error .toast-title {
    color: var(--color-danger);
}

.toast-success {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, var(--bg-card) 100%);
}
.toast-success .toast-icon {
    color: var(--color-success);
}
.toast-success .toast-title {
    color: var(--color-success);
}

.toast-warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-card) 100%);
}
.toast-warning .toast-icon {
    color: var(--color-warning);
}
.toast-warning .toast-title {
    color: var(--color-warning);
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, var(--bg-card) 100%);
}
.toast-info .toast-icon {
    color: var(--color-info);
}
.toast-info .toast-title {
    color: var(--color-info);
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}


/* --- Module: pagination.css --- */
/* Pagination Component */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}


/* --- Module: stats.css --- */
/* Dashboard Cards & Statistics Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

.dashboard-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dashboard-card-full {
    grid-column: 1 / -1;
}

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

.card-header h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
}

.card-body {
    padding: var(--space-5);
}

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

.stat-item {
    background-color: var(--color-surface-hover);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: var(--space-1);
}

.stat-value-warning {
    color: var(--color-warning);
}

.stat-value-danger {
    color: var(--color-danger);
}

.stat-value-success {
    color: var(--color-success);
}

.stat-value-large {
    font-size: 2rem;
    display: block;
    margin-top: 6px;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

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

.table-header-title {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
}

.table-header-meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

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


/* --- Module: inventory.css --- */
/* ==========================================================================
   Page-Specific: Inventory
   ========================================================================== */

.inventory-alerts-panel {
    margin-bottom: var(--space-5);
    background: var(--color-surface);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.inventory-alerts-title {
    margin-bottom: var(--space-3);
    font-size: var(--font-size-base);
    color: var(--color-warning-text);
    font-weight: 600;
}

.alerts-container {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 2px;
}

.inventory-alerts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.inventory-alerts-toolbar .btn {
    min-height: 28px;
    height: 28px;
    padding: 0 10px;
    font-size: 0.74rem;
    border-radius: var(--radius-sm);
}

.inventory-alert-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-warning, #f59e0b);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inventory-alert-card:hover {
    border-color: var(--color-border-hover);
    border-left-color: #d97706;
    box-shadow: var(--shadow-md);
}

.inventory-alert-card.alert-card-danger {
    background: var(--color-surface);
    border-color: var(--color-border);
    border-left-color: var(--color-danger, #ef4444);
}

.inventory-alert-card.alert-card-danger:hover {
    border-left-color: #dc2626;
}

.alert-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.inventory-alert-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.inventory-alert-product-title {
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.35;
}

.inventory-alert-card .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: normal;
}

.inventory-alert-card.alert-card-warning .status-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.inventory-alert-card.alert-card-danger .status-badge {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.inventory-alert-meta-row {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 2px;
    word-break: break-word;
}

.inventory-alert-meta-row code {
    background: var(--color-surface-hover);
    color: var(--color-text);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    border: 1px solid var(--color-border);
}

.inventory-alert-card small.cell-meta {
    font-size: 0.72rem;
    color: var(--color-text-light);
    margin-top: 1px;
}

.alert-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    flex-shrink: 0;
    margin-left: var(--space-2);
}

.alert-actions .btn {
    min-width: 78px;
    height: 30px;
    min-height: 30px;
    padding: 0 12px;
    font-size: 0.76rem;
    font-weight: 500;
    border-radius: 6px;
    justify-content: center;
    line-height: 1;
}

.inventory-alerts-footer {
    padding-top: var(--space-3);
    text-align: center;
}

.restock-item-preview {
    padding: var(--space-3);
    background: var(--color-surface-hover);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
}

.restock-product-name {
    margin: 0 0 4px 0;
    font-size: var(--font-size-base);
    font-weight: 600;
}

.inventory-alert-empty {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.inventory-inline-form-row {
    background-color: var(--color-surface-hover);
}

.inventory-inline-actions {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
    align-items: center;
    padding: var(--space-4);
}

.inventory-form-group-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.inventory-inline-label {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.inventory-inline-qty {
    width: 90px;
}

.inventory-inline-loc {
    width: 100px;
}

.inventory-inline-delta {
    width: 95px;
}

.inventory-inline-reason {
    width: 160px;
}

.inventory-adjust-divider {
    border-left: 2px solid var(--color-border);
    padding-left: var(--space-6);
}

.inventory-history-table-wrap {
    max-height: 400px;
    overflow-y: auto;
}

.inventory-empty-card {
    padding: var(--space-6);
    text-align: center;
    color: var(--color-text-muted);
}

.inventory-row-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.inventory-deficit-badge {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border-color: var(--color-danger-border);
}

.inventory-reports-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

@media (max-width: 640px) {
    .inventory-adjust-divider {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--color-border);
        padding-top: var(--space-3);
        width: 100%;
    }
}

.inventory-inline-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; gap: 16px; padding: 8px; max-width: 1000px; }
.inventory-form-group-inline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 12px; background: var(--color-surface); padding: 18px; border: 1px solid var(--color-border); border-radius: 12px; }
.inventory-inline-label { grid-column: 1 / -1; margin-bottom: 2px; font-size: .8rem; }
.inventory-form-group-inline .form-control { width: 100%; font-size: .8rem; }
.inventory-form-group-inline .btn { justify-self: start; }
.inventory-adjust-divider { padding: 18px; border: 1px solid var(--color-border); }

/* Warehouse visibility and controls */
.inventory-warehouses { margin-bottom: 24px; }
.inventory-warehouse-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.inventory-warehouse-heading h2 { font-size: 1rem; margin: 0 0 6px; }
.inventory-warehouse-heading p { color: var(--color-text-muted); font-size: .82rem; margin: 0; }
.inventory-warehouse-count { flex-shrink: 0; font-size: .75rem; color: var(--color-text-muted); border: 1px solid var(--color-border); border-radius: 20px; padding: 5px 10px; }
.inventory-warehouse-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.inventory-warehouse-card { display: flex; flex-direction: column; padding: 20px; gap: 6px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; color: var(--color-text); text-decoration: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.inventory-warehouse-card:hover, .inventory-warehouse-card.is-selected { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary); }
.inventory-warehouse-name { font-weight: 650; font-size: .9rem; overflow-wrap: anywhere; }
.inventory-warehouse-id { color: var(--color-text-muted); font-size: .73rem; overflow-wrap: anywhere; }
.inventory-warehouse-quantity { margin-top: 10px; font-size: 1.65rem; line-height: 1.2; }
.inventory-warehouse-quantity small { font-size: .72rem; font-weight: 400; color: var(--color-text-muted); }
.inventory-stock-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 16px; flex-wrap: wrap; }
.inventory-warehouse-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inventory-filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.inventory-search-field { min-width: 280px; }
.inventory-warehouse-filter label { font-size: .78rem; font-weight: 600; margin: 0; }
.inventory-warehouse-filter select, .inventory-warehouse-filter .search-input { min-height: 40px; }
.inventory-warehouse-filter .btn { min-height: 40px; }
.inventory-stock-summary { font-size: .8rem; color: var(--color-text-muted); margin: 0 0 10px; }
.inventory-stock-summary strong { color: var(--color-text); }
.inventory-stock-table { min-width: 1080px; }
.inventory-location-name, .inventory-location-id { display: block; overflow-wrap: anywhere; }
.inventory-edit-context { margin: 0 0 6px; font-size: .82rem; color: var(--color-text-muted); }
.inventory-count-help { font-size: .74rem; color: var(--color-text-muted); line-height: 1.5; }
.inventory-transfer-help { font-size: .8rem; color: var(--color-text-muted); line-height: 1.6; margin-bottom: 20px; }
.inventory-empty, .inventory-warehouse-empty { padding: 24px; text-align: center; color: var(--color-text-muted); }
@media (max-width: 640px) {
 .inventory-warehouse-heading { flex-direction: column; gap: 10px; }
 .inventory-warehouse-cards { grid-template-columns: 1fr; }
 .inventory-stock-toolbar { flex-direction: column; align-items: stretch; }
 .inventory-warehouse-filter { grid-template-columns: minmax(0, 1fr) auto; }
}


/* --- Module: products.css --- */
/* ==========================================================================
   Page-Specific: Products & Product Detail
   ========================================================================== */

.product-variant-guidance {
    background: var(--color-primary-light);
    border: 1px solid #cfe0ff;
    color: var(--color-text);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin-bottom: var(--space-4);
}

.product-name-link {
    color: var(--color-text);
    text-decoration: none;
}

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

.product-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.product-section-block {
    margin-bottom: var(--space-7);
}

.product-table-wrap {
    margin-bottom: var(--space-4);
}

.product-section-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-3);
}

.product-overview-box {
    margin-bottom: var(--space-6);
    background: var(--color-bg);
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.product-desc-text {
    margin-bottom: var(--space-2);
}

.product-desc-empty {
    color: var(--color-text-muted);
    font-style: italic;
}

.product-discount-old-price {
    margin-left: var(--space-1);
}

.discount-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-discount-bg);
    border: 1px solid var(--color-discount-border);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-top: var(--space-2);
}

.discount-banner-text {
    color: var(--color-discount-text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.discount-active-tag {
    background: var(--color-discount);
    color: var(--color-text-inverse);
}

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

.gallery-card {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.gallery-thumb-wrap {
    height: 110px;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gallery-thumb-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.gallery-primary-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
}

.gallery-card-footer {
    padding: var(--space-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border);
    gap: var(--space-1);
}

.gallery-btn-compact {
    font-size: var(--font-size-xs);
    padding: 3px 6px;
}

.product-form-box {
    background: var(--color-bg);
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.product-add-variant-box,
.product-add-image-box {
    background: var(--color-bg);
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--color-border);
}

.product-add-summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-primary);
    font-size: var(--font-size-sm);
}

.product-sub-form {
    margin-top: var(--space-4);
}

.product-form-group-compact {
    margin-bottom: 0;
}

.product-form-group-compact label {
    font-size: var(--font-size-sm);
}

.product-form-actions-compact {
    margin-top: var(--space-3);
}

.product-form-submit-align {
    display: flex;
    align-items: flex-end;
}

.product-shipping-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin: 0 0 22px; }
.product-shipping-form .form-group { margin-bottom: 0; }
.product-shipping-form .btn { min-height: 42px; }
.product-sub-form[enctype] { display: grid; gap: 12px; }
.product-sub-form[enctype] > .btn { justify-self: start; }
.product-upload-help { margin-top: 8px; line-height: 1.5; }
.gallery-grid > .cell-meta { grid-column: 1 / -1; padding: 16px; border: 1px dashed var(--color-border); border-radius: 8px; }
.product-add-image-box + .product-add-image-box { margin-top: 12px; }
.product-add-summary { line-height: 1.5; }
.product-add-summary:focus-visible { border-radius: 4px; }
.product-table-wrap { overflow-x: auto; }
.product-form-group-compact { min-width: 0; }
@media (max-width: 640px) {
    .product-shipping-form { grid-template-columns: minmax(0, 1fr); }
    .product-shipping-form .btn { justify-self: start; }
}


/* --- Module: reviews.css --- */
/* ==========================================================================
   Page-Specific: Reviews & Moderation
   ========================================================================== */

.review-product-meta {
    color: var(--color-text-muted);
}

.review-comment-body {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-2);
    max-width: 450px;
    color: var(--color-text);
}

.review-official-response {
    background: var(--color-success-bg);
    border-left: 3px solid var(--color-success);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-xs);
    font-size: var(--font-size-xs);
    color: var(--color-success-text);
    margin-bottom: var(--space-2);
}

.review-reply-toggle {
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.review-reply-details {
    font-size: var(--font-size-sm);
}

.review-reply-form {
    margin-top: var(--space-2);
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.review-reply-input {
    flex: 1;
}

.review-date {
    color: var(--color-text-muted);
}

.review-empty-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-muted);
}

.review-reply-form { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); }
.review-reply-label { font-size: .75rem; font-weight: 500; }
.review-reply-input { resize: vertical; min-height: 88px; font-size: .8rem; }
.review-reply-form > .btn { align-self: flex-start; }
.review-official-response { line-height: 1.6; }
.review-comment-body { line-height: 1.6; }
.review-reply-toggle { padding-block: 6px; }


/* --- Module: shipping.css --- */
/* ==========================================================================
   Page-Specific: Shipping
   ========================================================================== */

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

.shipping-stats-grid .stat-item {
    padding: var(--space-3);
    background: var(--color-surface-hover);
    border-radius: var(--radius-sm);
}

.shipping-stats-grid .stat-value {
    font-size: var(--font-size-base);
}

.shipping-meta-block {
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: var(--color-surface-hover);
    border-radius: var(--radius-sm);
}

.shipping-status-heading {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.shipping-history-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-5) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.shipping-history-item {
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface-hover);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
}

.shipping-history-actor {
    margin-left: var(--space-2);
    color: var(--color-text-muted);
}


/* --- Module: orders.css --- */
/* ==========================================================================
   Page-Specific: Orders
   ========================================================================== */

.order-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--color-surface-hover);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.order-items-table {
    margin-bottom: var(--space-6);
}

.order-section-subtitle {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.order-status-note {
    margin-bottom: var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.order-shipment-cta {
    margin-bottom: var(--space-4);
}

.form-help-text {
    margin-top: 6px;
}

.order-totals-row {
    font-weight: 700;
    color: var(--color-text);
}

.order-detail-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

@media (max-width: 640px) {
    .order-detail-cards {
        grid-template-columns: 1fr;
    }
}

.order-info-card {
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.order-info-card h4 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.order-info-card dl {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    margin: 0;
}

.order-info-card dt {
    color: var(--color-text-muted);
    font-weight: 500;
}

.order-info-card dd {
    margin: 0;
    color: var(--color-text);
    word-break: break-word;
}


/* --- Module: payments.css --- */
/* ==========================================================================
   Page-Specific: Payments
   ========================================================================== */

.payment-detail-card {
    background: var(--color-surface-hover);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: var(--space-5);
}

.payment-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
}

.payment-refund-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

@media (max-width: 640px) {
    .payment-detail-grid {
        grid-template-columns: 1fr;
    }
}


/* --- Module: login.css --- */
/* Page-Specific: Standalone Admin Login */
.login-page-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background-color: var(--color-surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--sidebar-border);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-badge {
    width: 48px;
    height: 48px;
    background-color: var(--color-primary);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-inverse);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.login-logo p {
    color: var(--color-text-muted);
    margin-top: 4px;
    font-size: 0.875rem;
}

.login-submit {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.95rem;
    margin-top: 10px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--sidebar-text);
    font-size: 0.75rem;
    line-height: 1.6;
}

.login-footer-links {
    margin-top: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.login-footer-link {
    color: var(--sidebar-active-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.login-footer-link:hover {
    text-decoration: underline;
    color: #93c5fd;
}

.login-footer-sep {
    color: var(--sidebar-border);
}

/* --- Module: about.css --- */
/* About and customer-facing attribution */
.about-page-container { display: flex; flex-direction: column; gap: 24px; max-width: 1120px; margin: 0 auto; }
.about-hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding: 40px; border: 1px solid #303849; border-radius: 18px; background: linear-gradient(120deg, #181d2b, #263147); color: #fff; box-shadow: var(--shadow-sm); }
.about-hero-brand { display: flex; align-items: center; gap: 22px; min-width: 0; }
.about-hero-brand > div:last-child { min-width: 0; }
.about-hero-logo { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border-radius: 16px; background: #eef1ff; color: #3659e3; font-size: 1.8rem; font-weight: 600; overflow: hidden; }
.about-hero-logo img { display: block; width: 38px; height: 38px; object-fit: contain; }
.about-eyebrow { font-size: .65rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: #aebcdc; margin-bottom: 10px; }
.about-hero-title { color: #fff; font-size: 1.8rem; font-weight: 600; letter-spacing: -.035em; overflow-wrap: anywhere; }
.about-hero-subtitle { font-size: .82rem; line-height: 1.7; color: #c2cada; margin-top: 10px; }
.about-hero-subtitle a, .public-about-container a:not(.btn) { color: #b9c9ff; }
.about-version { display: inline-flex; padding: 7px 11px; border: 1px solid #536079; border-radius: 7px; font-size: .7rem; color: #e1e7f5; white-space: nowrap; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.about-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; min-width: 0; overflow: hidden; box-shadow: var(--shadow-sm); }
.about-section-title { font-size: .92rem; font-weight: 600; letter-spacing: -.015em; }
.about-card .card-body { overflow-x: visible; }
.about-desc { color: var(--color-text-muted); font-size: .82rem; line-height: 1.8; margin-bottom: 24px; }
.about-software-details { margin: 0; }
.about-software-details > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--color-border-subtle); font-size: .8rem; line-height: 1.6; }
.about-software-details dt { color: var(--color-text-muted); }
.about-software-details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.about-support-note { padding: 16px; border: 1px solid #e0e6fa; border-radius: 10px; background: #f6f8ff; margin-bottom: 24px; font-size: .8rem; }
.about-support-note strong { font-weight: 500; }
.about-support-note p { margin-top: 6px; color: var(--color-text-muted); line-height: 1.7; }
.about-actions-row { display: flex; flex-wrap: wrap; gap: 10px; }
.about-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 2px 4px; color: var(--color-text-muted); font-size: .7rem; line-height: 1.7; }
.public-about-body { min-height: 100vh; padding: 40px 20px; background: radial-gradient(ellipse at top, #303953, #181b23 70%); color: #d4dae7; }
.public-about-container { width: 100%; max-width: 720px; margin: 0 auto; }
.public-about-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.public-brand { display: flex; gap: 12px; align-items: center; font-size: 1.15rem; font-weight: 600; }
.public-logo-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #edf1ff; color: #3659e3; }
.public-about-card { padding: 40px; border: 1px solid #3b455b; border-radius: 18px; background: #202838; box-shadow: 0 24px 80px rgba(0, 0, 0, .15); }
.public-hero-section { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid #3b455b; }
.public-hero-section .about-version { margin-bottom: 28px; }
.public-title { color: #fff; font-size: 2.2rem; font-weight: 600; letter-spacing: -.045em; }
.public-subtitle { font-size: .88rem; line-height: 1.7; margin-top: 12px; color: #bec8dc; }
.public-section { margin-bottom: 30px; }
.public-section h2 { font-size: 1rem; color: #fff; margin-bottom: 12px; font-weight: 500; }
.public-section p { font-size: .85rem; line-height: 1.8; }
.public-license-name { margin-top: 14px; color: #aebcdc; }
.public-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.public-about-container .btn-outline { background: transparent; border: 1px solid #65718b; color: #e1e7f5; }
.public-about-container .btn-outline:hover { background: #303953; }
.public-footer { border-top: 1px solid #3b455b; padding-top: 22px; font-size: .72rem; color: #aebcdc; }
@media (max-width: 1200px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .about-hero { padding: 28px 24px; }
    .about-hero-brand { align-items: flex-start; gap: 14px; }
    .about-hero-logo { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; font-size: 1.4rem; }
    .about-hero-logo img { width: 28px; height: 28px; }
    .about-hero-title { font-size: 1.35rem; }
    .about-eyebrow { font-size: .58rem; line-height: 1.7; }
    .about-hero-subtitle { font-size: .78rem; }
    .about-software-details > div { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
    .about-actions-row, .public-actions { flex-direction: column; }
    .about-actions-row .btn, .public-actions .btn { justify-content: center; white-space: normal; text-align: center; }
    .public-about-body { padding: 24px 16px; }
    .public-about-card { padding: 28px 24px; }
    .public-title { font-size: 1.8rem; }
}

/* Preserve native hidden semantics against button display rules. */
#live-updates-refresh[hidden] {
    display: none;
}

/* External indicator styles allow a script-src/style-src self-only admin CSP. */
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; transition: opacity 200ms ease-in; }


/* --- Module: 03-premium.css --- */
/* Shared finish layer. Included last in admin.css after the feature modules. */
:root {
    --color-primary: #3659e3;
    --color-primary-hover: #2946c4;
    --color-primary-active: #233ba3;
    --color-primary-light: #f0f3ff;
    --color-primary-subtle: rgba(54, 89, 227, .09);
    --color-primary-focus: rgba(54, 89, 227, .16);
    --color-bg: #f6f7f9;
    --color-surface-hover: #f5f6f8;
    --color-border: #e6e8ed;
    --color-border-subtle: #eff0f3;
    --color-text: #20242d;
    --color-text-muted: #626b7b;
    --color-text-light: #70798a;
    --sidebar-bg: #181b23;
    --sidebar-border: #2b2e37;
    --sidebar-text: #a9afbd;
    --sidebar-active-bg: #2c344f;
    --sidebar-active-text: #e0e6ff;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 5px rgba(24, 27, 35, .025);
    --shadow-md: 0 6px 24px rgba(24, 27, 35, .045);
}

body { font-size: .875rem; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
svg { stroke-linecap: round; stroke-linejoin: round; }
.skip-link {
    position: fixed; top: 12px; left: 12px; z-index: 1200;
    padding: 12px 20px; border-radius: var(--radius-sm);
    background: var(--color-surface); box-shadow: var(--shadow-md);
    transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Workspace shell */
.sidebar { width: 248px; padding: 28px 16px 20px; }
.sidebar-header { padding: 0 12px 26px; margin-bottom: 18px; gap: 12px; }
.sidebar-logo-icon {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 11px; background: #eef1ff; color: #3659e3;
    font-size: 1.25rem; letter-spacing: -.06em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
    overflow: hidden;
}
.sidebar-logo-icon img, .login-badge img, .public-logo-icon img, .about-hero-logo img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.about-hero-logo img {
    width: 38px;
    height: 38px;
}
.login-badge img {
    width: 34px;
    height: 34px;
}
.sidebar-header h1 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.brand-label {
    font-size: .55rem; font-weight: 600; letter-spacing: .1em;
    color: #bfc7df; border: 1px solid #424858; border-radius: 4px; padding: 3px 5px;
}
.sidebar-brand p { font-size: .7rem; color: var(--sidebar-text); margin-top: 3px; }
.sidebar-nav { gap: 4px; flex: 0 0 auto; }
.nav-section-label {
    padding: 20px 14px 7px; color: #9199aa; font-size: .62rem;
    font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.nav-section-label:first-child { padding-top: 2px; }
.nav-item { min-height: 42px; padding: 10px 14px; font-size: .8rem; position: relative; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.65; }
.nav-item.active { box-shadow: inset 0 0 0 1px #3b4563; }
.nav-item.active::after {
    content: ''; width: 5px; height: 5px; border-radius: 50%;
    background: #9aafff; margin-left: auto;
}
.nav-item:focus-visible { outline-color: #a9baff; }
.sidebar-footer {
    margin-top: auto; padding: 24px 12px 0; border-top: 1px solid var(--sidebar-border);
    color: var(--sidebar-text); font-size: .64rem; line-height: 1.8;
}
.sidebar-footer-label { display: block; color: #e3e5ed; font-size: .72rem; }
.main-content { margin-left: 248px; }
.top-bar { min-height: 76px; padding: 16px 36px; gap: 16px; }
.top-bar-left { min-width: 0; gap: 14px; }
.breadcrumb-root { color: var(--color-text-muted); font-size: .8rem; }
.breadcrumb-divider { color: #adb3c0; }
.top-bar-left h2 { font-size: .82rem; font-weight: 500; }
.user-info { border: 0; background: transparent; padding: 0; gap: 12px; min-width: 0; }
.user-avatar {
    width: 32px; height: 32px; border: 1px solid #dde3fa; border-radius: 50%;
    background: #edf1ff; display: grid; place-items: center; color: #5267ad; flex-shrink: 0;
}
.user-avatar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.user-name { font-size: .76rem; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { border-radius: 7px; color: var(--color-text-muted); font-size: .72rem; font-weight: 500; padding: 7px 10px; }
.content-area { padding: 32px 36px 48px; width: 100%; max-width: 1600px; margin: 0 auto; }
#live-updates {
    margin: 0 36px; padding: 11px 0; border-bottom: 1px solid var(--color-border);
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    color: var(--color-text-muted); font-size: .7rem; min-height: 39px;
}
#live-updates-status { display: flex; align-items: center; gap: 8px; }
#live-updates-status::before {
    content: ''; width: 6px; height: 6px; flex-shrink: 0;
    border: 1px solid #8993a6; border-radius: 50%; background: #dfe3eb;
}
#live-updates-refresh { margin-left: auto; }
#flash-message:not(:empty) { padding: 16px 36px 0; }
.page-header { margin-bottom: 26px; align-items: flex-end; gap: 20px; }
.page-title-section h1 { font-size: 1.8rem; font-weight: 600; letter-spacing: -.045em; margin-bottom: 7px; }
.page-title-section .subtitle { font-size: .8rem; line-height: 1.6; }
.page-eyebrow { font-size: .63rem; font-weight: 600; text-transform: uppercase; letter-spacing: .13em; color: var(--color-text-muted); margin-bottom: 9px; }
.page-actions { gap: 10px; }

/* Shared controls and data surfaces */
.btn { min-height: 38px; padding: 9px 15px; font-size: .78rem; gap: 8px; font-weight: 500; box-shadow: var(--shadow-sm); transition: background-color .15s, border-color .15s, box-shadow .15s; }
.btn > svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; flex-shrink: 0; }
.btn-primary { box-shadow: 0 2px 3px rgba(41, 70, 196, .12), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { box-shadow: 0 3px 8px rgba(41, 70, 196, .2); }
.btn-primary:active { background: var(--color-primary-active); }
.btn-small { min-height: 30px; padding: 6px 11px; font-size: .72rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.search-input, .status-filter { min-height: 38px; font-size: .78rem; border-radius: 8px; padding: 9px 12px; box-shadow: var(--shadow-sm); }
.search-input::placeholder, .form-group input::placeholder, .form-group textarea::placeholder { color: #70798a; }
.form-group { margin-bottom: 18px; }
.form-group label { font-size: .78rem; font-weight: 500; margin-bottom: 7px; }
.form-group input, .form-group select, .form-group textarea { padding: 11px 13px; font-size: .82rem; }
.table-container { border-radius: 12px; box-shadow: var(--shadow-sm); }
.admin-table { font-size: .8rem; font-variant-numeric: tabular-nums; }
.admin-table thead { background: #fafbfc; }
.admin-table th { font-size: .64rem; letter-spacing: .065em; padding: 14px 20px; color: #667081; }
.admin-table td { padding: 17px 20px; border-color: var(--color-border-subtle); }
.admin-table td strong { font-weight: 500; }
.admin-table tbody tr { transition: background-color .12s; }
.admin-table tbody tr:hover { background: #f8faff; }
.admin-table td:first-child { overflow-wrap: anywhere; }
.cell-meta { font-size: .72rem; line-height: 1.6; }
.status-badge { background: var(--color-surface-hover); color: var(--color-text-muted); font-size: .64rem; font-weight: 500; padding: 4px 9px; border-radius: 6px; letter-spacing: .015em; }

.status-pending, .status-refunding, .status-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.status-paid, .status-succeeded, .status-delivered, .status-active, .status-success, .status-done, .status-completed { background: var(--color-success-bg); color: var(--color-success-text); }
.status-shipped, .status-in_transit, .status-in-transit, .status-processing { background: var(--color-info-bg); color: var(--color-info-text); }
.status-failed, .status-refund_failed, .status-chargedback, .status-returned, .status-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.empty-row td { padding: 64px 20px; font-size: .82rem; }
.pagination { margin-top: 24px; }
.pagination-info { font-size: .74rem; }
.modal-content { padding: 28px; box-shadow: -8px 0 36px rgba(15, 23, 42, 0.18); border-radius: 0; }
.modal-header { padding-bottom: 18px; margin-bottom: 22px; }
.toast { border-radius: 12px; box-shadow: var(--shadow-md); }

/* Dashboard overview */
.dashboard-heading { margin-bottom: 30px; }
.dashboard-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.dashboard-summary { min-width: 0; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.dashboard-summary .stats-grid { margin-bottom: 0; }
.inventory-reports-stats { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 24px; }
.stat-item {
    border: 1px solid var(--color-border); background: var(--color-surface);
    padding: 20px; border-radius: 12px; min-width: 0;
    color: var(--color-text); box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s;
}
.stat-item:hover { color: var(--color-text); border-color: #bac7f7; box-shadow: var(--shadow-md); }
.stat-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stat-label { font-size: .75rem; font-weight: 500; }
.stat-icon { width: 30px; height: 30px; background: #f0f3fb; color: #596fae; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.65; }
.stat-item-warning .stat-icon { background: #fff5e5; color: #ad690d; }
.stat-item-danger .stat-icon { background: #fdf0ee; color: #bf554a; }
.stat-value { margin: 17px 0 14px; font-size: 2.15rem; font-weight: 600; letter-spacing: -.05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-caption { font-size: .66rem; line-height: 1.5; color: var(--color-text-muted); display: flex; justify-content: space-between; gap: 8px; }
.stat-caption > span { color: #7c879a; font-size: .82rem; }
.dashboard-card { min-width: 0; border-radius: 12px; box-shadow: var(--shadow-sm); }
.dashboard-orders { grid-row: span 2; }
.card-header { padding: 20px 22px; gap: 16px; flex-wrap: wrap; border-color: var(--color-border-subtle); }
.card-header h3 { font-size: .88rem; letter-spacing: -.015em; font-weight: 600; }
.card-description { color: var(--color-text-muted); font-size: .7rem; margin-top: 4px; }
.card-body { padding: 20px 22px; overflow-x: auto; }
.dashboard-card .admin-table th, .dashboard-card .admin-table td { padding-left: 12px; padding-right: 12px; }
.dashboard-card .admin-table th:first-child, .dashboard-card .admin-table td:first-child { padding-left: 0; }
.dashboard-card .admin-table th:last-child, .dashboard-card .admin-table td:last-child { padding-right: 0; }
.dashboard-card .admin-table thead { background: transparent; }
.dashboard-card .admin-table th { padding-top: 0; padding-bottom: 13px; }
.dashboard-empty { padding: 32px 12px; text-align: center; }
.dashboard-empty > svg { width: 30px; height: 30px; fill: none; stroke: #8793ad; stroke-width: 1.3; margin-bottom: 12px; }
.dashboard-empty h4 { font-size: .8rem; font-weight: 500; }
.dashboard-empty p { color: var(--color-text-muted); font-size: .72rem; margin-top: 6px; }

/* Sign in */
.login-page-body { background: radial-gradient(ellipse at 50% 0%, #303953 0, #181b23 65%); }
.login-card { border: 1px solid #e6e8ed; padding: 40px; box-shadow: 0 24px 80px rgba(0, 0, 0, .2); }
.login-badge { background: #edf1ff; color: var(--color-primary); border: 1px solid #dce3ff; border-radius: 14px; width: 54px; height: 54px; }
.login-logo h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.045em; }
.login-logo p { margin-top: 8px; font-size: .78rem; }
.login-submit { min-height: 44px; font-size: .82rem; }
.login-footer { color: #a9afbd; line-height: 1.8; }
.login-footer-links { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 4px; }
.login-footer-link { color: #bdc9f7; }
.login-footer-link:hover { color: #fff; }

/* Variant Discount Controls */
.variant-discount-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}
.variant-discount-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.variant-discount-remove-btn {
    padding: 0 6px !important;
    min-height: 20px !important;
    height: 20px !important;
    line-height: 1 !important;
    font-size: 0.75rem !important;
}
.variant-discount-details {
    font-size: 0.75rem;
}
.variant-discount-summary {
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 500;
    user-select: none;
}
.variant-discount-inline-form {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}
.variant-discount-inline-form select {
    width: auto;
    min-width: 58px;
    padding: 4px 6px;
    font-size: 0.75rem;
}
.variant-discount-inline-form input[type="number"] {
    width: 78px;
    padding: 4px 6px;
    font-size: 0.75rem;
}

/* Keep controls usable at smaller widths and honor reduced motion. */
@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-area { padding: 28px; }
    .top-bar { padding-inline: 28px; }
    #live-updates { margin-inline: 28px; }
    .user-name { max-width: 170px; }
}
@media (max-width: 1024px) {
    body.sidebar-open { overflow: hidden; }
    .sidebar { width: 248px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-orders { grid-row: auto; }
    .top-bar { min-height: 68px; padding: 14px 20px; }
    .content-area { padding: 24px 20px 40px; }
    #live-updates { margin-inline: 20px; }
    #flash-message:not(:empty) { padding-inline: 20px; }
}
@media (max-width: 640px) {
    .breadcrumb-root, .breadcrumb-divider, .user-avatar { display: none; }
    .top-bar { padding-inline: 16px; gap: 8px; }
    .top-bar-left { gap: 10px; }
    .top-bar-left h2 { font-size: .78rem; }
    .content-area { padding: 24px 16px 36px; }
    #live-updates { margin-inline: 16px; }
    #flash-message:not(:empty) { padding-inline: 16px; }
    .page-title-section h1 { font-size: 1.55rem; }
    .page-header { align-items: stretch; }
    .dashboard-heading > .btn { align-self: flex-start; }
    .page-actions { gap: 8px; }
    .stats-grid { gap: 10px; }
    .stat-item { padding: 16px; }
    .stat-heading { align-items: flex-start; }
    .stat-label { font-size: .7rem; }
    .stat-icon { width: 26px; height: 26px; }
    .stat-value { font-size: 1.9rem; }
    .stat-caption { font-size: .63rem; }
    .card-header, .card-body { padding: 18px; }
    .modal-content { padding: 22px; }
    .login-card { padding: 30px 24px; }
}
@media (max-width: 360px) {
    .stats-grid { grid-template-columns: minmax(0, 1fr); }
}
/* --- Module: loading.css --- */
/* Top Indeterminate Progress Bar */
.admin-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.admin-loading-bar.is-active {
    opacity: 1;
}

.admin-loading-bar-indicator {
    width: 45%;
    height: 100%;
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
    animation: admin-progress-slide 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes admin-progress-slide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(50%); }
    100% { transform: translateX(250%); }
}

/* Concrete Workspace Content Loading Screen Overlay */
.admin-content-loader {
    position: sticky;
    top: 76px;
    margin: 12px 36px 0;
    padding: 10px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 30;
    animation: admin-fade-in 0.2s ease-out;
}

.admin-content-loader.hidden {
    display: none !important;
}

.admin-content-loader-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border-hover);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: admin-spinner-rotate 0.75s linear infinite;
}

@keyframes admin-spinner-rotate {
    to { transform: rotate(360deg); }
}

@keyframes admin-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Skeletons */
.admin-skeleton-line {
    background: linear-gradient(90deg, var(--color-surface-hover) 25%, var(--color-border-subtle) 50%, var(--color-surface-hover) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-xs);
    animation: admin-shimmer 1.5s infinite linear;
}

.admin-skeleton-line-sm { height: 12px; width: 40%; }
.admin-skeleton-line-md { height: 16px; width: 65%; margin-bottom: 6px; }
.admin-skeleton-line-lg { height: 24px; width: 85%; margin-bottom: 12px; }

.admin-skeleton-card {
    padding: 16px;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-skeleton-modal {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-skeleton-box {
    width: 100%;
    height: 120px;
    background: var(--color-surface-hover);
    border-radius: var(--radius-sm);
    animation: admin-shimmer 1.5s infinite linear;
}

@keyframes admin-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* HTMX & Form Button Pending Spinner */
.btn.htmx-request,
button.is-submitting {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: wait;
}

.btn.htmx-request::after,
button.is-submitting::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin-top: -7px;
    margin-left: -7px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: admin-spinner-rotate 0.65s linear infinite;
    color: var(--color-text);
}

.btn-primary.htmx-request::after,
.btn-primary.is-submitting::after {
    color: var(--color-text-inverse);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
