/* Stock Count Sheet — Excel-style physical count */
.stock-count-sheet {
    --scs-border: #e2e8f0;
    --scs-head: #0f172a;
    --scs-muted: #64748b;
    --scs-sales: #dc2626;
    --scs-surplus: #16a34a;
    --scs-remain: #0369a1;
    --scs-count: #7c3aed;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scs-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--scs-border);
    border-radius: 12px;
}

.scs-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    flex: 1;
}

.scs-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.scs-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}

.scs-field--grow {
    flex: 1;
    min-width: 200px;
}

.scs-field > span {
    font-size: 11px;
    font-weight: 600;
    color: var(--scs-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.scs-select {
    height: 38px;
    border: 1px solid var(--scs-border);
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
    font-size: 14px;
    color: var(--scs-head);
}

.scs-tabs {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.scs-tab {
    border: none;
    background: transparent;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--scs-muted);
    cursor: pointer;
}

.scs-tab.is-active {
    background: #fff;
    color: var(--scs-head);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.scs-summary {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--scs-muted);
}

.scs-summary__sales {
    color: var(--scs-sales);
}

.scs-apply {
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.scs-apply:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.scs-apply:not(:disabled):hover {
    background: #1d4ed8;
}

.scs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--scs-muted);
    padding: 0 4px;
}

.scs-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.scs-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.scs-dot--remain { background: var(--scs-remain); }
.scs-dot--count { background: var(--scs-count); }
.scs-dot--sales { background: var(--scs-sales); }
.scs-dot--surplus { background: var(--scs-surplus); }

.scs-table-wrap {
    background: #fff;
    border: 1px solid var(--scs-border);
    border-radius: 12px;
    overflow: auto;
    max-height: calc(100vh - 280px);
}

.scs-table-wrap.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.scs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 920px;
}

.scs-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    border-bottom: 1px solid var(--scs-border);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--scs-muted);
    text-align: left;
    white-space: nowrap;
}

.scs-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 13px;
    color: var(--scs-head);
}

.scs-row:hover td {
    background: #f8fafc;
}

.scs-row--sales td {
    background: #fef2f2;
}

.scs-row--surplus td {
    background: #f0fdf4;
}

.scs-row--error td {
    background: #fff7ed;
}

.scs-col-sl { width: 48px; color: var(--scs-muted) !important; }
.scs-col-product { min-width: 200px; }
.scs-col-type { width: 90px; }
.scs-col-remain { min-width: 160px; }
.scs-col-count { min-width: 220px; }
.scs-col-sales { min-width: 160px; }

.scs-product-name { font-weight: 600; }
.scs-product-sku { font-size: 11px; color: var(--scs-muted); margin-top: 2px; }

.scs-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.scs-badge--liquor {
    background: #fef3c7;
    color: #92400e;
}

.scs-badge--other {
    background: #e0f2fe;
    color: #075985;
}

.scs-remain {
    font-weight: 600;
    color: var(--scs-remain);
}

.scs-liquor-inputs {
    display: flex;
    gap: 8px;
}

.scs-liquor-inputs label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.scs-liquor-inputs label span {
    font-size: 10px;
    font-weight: 600;
    color: var(--scs-muted);
    text-transform: uppercase;
}

.scs-qty-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scs-input {
    width: 100%;
    height: 36px;
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--scs-head);
    background: #faf5ff;
}

.scs-input:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 1px;
    background: #fff;
}

.scs-unit {
    font-size: 12px;
    color: var(--scs-muted);
    white-space: nowrap;
}

.scs-diff {
    font-weight: 700;
    font-size: 13px;
}

.scs-diff--unchanged,
.scs-diff--pending { color: #94a3b8; }
.scs-diff--sales { color: var(--scs-sales); }
.scs-diff--surplus { color: var(--scs-surplus); }
.scs-diff--error { color: #c2410c; }

.scs-empty {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--scs-muted);
}

@media (max-width: 900px) {
    .scs-table-wrap {
        max-height: none;
    }

    .scs-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .scs-toolbar__actions {
        justify-content: space-between;
    }
}
