/* ============================================================================
   WarehousePlanner Online v10.0.0 — Enterprise 3D Spatial WMS Design System
   Logen Solutions Product Suite (CubeMaster · CubeDesigner · RouteBuilder · WarehousePlanner)
   ============================================================================ */

:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-hover: #ecfdf5;
    --border: #dbe3ee;
    --border-strong: #c2cfdf;

    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;

    --brand: #059669;
    --brand-hover: #047857;
    --brand-soft: rgba(5, 150, 105, 0.11);
    --sidebar-bg: #06281e;
    --sidebar-w: 228px;
    --sidebar-w-mini: 62px;

    --blue: #2563eb;
    --cyan: #0891b2;
    --emerald: #059669;
    --emerald-soft: rgba(5, 150, 105, 0.12);
    --amber: #d97706;
    --amber-soft: rgba(217, 119, 6, 0.14);
    --rose: #dc2626;
    --rose-soft: rgba(220, 38, 38, 0.12);
    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.12);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.09);
    --shadow-lg: 0 18px 46px rgba(6, 40, 30, 0.24);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

[data-theme="dark"] {
    --bg: #071019;
    --surface: #0d1a26;
    --surface-2: #112233;
    --surface-hover: #153140;
    --border: #1d3549;
    --border-strong: #294863;

    --text: #f1f5f9;
    --text-2: #cbd5e1;
    --muted: #8da2c0;

    --brand: #10b981;
    --brand-hover: #34d399;
    --brand-soft: rgba(16, 185, 129, 0.18);
    --emerald-soft: rgba(16, 185, 129, 0.18);
    --amber-soft: rgba(245, 158, 11, 0.20);
    --rose-soft: rgba(239, 68, 68, 0.20);
    --violet-soft: rgba(139, 92, 246, 0.20);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0; height: 100%; overflow: hidden;
    font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg); color: var(--text); font-size: 13px;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Outfit', 'Inter', 'Noto Sans KR', sans-serif; margin: 0; color: var(--text); }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
#appRoot { width: 100%; height: 100vh; overflow: hidden; }

/* Custom scrollbars */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.32); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.52); }

/* ── Main Enterprise Shell ─────────────────────────────────────────────────── */
.sb-shell { display: flex; width: 100%; height: 100vh; overflow: hidden; }
.sb-sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #041512 100%);
    color: #e2e8f0; display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.08);
    transition: width 0.18s ease; z-index: 30;
}
.sb-shell.sb-collapsed .sb-sidebar { width: var(--sidebar-w-mini); }
.sb-shell.sb-collapsed .sb-hide { display: none !important; }
.sb-shell.sb-collapsed .sb-item { justify-content: center; padding: 10px 0; }
.sb-shell.sb-collapsed .sb-brand { justify-content: center; padding: 12px 0; }

.sb-brand {
    display: flex; align-items: center; gap: 9px; padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08); height: 54px; cursor: pointer;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.sb-logo-mark { width: 100%; height: 100%; display: block; border-radius: 9px; filter: drop-shadow(0 2px 6px rgba(4, 24, 18, 0.4)); }
.brand-title { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 800; color: #fff; line-height: 1.1; }
.brand-title b { color: #34d399; }
.brand-sub { font-size: 10px; color: #94a3b8; font-family: 'JetBrains Mono', monospace; }

.sb-nav { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 3px; }
.sb-section { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; color: #64748b; padding: 8px 10px 4px; }
.sb-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 7px 6px; }

.sb-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px;
    border: none; border-radius: 8px; background: transparent; color: #cbd5e1;
    font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; text-decoration: none;
    transition: all 0.14s;
}
.sb-item i { width: 17px; text-align: center; font-size: 13.5px; flex-shrink: 0; }
.sb-item:hover { background: rgba(255,255,255,0.09); color: #fff; }
.sb-item.active { background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(0,0,0,0.28); }

.sb-footer { padding: 8px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 3px; }

.sb-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.sb-topbar {
    height: 54px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 20;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-plan-pill {
    display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600;
    max-width: 470px; overflow: hidden; white-space: nowrap;
}
#topbarPlanName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbarPlanStatus { flex-shrink: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #94a3b8; }
.status-dot.ok { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.status-dot.warn { background: #f59e0b; }

.sb-content { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.sb-content.no-scroll { overflow: hidden; display: flex; flex-direction: column; }

/* Guest Demo Banner */
.demo-banner {
    background: linear-gradient(90deg, #06281e, #0d4b3c); color: #fff;
    padding: 7px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 12px; border-bottom: 1px solid rgba(52,211,153,0.3); flex-shrink: 0;
}
.demo-pill {
    background: rgba(52,211,153,0.2); border: 1px solid rgba(52,211,153,0.45); color: #6ee7b7;
    padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
}

/* ── Buttons, Inputs, Badges & Cards ───────────────────────────────────────── */
.btn-primary, .btn-brand {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
    border: none; background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 700;
    cursor: pointer; transition: all 0.14s; white-space: nowrap;
}
.btn-primary:hover, .btn-brand:hover { background: var(--brand-hover); transform: translateY(-1px); }
.btn-outline, .btn-outline-sm {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.14s; white-space: nowrap;
}
.btn-outline-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-outline:hover, .btn-outline-sm:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-danger-sm {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 7px;
    border: 1px solid rgba(220,38,38,0.3); background: var(--rose-soft); color: var(--rose);
    font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.icon-btn-light {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn-light:hover { border-color: var(--brand); color: var(--brand); }

.lang-select, .sb-select, .sb-input {
    height: 32px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font-size: 12px; font-family: inherit;
}
.sb-input { width: 100%; height: 34px; }
.sb-input:focus, .sb-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.sb-input { height: auto; padding: 8px; min-height: 70px; resize: vertical; }

.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px;
    font-size: 10.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge.ok { background: var(--emerald-soft); color: var(--emerald); border-color: rgba(5,150,105,0.28); }
.badge.info { background: rgba(37,99,235,0.12); color: #2563eb; border-color: rgba(37,99,235,0.28); }
.badge.warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(217,119,6,0.28); }
.badge.danger { background: var(--rose-soft); color: var(--rose); border-color: rgba(220,38,38,0.28); }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: rgba(124,58,237,0.28); }
.badge.cold { background: rgba(8,145,178,0.13); color: #0891b2; border-color: rgba(8,145,178,0.28); }

/* ── Pages & Cards ─────────────────────────────────────────────────────────── */
.page-wrap { padding: 18px 22px 28px; max-width: 1520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page-hdr { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-hdr h1 { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.page-hdr h1 i { color: var(--brand); }
.page-hdr p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.hdr-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-hdr {
    padding: 11px 15px; border-bottom: 1px solid var(--border); background: var(--surface-2);
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-hdr h3 { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.card-hdr h3 i { color: var(--brand); }
.card-body { padding: 14px 16px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; }
.kpi-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 13px 15px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.kpi-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3.5px; background: var(--kpi-accent, var(--brand)); }
.kpi-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.kpi-val { font-family: 'Outfit', sans-serif; font-size: 23px; font-weight: 800; color: var(--text); line-height: 1.15; }
.kpi-sub { font-size: 11px; color: var(--muted); }

/* Tables */
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
    text-align: left; padding: 8px 10px; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.data-table tr:hover td { background: var(--surface-hover); }

/* Tabs */
.tab-bar { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 4px; flex-wrap: wrap; }
.tab-btn {
    border: none; background: transparent; color: var(--muted); padding: 9px 13px; font-size: 12.5px;
    font-weight: 700; cursor: pointer; border-bottom: 2.5px solid transparent; display: inline-flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Progress Bar */
.prog-track { width: 100%; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #34d399); transition: width 0.3s; }

/* ── Calendar & Dashboard Grids ────────────────────────────────────────────── */
.dash-grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-dow { text-align: center; padding: 7px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 92px; padding: 5px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.cal-cell.is-other { background: var(--surface-2); opacity: 0.6; }
.cal-cell.is-today { background: var(--brand-soft); }
.cal-cell-hdr { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-add-btn { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 11px; line-height: 1; }
.cal-add-btn:hover { border-color: var(--brand); color: var(--brand); }
.cal-chip {
    width: 100%; text-align: left; border: none; border-radius: 5px; padding: 4px 6px;
    background: var(--brand-soft); color: var(--text); font-size: 10.5px; cursor: pointer;
    border-left: 3px solid var(--brand); display: flex; flex-direction: column; gap: 1px;
}
.cal-chip.prio-urgent { border-left-color: var(--rose); background: var(--rose-soft); }
.cal-chip.prio-cold { border-left-color: var(--cyan); background: rgba(8,145,178,0.13); }
.cal-chip.prio-high { border-left-color: var(--amber); background: var(--amber-soft); }
.cal-chip:hover { filter: brightness(0.95); }

/* ── Integrated WMS Analysis Workbench (Left Tree + 2D Floor + 3D Twin + Bottom Dock) ─ */
.wb-root { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.wb-toolbar {
    padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; flex-shrink: 0;
}
.wb-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
.wb-seg button {
    border: none; background: transparent; color: var(--muted); padding: 5px 10px; border-radius: 6px;
    font-size: 11.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.wb-seg button.active { background: var(--brand); color: #fff; }

.wb-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.wb-tree {
    width: 268px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
}
.wb-tree-hdr { padding: 9px 12px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 12px; display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); }
.wb-tree-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.tree-group-lbl { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 6px 6px 2px; }
.tree-item {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 7px 9px; border-radius: 7px; border: 1px solid transparent; background: transparent;
    color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; width: 100%; text-align: left;
}
.tree-item:hover { background: var(--surface-2); border-color: var(--border); }
.tree-item.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.wb-center { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.wb-stage { flex: 1; min-height: 220px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); overflow: hidden; }
.wb-stage.single-pane { grid-template-columns: 1fr; }
.wb-pane { background: var(--surface); position: relative; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.wb-pane-hdr {
    padding: 7px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.wb-canvas-host { flex: 1; position: relative; min-height: 0; overflow: hidden; background: #eef3f9; }
[data-theme="dark"] .wb-canvas-host { background: #091320; }

.wb-dock {
    height: 210px; flex-shrink: 0; background: var(--surface); border-top: 2px solid var(--border-strong);
    display: flex; flex-direction: column; overflow: hidden;
}
.wb-dock.collapsed { height: 38px; }
.wb-dock.expanded { height: 68%; }
.wb-dock-hdr {
    min-height: 36px; height: auto; flex-shrink: 0; padding: 2px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.wb-dock-hdr .tab-bar { flex-wrap: nowrap; overflow-x: auto; gap: 2px; }
.wb-dock-hdr .tab-btn { white-space: nowrap; flex-shrink: 0; padding: 6px 9px; font-size: 11px; }
.wb-dock-body { flex: 1; overflow: auto; padding: 10px 14px; }

/* 3D Overlay Controls */
.three-overlay-bar {
    position: absolute; top: 8px; left: 8px; right: 8px; z-index: 10; pointer-events: none;
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.three-overlay-bar > * { pointer-events: auto; }
.three-badge {
    background: rgba(6, 29, 34, 0.86); color: #fff; padding: 5px 10px; border-radius: 7px;
    font-size: 11px; font-weight: 600; backdrop-filter: blur(8px); border: 1px solid rgba(52,211,153,0.35);
}
.three-scrubber {
    position: absolute; bottom: 10px; left: 12px; right: 12px; z-index: 10;
    background: rgba(15, 23, 42, 0.88); color: #fff; padding: 8px 12px; border-radius: 9px;
    display: flex; align-items: center; gap: 10px; font-size: 11.5px; backdrop-filter: blur(8px);
}
.three-hover-tip {
    position: absolute; z-index: 20; pointer-events: none; display: none;
    background: rgba(6, 29, 34, 0.94); color: #fff; padding: 7px 10px; border-radius: 7px;
    font-size: 11px; line-height: 1.45; border: 1px solid rgba(52,211,153,0.45); max-width: 240px;
}

/* CubeMaster 3D Studio Engine Floating Viewport HUD */
.wp3d-studio-hud {
    position: absolute; top: 10px; right: 10px; z-index: 14;
    display: flex; align-items: center; gap: 6px; padding: 4px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(15, 35, 66, 0.11);
    box-shadow: 0 8px 24px rgba(15, 35, 66, 0.10), 0 1px 3px rgba(15, 35, 66, 0.06);
    user-select: none;
}
[data-theme="dark"] .wp3d-studio-hud {
    background: rgba(15, 28, 48, 0.82);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
}
.wp3d-hud-select {
    height: 26px; border-radius: 7px; border: 1px solid rgba(15, 35, 66, 0.12);
    background: rgba(255, 255, 255, 0.90); color: #0f2342;
    font-size: 11px; font-weight: 700; padding: 0 7px; cursor: pointer; outline: none;
}
[data-theme="dark"] .wp3d-hud-select {
    background: rgba(15, 23, 42, 0.90); color: #e2e8f0; border-color: rgba(148, 163, 184, 0.24);
}
.wp3d-cam-pills {
    display: inline-flex; gap: 2px; padding: 2px; border-radius: 7px;
    background: rgba(15, 35, 66, 0.06);
}
[data-theme="dark"] .wp3d-cam-pills { background: rgba(148, 163, 184, 0.12); }
.wp3d-cam-btn {
    border: none; background: transparent; color: #475569;
    font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 5px;
    cursor: pointer; transition: all 0.14s ease; white-space: nowrap;
}
.wp3d-cam-btn:hover { background: rgba(255, 255, 255, 0.85); color: #0f2342; }
.wp3d-cam-btn.active {
    background: #ffffff; color: #0f2342;
    box-shadow: 0 1px 4px rgba(15, 35, 66, 0.12);
}
[data-theme="dark"] .wp3d-cam-btn { color: #94a3b8; }
[data-theme="dark"] .wp3d-cam-btn:hover,
[data-theme="dark"] .wp3d-cam-btn.active { background: #1e3a5f; color: #f8fafc; }
.wp3d-perf-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 99px;
    background: rgba(15, 35, 66, 0.06);
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 600; color: #0f2342;
    white-space: nowrap;
}
[data-theme="dark"] .wp3d-perf-pill { background: rgba(148, 163, 184, 0.14); color: #e2e8f0; }
.wp3d-perf-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #10b981;
    box-shadow: 0 0 7px rgba(16, 185, 129, 0.75);
}
.wp3d-perf-sep { color: #94a3b8; }

/* Gantt Dock Timeline */
.gantt-row { display: grid; grid-template-columns: 165px 1fr; align-items: center; border-bottom: 1px solid var(--border); min-height: 36px; }
.gantt-lbl { padding: 6px 10px; font-size: 11.5px; font-weight: 700; color: var(--text); background: var(--surface-2); border-right: 1px solid var(--border); }
.gantt-track { position: relative; height: 34px; background: repeating-linear-gradient(90deg, transparent, transparent 8.33%, rgba(148,163,184,0.12) 8.33%, rgba(148,163,184,0.12) calc(8.33% + 1px)); }
.gantt-bar {
    position: absolute; top: 5px; height: 24px; border-radius: 5px; padding: 0 7px;
    color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; gap: 5px;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-shadow: 0 2px 5px rgba(0,0,0,0.16);
}

/* API Sandbox */
.sandbox-layout { display: grid; grid-template-columns: 290px 1fr; gap: 14px; align-items: start; }
.sandbox-code {
    background: #0b1420; color: #e2e8f0; border-radius: 8px; padding: 12px;
    font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.55;
    overflow: auto; max-height: 360px; white-space: pre-wrap; word-break: break-word;
}

/* Pricing Grid */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.tier-card {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
    padding: 20px; display: flex; flex-direction: column; gap: 12px; position: relative;
}
.tier-card.popular { border-color: var(--brand); box-shadow: 0 10px 28px rgba(5,150,105,0.14); }
.tier-price { font-family: 'Outfit', sans-serif; font-size: 32px; font-weight: 800; color: var(--text); }
.tier-feat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--text-2); flex: 1; }
.tier-feat-list li { display: flex; align-items: flex-start; gap: 7px; }
.tier-feat-list li i { color: var(--brand); margin-top: 2px; }

/* Auth Split-Screen */
.auth-shell { display: grid; grid-template-columns: 1.15fr 0.85fr; width: 100%; height: 100%; min-height: calc(100vh - 62px); background: var(--bg); }
.auth-hero {
    background: radial-gradient(circle at 18% 20%, #0f4c43 0%, #062220 55%, #031110 100%);
    color: #fff; padding: 36px 46px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px;
    background: rgba(52,211,153,0.14); border: 1px solid rgba(52,211,153,0.38); color: #6ee7b7;
    font-size: 11px; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 16px;
}
.auth-hero h1 { color: #fff; font-size: 32px; line-height: 1.2; margin-bottom: 14px; }
.auth-hero p { color: #cbd5e1; font-size: 14px; line-height: 1.65; margin: 0 0 24px; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.auth-feat {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); border-radius: 10px;
    padding: 11px 13px; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #e2e8f0;
}
.auth-feat i { color: #34d399; font-size: 15px; flex-shrink: 0; }
.auth-form-pane { display: flex; align-items: center; justify-content: center; padding: 28px; overflow-y: auto; }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; box-shadow: var(--shadow-md); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.auth-tab { border: none; background: transparent; color: var(--muted); padding: 9px; border-radius: 7px; font-weight: 700; font-size: 13px; cursor: pointer; }
.auth-tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* Modals, Busy Overlay & Toasts */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(4, 18, 22, 0.58); backdrop-filter: blur(4px);
    z-index: 240; display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-dialog {
    width: 100%; max-width: 640px; max-height: 90vh; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 11px; font-weight: 700; color: var(--muted); }

.busy-overlay {
    position: fixed; inset: 0; z-index: 300; background: rgba(4, 22, 20, 0.68); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
}
.busy-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 28px 34px; text-align: center; max-width: 440px; box-shadow: var(--shadow-lg);
}
.busy-spinner {
    width: 42px; height: 42px; border: 4px solid var(--border); border-top-color: var(--brand);
    border-radius: 50%; margin: 0 auto 14px; animation: sbSpin 0.8s linear infinite;
}
@keyframes sbSpin { to { transform: rotate(360deg); } }

.toast-stack { position: fixed; bottom: 18px; right: 18px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 10px 14px; border-radius: 9px; background: #0f172a; color: #fff; font-size: 12.5px; font-weight: 600;
    box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px; max-width: 380px;
    border-left: 4px solid var(--brand); animation: toastIn 0.2s ease;
}
.toast.error { border-left-color: #ef4444; }
.toast.warn { border-left-color: #f59e0b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
    .dash-grid-2, .sandbox-layout, .auth-shell, .wb-stage { grid-template-columns: 1fr; }
    .wb-tree { width: 210px; }
}

/* ============================================================================
   WarehousePlanner Online v11.0 — CAD Layout Studio, 5-Stage Stepper & Inspector
   ============================================================================ */
.cad-studio { display: flex; flex-direction: column; background: var(--surface); }
.cad-topbar {
    padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.cad-templates { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cad-lbl { font-size: 11px; font-weight: 800; color: var(--muted); margin-right: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.cad-tpl-btn {
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
    padding: 4px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.12s;
}
.cad-tpl-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.cad-dims-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.cad-mini-in { width: 52px; height: 27px; padding: 0 5px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.cad-mini-sel { height: 27px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 11px; font-weight: 700; }

.cad-metrics-bar {
    padding: 7px 14px; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.cad-metric { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; }
.cad-metric span { color: var(--muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase; }
.cad-metric b { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text); }

.cad-workspace { display: grid; grid-template-columns: 182px minmax(0, 1fr) 284px; min-height: 550px; background: var(--border); gap: 1px; width: 100%; overflow: hidden; }
.cad-palette { background: var(--surface); padding: 9px; display: flex; flex-direction: column; gap: 11px; overflow-y: auto; max-height: 620px; min-width: 0; }
.cad-pal-sec { display: flex; flex-direction: column; gap: 4px; }
.cad-pal-title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 2px; display: flex; align-items: center; gap: 5px; }
.cad-pal-btn {
    display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
    font-size: 11.5px; font-weight: 600; cursor: pointer; text-align: left; transition: all 0.12s;
}
.cad-pal-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.cad-pal-btn .dot, .tree-row .dot, .tree-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.cad-canvas-split { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface); min-width: 0; overflow: hidden; }
.cad-canvas-split.split-3d { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 1px; background: var(--border); }
.cad-canvas-wrap, .cad-3d-pane { display: flex; flex-direction: column; background: var(--surface); min-width: 0; overflow: hidden; }
.cad-canvas-hint {
    padding: 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); font-weight: 600;
}
.cad-svg-host { flex: 1; min-height: 490px; position: relative; overflow: hidden; }

.cad-inspector { background: var(--surface); display: flex; flex-direction: column; max-height: 620px; overflow: hidden; min-width: 0; }
.cad-inspector .form-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.cad-inspector .form-field { min-width: 0; }
.cad-inspector .sb-input, .cad-inspector .sb-select { width: 100%; min-width: 0; box-sizing: border-box; font-size: 11.5px; }
.cad-insp-hdr, .insp-hdr {
    padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.cad-insp-body, .insp-body { padding: 11px 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.cad-fp-summary { padding: 8px 10px; border-radius: 7px; background: var(--brand-soft); border: 1px solid rgba(5,150,105,0.28); font-size: 11.5px; color: var(--text); }

/* 5-Stage Systematic Operational Planning Stepper */
.stage-stepper {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
    padding: 7px 12px; background: linear-gradient(90deg, #06281e, #0c3b2e); border-bottom: 1px solid rgba(52,211,153,0.25); flex-shrink: 0;
}
.stage-step {
    display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #cbd5e1;
    cursor: pointer; text-align: left; transition: all 0.14s; min-width: 0;
}
.stage-step:hover { background: rgba(255,255,255,0.13); color: #fff; }
.stage-step.active {
    background: var(--brand); border-color: #6ee7b7; color: #fff;
    box-shadow: 0 3px 12px rgba(5,150,105,0.42);
}
.stage-ico { width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,0.14); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; }
.stage-txt { display: flex; flex-direction: column; min-width: 0; }
.stage-txt b { font-size: 11.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-txt small { font-size: 10px; opacity: 0.82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Expandable Hierarchical Tree */
.tree-sec-hdr {
    display: flex; align-items: center; gap: 6px; padding: 6px 6px 3px; cursor: pointer;
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); user-select: none;
}
.tree-sec-hdr:hover { color: var(--text); }
.tree-chev { width: 12px; text-align: center; font-size: 9px; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.tree-row { display: flex; align-items: center; gap: 3px; padding: 2px 4px; border-radius: 6px; border: 1px solid transparent; }
.tree-row:hover { background: var(--surface-2); }
.tree-row.active { background: var(--brand-soft); border-color: var(--brand); }
.tree-lbl-btn {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: none; background: transparent;
    color: var(--text-2); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 4px 3px; text-align: left;
}
.tree-row.active .tree-lbl-btn { color: var(--brand); font-weight: 700; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tree-cnt { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.indent-1 { margin-left: 12px; width: calc(100% - 12px); }
.indent-2 { margin-left: 24px; width: calc(100% - 24px); padding: 4px 7px; }

/* Right Context Detail Inspector */
.wb-inspector {
    width: 300px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
}
.insp-kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.insp-kv-grid > div { padding: 6px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.insp-kv-grid span { font-size: 9.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.insp-kv-grid b { font-size: 11.5px; color: var(--text); white-space: normal; word-break: break-word; line-height: 1.28; }
.insp-sec { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-top: 4px; }
.insp-stack-row {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2);
    font-size: 11px; color: var(--text-2); cursor: pointer; text-align: left;
}
.insp-stack-row.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.insp-lot-card { padding: 7px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; }
.insp-note { padding: 8px 10px; border-radius: 7px; background: var(--brand-soft); border: 1px solid rgba(5,150,105,0.24); font-size: 11.5px; color: var(--text-2); line-height: 1.45; }

/* Stage 1 Readiness Gauges & Action Queue Cards */
.readiness-strip { display: grid; grid-template-columns: 110px repeat(5, 1fr); gap: 8px; margin-bottom: 10px; align-items: center; }
.readiness-grade {
    padding: 7px 10px; border-radius: 9px; background: linear-gradient(135deg, #064e3b, #059669); color: #fff;
    display: flex; flex-direction: column; align-items: center; line-height: 1.15;
}
.readiness-grade span { font-size: 9.5px; text-transform: uppercase; opacity: 0.85; }
.readiness-grade b { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; }
.readiness-grade small { font-size: 10px; opacity: 0.9; }
.readiness-gauge { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }

.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 9px; }
.action-card {
    padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
    border-left: 3.5px solid var(--brand);
}
.action-card.prio-1 { border-left-color: #dc2626; }
.action-card.prio-2 { border-left-color: #f59e0b; }
.action-card.prio-3 { border-left-color: #0891b2; }

.data-table tr.row-selected td { background: var(--brand-soft) !important; font-weight: 600; }

/* ── Standalone Building Layout Repository & Picker ───────────────────────── */
.lay-repo-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(305px, 1fr)); gap: 14px;
}
.lay-repo-card {
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.lay-repo-card:hover { border-color: var(--brand); box-shadow: 0 8px 22px rgba(5,150,105,0.10); transform: translateY(-1px); }
.lay-repo-card.is-custom { border-color: rgba(5,150,105,0.45); }
.lay-repo-thumb {
    position: relative; background: var(--surface-2); border-bottom: 1px solid var(--border);
    padding: 8px; display: flex; align-items: center; justify-content: center; height: 148px;
}
.lay-mini-svg { width: 100%; height: 100%; display: block; }
.lay-flow-pill {
    position: absolute; bottom: 8px; left: 8px; font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px;
    background: rgba(15,23,42,0.78); color: #fff;
}
.lay-type-pill { position: absolute; top: 8px; right: 8px; font-size: 10px; }
.lay-repo-info { padding: 11px 13px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lay-repo-name { font-size: 13.5px; font-weight: 800; color: var(--text); line-height: 1.25; }
.lay-repo-stats {
    display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 11px; color: var(--text-2);
    font-family: 'JetBrains Mono', monospace;
}
.lay-repo-stats i { color: var(--brand); margin-right: 3px; }
.lay-repo-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; padding-top: 4px; }

.lay-meta-bar {
    display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
    padding: 9px 14px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.lay-meta-field { display: flex; flex-direction: column; gap: 3px; }
.lay-meta-field label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); }

.lay-pick-list { display: flex; flex-direction: column; gap: 7px; max-height: 360px; overflow-y: auto; padding-right: 2px; }
.lay-pick-card {
    display: flex; align-items: center; gap: 11px; padding: 8px 10px;
    border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface);
    cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.lay-pick-card:hover { border-color: var(--brand); background: var(--surface-2); }
.lay-pick-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.lay-pick-svg { width: 132px; height: 74px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }

.plan-assigned-layout-card {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 13px 15px; margin-bottom: 16px; border-radius: 11px;
    border: 1.5px solid rgba(5,150,105,0.34); background: linear-gradient(135deg, var(--brand-soft), var(--surface));
}
.plan-lay-thumb {
    width: 224px; height: 128px; flex-shrink: 0; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface); padding: 4px;
}

/* ── Maximizable 2D/3D CAD Studio Modal ────────────────────────────────────── */
.cad-modal-backdrop {
    position: fixed; inset: 0; z-index: 180;
    background: rgba(4, 18, 22, 0.64); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 18px;
    transition: padding 0.16s ease;
}
.cad-modal-backdrop.is-maximized { padding: 0; }
.cad-modal-shell {
    width: min(96vw, 1540px); height: 92vh;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 24px 64px rgba(2, 16, 20, 0.42);
    display: flex; flex-direction: column; overflow: hidden;
    transition: width 0.16s ease, height 0.16s ease, border-radius 0.16s ease;
}
.cad-modal-shell.is-maximized {
    width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh;
    border-radius: 0; border: none;
}
.cad-modal-hdr {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 9px 14px; background: linear-gradient(90deg, #06281e, #0a3c2d); color: #fff;
    border-bottom: 1px solid rgba(52, 211, 153, 0.24); flex-shrink: 0;
}
.cad-modal-title-grp { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.cad-modal-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cad-modal-hdr .btn-outline-sm {
    background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.22); color: #f8fafc;
}
.cad-modal-hdr .btn-outline-sm:hover { background: rgba(255,255,255,0.20); color: #fff; border-color: #6ee7b7; }
.cad-modal-body {
    flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface);
}
.cad-modal-body #layCadMount {
    flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.cad-modal-body .cad-studio { flex: 1; min-height: 0; height: 100%; }
.cad-modal-body .cad-workspace { flex: 1; min-height: 0; height: 100%; }
.cad-modal-body .cad-palette,
.cad-modal-body .cad-inspector { max-height: none; height: 100%; }
.cad-modal-body .cad-svg-host { min-height: 0; height: 100%; }

/* ── Enterprise Reports Workspace & Live Printable Preview ─────────────────── */
.reports-workspace {
    display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 16px; align-items: start;
}
.reports-rail {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 12px;
}
.rep-rail-hdr {
    font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); padding: 2px 4px 6px;
}
.rep-tpl-btn {
    width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left;
    padding: 9px 10px; border-radius: 9px; border: 1.5px solid transparent;
    background: transparent; color: var(--text-2); cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.rep-tpl-btn:hover { background: var(--surface-2); border-color: var(--border); }
.rep-tpl-btn.active {
    background: var(--brand-soft); border-color: var(--brand); color: var(--text);
}
.rep-tpl-btn i { font-size: 16px; color: var(--brand); margin-top: 2px; flex-shrink: 0; }
.rep-tpl-btn b { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.rep-tpl-btn small { display: block; font-size: 11px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.rep-spec-box {
    margin-top: 10px; padding: 10px 11px; border-radius: 9px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 11.5px; color: var(--muted); line-height: 1.48;
}
.rep-spec-box h4 { font-size: 11.5px; color: var(--text); margin: 0 0 5px; display: flex; align-items: center; gap: 6px; }

.report-preview-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; min-width: 0; box-shadow: var(--shadow-sm);
}
.report-preview-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.report-sheet { padding: 20px 22px; background: var(--surface); }
.report-paper-banner {
    background: linear-gradient(135deg, #06281e, #0a4232); color: #fff;
    border-radius: 11px; padding: 16px 18px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    overflow: hidden;
}
.report-paper-banner > div, .report-paper-banner > div > div { min-width: 0; overflow-wrap: anywhere; }
.rep-visual-row {
    display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; margin: 14px 0;
}
.rep-mini-map-box {
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
    padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;
}
.rep-sec-hdr {
    font-size: 13.5px; font-weight: 800; color: var(--brand); margin: 18px 0 8px;
    padding-bottom: 5px; border-bottom: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.rep-pdf-frame {
    width: 100%; height: 740px; border: none; display: block; background: #1e293b;
}

/* ============================================================================
   WarehousePlanner Online v12.0 — Wave->Pallet->Truck Player, 3D Loading Dock,
   Collapsible Plan Tree, Full-Viewport Maximize & Truck Bay Manifest Inspector
   ============================================================================ */
.wb-seg-cnt {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 17px; height: 16px; padding: 0 5px; border-radius: 99px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 800;
    background: rgba(16, 185, 129, 0.16); color: var(--emerald); margin-left: 3px;
}
.wb-seg button.active .wb-seg-cnt {
    background: rgba(255, 255, 255, 0.24); color: #ffffff;
}
.btn-outline-sm.is-active {
    background: var(--brand-soft); border-color: var(--brand); color: var(--brand);
}
.wb-tree { transition: width 0.16s ease, opacity 0.14s ease; }
.wb-tree.collapsed {
    width: 0 !important; min-width: 0 !important; padding: 0 !important;
    border-right: none !important; opacity: 0; overflow: hidden; pointer-events: none;
}
.tree-truck-step {
    background: rgba(16, 185, 129, 0.07); border-color: rgba(16, 185, 129, 0.24);
    font-weight: 700;
}
.tree-truck-step:hover { background: rgba(16, 185, 129, 0.14); border-color: var(--emerald); }

/* Full-Viewport Maximize Mode for 3D Digital Twin, Loading Dock & 3D Pack Studio */
.wb-pane.is-maximized {
    position: fixed !important; inset: 0 !important; z-index: 210 !important;
    width: 100vw !important; height: 100vh !important;
    border: none !important; border-radius: 0 !important;
}
.wb-pane.is-maximized .wb-pane-hdr {
    padding: 9px 14px; background: linear-gradient(90deg, #06281e, #0a3c2d); color: #fff;
    border-bottom: 1px solid rgba(52, 211, 153, 0.24);
}
.wb-pane.is-maximized .wb-pane-hdr .btn-outline-sm {
    background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.24); color: #f8fafc;
}
.wb-pane.is-maximized .wb-pane-hdr .btn-outline-sm:hover,
.wb-pane.is-maximized .wb-pane-hdr .btn-outline-sm.is-active {
    background: rgba(16, 185, 129, 0.30); border-color: #6ee7b7; color: #fff;
}
.wb-inspector.is-max-overlay {
    position: fixed !important; top: 44px; right: 12px; bottom: 64px; z-index: 225 !important;
    width: 315px !important; border-radius: 12px;
    border: 1px solid var(--border-strong);
    box-shadow: 0 20px 50px rgba(2, 16, 20, 0.36);
}

/* Floating Glass Bottom Wave->Pallet->Truck & Loading Dock Animation Player */
.wp3d-wave-player {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    z-index: 16; max-width: calc(100% - 24px);
    display: flex; align-items: center; gap: 6px; padding: 5px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(15, 35, 66, 0.12);
    box-shadow: 0 10px 28px rgba(15, 35, 66, 0.14), 0 1px 3px rgba(15, 35, 66, 0.06);
    user-select: none; white-space: nowrap;
}
[data-theme="dark"] .wp3d-wave-player {
    background: rgba(12, 24, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    color: #e2e8f0;
}
.wp3d-wp-icon, .wp3d-wp-speed, .wp3d-mini-btn {
    border: 1px solid rgba(15, 35, 66, 0.12); background: rgba(255, 255, 255, 0.92);
    color: #0f2342; border-radius: 7px; height: 26px; padding: 0 8px;
    font-size: 11px; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    transition: all 0.12s ease;
}
.wp3d-wp-icon { min-width: 28px; padding: 0; font-size: 12px; }
.wp3d-wp-icon:hover, .wp3d-wp-speed:hover, .wp3d-mini-btn:hover {
    border-color: var(--brand); color: var(--brand); background: #fff;
}
[data-theme="dark"] .wp3d-wp-icon,
[data-theme="dark"] .wp3d-wp-speed,
[data-theme="dark"] .wp3d-mini-btn {
    background: rgba(30, 41, 59, 0.9); border-color: rgba(148, 163, 184, 0.24); color: #f8fafc;
}
.wp3d-play-btn {
    border: none; background: linear-gradient(135deg, #059669, #10b981); color: #fff;
    height: 26px; padding: 0 11px; border-radius: 7px; font-size: 11px; font-weight: 800;
    cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.30); transition: filter 0.12s;
}
.wp3d-play-btn:hover { filter: brightness(1.06); }
.wp3d-wp-phases {
    display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px;
    background: rgba(15, 35, 66, 0.06);
}
[data-theme="dark"] .wp3d-wp-phases { background: rgba(148, 163, 184, 0.12); }
.wp3d-phase-btn {
    border: none; background: transparent; color: #475569;
    font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
    cursor: pointer; transition: all 0.14s ease;
}
.wp3d-phase-btn:hover { color: #0f2342; background: rgba(255, 255, 255, 0.72); }
.wp3d-phase-btn.active {
    background: #059669; color: #fff; box-shadow: 0 2px 6px rgba(5, 150, 105, 0.28);
}
[data-theme="dark"] .wp3d-phase-btn { color: #94a3b8; }
[data-theme="dark"] .wp3d-phase-btn.active { background: #10b981; color: #041d15; }
.wp3d-stage-pill {
    font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 6px;
    background: rgba(5, 150, 105, 0.12); color: var(--brand);
}
.wp3d-wp-scrub, .wp3d-scrub {
    width: 110px; accent-color: #059669; cursor: pointer;
}
.wp3d-pct { font-size: 11px; font-weight: 800; min-width: 34px; text-align: right; color: #0f2342; }
[data-theme="dark"] .wp3d-pct { color: #e2e8f0; }
.wp3d-wp-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 99px;
    background: rgba(15, 35, 66, 0.06); font-size: 10.5px; font-weight: 700; color: #0f2342;
}
[data-theme="dark"] .wp3d-wp-status { background: rgba(148, 163, 184, 0.14); color: #e2e8f0; }
.wp3d-wp-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* Stage 5 Outbound Truck Dispatch Bay Cards Strip */
.wb-bay-strip {
    margin-bottom: 10px; padding: 9px 11px; border-radius: 9px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.wb-bay-strip-hdr {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    margin-bottom: 8px; font-size: 12px;
}
.wb-bay-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px;
}
.wb-bay-card {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 8px;
    padding: 8px 10px; cursor: pointer; transition: all 0.14s ease; text-align: left;
    color: var(--text);
}
.wb-bay-card:hover { border-color: var(--emerald); transform: translateY(-1px); }
.wb-bay-card.active {
    border-color: var(--emerald); background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

/* Truck Bay Manifest Inspector Additions */
.insp-ai-banner {
    padding: 8px 10px; border-radius: 8px; background: var(--surface-2);
    border: 1px solid var(--border); margin-bottom: 8px;
}
.insp-unit-list { display: flex; flex-direction: column; gap: 4px; max-height: 225px; overflow-y: auto; }
.insp-unit-row {
    display: flex; align-items: center; gap: 7px; padding: 6px 8px;
    border-radius: 7px; border: 1px solid var(--border); background: var(--surface);
    cursor: pointer; transition: all 0.12s ease;
}
.insp-unit-row:hover { border-color: var(--brand); background: var(--surface-2); }
.insp-unit-row.active {
    border-color: #0ea5e9; background: rgba(14, 165, 233, 0.12);
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.25);
}
.insp-pack-mini {
    border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--violet);
    width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    font-size: 10.5px; transition: all 0.12s;
}
.insp-pack-mini:hover { background: var(--violet); color: #fff; border-color: var(--violet); }

/* ============================================================================
   WarehousePlanner Online v13.0 — Answer-First 4-Goal WMS Analysis Workspace
   ============================================================================ */
.v13-verdict-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 6px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.09), var(--surface) 42%);
}
.v13-verdict-bar.tone-warn {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.11), var(--surface) 42%);
}
.v13-verdict-bar.tone-danger {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.11), var(--surface) 42%);
}
[data-theme="dark"] .v13-verdict-bar {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.14), var(--surface) 45%);
}
.v13-verdict-left {
    display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1;
}
.v13-grade-chip {
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
    padding: 3px 9px; border-radius: 7px; font-family: 'Outfit', sans-serif;
    font-size: 12px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, #065f46, #059669);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}
.v13-verdict-bar.tone-warn .v13-grade-chip { background: linear-gradient(135deg, #b45309, #f59e0b); }
.v13-verdict-bar.tone-danger .v13-grade-chip { background: linear-gradient(135deg, #991b1b, #ef4444); }
.v13-grade-chip b { font-family: 'JetBrains Mono', monospace; font-size: 11px; opacity: 0.92; }
.v13-verdict-text {
    font-size: 12.5px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v13-verdict-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

.v13-mode-pill {
    display: inline-flex; padding: 2px; border-radius: 8px;
    background: var(--surface-2); border: 1px solid var(--border-strong); gap: 2px;
}
.v13-mode-pill button {
    border: none; background: transparent; color: var(--muted);
    padding: 4px 9px; border-radius: 6px; font-size: 11px; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all 0.12s;
}
.v13-mode-pill button:hover { color: var(--text); }
.v13-mode-pill button.active {
    background: var(--surface); color: var(--brand);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
}

/* Row 2: Single Unified 4-Goal Bar */
.v13-goal-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: nowrap;
    padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
    overflow-x: auto;
}
.v13-goal-tabs { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.v13-goal-tab {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text-2);
    font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
    transition: all 0.14s ease;
}
.v13-goal-tab:hover { border-color: var(--brand); color: var(--text); background: var(--surface); }
.v13-goal-tab.active {
    background: linear-gradient(135deg, #064e3b, #059669); color: #fff;
    border-color: #059669; box-shadow: 0 3px 10px rgba(5, 150, 105, 0.24);
}
.v13-goal-chip {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
    padding: 1px 5px; border-radius: 99px;
    background: rgba(15, 23, 42, 0.08); color: var(--muted);
}
.v13-goal-tab.active .v13-goal-chip { background: rgba(255, 255, 255, 0.22); color: #fff; }
.v13-view-controls { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.v13-seg button { padding: 4px 8px !important; font-size: 11px !important; }
.v13-heat-sel { height: 27px; font-size: 11px; width: 108px; padding: 0 6px !important; white-space: nowrap; }

/* Body & Left Focused Goal Rail */
.v13-body { position: relative; }
.v13-left-panel {
    flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
}
.v13-left-panel.is-goal-mode { width: 312px; }
.v13-left-panel.is-tree-mode { width: 266px; }
.v13-tree-wrap { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.v13-goal-rail { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.v13-rail-head {
    padding: 10px 12px 9px; border-bottom: 1px solid var(--border);
    background: var(--surface-2); flex-shrink: 0;
}
.v13-rail-title { font-size: 12.5px; font-weight: 800; color: var(--text); }
.v13-rail-sub { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.v13-rail-scroll {
    flex: 1; overflow-y: auto; padding: 10px 11px;
    display: flex; flex-direction: column; gap: 8px;
}
.v13-rail-foot {
    padding: 9px 11px; border-top: 1px solid var(--border);
    background: var(--surface-2); flex-shrink: 0;
}
.v13-next-btn {
    width: 100%; justify-content: space-between !important; padding: 8px 12px !important;
    font-size: 12px !important; border-radius: 8px !important;
}

.v13-subtabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
    margin-top: 7px; padding: 2px; border-radius: 8px;
    background: var(--surface); border: 1px solid var(--border);
}
.v13-subtabs button {
    border: none; background: transparent; color: var(--muted);
    padding: 5px 6px; border-radius: 6px; font-size: 11px; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    transition: all 0.12s;
}
.v13-subtabs button.active {
    background: var(--brand-soft); color: var(--brand);
}

.v13-hint-pill {
    font-size: 11px; color: var(--text-2); line-height: 1.4;
    padding: 7px 9px; border-radius: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.v13-hint-pill i { color: var(--brand); margin-right: 4px; }

/* Goal 1 Executive Score Card */
.v13-score-card {
    padding: 10px 11px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.v13-score-top { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.v13-score-badge {
    width: 66px; height: 66px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #064e3b, #059669); color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.22);
}
.v13-score-badge span { font-size: 8.5px; font-weight: 700; opacity: 0.85; letter-spacing: 0.04em; }
.v13-score-badge b { font-family: 'Outfit', sans-serif; font-size: 24px; line-height: 1.05; }
.v13-score-badge small { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; opacity: 0.9; }
.v13-kpi-mini-col { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v13-kpi-mini-col > div { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.v13-kpi-mini-col span { color: var(--muted); font-weight: 600; }
.v13-mini-bars { display: flex; flex-direction: column; gap: 5px; padding-top: 7px; border-top: 1px solid var(--border); }
.v13-mini-bar-row { display: flex; align-items: center; gap: 7px; font-size: 10.5px; }
.v13-mini-bar-row span { width: 82px; color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v13-mini-bar-row b { width: 32px; text-align: right; font-size: 10.5px; }

.v13-sec-label {
    font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--muted); padding: 2px 2px 0;
}
.v13-card-stack { display: flex; flex-direction: column; gap: 7px; }
.v13-act-card, .v13-item-card, .v13-wave-card, .v13-bay-card {
    padding: 9px 10px; border-radius: 9px;
    background: var(--surface); border: 1px solid var(--border);
    transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.v13-act-card { border-left: 3px solid var(--brand); }
.v13-act-card.prio-1 { border-left-color: #dc2626; }
.v13-act-card.prio-2 { border-left-color: #f59e0b; }
.v13-act-card.prio-3 { border-left-color: #0891b2; }
.v13-item-card, .v13-wave-card, .v13-bay-card { cursor: pointer; }
.v13-item-card:hover, .v13-wave-card:hover, .v13-bay-card:hover {
    border-color: var(--brand); background: var(--surface-2);
}
.v13-item-card.active, .v13-wave-card.active, .v13-bay-card.active {
    border-color: var(--brand); background: var(--brand-soft);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.10);
}
.v13-act-title { font-size: 11.5px; font-weight: 700; color: var(--text); margin-top: 4px; line-height: 1.3; }
.v13-act-desc { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.38; }
.v13-item-meta {
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
    font-size: 10.5px; color: var(--muted); margin-top: 4px;
}
.v13-empty-ok {
    padding: 14px 10px; text-align: center; border-radius: 9px;
    background: var(--surface-2); border: 1px dashed var(--border);
    color: var(--emerald); font-size: 11.5px; font-weight: 700;
}

/* Goal 3 Wave Stops & Truck End Action */
.v13-stop-list {
    display: flex; flex-direction: column; gap: 3px;
    margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border);
}
.v13-stop-row {
    width: 100%; display: flex; align-items: center; gap: 6px;
    padding: 4px 6px; border-radius: 6px; border: 1px solid transparent;
    background: var(--surface); color: var(--text-2); font-size: 10.5px; cursor: pointer;
}
.v13-stop-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.v13-stop-row.active { border-color: var(--brand); background: var(--brand-soft); color: var(--text); font-weight: 700; }
.v13-truck-end-btn {
    width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 6px;
    margin-top: 3px; padding: 6px 8px; border-radius: 7px;
    border: 1px solid rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.12);
    color: #047857; font-size: 11px; font-weight: 800; cursor: pointer; transition: all 0.12s;
}
[data-theme="dark"] .v13-truck-end-btn { color: #6ee7b7; }
.v13-truck-end-btn:hover, .v13-truck-end-btn.active {
    background: #059669; color: #fff; border-color: #059669;
}
.v13-mhe-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.v13-mhe-chip {
    display: flex; justify-content: space-between; align-items: center; gap: 5px;
    padding: 5px 7px; border-radius: 7px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-2); font-size: 10.5px; font-weight: 600; cursor: pointer;
}
.v13-mhe-chip:hover, .v13-mhe-chip.active { border-color: var(--brand); background: var(--brand-soft); }

/* Goal 4 Inline Bay Load Units */
.v13-bay-units {
    display: flex; flex-direction: column; gap: 3px;
    margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border);
}
.v13-bay-unit-row {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px; border-radius: 6px; border: 1px solid transparent;
    background: var(--surface); font-size: 10.5px; cursor: pointer;
}
.v13-bay-unit-row:hover { border-color: var(--border-strong); }
.v13-bay-unit-row.active { border-color: #0ea5e9; background: rgba(14, 165, 233, 0.14); font-weight: 700; }

/* Slim Bottom Data Table Drawer (Simple Mode) */
.v13-dock.collapsed { height: 34px; }
.v13-dock.collapsed .wb-dock-hdr { padding: 0; min-height: 34px; border-bottom: none; }
.v13-drawer-bar-btn {
    width: 100%; height: 34px; border: none; background: transparent; color: var(--text);
    padding: 0 14px; display: flex; justify-content: space-between; align-items: center;
    font-size: 11.5px; cursor: pointer; transition: background 0.12s;
}
.v13-drawer-bar-btn:hover { background: var(--brand-soft); }
.v13-drawer-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10.5px; font-weight: 700; color: var(--brand);
    padding: 2px 9px; border-radius: 99px; background: var(--brand-soft);
}

/* On-Demand Slide-Over Detail Inspector Drawer (Simple Mode — doesn't crush 3D canvas!) */
.wb-inspector.is-slide-drawer {
    position: absolute; top: 8px; right: 8px; bottom: 42px; z-index: 30;
    width: 312px !important; border-radius: 12px;
    border: 1px solid var(--border-strong);
    box-shadow: 0 18px 44px rgba(2, 16, 20, 0.24);
    animation: slideInRight 0.16s ease;
}
.v13-insp-close { width: 24px; height: 24px; font-size: 11px; }
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1180px) {
    .v13-left-panel.is-goal-mode { width: 270px; }
    .v13-goal-chip { display: none; }
}

/* ============================================================================
   WarehousePlanner Online v14.0 — Persistent Warehouse Switcher, Live 3D
   Inventory Monitor & Daily Orders Context Strip
   ============================================================================ */
.topbar-wh-switcher {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
}
.topbar-wh-lbl {
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--muted);
}
.topbar-wh-select {
    border: none; background: transparent; color: var(--text);
    font-weight: 800; font-size: 12.5px; cursor: pointer; outline: none;
    width: auto; max-width: 350px; padding-right: 18px; margin-right: 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1;
}
[data-theme="dark"] .topbar-wh-select option { background: #0f172a; color: #f8fafc; }

.pb-wh-context-strip {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 9px 13px; margin-bottom: 12px; border-radius: 10px;
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.08), var(--surface));
    border: 1px solid rgba(5, 150, 105, 0.28);
}

.inv-kpi-strip {
    display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inv-kpi-strip b { font-family: 'JetBrains Mono', monospace; font-weight: 800; }
.inv-kpi-sep { color: var(--muted); }

.inv-search-box {
    position: relative; display: flex; align-items: center; width: 280px; flex-shrink: 0;
}
.inv-search-box i.fa-magnifying-glass {
    position: absolute; left: 9px; font-size: 11px; color: var(--muted); pointer-events: none;
}
.inv-search-box input {
    width: 100%; height: 29px; padding: 0 26px 0 28px; border-radius: 8px;
    border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
    font-size: 11.5px; outline: none; transition: border-color 0.14s, background 0.14s;
}
.inv-search-box input:focus { border-color: var(--brand); background: var(--surface); }
.inv-search-clear {
    position: absolute; right: 5px; border: none; background: transparent;
    color: var(--muted); cursor: pointer; width: 20px; height: 20px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
}
.inv-search-clear:hover { background: var(--border); color: var(--text); }

.inv-filter-pills { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.inv-fpill {
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
    padding: 4px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
    cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
    transition: all 0.12s;
}
.inv-fpill span { font-family: 'JetBrains Mono', monospace; font-size: 10px; opacity: 0.78; }
.inv-fpill:hover { border-color: var(--brand); color: var(--text); background: var(--surface); }
.inv-fpill.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.inv-fpill.warn.active { background: #d97706; border-color: #d97706; color: #fff; }
.inv-fpill.cold.active { background: #0284c7; border-color: #0284c7; color: #fff; }

.inv-bin-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.inv-bin-chip {
    border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
    padding: 2px 6px; border-radius: 5px; font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 3px;
    transition: all 0.12s;
}
.inv-bin-chip i { color: #0ea5e9; font-size: 8.5px; }
.inv-bin-chip:hover, .inv-bin-chip.active {
    border-color: #0ea5e9; background: rgba(14, 165, 233, 0.16); color: var(--text);
}

@media (max-width: 1180px) {
    .cad-workspace { grid-template-columns: 1fr; }
    .reports-workspace { grid-template-columns: 1fr; }
    .reports-rail { position: static; }
    .rep-visual-row { grid-template-columns: 1fr; }
    .stage-stepper { grid-template-columns: repeat(2, 1fr); }
    .readiness-strip { grid-template-columns: repeat(3, 1fr); }
    .wb-inspector { width: 250px; }
}

@media print {
    html, body, #appRoot {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        background: #fff !important;
    }
    .sb-sidebar, .sb-topbar, .demo-banner, .reports-rail, .report-preview-bar, .page-hdr, .no-print {
        display: none !important;
    }
    .sb-shell, .sb-main-col, .sb-content, .page-wrap, .reports-workspace, .report-preview-card, .report-sheet {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
    }
    .table-wrap, .data-table-wrap, .rep-table-wrap { overflow: visible !important; }
    thead { display: table-header-group; }
    tr, .rep-section-card, .rep-kpi-grid, .rep-visual-row { break-inside: avoid; page-break-inside: avoid; }
}
