/* ==========================================================================
   Painel de Acompanhamento - Processos Samsung
   Importacao -> Acompanhamento. Mesma pegada do Dashboard de Catalogo.
   Prefixo de classe: sac- (Samsung ACompanhamento)
   ========================================================================== */

.sac-dashboard {
    font-family: 'Poppins', sans-serif;
    background: #f5f6fa;
    padding: 20px 24px 40px;
    min-height: 100%;
    color: #1e293b;
}

.sac-content {
    max-width: 1440px;
    margin: 0 auto;
}

/* ---------- Header ---------- */
.sac-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.sac-breadcrumb {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sac-breadcrumb-sep {
    font-size: 9px;
    color: #cbd5e1;
}

.sac-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: normal;
    color: #0f172a;
    margin: 0 0 4px;
}

.sac-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.sac-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
}

.sac-btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #4F00D1;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sac-btn-refresh:hover {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.sac-btn-refresh:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------- KPI Cards ---------- */
.sac-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.sac-kpi-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef2f7;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.sac-kpi-card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
    transform: translateY(-2px);
}

.sac-kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #cbd5e1;
}

.sac-kpi-blue::before { background: #007AFF; }
.sac-kpi-orange::before { background: #FF9500; }
.sac-kpi-purple::before { background: #5856D6; }
.sac-kpi-green::before { background: #34C759; }

.sac-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.sac-kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.sac-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ffffff;
}

.sac-kpi-blue .sac-kpi-icon { background: linear-gradient(135deg, #007AFF, #0056d6); }
.sac-kpi-orange .sac-kpi-icon { background: linear-gradient(135deg, #FF9500, #e07d00); }
.sac-kpi-purple .sac-kpi-icon { background: linear-gradient(135deg, #5856D6, #4038c0); }
.sac-kpi-green .sac-kpi-icon { background: linear-gradient(135deg, #34C759, #24a347); }

.sac-kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 6px;
}

.sac-kpi-foot {
    font-size: 12px;
    color: #94a3b8;
}

/* ---------- Charts ---------- */
.sac-charts-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.sac-chart-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sac-chart-half { grid-column: span 6; }
.sac-chart-full { grid-column: span 12; }

.sac-chart-header {
    padding: 18px 20px 6px;
}

.sac-chart-title {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    letter-spacing: normal;
}

.sac-chart-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.sac-chart-body {
    padding: 12px 20px 20px;
    flex: 1;
    min-height: 320px;
}

/* Doughnut + legend layout */
.sac-doughnut-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
    flex-wrap: wrap;
}

.sac-doughnut-canvas {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

/* Legend */
.sac-legend {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.sac-legend-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
    max-height: none;
    margin-bottom: 12px;
}

.sac-legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #334155;
    padding: 4px 8px;
    border-radius: 6px;
}

.sac-legend:not(.sac-legend-inline) .sac-legend-item {
    background: #f8fafc;
}

.sac-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.sac-legend-name {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sac-legend-value {
    font-weight: 600;
    color: #64748b;
    margin-left: 8px;
}

.sac-line-wrap {
    position: relative;
    height: 320px;
}

/* Empty mini */
.sac-empty-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 220px;
    color: #cbd5e1;
    gap: 10px;
}

.sac-empty-mini i {
    font-size: 34px;
}

.sac-empty-mini span {
    font-size: 13px;
    color: #94a3b8;
}

/* ---------- Skeleton ---------- */
.sac-skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%);
    background-size: 400% 100%;
    animation: sacShimmer 1.4s ease infinite;
    border-radius: 14px;
}

.sac-skeleton-kpi { height: 132px; }
.sac-skeleton-chart { min-height: 340px; }

@keyframes sacShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- Error state ---------- */
.sac-error-state {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eef2f7;
    padding: 48px 24px;
    text-align: center;
    color: #64748b;
}

.sac-error-state i {
    font-size: 42px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.sac-error-title {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px;
}

.sac-error-text {
    font-size: 13px;
    margin: 0 0 18px;
}

/* ---------- Footer ---------- */
.sac-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #e9edf3;
    flex-wrap: wrap;
    gap: 8px;
}

.sac-footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .sac-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .sac-chart-half { grid-column: span 12; }
}

@media (max-width: 640px) {
    .sac-kpi-grid { grid-template-columns: 1fr; }
    .sac-doughnut-canvas { width: 180px; height: 180px; }
}

/* ==========================================================================
   Cards clicaveis + Tabela de processos + Paginacao
   ========================================================================== */

.sac-kpi-click {
    cursor: pointer;
    user-select: none;
}

.sac-kpi-active {
    box-shadow: 0 0 0 2px #4F00D1, 0 8px 20px rgba(79, 0, 209, 0.15);
    transform: translateY(-2px);
}

.sac-kpi-active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-right: 2px solid #4F00D1;
    border-bottom: 2px solid #4F00D1;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 2px;
}

/* Table card */
.sac-table-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef2f7;
    margin-bottom: 22px;
    overflow: hidden;
}

.sac-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef2f7;
    flex-wrap: wrap;
    gap: 12px;
}

.sac-table-head-title .sac-chart-title {
    font-size: 15px;
}

.sac-table-cats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sac-cat-btn {
    background: #f1f5f9;
    border: 1px solid transparent;
    color: #475569;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sac-cat-btn:hover {
    background: #e9eef5;
}

.sac-cat-btn-active {
    background: #4F00D1;
    color: #ffffff;
    border-color: #4F00D1;
}

/* Table */
.sac-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.sac-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sac-table thead th {
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
    white-space: nowrap;
}

.sac-table tbody td {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.sac-table tbody tr:hover {
    background: #f8fafc;
}

.sac-table tbody tr:last-child td {
    border-bottom: none;
}

.sac-td-codigo {
    font-weight: 600;
    color: #4F00D1;
    white-space: nowrap;
}

.sac-th-data, .sac-td-data {
    white-space: nowrap;
}

.sac-table-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px;
    color: #94a3b8;
    font-size: 13px;
}

/* Pagination */
.sac-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid #eef2f7;
}

.sac-page-info {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.sac-page-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #4F00D1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sac-page-btn:hover:not(:disabled) {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.sac-page-btn:disabled {
    color: #cbd5e1;
    cursor: default;
}

/* ==========================================================================
   Tabela compacta (estilo Importação → Processos) + filtro de analista
   ========================================================================== */

.sac-table-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sac-analista-filtro {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 10px;
    color: #64748b;
    font-size: 12px;
}

.sac-analista-filtro i {
    color: #94a3b8;
    font-size: 12px;
}

.sac-analista-filtro select {
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #334155;
    outline: none;
    max-width: 220px;
    height: 24px;
    cursor: pointer;
}

/* Tabela compacta — casa com a tela de Importação → Processos */
.sac-proc-table {
    margin: 0;
    font-size: 12.5px;
}

.sac-proc-table > thead > tr > th {
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f8fafc;
    border-bottom: 2px solid #e9edf3;
    vertical-align: middle;
}

.sac-proc-table > tbody > tr > td {
    padding: 6px 10px;
    vertical-align: middle;
    color: #334155;
}

.sac-proc-table .sac-td-codigo {
    font-weight: 600;
    color: #4F00D1;
}

.sac-proc-table a {
    color: #4F00D1;
    cursor: pointer;
    text-decoration: none;
}
.sac-proc-table a:hover {
    text-decoration: underline;
}
.sac-proc-table .col-referencia-cliente a {
    color: #334155;
    font-weight: 500;
}
