/* ═══════════════════════════════════════════════════════
   Stock Take Executive Dashboard — compact dense layout
   ═══════════════════════════════════════════════════════ */

.ste-dash {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #eef2f6;
    --teal: #0f766e;
    --red: #dc2626;
    --amber: #d97706;
    --green: #15803d;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 48px);
    background: var(--bg);
    color: var(--ink);
    font-size: 10px;
}

.ste-dash-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 10px;
    background: linear-gradient(135deg, #0b1220 0%, #0f3d3a 48%, #0f766e 100%);
    color: #fff;
}
.ste-dash-top-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ste-dash-icon {
    width: 26px; height: 26px; border-radius: 6px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.12); font-size: 13px;
}
.ste-dash-title { display: block; font-size: 12px; font-weight: 800; line-height: 1.15; }
.ste-dash-sub { display: block; font-size: 9px; opacity: .75; margin-top: 1px; }
.ste-dash-metrics { display: flex; gap: 10px; flex-wrap: wrap; }
.ste-dash-metric { text-align: right; }
.ste-dash-metric b { display: block; font-size: 8px; text-transform: uppercase; letter-spacing: .03em; opacity: .7; }
.ste-dash-metric span { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ste-dash-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.ste-dash-btn {
    display: inline-flex; align-items: center; gap: 3px;
    height: 22px; padding: 0 8px; border-radius: 4px;
    font-size: 9px; font-weight: 700; border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.12); color: #fff; text-decoration: none; cursor: pointer;
}
.ste-dash-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.ste-dash-btn--solid { background: #fff; color: #0f766e; border-color: #fff; }
.ste-dash-btn--solid:hover { background: #ecfdf5; color: #0f766e; }

.ste-dash-body {
    padding: 6px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin: 0;
}

.ste-dash-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.ste-dash-status {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 4px 8px 4px 9px;
    text-align: left;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-width: 72px;
    flex: 0 0 auto;
}
.ste-dash-status::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
    background: #94a3b8;
}
.ste-dash-status:hover { border-color: #99f6e4; }
.ste-dash-status.on {
    border-color: #5eead4;
    background: #f0fdfa;
}
.ste-dash-status.on::before { background: var(--teal); }
.ste-dash-status .n { font-size: 14px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ste-dash-status .l { margin-top: 1px; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.ste-dash-status--closed::before { background: #0f766e; }
.ste-dash-status--posted::before { background: #0891b2; }
.ste-dash-status--approved::before { background: #16a34a; }
.ste-dash-status--submitted::before,
.ste-dash-status--review::before { background: #ea580c; }
.ste-dash-status--active::before,
.ste-dash-status--counting::before { background: #2563eb; }
.ste-dash-status--cancel::before { background: #dc2626; }
.ste-dash-status--draft::before,
.ste-dash-status--scheduled::before { background: #64748b; }

.ste-dash-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 6px;
    align-items: stretch;
    min-height: calc(100vh - 150px);
}
@media (max-width: 980px) {
    .ste-dash-layout { grid-template-columns: 1fr; min-height: 0; }
}

.ste-dash-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 150px);
}
.ste-dash-print-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.ste-dash-panel-h {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 5px 8px; border-bottom: 1px solid var(--line); background: #f8fafc;
    flex-shrink: 0;
}
.ste-dash-panel-h strong { font-size: 10px; font-weight: 800; }
.ste-dash-panel-h span { font-size: 9px; color: var(--muted); font-weight: 600; }
.ste-dash-search {
    width: 100%; height: 24px; border: 1px solid var(--line); border-radius: 4px;
    padding: 0 6px; font-size: 9px; background: #fff; box-sizing: border-box;
}
.ste-dash-panel-tools { padding: 5px 6px; border-bottom: 1px solid var(--line); background: #fff; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; }
.ste-dash-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.ste-dash-dates label {
    display: flex; flex-direction: column; gap: 1px;
    font-size: 8px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em;
}
.ste-dash-dates input[type="date"] {
    width: 100%; height: 24px; border: 1px solid var(--line); border-radius: 4px;
    padding: 0 4px; font-size: 9px; background: #fff; box-sizing: border-box; color: var(--ink);
}
.ste-dash-date-hint {
    font-size: 8px; font-weight: 600; color: #b45309; background: #fffbeb;
    border: 1px solid #fde68a; border-radius: 4px; padding: 3px 5px; line-height: 1.3;
}

.ste-dash-ex-list { flex: 1; overflow: auto; min-height: 0; }
.ste-dash-ex {
    width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f1f5f9;
    background: #fff; padding: 6px 8px; cursor: pointer;
    display: flex; flex-direction: column; gap: 2px;
}
.ste-dash-ex:hover { background: #f0fdfa; }
.ste-dash-ex.on { background: #ecfdf5; box-shadow: inset 2px 0 0 var(--teal); }
.ste-dash-ex-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.ste-dash-ex-no { font-size: 10px; font-weight: 800; color: var(--teal); }
.ste-dash-ex-name { font-size: 9px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.ste-dash-ex-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 8px; color: var(--muted); }
.ste-dash-ex-stats { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 1px; }
.ste-dash-chip {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 1px 5px; border-radius: 999px; font-size: 8px; font-weight: 700;
    background: #f1f5f9; color: #475569; line-height: 1.3;
}
.ste-dash-chip--neg { background: #fef2f2; color: #b91c1c; }
.ste-dash-chip--pos { background: #fff7ed; color: #c2410c; }
.ste-dash-chip--ok { background: #dcfce7; color: #166534; }

.ste-dash-empty {
    padding: 16px 10px; text-align: center; color: #94a3b8; font-size: 10px;
}
.ste-dash-empty i { display: block; font-size: 18px; margin-bottom: 4px; opacity: .45; }

.ste-dash-detail-head {
    padding: 6px 8px;
    display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    flex-shrink: 0;
}
.ste-dash-detail-head h2 { margin: 0; font-size: 12px; font-weight: 800; line-height: 1.2; }
.ste-dash-detail-head p { margin: 1px 0 0; font-size: 9px; color: var(--muted); }
.ste-dash-pills { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 3px; }
.ste-dash-pill {
    display: inline-block; padding: 1px 6px; border-radius: 999px;
    font-size: 8px; font-weight: 700; line-height: 1.35;
}
.ste-dash-pill--status { background: #ccfbf1; color: #0f766e; }
.ste-dash-pill--scope { background: #e0e7ff; color: #3730a3; }
.ste-dash-pill--meta { background: #f1f5f9; color: #475569; }

.ste-dash-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 5px 6px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
@media (max-width: 1100px) { .ste-dash-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .ste-dash-kpis { grid-template-columns: 1fr 1fr; } }
.ste-dash-kpi {
    background: #f8fafc; border: 1px solid var(--line); border-radius: 4px;
    padding: 4px 6px; border-top: 2px solid #94a3b8;
}
.ste-dash-kpi--teal { border-top-color: #0f766e; }
.ste-dash-kpi--green { border-top-color: #16a34a; }
.ste-dash-kpi--red { border-top-color: #dc2626; }
.ste-dash-kpi--amber { border-top-color: #d97706; }
.ste-dash-kpi--blue { border-top-color: #2563eb; }
.ste-dash-kpi .l { font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.ste-dash-kpi .n { font-size: 12px; font-weight: 800; margin-top: 0; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ste-dash-kpi .s { font-size: 8px; color: #94a3b8; margin-top: 0; }
.ste-dash-kpi .n.neg { color: var(--red); }
.ste-dash-kpi .n.pos { color: var(--green); }

.ste-dash-asn {
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.ste-dash-mini-h {
    padding: 3px 8px; font-size: 8px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbfc;
}

.ste-dash-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.ste-dash-table th {
    background: #0f172a; color: #e2e8f0; padding: 3px 6px;
    font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; text-align: left;
}
.ste-dash-table.soft th { background: #f1f5f9; color: #475569; }
.ste-dash-table td { padding: 2px 6px; border-bottom: 1px solid #f1f5f9; height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ste-dash-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ste-dash-table .neg { color: var(--red); font-weight: 700; }
.ste-dash-table .pos { color: var(--green); font-weight: 700; }
.ste-dash-table .zero { color: var(--muted); }
.ste-dash-table .code { font-family: ui-monospace, Consolas, monospace; font-size: 8px; color: var(--teal); font-weight: 700; }
.ste-dash-table tbody tr:hover td { background: #f0fdfa; }
.ste-dash-row--short td { background: #fff7ed !important; }
.ste-dash-row--excess td { background: #fef2f2 !important; }

.ste-dash-scroll { overflow: auto; max-height: 72px; }
.ste-dash-scroll--tall { flex: 1 1 auto; overflow: auto; min-height: 120px; max-height: none; }
.ste-dash-rowno { color: var(--muted); font-weight: 700; width: 28px; }

.ste-dash-filters {
    display: flex; flex-wrap: wrap; gap: 3px; align-items: center;
    padding: 4px 6px; border-bottom: 1px solid var(--line); background: #fff;
    flex-shrink: 0;
}
.ste-dash-tab {
    border: 1px solid var(--line); background: #fff; color: var(--muted);
    border-radius: 999px; padding: 2px 7px; font-size: 8px; font-weight: 700; cursor: pointer; line-height: 1.3;
}
.ste-dash-tab.on { background: #ecfdf5; border-color: #99f6e4; color: var(--teal); }
.ste-dash-filters .ste-dash-search { margin-left: auto; max-width: 160px; height: 22px; }

.ste-dash-pager {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    padding: 5px 8px; border-top: 1px solid var(--line); background: #ecfdf5;
    flex-shrink: 0; z-index: 2;
}
.ste-dash-pager-left { display: flex; align-items: center; gap: 6px; font-size: 9px; color: var(--muted); font-weight: 600; }
.ste-dash-pager-left select {
    height: 22px; border: 1px solid var(--line); border-radius: 4px; font-size: 9px; padding: 0 4px; background: #fff;
}
.ste-dash-pager-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.ste-dash-pager-nav button {
    min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px;
    background: #fff; color: var(--ink); font-size: 9px; font-weight: 700; cursor: pointer;
}
.ste-dash-pager-nav button:hover:not(:disabled) { border-color: #99f6e4; background: #f0fdfa; }
.ste-dash-pager-nav button.on { background: #0f766e; border-color: #0f766e; color: #fff; }
.ste-dash-pager-nav button:disabled { opacity: .4; cursor: not-allowed; }

.ste-dash-print-wait {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-bottom: 1px solid #99f6e4;
    background: #ecfdf5; color: #0f766e; font-size: 10px; font-weight: 700;
    flex-shrink: 0;
}

.ste-dash-print-banner { display: none; }
.ste-dash-print-only { display: none !important; }

.ste-dash-busy { opacity: .55; pointer-events: none; }
.ste-dash-spinner {
    width: 12px; height: 12px; border: 2px solid #cbd5e1; border-top-color: var(--teal);
    border-radius: 50%; animation: stedashspin .7s linear infinite; display: inline-block;
}
@keyframes stedashspin { to { transform: rotate(360deg); } }
