/* StockGrid — dense, cool-toned warehouse data console */

:root {
    --bg: #f2f5f8;
    --surface: #ffffff;
    --surface-2: #eaeff4;
    --border: #d7dfe7;
    --text: #1e293b;
    --text-dim: #64748b;
    --accent: #2563eb;
    --accent-dim: #dbeafe;
    --rail-bg: #0f172a;
    --rail-text: #94a3b8;
    --rail-active: #1d2c4d;
    --ok: #16a34a;
    --ok-dim: #dcfce7;
    --warn: #d97706;
    --warn-dim: #fef3c7;
    --danger: #dc2626;
    --danger-dim: #fee2e2;
    --info: #0891b2;
    --info-dim: #cffafe;
    --radius: 4px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6, .font-mono {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    color: var(--text);
    font-weight: 600;
}

a { color: var(--accent); text-decoration: none; }

/* ---------- Layout: icon-rail sidebar (no labels) ---------- */

.wh-shell { display: flex; min-height: 100vh; }

.wh-rail {
    width: 64px;
    flex-shrink: 0;
    background: var(--rail-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0;
}

.wh-rail-logo {
    width: 36px; height: 36px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 22px;
}

.wh-rail-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.wh-rail a {
    width: 42px; height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rail-text);
    font-size: 16px;
    position: relative;
}

.wh-rail a:hover { background: var(--rail-active); color: #fff; }
.wh-rail a.active { background: var(--accent); color: #fff; }

.wh-rail a .rail-tip {
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #fff;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    z-index: 50;
}

.wh-rail a:hover .rail-tip { opacity: 1; }

.wh-rail-user {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--rail-active);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
    margin-top: 10px;
}

.wh-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wh-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.wh-toolbar h2 {
    font-size: 15px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.wh-toolbar .wh-breadcrumb {
    font-size: 12px;
    color: var(--text-dim);
}

.wh-content { padding: 22px 26px 50px; max-width: 1320px; }

/* ---------- Stat tiles ---------- */

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.stat-card .stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    font-weight: 600;
}

.stat-card .stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    margin-top: 4px;
}

.stat-card.st-danger .stat-value { color: var(--danger); }
.stat-card.st-warn .stat-value { color: var(--warn); }
.stat-card.st-ok .stat-value { color: var(--ok); }

/* ---------- Panels ---------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.panel-head {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-head h3 {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
    color: var(--text-dim);
}

.panel-body { padding: 16px 18px; }
.panel-body.p-0 { padding: 0; }

/* ---------- Dense data table ---------- */

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

.wh-table thead th {
    text-align: left;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-dim);
    font-weight: 600;
    padding: 8px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.wh-table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.wh-table tbody tr:nth-child(even) { background: #fafbfd; }
.wh-table tbody tr:hover { background: var(--accent-dim); }
.wh-table tbody tr:last-child td { border-bottom: none; }

.wh-sku {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 7px;
    border-radius: 3px;
}

.wh-num { font-family: 'IBM Plex Mono', monospace; font-weight: 600; text-align: right; }

/* ---------- Tags ---------- */

.wh-tag {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 3px;
}

.wh-tag-ok    { background: var(--ok-dim);    color: #15803d; }
.wh-tag-low   { background: var(--warn-dim);  color: #b45309; }
.wh-tag-out   { background: var(--danger-dim);color: #b91c1c; }
.wh-tag-info  { background: var(--info-dim);  color: #0e7490; }
.wh-tag-muted { background: var(--surface-2); color: var(--text-dim); }

/* ---------- Buttons ---------- */

.btn-wh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-wh:hover { background: #1d4ed8; color: #fff; }

.btn-wh-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-wh-outline:hover { background: var(--surface-2); color: var(--text); }
.btn-wh-outline.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.btn-wh-sm { padding: 5px 10px; font-size: 12px; }

.btn-wh-danger { background: var(--danger); }
.btn-wh-danger:hover { background: #b91c1c; }
.btn-wh-ok { background: var(--ok); }
.btn-wh-ok:hover { background: #15803d; }

.btn-icon-wh {
    width: 28px; height: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.btn-icon-wh:hover { background: var(--accent-dim); color: var(--accent); }

/* ---------- Forms ---------- */

.form-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-size: 13.5px;
    background: var(--surface);
    color: var(--text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ---------- Auth pages ---------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rail-bg);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.auth-card-top {
    text-align: center;
    padding: 32px 28px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.auth-logo {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 12px;
}

.auth-card-top h1 { font-size: 19px; margin: 0; letter-spacing: 1px; }
.auth-card-top p { color: var(--text-dim); font-size: 12.5px; margin: 4px 0 0; font-family: 'IBM Plex Sans', sans-serif; }
.auth-card-body { padding: 26px 28px 30px; }

/* ---------- Misc ---------- */

.fs-13 { font-size: 13px; }
.text-dim { color: var(--text-dim); }
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-dim); }
.empty-state i { font-size: 28px; color: var(--border); margin-bottom: 10px; }

.wh-nav-toggle { display: none; background: none; border: none; font-size: 18px; color: var(--text); }

@media (max-width: 860px) {
    .wh-rail {
        position: fixed;
        left: -70px;
        top: 0; bottom: 0;
        z-index: 1000;
        transition: left 0.2s ease;
    }
    .wh-rail.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.2); }
    .wh-nav-toggle { display: inline-flex; }
    .wh-content { padding: 16px 14px 40px; }
}
