/* ═══════════════════════════════════════════════════════
   Stock Take Smart Report — modern printable analysis
   ═══════════════════════════════════════════════════════ */

.ste-rpt {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f1f5f9;
    --teal: #0f766e;
    --blue: #1d4ed8;
    --red: #dc2626;
    --amber: #d97706;
    --green: #15803d;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 48px);
    background: var(--bg);
    color: var(--ink);
    font-size: 12px;
}

.ste-rpt-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: linear-gradient(135deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.22);
}
.ste-rpt-top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ste-rpt-top-icon {
    width: 34px; height: 34px; border-radius: 8px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.12); font-size: 16px;
}
.ste-rpt-title { display: block; font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.ste-rpt-sub { display: block; font-size: 10px; opacity: .78; margin-top: 1px; }
.ste-rpt-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.ste-rpt-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 28px; padding: 0 10px; border-radius: 6px;
    font-size: 11px; font-weight: 700; border: 1px solid transparent;
    cursor: pointer; text-decoration: none; color: #fff; background: rgba(255,255,255,.14);
}
.ste-rpt-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.ste-rpt-btn--print { background: #475569; }
.ste-rpt-btn--pdf { background: #dc2626; }
.ste-rpt-btn--csv { background: #15803d; }
.ste-rpt-btn--ghost { background: transparent; border-color: rgba(255,255,255,.28); }

.ste-rpt-body {
    padding: 12px 16px 24px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ste-rpt-filters {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.ste-rpt-tab {
    border: 1px solid var(--line); background: #fff; color: var(--muted);
    border-radius: 999px; padding: 4px 10px; font-size: 10px; font-weight: 700; cursor: pointer;
}
.ste-rpt-tab.on { background: #ecfdf5; border-color: #99f6e4; color: var(--teal); }
.ste-rpt-search {
    margin-left: auto; height: 28px; min-width: 180px; border: 1px solid var(--line);
    border-radius: 6px; padding: 0 8px; font-size: 11px; background: #f8fafc;
}
.ste-rpt-outlet {
    height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 11px; background: #fff;
}

.ste-rpt-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}
@media (max-width: 1100px) { .ste-rpt-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .ste-rpt-kpis { grid-template-columns: 1fr 1fr; } }

.ste-rpt-kpi {
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    padding: 10px 12px; border-top: 3px solid #94a3b8;
}
.ste-rpt-kpi--teal { border-top-color: #0f766e; }
.ste-rpt-kpi--blue { border-top-color: #2563eb; }
.ste-rpt-kpi--red { border-top-color: #dc2626; }
.ste-rpt-kpi--amber { border-top-color: #d97706; }
.ste-rpt-kpi--green { border-top-color: #16a34a; }
.ste-rpt-kpi--slate { border-top-color: #475569; }
.ste-rpt-kpi .l { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ste-rpt-kpi .n { font-size: 18px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ste-rpt-kpi .s { font-size: 9px; color: #94a3b8; margin-top: 2px; }
.ste-rpt-kpi .n.neg { color: var(--red); }
.ste-rpt-kpi .n.pos { color: var(--green); }

.ste-rpt-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 10px;
}
@media (max-width: 960px) { .ste-rpt-grid { grid-template-columns: 1fr; } }

.ste-rpt-card {
    background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.ste-rpt-card-h {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f8fafc;
}
.ste-rpt-card-h strong { font-size: 12px; font-weight: 800; }
.ste-rpt-card-h span { font-size: 10px; color: var(--muted); font-weight: 600; }

.ste-rpt-meta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 10px 12px; margin: 0;
}
.ste-rpt-meta div { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.ste-rpt-meta dt { color: var(--muted); font-weight: 600; }
.ste-rpt-meta dd { margin: 0; font-weight: 700; text-align: right; }

.ste-rpt-bars { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ste-rpt-bar-row { display: grid; grid-template-columns: 72px 1fr 52px; gap: 8px; align-items: center; font-size: 10px; }
.ste-rpt-bar-row b { color: var(--muted); font-weight: 700; }
.ste-rpt-bar-row span { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.ste-rpt-bar {
    height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden;
}
.ste-rpt-bar > i { display: block; height: 100%; border-radius: inherit; }
.ste-rpt-bar > i.exact { background: #0f766e; }
.ste-rpt-bar > i.short { background: #dc2626; }
.ste-rpt-bar > i.excess { background: #d97706; }

.ste-rpt-asn { width: 100%; border-collapse: collapse; font-size: 11px; }
.ste-rpt-asn th {
    background: #f8fafc; border-bottom: 1px solid var(--line); padding: 6px 8px;
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: left;
}
.ste-rpt-asn td { padding: 7px 8px; border-bottom: 1px solid #f1f5f9; }
.ste-rpt-asn .num { text-align: right; font-variant-numeric: tabular-nums; }

.ste-rpt-pill {
    display: inline-block; padding: 2px 7px; border-radius: 999px;
    font-size: 9px; font-weight: 700;
}
.ste-rpt-pill--ok { background: #dcfce7; color: #166534; }
.ste-rpt-pill--warn { background: #ffedd5; color: #c2410c; }
.ste-rpt-pill--info { background: #e0f2fe; color: #075985; }
.ste-rpt-pill--done { background: #ccfbf1; color: #0f766e; }

.ste-rpt-table-wrap { overflow: auto; max-height: calc(100vh - 340px); }
.ste-rpt-table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 860px; }
.ste-rpt-table thead th {
    position: sticky; top: 0; z-index: 1; background: #0f172a; color: #e2e8f0;
    padding: 7px 8px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; text-align: left;
}
.ste-rpt-table td { padding: 5px 8px; border-bottom: 1px solid #f1f5f9; }
.ste-rpt-table tbody tr:nth-child(even) td { background: #f8fafc; }
.ste-rpt-table tbody tr:hover td { background: #ecfdf5; }
.ste-rpt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ste-rpt-table .code { font-family: ui-monospace, Consolas, monospace; font-size: 10px; color: #0f766e; font-weight: 700; }
.ste-rpt-table .neg { color: var(--red); font-weight: 700; }
.ste-rpt-table .pos { color: var(--green); font-weight: 700; }
.ste-rpt-table .zero { color: var(--muted); }
.ste-rpt-row--short td { background: #fff7ed !important; }
.ste-rpt-row--excess td { background: #fef2f2 !important; }
.ste-rpt-empty { padding: 28px; text-align: center; color: #94a3b8; }
.ste-rpt-state { padding: 48px; text-align: center; color: var(--muted); }

.ste-rpt-print-header { display: none; }

@media print {
    .ste-rpt-top, .ste-rpt-filters, .ste-rpt-actions { display: none !important; }
    .ste-rpt { background: #fff; min-height: 0; }
    .ste-rpt-body { max-width: none; padding: 0; }
    .ste-rpt-print-header { display: block !important; margin-bottom: 12px; border-bottom: 2px solid #0f172a; padding-bottom: 8px; }
    .ste-rpt-print-header h1 { margin: 0; font-size: 16px; }
    .ste-rpt-print-header p { margin: 2px 0 0; font-size: 10px; color: #475569; }
    .ste-rpt-table-wrap { max-height: none; overflow: visible; }
    .ste-rpt-table thead th { background: #e2e8f0 !important; color: #0f172a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ste-rpt-kpis { break-inside: avoid; }
    .ste-rpt-card { break-inside: avoid; }
}
