/* ============================================================
   IPAR Admin — Sales Command Center
   Aligned with CRM slate tokens for a single admin product feel.
   ============================================================ */

.scc {
    --scc-border: #e2e8f0;
    --scc-muted: #64748b;
    --scc-text: #0f172a;
    --scc-surface: #fff;
    --scc-soft: #f8fafc;
    --scc-primary: #2563eb;
    --scc-success: #059669;
    --scc-danger: #dc2626;
    --scc-warning: #d97706;
    --scc-radius: 12px;
    --scc-radius-lg: 14px;
    --scc-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    --scc-shadow-md: 0 8px 24px rgba(15, 23, 42, .06);
    --scc-transition: all .2s cubic-bezier(.4, 0, .2, 1);
}

.scc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.scc-eyebrow {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--scc-muted);
    margin: 0 0 .35rem;
}

.scc-header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.scc-date-chip,
.scc-updated-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .85rem;
    border-radius: 999px;
    background: var(--scc-soft);
    border: 1px solid var(--scc-border);
    color: var(--scc-muted);
    font-size: .82rem;
    font-weight: 600;
}

.scc-live-clock {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.scc-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    border-radius: 8px;
    border: 1px solid var(--scc-border);
    background: #fff;
    color: var(--scc-text);
    font-size: .85rem;
    font-weight: 600;
    transition: var(--scc-transition);
    cursor: pointer;
}

.scc-btn-ghost:hover:not(:disabled) {
    background: var(--scc-soft);
}

.scc-btn-ghost:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.scc-btn-ghost:focus-visible,
.scc-kpi:focus-visible,
.scc-nav-card:focus-visible,
.scc-ops-item.is-clickable:focus-visible {
    outline: 2px solid rgba(37, 99, 235, .45);
    outline-offset: 2px;
}

.scc-insight-line {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: -.35rem 0 1.1rem;
    padding: .65rem .9rem;
    border-radius: var(--scc-radius);
    background: var(--scc-soft);
    border: 1px solid var(--scc-border);
    color: var(--scc-muted);
    font-size: .85rem;
    line-height: 1.45;
}

.scc-insight-line i {
    color: var(--scc-warning);
    margin-top: .1rem;
}

.scc-loading,
.scc-skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.scc-loading {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 4rem 1rem;
    color: var(--scc-muted);
    font-weight: 500;
}

.scc-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
    background-size: 400px 100%;
    animation: sccShimmer 1.4s ease infinite;
    border-radius: 8px;
}

@keyframes sccShimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.scc-skeleton-kpi {
    height: 118px;
    border-radius: var(--scc-radius-lg);
}

.scc-skeleton-ops {
    height: 64px;
    border-radius: var(--scc-radius);
}

.scc-skeleton-panel {
    height: 220px;
    border-radius: var(--scc-radius-lg);
}

.scc-alert {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem 1.1rem;
    border-radius: var(--scc-radius);
    margin-bottom: 1.25rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.scc-alert i {
    font-size: 1.25rem;
    margin-top: .1rem;
}

.scc-alert .scc-btn-ghost {
    margin-left: auto;
}

/* KPIs */
.scc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.scc-kpi {
    background: var(--scc-surface);
    border: 1px solid var(--scc-border);
    border-radius: var(--scc-radius-lg);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--scc-shadow);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--scc-transition);
    cursor: default;
}

a.scc-kpi,
.scc-kpi.is-clickable {
    cursor: pointer;
}

a.scc-kpi:hover,
.scc-kpi.is-clickable:hover {
    border-color: #cbd5e1;
    box-shadow: var(--scc-shadow-md);
    transform: translateY(-1px);
    color: inherit;
    text-decoration: none;
}

.scc-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .85rem;
}

.scc-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.scc-kpi-delta {
    font-size: .75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .2rem .55rem;
}

.scc-kpi-delta.is-up {
    color: var(--scc-success);
    background: #ecfdf5;
}

.scc-kpi-delta.is-down {
    color: var(--scc-danger);
    background: #fef2f2;
}

.scc-kpi-delta.is-flat,
.scc-kpi-delta.is-neutral {
    color: var(--scc-muted);
    background: var(--scc-soft);
}

.scc-kpi-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--scc-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.scc-kpi-value {
    font-size: 1.75rem;
    font-weight: 750;
    color: var(--scc-text);
    line-height: 1.15;
    margin-top: .2rem;
}

.scc-kpi-value-primary {
    font-size: 1.35rem;
    font-weight: 750;
    color: var(--scc-text);
    line-height: 1.25;
    margin-top: .2rem;
}

.scc-kpi-value-secondary {
    font-size: .78rem;
    font-weight: 600;
    color: var(--scc-muted);
    margin-top: .2rem;
    line-height: 1.35;
}

.scc-kpi-hint {
    font-size: .75rem;
    color: #94a3b8;
    margin-top: .35rem;
}

.scc-tone-blue { background: #eff6ff; color: #2563eb; }
.scc-tone-green { background: #ecfdf5; color: #059669; }
.scc-tone-indigo { background: #eef2ff; color: #4f46e5; }
.scc-tone-amber { background: #fffbeb; color: #d97706; }
.scc-tone-slate { background: #f1f5f9; color: #475569; }

/* Compact ops strip */
.scc-ops-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    margin-bottom: 1.25rem;
    background: linear-gradient(180deg, #fff, #f8fafc);
    border: 1px solid var(--scc-border);
    border-radius: var(--scc-radius);
    overflow: hidden;
}

.scc-ops-item {
    flex: 1;
    min-width: 140px;
    padding: .85rem 1.1rem;
    border-right: 1px solid var(--scc-border);
    text-decoration: none;
    color: inherit;
    transition: var(--scc-transition);
}

.scc-ops-item:last-child {
    border-right: none;
}

.scc-ops-item.is-clickable {
    cursor: pointer;
}

.scc-ops-item.is-clickable:hover {
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.scc-ops-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--scc-muted);
    margin-bottom: .25rem;
}

.scc-ops-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 750;
    color: var(--scc-text);
}

.scc-ops-value small {
    font-size: .75rem;
    font-weight: 600;
    color: var(--scc-muted);
}

.scc-ops-sub {
    display: block;
    font-size: .78rem;
    color: var(--scc-muted);
    margin-top: .15rem;
}

/* Quick nav */
.scc-nav-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .85rem;
    margin-top: 1.25rem;
    margin-bottom: .25rem;
}

.scc-role-home-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0;
}

.scc-nav-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1rem;
    border-radius: var(--scc-radius);
    border: 1px solid var(--scc-border);
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.scc-nav-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--scc-shadow-md);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.scc-nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.scc-nav-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--scc-text);
}

.scc-nav-desc {
    font-size: .75rem;
    color: var(--scc-muted);
}

/* Panels */
.scc-panel {
    background: #fff;
    border: 1px solid var(--scc-border);
    border-radius: var(--scc-radius-lg);
    box-shadow: var(--scc-shadow);
    overflow: hidden;
}

.scc-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--scc-border);
}

.scc-panel-title {
    font-size: 1rem;
    font-weight: 750;
    margin: 0;
    color: var(--scc-text);
}

.scc-panel-sub {
    font-size: .8rem;
    color: var(--scc-muted);
    margin: .2rem 0 0;
}

.scc-panel-body {
    padding: 1.1rem 1.15rem;
}

.scc-link {
    font-size: .82rem;
    font-weight: 650;
    color: var(--scc-primary);
    text-decoration: none;
    white-space: nowrap;
}

.scc-link:hover {
    text-decoration: underline;
}

.scc-legend {
    display: flex;
    gap: .85rem;
    flex-wrap: wrap;
    font-size: .75rem;
    font-weight: 600;
    color: var(--scc-muted);
}

.scc-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: .3rem;
}

.scc-dot-blue { background: #3b82f6; }
.scc-dot-green { background: #10b981; }
.scc-dot-indigo { background: #6366f1; }

/* Chart + tooltip */
.scc-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .35rem;
    height: 200px;
    padding: .25rem .15rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.scc-chart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
    cursor: default;
}

.scc-chart-bars {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.scc-bar {
    width: 28%;
    max-width: 10px;
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transform-origin: bottom;
    animation: sccBarGrow .45s ease-out both;
}

@keyframes sccBarGrow {
    from { transform: scaleY(0); opacity: .4; }
    to { transform: scaleY(1); opacity: 1; }
}

.scc-bar-blue, .scc-bar-primary { background: #3b82f6; }
.scc-bar-green, .scc-bar-success { background: #10b981; }
.scc-bar-indigo, .scc-bar-info { background: #6366f1; }
.scc-bar-warning { background: #f59e0b; }
.scc-bar-secondary { background: #94a3b8; }

.scc-chart-label {
    font-size: .65rem;
    color: #94a3b8;
    margin-top: .4rem;
}

.scc-chart-tooltip {
    position: absolute;
    bottom: calc(100% - 1.4rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    min-width: 140px;
    padding: .55rem .7rem;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
    font-size: .72rem;
    line-height: 1.4;
    box-shadow: var(--scc-shadow-md);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease;
    white-space: nowrap;
}

.scc-chart-col:hover .scc-chart-tooltip,
.scc-chart-col:focus-within .scc-chart-tooltip {
    opacity: 1;
    visibility: visible;
}

.scc-chart-tooltip strong {
    display: block;
    margin-bottom: .25rem;
    font-weight: 700;
}

/* Tables */
.scc-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.scc-table th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--scc-muted);
    font-weight: 700;
    padding: .7rem 1.15rem;
    background: var(--scc-soft);
    border-bottom: 1px solid var(--scc-border);
}

.scc-table td {
    padding: .8rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .9rem;
    color: var(--scc-text);
    vertical-align: middle;
}

.scc-table tbody tr:last-child td {
    border-bottom: 0;
}

.scc-table tbody tr:hover td {
    background: #fafbfc;
}

.scc-rank {
    display: inline-flex;
    min-width: 2rem;
    justify-content: center;
    padding: .15rem .4rem;
    border-radius: 6px;
    background: var(--scc-soft);
    font-size: .78rem;
    font-weight: 700;
    color: var(--scc-muted);
}

.scc-order-link {
    font-weight: 700;
    color: #1d4ed8;
    text-decoration: none;
}

.scc-order-link:hover {
    text-decoration: underline;
}

.scc-status {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 650;
    background: #f1f5f9;
    color: #334155;
}

.scc-status.is-success {
    background: #ecfdf5;
    color: #059669;
}

.scc-status.is-warning {
    background: #fffbeb;
    color: #b45309;
}

.scc-status.is-danger {
    background: #fef2f2;
    color: #dc2626;
}

.scc-status.is-info {
    background: #eff6ff;
    color: #2563eb;
}

.scc-empty,
.scc-empty-cell {
    text-align: center;
    color: var(--scc-muted);
    font-size: .88rem;
    padding: 1.75rem .5rem;
}

.scc-empty-rich {
    text-align: center;
    padding: 1.75rem 1rem;
    color: var(--scc-muted);
}

.scc-empty-rich i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: .5rem;
    opacity: .7;
}

.scc-rank-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scc-progress {
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.scc-progress-bar {
    height: 100%;
    border-radius: 999px;
}

.scc-is-refreshing {
    opacity: .92;
    transition: opacity .2s ease;
}

@media (max-width: 1199.98px) {
    .scc-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scc-nav-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .scc-kpi-grid,
    .scc-nav-grid {
        grid-template-columns: 1fr;
    }

    .scc-ops-item {
        border-right: none;
        border-bottom: 1px solid var(--scc-border);
        min-width: 100%;
    }

    .scc-ops-item:last-child {
        border-bottom: none;
    }
}
