/*
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *  WMS PartVault — Brand Design System
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *
 *  BRAND BOOK (mini)
 *  ─────────────────
 *  Name:     PartVault
 *  Tagline:  Magazyn pod kontrolą
 *  Tone:     Professional, industrial, trustworthy
 *
 *  PALETTE:
 *  Primary:    Slate 900 (#0f172a) — dark nav, authority
 *  Accent:     Teal 600  (#0d9488) — actions, trust, clarity
 *  Surface:    #f8fafc (cool off-white, easy on eyes in workshop light)
 *  Card:       #ffffff
 *  Border:     #e2e8f0 (soft structure)
 *
 *  SEMANTIC:
 *  Success:    #059669 (emerald)
 *  Warning:    #d97706 (amber)
 *  Danger:     #dc2626 (red)
 *  Info:       #0284c7 (sky)
 *
 *  TYPOGRAPHY:
 *  Font:       Inter (clean, geometric, highly legible)
 *  Headings:   600 weight, slate-800
 *  Body:       400 weight, slate-600
 *  Mono:       JetBrains Mono — SKUs, locations, order numbers
 *
 *  RADIUS:     4px cards, 3px buttons/inputs, 2px small elements (square aesthetic)
 *  SHADOWS:    Subtle, layered (no harsh drop shadows)
 *  SPACING:    4px base grid
 *
 *  ICONS:      SVG inline (no emoji in production — emoji used in PoC)
 *  TOUCH:      44px min target, 48px preferred
 */

/* ===== Tokens ===== */
:root {
    --c-bg: #f1f5f9;
    --c-surface: #ffffff;
    --c-surface-hover: #f8fafc;
    --c-surface-alt: #f8fafc;

    --c-sidebar: #0f172a;
    --c-sidebar-hover: #1e293b;
    --c-sidebar-active: #1e293b;
    --c-sidebar-text: #94a3b8;
    --c-sidebar-text-active: #f1f5f9;
    --c-sidebar-border: #1e293b;

    --c-accent: #0d9488;
    --c-accent-hover: #0f766e;
    --c-accent-light: #ccfbf1;
    --c-accent-text: #ffffff;

    --c-success: #059669;
    --c-success-bg: #ecfdf5;
    --c-warning: #d97706;
    --c-warning-bg: #fffbeb;
    --c-danger: #dc2626;
    --c-danger-bg: #fef2f2;
    --c-info: #0284c7;
    --c-info-bg: #f0f9ff;

    --c-text: #334155;
    --c-text-heading: #0f172a;
    --c-text-secondary: #64748b;
    --c-text-muted: #94a3b8;

    --c-border: #e2e8f0;
    --c-border-strong: #cbd5e1;

    --radius-sm: 2px;
    --radius: 3px;
    --radius-lg: 4px;
    --radius-xl: 6px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
    --shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md: 0 4px 6px rgba(15,23,42,0.05), 0 2px 4px rgba(15,23,42,0.03);
    --shadow-lg: 0 10px 25px rgba(15,23,42,0.08), 0 4px 10px rgba(15,23,42,0.04);
    --shadow-overlay: 0 20px 60px rgba(15,23,42,0.18);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;

    --transition: 150ms ease;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.55;
    min-height: 100vh;
}

/* ===== Utility: hidden/shown at breakpoints ===== */
/* NOTE: Do NOT override Tailwind's .hidden — it breaks md:block responsive */
@media (min-width: 768px) {
    .md-hidden { display: none !important; }
    .md-flex { display: flex !important; }
    .md-block { display: block !important; }
    .md-grid { display: grid !important; }
    .md-table { display: table !important; }
    .md-table-row-group { display: table-row-group !important; }
    .md-table-header-group { display: table-header-group !important; }
    .md-table-row { display: table-row !important; }
    .md-table-cell { display: table-cell !important; }
}
@media (max-width: 767px) {
    .sm-only { display: block !important; }
    .md-only { display: none !important; }
}
@media (min-width: 768px) {
    .sm-only { display: none !important; }
    .md-only { display: block !important; }
}

/* ===== Square aesthetic: override Tailwind rounded classes ===== */
.rounded-sm { border-radius: 2px !important; }
.rounded { border-radius: 3px !important; }
.rounded-md { border-radius: 4px !important; }
.rounded-lg { border-radius: 4px !important; }
.rounded-xl { border-radius: 6px !important; }
.rounded-2xl { border-radius: 6px !important; }
.rounded-full { border-radius: 9999px !important; }

/* ===== Layout Shell ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
}
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}
@media (max-width: 767px) {
    .content-area { padding: 16px; }
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--c-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40;
    overflow: hidden;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}
/* Collapsed state */
.sidebar.sidebar-collapsed {
    width: 64px;
}
.sidebar.sidebar-collapsed .sidebar-label,
.sidebar.sidebar-collapsed .brand-text,
.sidebar.sidebar-collapsed .sidebar-user-info,
.sidebar.sidebar-collapsed .nav-badge {
    display: none;
}
.sidebar.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 10px 0;
}
.sidebar.sidebar-collapsed .nav-link .nav-icon {
    margin-right: 0;
}
.sidebar.sidebar-collapsed .sidebar-footer {
    padding: 12px 8px;
    text-align: center;
}
.sidebar.sidebar-collapsed .logout-btn span {
    display: none;
}
.sidebar.sidebar-collapsed .logout-btn {
    justify-content: center;
    padding: 7px;
}
/* Collapse toggle button */
.sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--c-sidebar-text);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-collapse-btn:hover {
    background: var(--c-sidebar-hover);
    color: var(--c-sidebar-text-active);
}

@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-open { transform: translateX(0); }
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--c-sidebar-border);
}
.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-icon {
    width: 32px; height: 32px;
    background: var(--c-accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: 700;
}
.brand-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--c-sidebar-text-active);
    letter-spacing: -0.3px;
}
.brand-tagline {
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 1px;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}
.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-text-muted);
    padding: 12px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    color: var(--c-sidebar-text);
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    text-decoration: none;
    border: 1px solid transparent;
}
.nav-link:hover {
    background: var(--c-sidebar-hover);
    color: var(--c-sidebar-text-active);
}
.nav-link-active {
    background: var(--c-sidebar-active);
    color: var(--c-sidebar-text-active);
    border-color: rgba(13,148,136,0.3);
}
.nav-link-active .nav-icon { color: var(--c-accent); }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 20px; height: 20px; }
.nav-label { flex: 1; }
.nav-badge {
    background: var(--c-danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}
.nav-badge-accent {
    background: var(--c-accent);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--c-sidebar-border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    background: var(--c-sidebar-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-accent);
    flex-shrink: 0;
    border: 1px solid rgba(13,148,136,0.25);
}
.user-info { min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-sidebar-text-active);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    color: var(--c-text-muted);
}
.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--c-sidebar-border);
    color: var(--c-sidebar-text);
    font-size: 12px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
    margin-top: 4px;
}
.logout-btn:hover {
    border-color: var(--c-danger);
    color: #fca5a5;
    background: rgba(220,38,38,0.08);
}

/* ===== Mobile Top Bar ===== */
.mobile-topbar {
    display: none;
    background: var(--c-sidebar);
    color: var(--c-sidebar-text-active);
    padding: 0 16px;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}
@media (max-width: 767px) {
    .mobile-topbar { display: flex; }
}
.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--c-sidebar-text-active);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.mobile-menu-btn:hover { background: var(--c-sidebar-hover); }
.mobile-brand {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mobile-user {
    font-size: 12px;
    color: var(--c-text-muted);
    font-weight: 500;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 35;
    backdrop-filter: blur(2px);
}
@media (max-width: 767px) {
    .sidebar-overlay.is-visible { display: block; }
}

/* ===== Page Headers ===== */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
@media (min-width: 640px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--c-text-heading);
    letter-spacing: -0.3px;
}
.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Card ===== */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
@media (min-width: 640px) {
    .card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body { padding: 16px 20px; }
.card-footer {
    padding: 12px 20px;
    background: var(--c-surface-alt);
    border-top: 1px solid var(--c-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== Stat Card ===== */
.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-secondary);
    letter-spacing: 0.01em;
}
.stat-accent { color: var(--c-accent); }
.stat-success { color: var(--c-success); }
.stat-warning { color: var(--c-warning); }
.stat-danger { color: var(--c-danger); }

.stat-card.has-alert {
    border-color: var(--c-warning);
    background: linear-gradient(135deg, var(--c-surface), var(--c-warning-bg));
}
.stat-card.has-danger {
    border-color: var(--c-danger);
    background: linear-gradient(135deg, var(--c-surface), var(--c-danger-bg));
}

/* ===== Grid layouts ===== */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (min-width: 1024px) {
    .grid-stats { grid-template-columns: repeat(4, 1fr); }
}
.grid-2col {
    display: grid;
    gap: 20px;
}
@media (min-width: 768px) {
    .grid-2col { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Buttons ===== */
button, .btn {
    font-family: var(--font-sans);
    cursor: pointer;
    outline: none;
}
/* Zone/location filter pill buttons */
.filter-pill {
    border: 1px solid var(--c-border) !important;
    background: var(--c-surface);
    transition: all var(--transition);
}
.filter-pill.active {
    background: var(--c-accent) !important;
    color: #fff !important;
    border-color: var(--c-accent) !important;
}

/* Expand button on part rows */
.expand-toggle-row {
    border: none !important;
}
.expand-toggle-row td {
    border: none !important;
}
.expand-btn {
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 12px;
    border: 1px solid var(--c-border) !important;
    border-radius: 999px;
    background: var(--c-surface);
    color: var(--c-text-muted);
    font-size: 11px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    cursor: pointer;
    white-space: nowrap;
}
.part-row:hover + .expand-toggle-row .expand-btn,
.expand-toggle-row:hover .expand-btn,
.expand-toggle-row.expanded .expand-btn {
    opacity: 1;
}
.expand-btn:hover {
    background: var(--c-accent) !important;
    color: #fff !important;
    border-color: var(--c-accent) !important;
}
.btn-primary {
    background: var(--c-accent);
    color: var(--c-accent-text);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: var(--c-accent-hover);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-success {
    background: var(--c-success);
    color: white;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}
.btn-success:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-danger {
    background: var(--c-danger);
    color: white;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-outline {
    border: 1px solid var(--c-border-strong);
    color: var(--c-text);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    background: var(--c-surface);
    transition: all var(--transition);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-outline:hover { background: var(--c-surface-alt); border-color: var(--c-text-muted); }

.btn-ghost {
    background: none;
    border: none;
    color: var(--c-accent);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-ghost:hover { background: var(--c-accent-light); }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 34px;
}

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
    white-space: nowrap;
}
.badge-red { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-amber { background: var(--c-warning-bg); color: var(--c-warning); }
.badge-green { background: var(--c-success-bg); color: var(--c-success); }
.badge-blue { background: var(--c-info-bg); color: var(--c-info); }
.badge-gray { background: #f1f5f9; color: var(--c-text-secondary); }
.badge-teal { background: var(--c-accent-light); color: var(--c-accent); }

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-secondary);
}

/* ===== Priority ===== */
.priority-btn {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all var(--transition);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text-secondary);
}
.priority-btn:hover { border-color: var(--c-text-muted); }

/* Ring highlight for express/priority orders */
.ring-danger {
    border-color: var(--c-danger) !important;
    box-shadow: 0 0 0 3px var(--c-danger-bg);
}
.ring-warning {
    border-color: var(--c-warning) !important;
    box-shadow: 0 0 0 3px var(--c-warning-bg);
}

/* ===== Forms ===== */
.label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--c-text);
    background: var(--c-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    min-height: 44px;
}
.input::placeholder { color: var(--c-text-muted); }
.input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}
.input:disabled {
    background: #f1f5f9;
    color: var(--c-text-muted);
    cursor: not-allowed;
}
select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 36px;
}
textarea.input {
    resize: vertical;
    min-height: 72px;
}

.form-row { display: grid; gap: 12px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 767px) {
    .form-row-3 { grid-template-columns: 1fr; }
}
.form-group { display: flex; flex-direction: column; }
.form-error {
    font-size: 13px;
    color: var(--c-danger);
    background: var(--c-danger-bg);
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid rgba(220,38,38,0.15);
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
}

/* ===== Login screen ===== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-sidebar);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-screen::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(13,148,136,0.08), transparent 50%),
                radial-gradient(ellipse at 70% 30%, rgba(13,148,136,0.05), transparent 40%);
    pointer-events: none;
}
.login-card {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    padding: 40px 32px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-overlay);
    position: relative;
    z-index: 1;
}
.login-brand {
    text-align: center;
    margin-bottom: 28px;
}
.login-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-hover));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 4px 12px rgba(13,148,136,0.25);
}
.login-icon svg { width: 26px; height: 26px; color: white; }
.login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--c-text-heading);
    letter-spacing: -0.5px;
}
.login-subtitle {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-top: 2px;
}
.login-error {
    background: var(--c-danger-bg);
    color: var(--c-danger);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid rgba(220,38,38,0.12);
}
.login-form .form-group { margin-bottom: 16px; }
.login-form .form-group:last-of-type { margin-bottom: 24px; }
.login-form .input {
    padding: 12px 14px;
    font-size: 15px;
    min-height: 48px;
}
.login-btn {
    width: 100%;
    background: var(--c-accent);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(13,148,136,0.2);
}
.login-btn:hover {
    background: var(--c-accent-hover);
    box-shadow: 0 4px 12px rgba(13,148,136,0.25);
    transform: translateY(-1px);
}
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.login-demo {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
    text-align: center;
    font-size: 11px;
    color: var(--c-text-muted);
    line-height: 1.6;
}
.login-demo strong {
    font-weight: 600;
    color: var(--c-text-secondary);
}
.login-demo code {
    font-family: var(--font-mono);
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}
@media (max-width: 767px) {
    .modal-overlay { padding: 16px 8px; }
}
.modal-content {
    background: var(--c-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-overlay);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    border: 1px solid var(--c-border);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    background: var(--c-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 1;
}
.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text-heading);
}
.modal-close {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: none;
    border: none;
    color: var(--c-text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition);
}
.modal-close:hover {
    background: #f1f5f9;
    color: var(--c-text);
}
.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead {
    background: var(--c-surface-alt);
    border-bottom: 1px solid var(--c-border);
}
.data-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
}
.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td {
    background: var(--c-surface-hover);
}
.data-table .cell-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.02em;
}
.data-table .cell-right { text-align: right; }
.data-table .cell-center { text-align: center; }
.data-table .cell-bold { font-weight: 600; }

/* Small inline table (inside cards) */
.inline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.inline-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.inline-table tr:last-child td { border-bottom: none; }

/* ===== Mobile part card ===== */
.part-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
}
.part-card:hover { border-color: var(--c-accent); box-shadow: var(--shadow); }
.part-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.part-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text-heading);
}
.part-card-meta {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-top: 2px;
}
.part-card-stock {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.part-card-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--c-text-secondary);
}
.part-card-location {
    font-family: var(--font-mono);
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* ===== Detail grid (part detail modal) ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.detail-item {}
.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text-muted);
    margin-bottom: 2px;
}
.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--c-text-heading);
}

/* Compatibility row */
.compat-row {
    font-size: 13px;
    background: var(--c-surface-alt);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 8px 12px;
}
.compat-row strong { color: var(--c-text-heading); }

/* ===== Filter bar ===== */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
@media (min-width: 640px) {
    .filter-bar { flex-direction: row; }
}
.filter-bar .input { min-height: 44px; }
.filter-bar .search-input { flex: 1; }

/* ===== Stock colour utility ===== */
.stock-ok { color: var(--c-success); }
.stock-low { color: var(--c-warning); }
.stock-out { color: var(--c-danger); }

/* ===== Section spacing (vertical list) ===== */
.vstack { display: flex; flex-direction: column; }
.vstack-sm { gap: 8px; }
.vstack-md { gap: 12px; }
.vstack-lg { gap: 16px; }

/* ===== Vehicle info strip ===== */
.vehicle-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--c-text-secondary);
    padding: 8px 20px;
}
.vehicle-strip .vin {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-text-muted);
}
.mechanic-note {
    font-size: 13px;
    color: var(--c-text-muted);
    font-style: italic;
    padding: 0 20px 4px;
}

/* ===== Item line (delivery/order row) ===== */
.item-remove-btn {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: none;
    border: 1px solid var(--c-border);
    color: var(--c-danger);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.item-remove-btn:hover { background: var(--c-danger-bg); border-color: var(--c-danger); }

.add-line-btn {
    color: var(--c-accent);
    font-size: 13px;
    font-weight: 600;
    background: none;
    border: 1px dashed var(--c-border);
    padding: 8px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.add-line-btn:hover { border-color: var(--c-accent); background: var(--c-accent-light); }

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--c-text-muted);
    font-size: 14px;
}
.empty-state-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-muted); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-content { animation: fadeIn 0.2s ease-out; }

/* ===== Print ===== */
@media print {
    .sidebar, .mobile-topbar, .btn-primary, .btn-outline { display: none !important; }
    .content-area { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
