/* ═══════════════════════════════════════════════════════════════
   Supplier Collaboration – Shared Styles (sc-*)
   Shared across InventoryHealth, DeliveryPerformance, and
   future SC pages. Eliminates duplication of common patterns.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Page Layout Shell ─────────────────────────────────────── */

.sc-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 50px);
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    margin: -5px -10px 0 -10px;
}

.sc-content-area {
    flex: 1;
    padding: 1.25rem 1.25rem 1.25rem;
    overflow-y: auto;
}

.sc-content-wrapper {
    width: 100%;
}

.sc-section {
    margin-bottom: 2rem;
}

/* ── 2. Loading States ────────────────────────────────────────── */

.sc-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
}

.sc-loading-container.small {
    padding: 1.5rem 1rem;
}

.sc-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 37, 84, 0.1);
    border-top-color: var(--primary-1, #002554);
    border-radius: 50%;
    animation: sc-spin 0.8s linear infinite;
}

@keyframes sc-spin {
    to { transform: rotate(360deg); }
}

.sc-loading-text {
    font-size: 0.8rem;
    color: var(--neutral-4, #64748b);
    font-weight: 500;
}

/* ── 3. Error States ──────────────────────────────────────────── */

.sc-error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(239, 68, 68, 0.02) 100%);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 12px;
}

.sc-error-icon {
    font-size: 1.25rem;
    color: var(--error, #ef4444);
}

.sc-error-text {
    font-size: 0.8rem;
    color: var(--error, #ef4444);
    font-weight: 500;
}

.sc-retry-btn {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: var(--primary-1, #002554);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.sc-retry-btn:hover {
    background: var(--secondary-1, #2e609d);
    box-shadow: 0 2px 8px rgba(0, 37, 84, 0.25);
}

/* ── 4. Empty States ──────────────────────────────────────────── */

.sc-empty-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.sc-empty-text {
    font-size: 0.8rem;
    color: var(--neutral-4, #64748b);
    font-weight: 500;
}

/* ── 5. Table Panel & Tabs ────────────────────────────────────── */

.sc-table-panel {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,37,84,0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.sc-table-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    min-height: 44px;
}

.sc-table-tabs {
    display: flex;
    gap: 0;
    margin: 0;
    position: relative;
}

.sc-table-tab {
    padding: 0.625rem 1.125rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--neutral-4, #64748b);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -1px;
}

.sc-table-tab:hover {
    color: var(--primary-1, #002554);
    background: rgba(0, 37, 84, 0.03);
}

.sc-table-tab.active {
    color: var(--primary-1, #002554);
    border-bottom-color: var(--primary-1, #002554);
    background: rgba(255, 255, 255, 0.7);
}

.sc-tab-count {
    font-size: 0.6rem;
    background: rgba(0, 37, 84, 0.08);
    padding: 0.125rem 0.45rem;
    border-radius: 10px;
    font-weight: 700;
    color: var(--neutral-4, #64748b);
    min-width: 22px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sc-table-tab.active .sc-tab-count {
    background: rgba(0, 37, 84, 0.14);
    color: var(--primary-1, #002554);
}

/* Toolbar-only header row (no tabs, used with ScSectionHeader) */
.sc-table-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    min-height: 44px;
}

/* ── 6. Table Toolbar ─────────────────────────────────────────── */

.sc-table-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
    flex-wrap: wrap;
}

/* ── 7. Data Table ────────────────────────────────────────────── */

.sc-data-table {
    width: 100%;
    border-collapse: collapse;
}

.sc-data-table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--neutral-4, #64748b);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    white-space: nowrap;
}

.sc-data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 37, 84, 0.04);
    color: var(--text-primary, #1a2332);
    vertical-align: middle;
    font-size: 0.8rem;
    font-weight: 500;
}

.sc-data-table tbody tr {
    transition: background 0.15s ease;
}

.sc-data-table tbody tr:hover {
    background: rgba(0, 37, 84, 0.02);
}

.sc-data-table thead th:last-child,
.sc-data-table tbody td:last-child {
    padding-right: 1.25rem;
}

/* ── 8. Sort Headers ──────────────────────────────────────────── */

.sc-sort-header {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, background-color 0.15s ease;
    position: relative;
}

.sc-sort-header:hover {
    color: var(--primary-1, #002554);
    background-color: rgba(0, 37, 84, 0.04);
}

.sc-sort-active {
    color: var(--primary-1, #002554);
}

/* ── 9. Stacked Cells ─────────────────────────────────────────── */

.sc-cell-stacked {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.3;
    max-width: 220px;
}

.sc-cell-primary {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--secondary-1, #2e609d);
}

.sc-cell-secondary {
    font-size: 0.7rem;
    color: var(--neutral-4, #64748b);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 10. Numeric Cells ────────────────────────────────────────── */

.sc-cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   Drill-Through Tree Table (rendered via RenderFragment — needs
   global scope since CSS isolation doesn't apply)
   ═══════════════════════════════════════════════════════════════ */

/* Root-level search bar */
.sp-root-search-bar {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(0,37,84,0.06);
}
.sp-root-search-icon { color: #94a3b8; }
.sp-root-search-input {
    flex: 1; padding: 0.4rem 0.6rem; border: 1px solid rgba(0,37,84,0.12);
    border-radius: 6px; font-size: 0.78rem; outline: none;
    background: rgba(0,37,84,0.02); transition: all 0.15s;
    max-width: 320px;
}
.sp-root-search-input:focus {
    border-color: #3b82f6; background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.sp-root-search-clear {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; border: none;
    background: rgba(0,37,84,0.06); color: #64748b; cursor: pointer;
    transition: all 0.15s; padding: 0;
}
.sp-root-search-clear:hover { background: rgba(0,37,84,0.12); color: #002554; }

/* Drill table base */
.sp-drill-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.sp-drill-thead th {
    background: #002554; color: #fff; text-transform: uppercase;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em;
    padding: 0.75rem 0.75rem; border: none;
}
.sp-drill-thead th:first-child { border-radius: 8px 0 0 0; }
.sp-drill-thead th:last-child  { border-radius: 0 8px 0 0; }

/* Drill-through specific column widths (8-column layout) */
.sp-drill-panel-wrap .sp-drill-table { table-layout: fixed; }
.sp-drill-panel-wrap .sp-drill-thead th:first-child { width: 26%; }
.sp-drill-panel-wrap .sp-drill-thead th:last-child  { width: 8%; }
.sp-drill-panel-wrap .sp-drill-thead th:nth-child(2),
.sp-drill-panel-wrap .sp-drill-thead th:nth-child(4) { width: 11%; }
.sp-drill-panel-wrap .sp-drill-thead th:nth-child(3),
.sp-drill-panel-wrap .sp-drill-thead th:nth-child(5) { width: 10%; }
.sp-drill-panel-wrap .sp-drill-thead th:nth-child(6) { width: 9%; }
.sp-drill-panel-wrap .sp-drill-thead th:nth-child(7) { width: 8%; }

/* Ensure data cells match header padding and alignment */
.sp-drill-table td { padding: 0.6rem 0.75rem; vertical-align: middle; font-size: 0.78rem; }
.sp-drill-table .sc-cell-num { text-align: right; }

/* Clickable rows */
.sp-drill-row { cursor: pointer; }
.sp-drill-row:hover { background: rgba(0, 37, 84, 0.06) !important; }

/* Name cell layout */
.sp-drill-name-cell {
    display: flex; align-items: center; gap: 0.5rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Expand chevron */
.sp-drill-chevron {
    display: inline-flex; align-items: center; color: #94a3b8;
    transition: transform 0.2s ease;
}
.sp-drill-chevron.expanded { transform: rotate(90deg); }

/* Category badge */
.sp-cat-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px;
    font-size: 0.7rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sp-cat-badge.sm { width: 22px; height: 22px; font-size: 0.6rem; border-radius: 4px; }
.sp-cat-badge.core          { background: #10b981; }
.sp-cat-badge.mainstream    { background: #3b82f6; }
.sp-cat-badge.complementary { background: #ec4899; }
.sp-cat-badge.unranged      { background: #94a3b8; }
.sp-cat-badge.other         { background: #002554; }
.sp-cat-badge.region        { background: #6366f1; }
.sp-cat-badge.store         { background: #8b5cf6; }
.sp-cat-badge.sku           { background: #64748b; }

/* Status badges */
.sp-status-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.75rem; border-radius: 20px;
    font-size: 0.68rem; font-weight: 600; white-space: nowrap;
}
.sp-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sp-status-badge.healthy    { background: rgba(16,185,129,0.12); color: #059669; }
.sp-status-badge.healthy .sp-status-dot { background: #10b981; }
.sp-status-badge.monitor    { background: rgba(245,158,11,0.12); color: #d97706; }
.sp-status-badge.monitor .sp-status-dot { background: #f59e0b; }
.sp-status-badge.at-risk    { background: rgba(239,68,68,0.12);  color: #dc2626; }
.sp-status-badge.at-risk .sp-status-dot { background: #ef4444; }
.sp-status-badge.review     { background: rgba(148,163,184,0.15); color: #64748b; }
.sp-status-badge.review .sp-status-dot  { background: #94a3b8; }

/* Child row indentation */
.sp-indent { display: inline-block; flex-shrink: 0; }
.sp-indent-1 { width: 24px; }
.sp-indent-2 { width: 48px; }
.sp-indent-3 { width: 72px; }
.sp-indent-4 { width: 96px; }
.sp-indent-5 { width: 120px; }

.sp-child-row { border-left: 3px solid transparent; }
.sp-child-row td { font-size: 0.78rem; }
.sp-depth-1 { background: rgba(0,37,84,0.02); border-left-color: #3b82f6; }
.sp-depth-2 { background: rgba(0,37,84,0.04); border-left-color: #8b5cf6; }
.sp-depth-3 { background: rgba(0,37,84,0.06); border-left-color: #64748b; }
.sp-depth-4 { background: rgba(0,37,84,0.08); border-left-color: #f59e0b; }
.sp-depth-5 { background: rgba(0,37,84,0.10); border-left-color: #94a3b8; }

/* Loading rows */
.sp-child-loading-row td { padding: 0.5rem 0.6rem; }
.sp-child-loading { color: #94a3b8; font-size: 0.75rem; font-style: italic; }

/* Child search + pagination toolbar */
.sp-child-toolbar-row td { padding: 0.35rem 0.6rem !important; background: rgba(0,37,84,0.02); }
.sp-child-toolbar {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem;
}
.sp-child-search {
    padding: 0.3rem 0.6rem; border: 1px solid rgba(0,37,84,0.15); border-radius: 4px;
    font-size: 0.72rem; width: 160px; outline: none; background: #fff;
}
.sp-child-search:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.sp-child-paging-info { color: #64748b; white-space: nowrap; margin-left: auto; }
.sp-child-page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border: 1px solid rgba(0,37,84,0.15);
    border-radius: 4px; background: #fff; color: #334155; cursor: pointer;
    transition: all 0.15s;
}
.sp-child-page-btn:hover:not(:disabled) { background: rgba(0,37,84,0.04); border-color: #002554; }
.sp-child-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Total row */
.sp-drill-total-row { background: rgba(0,37,84,0.03); border-top: 2px solid rgba(0,37,84,0.12); }
.sp-drill-total-row td { padding: 0.65rem 0.6rem; font-size: 0.78rem; color: #002554; }

/* Overlay */
.sp-drill-panel-wrap { position: relative; }
.sp-drill-overlay {
    position: absolute; inset: 0; background: rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 10; border-radius: 8px;
}
.sp-drill-spinner {
    width: 32px; height: 32px; border: 3px solid rgba(0,37,84,0.15);
    border-top-color: #002554; border-radius: 50%;
    animation: sp-spin 0.7s linear infinite;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   Drill Chain Configurator
   ═══════════════════════════════════════════════════════════════ */

.dcc-wrapper { position: relative; }

.dcc-trigger {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.85rem; border: 1px solid rgba(0,37,84,0.15);
    border-radius: 8px; background: #fff; color: #334155;
    font-size: 0.72rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s ease; white-space: nowrap;
}
.dcc-trigger:hover, .dcc-trigger.active {
    background: rgba(0,37,84,0.04); border-color: #002554;
    box-shadow: 0 2px 8px rgba(0,37,84,0.08);
}
.dcc-chain-preview {
    color: #94a3b8; font-weight: 400; font-size: 0.66rem;
    max-width: 280px; overflow: hidden; text-overflow: ellipsis;
}
.dcc-caret { color: #94a3b8; transition: transform 0.2s; }

.dcc-panel {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
    width: 540px; background: #fff; border: 1px solid rgba(0,37,84,0.1);
    border-radius: 12px; padding: 1.25rem;
    box-shadow: 0 12px 40px rgba(0,37,84,0.12), 0 2px 8px rgba(0,0,0,0.06);
    animation: dcc-slide-in 0.2s ease;
}
@keyframes dcc-slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dcc-panel-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 1rem; padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0,37,84,0.06);
}
.dcc-title { font-size: 0.85rem; font-weight: 700; color: #002554; margin: 0; }
.dcc-subtitle { font-size: 0.68rem; color: #94a3b8; margin: 0.2rem 0 0; }
.dcc-reset-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.6rem; border: 1px solid rgba(0,37,84,0.12);
    border-radius: 6px; background: #fff; color: #64748b;
    font-size: 0.68rem; font-weight: 500; cursor: pointer;
    transition: all 0.15s;
}
.dcc-reset-btn:hover { background: rgba(0,37,84,0.04); color: #002554; }

/* Chain area — horizontal drag strip */
.dcc-chain-area {
    display: flex; align-items: center; gap: 0; flex-wrap: wrap;
    padding: 0.75rem; background: rgba(0,37,84,0.02);
    border-radius: 10px; border: 1px dashed rgba(0,37,84,0.1);
    margin-bottom: 0.75rem; min-height: 52px;
}

.dcc-chip {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.6rem; border-radius: 8px;
    background: #fff; border: 1px solid rgba(0,37,84,0.12);
    cursor: grab; user-select: none; transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dcc-chip:hover { border-color: #3b82f6; box-shadow: 0 2px 8px rgba(59,130,246,0.12); }
.dcc-chip.dragging { opacity: 0.4; transform: scale(0.95); }
.dcc-chip.drop-target { border-color: #3b82f6; background: rgba(59,130,246,0.06); }
.dcc-chip.first { border-left: 3px solid #10b981; }
.dcc-chip.last { border-left: 3px solid #64748b; }

.dcc-drag-handle { color: #cbd5e1; display: flex; cursor: grab; }
.dcc-chip-label { font-size: 0.72rem; font-weight: 600; color: #334155; }
.dcc-chip-pos {
    font-size: 0.58rem; font-weight: 700; color: #94a3b8;
    background: rgba(0,37,84,0.05); padding: 0.1rem 0.35rem;
    border-radius: 4px; min-width: 18px; text-align: center;
}

.dcc-chip-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 5px;
    font-size: 0.6rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.dcc-chip-icon.sm { width: 18px; height: 18px; font-size: 0.55rem; border-radius: 4px; }
.dcc-chip-icon.cat-sc  { background: #10b981; }
.dcc-chip-icon.cat-r   { background: #6366f1; }
.dcc-chip-icon.cat-sr  { background: #8b5cf6; }
.dcc-chip-icon.cat-a   { background: #a855f7; }
.dcc-chip-icon.cat-s   { background: #3b82f6; }
.dcc-chip-icon.cat-sku { background: #64748b; }

.dcc-connector { color: #cbd5e1; display: flex; align-items: center; padding: 0 0.15rem; }
.dcc-connector.drop-target { color: #3b82f6; }

/* Available dimensions */
.dcc-available {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.dcc-available-label { font-size: 0.68rem; color: #94a3b8; font-weight: 600; }
.dcc-add-chip {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.25rem 0.5rem; border: 1px dashed rgba(0,37,84,0.2);
    border-radius: 6px; background: #fff; color: #64748b;
    font-size: 0.68rem; cursor: pointer; transition: all 0.15s;
}
.dcc-add-chip:hover { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.04); }
.dcc-none-available { font-size: 0.66rem; color: #94a3b8; font-style: italic; }

/* Active chips (removable) */
.dcc-active-chips {
    display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.dcc-removable-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.2rem 0.5rem; border-radius: 6px;
    background: rgba(0,37,84,0.04); font-size: 0.68rem;
    color: #334155; font-weight: 500;
}
.dcc-remove-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; border: none;
    background: rgba(239,68,68,0.1); color: #ef4444; cursor: pointer;
    transition: all 0.15s; padding: 0;
}
.dcc-remove-btn:hover { background: rgba(239,68,68,0.2); }

/* Actions */
.dcc-actions {
    display: flex; gap: 0.5rem; justify-content: flex-end;
    padding-top: 0.75rem; border-top: 1px solid rgba(0,37,84,0.06);
}
.dcc-apply-btn {
    padding: 0.45rem 1.2rem; border: none; border-radius: 8px;
    background: #002554; color: #fff; font-size: 0.72rem;
    font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.dcc-apply-btn:hover { background: #003380; box-shadow: 0 2px 8px rgba(0,37,84,0.2); }
.dcc-cancel-btn {
    padding: 0.45rem 1.2rem; border: 1px solid rgba(0,37,84,0.15);
    border-radius: 8px; background: #fff; color: #64748b;
    font-size: 0.72rem; font-weight: 500; cursor: pointer;
    transition: all 0.15s;
}
.dcc-cancel-btn:hover { background: rgba(0,37,84,0.04); }

/* Header / Export */
.sp-drill-header { display: flex; justify-content: space-between; align-items: center; }
.sp-export-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 1rem; border: 1px solid rgba(0,37,84,0.2);
    border-radius: 6px; background: #fff; color: #334155;
    font-size: 0.75rem; font-weight: 600; cursor: pointer;
    transition: all 0.15s ease; white-space: nowrap;
}
.sp-export-btn:hover:not(:disabled) { background: rgba(0,37,84,0.04); border-color: #002554; }
.sp-export-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sc-cell-num.positive { color: #059669; }
.sc-cell-num.negative { color: #dc2626; }

/* ── 11. Drilldown / Filter Banner ────────────────────────────── */

.sc-drilldown-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, rgba(0, 37, 84, 0.06) 0%, rgba(16, 185, 129, 0.06) 100%);
    border: 1px solid rgba(0, 37, 84, 0.12);
    border-radius: 10px;
    animation: sc-banner-slide-in 0.3s ease-out;
}

@keyframes sc-banner-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sc-drilldown-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sc-drilldown-icon {
    color: var(--primary-1, #002554);
    flex-shrink: 0;
    opacity: 0.6;
}

.sc-drilldown-text {
    font-size: 0.8rem;
    color: var(--neutral-4, #64748b);
}

.sc-drilldown-text strong {
    color: var(--dark-1, #002554);
}

.sc-drilldown-value {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    background: var(--primary-1, #002554);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sc-drilldown-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(0, 37, 84, 0.15);
    border-radius: 8px;
    background: white;
    color: var(--neutral-4, #64748b);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sc-drilldown-clear:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ── 12. Table Loading Overlay ────────────────────────────────── */

.sc-table-wrapper {
    position: relative;
    min-height: 200px;
}

.sc-table-loading tbody {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.sc-table-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

/* ── 13. Search Input ─────────────────────────────────────────── */

.sc-table-search {
    display: flex;
    align-items: center;
    position: relative;
}

.sc-search-icon {
    position: absolute;
    left: 0.5rem;
    color: var(--neutral-4, #94a3b8);
    pointer-events: none;
}

.sc-search-input {
    padding: 0.375rem 1.75rem 0.375rem 1.75rem;
    border: 1px solid rgba(0, 37, 84, 0.12);
    border-radius: 6px;
    font-size: 0.725rem;
    font-family: inherit;
    background: #ffffff;
    color: var(--neutral-5, #1e293b);
    width: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, width 0.2s ease;
}

.sc-search-input:focus {
    outline: none;
    border-color: var(--primary-1, #002554);
    box-shadow: 0 0 0 2px rgba(0, 37, 84, 0.06);
    width: 240px;
}

.sc-search-input::placeholder {
    color: var(--neutral-4, #94a3b8);
    font-size: 0.7rem;
}

.sc-search-clear {
    position: absolute;
    right: 0.375rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.125rem;
    color: var(--neutral-4, #94a3b8);
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.sc-search-clear:hover {
    color: var(--neutral-5, #1e293b);
    background: rgba(0, 0, 0, 0.06);
}

/* ── 14. Badges ───────────────────────────────────────────────── */

.sc-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.sc-badge.on-time {
    background: linear-gradient(135deg, rgba(0,200,83,0.15) 0%, rgba(0,200,83,0.05) 100%);
    color: var(--success, #50A684);
}

.sc-badge.early {
    background: linear-gradient(135deg, rgba(26,115,232,0.15) 0%, rgba(26,115,232,0.05) 100%);
    color: var(--secondary-1, #2e609d);
}

.sc-badge.warning {
    background: linear-gradient(135deg, rgba(255,171,0,0.15) 0%, rgba(255,171,0,0.05) 100%);
    color: var(--warning, #ed8936);
}

.sc-badge.late {
    background: linear-gradient(135deg, rgba(255,171,0,0.15) 0%, rgba(255,171,0,0.05) 100%);
    color: var(--warning, #ed8936);
}

.sc-badge.critical {
    background: linear-gradient(135deg, rgba(255,82,82,0.15) 0%, rgba(255,82,82,0.05) 100%);
    color: var(--error, #ef4444);
}

/* ── 15. Table Content Animation ──────────────────────────────── */

.sc-table-content {
    animation: sc-table-fade 0.15s ease-out;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@keyframes sc-table-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sc-table-scroll {
    overflow-x: auto;
}

/* ── 16. Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .sc-table-tabs-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .sc-table-toolbar {
        justify-content: space-between;
    }

    .sc-search-input {
        width: 100%;
    }

    .sc-search-input:focus {
        width: 100%;
    }
}

/* ── Forecast Table Alignment ──────────────────────────────────── */

.sp-forecast-table {
    width: 100%;
}

.sp-forecast-table th,
.sp-forecast-table td {
    text-align: right;
    padding: 10px 16px;
    white-space: nowrap;
}

.sp-forecast-table.sp-drill-thead th,
.sp-forecast-table .sp-drill-thead th {
    text-align: right;
}

.sp-forecast-table th:first-child,
.sp-forecast-table td:first-child,
.sp-forecast-table .sp-drill-thead th:first-child {
    text-align: left;
}

.sp-forecast-table .sp-total-col {
    font-weight: 700;
    color: var(--primary-1, #002554);
}

/* ── Toggle Buttons (global, for use outside ScBreakdownControls) ── */

.sc-toggle-group {
    display: inline-flex;
    background: rgba(0, 37, 84, 0.06);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.sc-toggle-group button {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sc-toggle-group button:hover {
    color: var(--primary-1, #002554);
    background: rgba(0, 37, 84, 0.06);
}

.sc-toggle-group button.active {
    background: var(--primary-1, #002554);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 37, 84, 0.25);
}

/* ── Inline Pagination (for use inside tables/expansions) ───── */

.sc-inline-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
    border-top: 1px solid rgba(0, 37, 84, 0.06);
}

.sc-inline-pagination .sc-page-info {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    font-weight: 500;
}

.sc-inline-pagination .sc-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid rgba(0, 37, 84, 0.1);
    background: #fff;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary, #1a2332);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sc-inline-pagination .sc-page-btn:hover {
    background: rgba(0, 37, 84, 0.04);
    border-color: rgba(0, 37, 84, 0.16);
}

.sc-inline-pagination .sc-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
