/* SysTech — visual Pro compartilhado (Ordens, Financeiro, Clientes) */

.st-pro {
    animation: st-fade-up 0.45s var(--st-ease) both;
}

/* Skeleton */
.st-skeleton {
    display: grid;
    gap: var(--st-space-3);
    margin-bottom: var(--st-space-4);
}

.st-skeleton.oculto { display: none; }

.st-skel-block {
    border-radius: var(--st-radius-lg);
    background: linear-gradient(90deg, #12151c 0%, #1c2230 50%, #12151c 100%);
    background-size: 200% 100%;
    animation: st-shimmer 1.4s ease infinite;
}

.st-skel-hero { height: 132px; }
.st-skel-row { height: 72px; }
.st-skel-grid { height: 160px; }
.st-skel-list { height: 200px; }

.st-content {
    display: flex;
    flex-direction: column;
    gap: var(--st-space-4);
}

.st-content.carregando { display: none; }

/* Cabeçalho de página */
.st-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--st-space-3);
    margin-bottom: var(--st-space-4);
}

.st-page-head h1 {
    font-size: clamp(22px, 5vw, 26px);
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.st-page-sub {
    font-size: 13px;
    color: var(--systech-muted);
    margin: 4px 0 0;
}

.st-filtro-periodo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--st-space-2);
}

.st-filtro-periodo label {
    font-size: 12px;
    color: var(--systech-muted);
    font-weight: 600;
}

.st-filtro-periodo select {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: var(--st-radius-sm);
    border: 1px solid var(--systech-border);
    background: var(--systech-surface);
    color: #e7eaf0;
    font-size: 14px;
}

/* Alertas rápidos */
.st-alertas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--st-space-2);
}

.st-alertas:empty { display: none; }

.st-alerta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--st-dur) var(--st-ease);
    touch-action: manipulation;
    background: transparent;
    font-family: inherit;
    color: inherit;
}

.st-alerta:active { transform: scale(0.97); }

.st-alerta.amarelo {
    background: rgba(245, 166, 35, 0.12);
    border-color: rgba(245, 166, 35, 0.28);
    color: #f5c842;
}

.st-alerta.laranja {
    background: rgba(255, 149, 0, 0.12);
    border-color: rgba(255, 149, 0, 0.28);
    color: #ffab40;
}

.st-alerta.vermelho {
    background: rgba(255, 71, 87, 0.12);
    border-color: rgba(255, 71, 87, 0.28);
    color: #ff6b7a;
}

.st-alerta.azul {
    background: rgba(var(--systech-primary-rgb), 0.12);
    border-color: rgba(var(--systech-primary-rgb), 0.28);
    color: var(--systech-primary-light);
}

.st-alerta.verde {
    background: rgba(52, 199, 89, 0.12);
    border-color: rgba(52, 199, 89, 0.28);
    color: #34c759;
}

/* Hero KPI (Financeiro e resumos) */
.st-hero-kpi {
    display: grid;
    gap: var(--st-space-4);
    padding: var(--st-space-5);
    border-radius: var(--st-radius-xl);
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(var(--systech-primary-rgb), 0.18), transparent 55%),
        linear-gradient(145deg, #0c1220 0%, #0a1020 45%, #060a14 100%);
    border: 1px solid rgba(var(--systech-primary-rgb), 0.2);
    box-shadow: var(--st-shadow-glow);
}

.st-hero-kpi-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--st-space-4);
}

.st-hero-kpi-main { flex: 1 1 180px; min-width: 0; }

.st-kpi-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(var(--systech-primary-rgb), 0.85);
}

.st-kpi-valor {
    font-size: clamp(28px, 7vw, 40px);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-top: 4px;
}

.st-kpi-valor.neg { color: #ff6b7a; }

.st-kpi-sub {
    font-size: 11px;
    color: var(--systech-muted);
    margin-top: 6px;
}

.st-meta-wrap {
    margin-top: var(--st-space-3);
    max-width: 100%;
}

.st-meta-top {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #8a92a3;
    margin-bottom: 6px;
    font-weight: 600;
}

.st-meta-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.st-meta-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--systech-gradient);
    width: 0%;
    transition: width 0.8s var(--st-ease);
}

.st-meta-fill.neg {
    background: linear-gradient(90deg, #ff6b7a, #ff4757);
}

.st-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--st-space-3);
    padding-top: var(--st-space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.st-stat-pill {
    text-align: center;
    padding: var(--st-space-3);
    border-radius: var(--st-radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.st-stat-pill .ico {
    font-size: 16px;
    margin-bottom: 4px;
    display: block;
}

.st-stat-pill .lbl {
    font-size: 10px;
    color: #8a92a3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.st-stat-pill .val {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-top: 4px;
}

.st-stat-pill .val.neg { color: #ff6b7a; }

/* Seções / cards */
.st-secao {
    padding: var(--st-space-4);
    border-radius: var(--st-radius-lg);
    background: var(--systech-surface);
    border: 1px solid var(--systech-border);
}

.st-secao h2 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 var(--st-space-3);
    color: var(--systech-primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-form-linha {
    display: flex;
    flex-wrap: wrap;
    gap: var(--st-space-2);
    margin-bottom: var(--st-space-3);
}

.st-form-linha input,
.st-form-linha select {
    flex: 1 1 140px;
    min-width: 0;
    min-height: 44px;
    margin: 0;
}

.st-form-linha button {
    flex: 1 1 100%;
    min-height: 44px;
}

.st-secao .st-tabela-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--st-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.st-secao table {
    margin: 0;
}

.st-secao tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.st-vazio-linha td {
    text-align: center !important;
    color: var(--systech-muted) !important;
    padding: 24px !important;
}

/* Ações rápidas */
.st-acoes-pro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--st-space-2);
}

.st-acao-pro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: var(--st-radius-md);
    border: 1px solid var(--systech-border);
    background: var(--systech-surface);
    color: #e7eaf0;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--st-dur) var(--st-ease);
    touch-action: manipulation;
}

.st-acao-pro:active { transform: scale(0.98); }

.st-acao-pro.primario {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    border-color: rgba(52, 199, 89, 0.4);
    color: #fff;
    box-shadow: 0 8px 24px rgba(52, 199, 89, 0.2);
}

/* Ordens Pro */
.st-pro .os-status-grid {
    gap: var(--st-space-2);
}

.st-pro .os-stat-card {
    border-radius: var(--st-radius-md);
    transition: transform var(--st-dur) var(--st-ease), box-shadow var(--st-dur);
}

.st-pro .os-stat-card:active {
    transform: scale(0.98);
}

.st-pro .os-stat-card .stat-num {
    font-variant-numeric: tabular-nums;
}

.st-pro .os-gestao {
    border-radius: var(--st-radius-lg);
    border: 1px solid var(--systech-border);
    background: var(--systech-surface);
    padding: var(--st-space-4);
}

.st-pro .os-gestao #pesquisa {
    border-radius: var(--st-radius-sm);
    min-height: 44px;
    font-size: 16px;
}

.st-pro .os-view-toggle button {
    border-radius: var(--st-radius-sm);
    transition: background var(--st-dur);
}

.st-pro .os-table-wrap {
    border-radius: var(--st-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.st-pro .os-painel {
    border-radius: var(--st-radius-lg);
    overflow: hidden;
}

/* Clientes Pro */
.cli-pro .cli-stats {
    gap: var(--st-space-2);
}

.cli-pro .cli-stat {
    border-radius: var(--st-radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform var(--st-dur) var(--st-ease);
}

.cli-pro .cli-stat .num {
    font-variant-numeric: tabular-nums;
}

.cli-pro .cli-form-card {
    border-radius: var(--st-radius-lg);
    border: 1px solid rgba(var(--systech-primary-rgb), 0.2);
    box-shadow: var(--st-shadow-sm);
}

.cli-pro .cli-card {
    border-radius: var(--st-radius-md);
    transition: border-color var(--st-dur), transform var(--st-dur);
}

.cli-pro .cli-card:active {
    transform: scale(0.995);
}

.cli-pro .cli-toolbar #pesquisa {
    border-radius: var(--st-radius-sm);
}

.cli-pro .vazio {
    text-align: center;
    padding: var(--st-space-6);
    border-radius: var(--st-radius-lg);
    border: 1px dashed #2a3344;
    background: rgba(255, 255, 255, 0.02);
    color: var(--systech-muted);
}

/* Financeiro Pro */
.fin-pro .fin-grid-secoes {
    display: grid;
    gap: var(--st-space-4);
}

.fin-pro .st-secao.receita h2 { color: #34c759; }
.fin-pro .st-secao.despesa h2 { color: #ff6b7a; }

@media (min-width: 768px) {
    .st-hero-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .st-form-linha button {
        flex: 0 0 auto;
        min-width: 160px;
    }

    .st-acoes-pro {
        grid-template-columns: repeat(3, 1fr);
    }

    .st-acao-pro.primario {
        grid-column: auto;
    }

    .fin-pro .fin-grid-secoes {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1025px) {
    .st-hero-kpi-top {
        flex-wrap: nowrap;
    }
}

.badge-baixo { color: #ff6b7a; font-weight: 700; }
.badge-ok { color: #34c759; }

/* Financeiro Premium — abas e comissões */
.fin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fin-tab { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--systech-border); background: var(--systech-surface); color: var(--systech-muted); font-weight: 600; cursor: pointer; }
.fin-tab.ativo { background: rgba(var(--systech-primary-rgb), 0.15); border-color: rgba(var(--systech-primary-rgb), 0.4); color: #fff; }
.fin-panel { display: none; }
.fin-panel.ativo { display: block; }
.fin-comissao-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.fin-comissao-resumo { font-size: 13px; color: var(--systech-muted); }
.fin-grafico-barras { display: flex; align-items: flex-end; gap: 10px; min-height: 180px; padding: 16px 8px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--systech-border); }
.fin-grafico-barras .fin-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.fin-grafico-barras .fin-bar { width: 100%; max-width: 48px; border-radius: 6px 6px 0 0; background: var(--systech-gradient-v); min-height: 4px; }
.fin-grafico-barras .fin-bar-lbl { font-size: 10px; color: var(--systech-muted); text-align: center; }

/* Dashboard Top 5 */
.dash-top5 { display: grid; gap: 10px; margin-bottom: 20px; }
.dash-top5-item { display: grid; grid-template-columns: 1fr minmax(80px, 120px) auto; gap: 10px; align-items: center; font-size: 13px; }
.dash-top5-bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.dash-top5-bar div { height: 100%; background: var(--systech-gradient-h); border-radius: 4px; }
.dash-top5-vazio { font-size: 13px; color: var(--systech-muted); margin-bottom: 16px; }

/* Config cupons */
.cfg-cupom-lista { display: grid; gap: 8px; }
.cfg-cupom-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid var(--systech-border); font-size: 13px; flex-wrap: wrap; }
