/* style.css — COMFICA Dashboard TIM SUL */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --tim-blue: #0033A0;
  --tim-red: #E40000;
  --tim-light: #EEF2FF;
  --tim-border: #C7D2F0;
  --warning: #F59E0B;
  --critical: #EF4444;
  --ok: #10B981;
  --bg: #F0F4FF;
  --card: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  --shadow: 0 2px 8px rgba(0,51,160,0.10);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Header ── */
.header { background: linear-gradient(135deg, var(--tim-blue) 0%, #001F6B 100%); color: #fff; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 3px 12px rgba(0,0,0,.25); }
.header h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: .5px; }
.header .sub { font-size: .8rem; opacity: .8; margin-top: 2px; }
.badge-regional { background: var(--tim-red); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 12px; letter-spacing: .5px; }

/* ── Upload Zone ── */
.upload-zone { max-width: 860px; margin: 32px auto; padding: 0 16px; }
.upload-card { background: var(--card); border: 2px dashed var(--tim-border); border-radius: 16px; padding: 36px 28px; text-align: center; transition: border-color .2s; }
.upload-card:hover { border-color: var(--tim-blue); }
.upload-card h2 { color: var(--tim-blue); font-size: 1.15rem; margin-bottom: 8px; }
.upload-card p { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }
.btn-group { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.btn { padding: 10px 22px; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; border: none; transition: all .18s; }
.btn-primary { background: var(--tim-blue); color: #fff; }
.btn-primary:hover { background: #001F6B; }
.btn-outline { background: transparent; color: var(--tim-blue); border: 2px solid var(--tim-blue); }
.btn-outline:hover { background: var(--tim-light); }
.btn-red { background: var(--tim-red); color: #fff; }
.btn-red:hover { background: #B00000; }
textarea.paste-area { width: 100%; min-height: 120px; border: 1px solid var(--tim-border); border-radius: 10px; padding: 12px; font-size: .85rem; font-family: monospace; resize: vertical; color: var(--text); outline: none; transition: border-color .2s; }
textarea.paste-area:focus { border-color: var(--tim-blue); }
.format-hint { font-size: .75rem; color: var(--muted); margin-top: 8px; }
.error-msg { color: var(--critical); font-size: .88rem; margin-top: 12px; display: none; }

/* ── Dashboard ── */
.dashboard { max-width: 1200px; margin: 0 auto; padding: 24px 16px 40px; display: none; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi-card { background: var(--card); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); border-left: 5px solid var(--tim-blue); }
.kpi-card.red { border-left-color: var(--critical); }
.kpi-card.orange { border-left-color: var(--warning); }
.kpi-card.green { border-left-color: var(--ok); }
.kpi-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 6px; }
.kpi-value { font-size: 2rem; font-weight: 800; color: var(--tim-blue); line-height: 1; }
.kpi-card.red .kpi-value { color: var(--critical); }
.kpi-card.orange .kpi-value { color: var(--warning); }
.kpi-card.green .kpi-value { color: var(--ok); }
.kpi-sub { font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* Sections */
.section { background: var(--card); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.section-title { font-size: 1rem; font-weight: 700; color: var(--tim-blue); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title .icon { font-size: 1.1rem; }

/* Bar Chart */
.bar-chart { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: .82rem; }
.bar-label { min-width: 180px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.bar-track { flex: 1; background: var(--tim-light); border-radius: 6px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--tim-blue), #4A7CFF); display: flex; align-items: center; padding-left: 8px; transition: width .5s ease; min-width: 2px; }
.bar-fill.red { background: linear-gradient(90deg, var(--critical), #FF7070); }
.bar-val { font-size: .78rem; font-weight: 700; color: var(--muted); min-width: 60px; text-align: right; }
.bar-count { font-size: .72rem; color: var(--muted); min-width: 40px; text-align: right; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
th { background: var(--tim-light); color: var(--tim-blue); font-weight: 700; padding: 10px 12px; text-align: left; position: sticky; top: 0; }
td { padding: 9px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
tr:hover td { background: #F8FAFF; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.badge-falha { background: #FEE2E2; color: #B91C1C; }
.badge-atend { background: #FEF3C7; color: #92400E; }
.badge-ok { background: #D1FAE5; color: #065F46; }
.badge-default { background: #E2E8F0; color: #475569; }
.critico-tag { color: var(--critical); font-weight: 700; }
.horas-tag { font-size: .78rem; color: var(--muted); }

/* Donut chart placeholder */
.donut-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.causa-item { display: flex; align-items: center; gap: 8px; background: var(--tim-light); border-radius: 8px; padding: 8px 14px; flex: 1; min-width: 200px; }
.causa-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.causa-name { font-size: .82rem; font-weight: 600; flex: 1; }
.causa-meta { font-size: .75rem; color: var(--muted); text-align: right; }

/* Timestamp */
.timestamp { font-size: .75rem; color: #94A3B8; text-align: right; margin-bottom: 18px; }

/* Responsive */
@media (max-width: 600px) {
  .header h1 { font-size: 1rem; }
  .kpi-value { font-size: 1.5rem; }
  .bar-label { min-width: 120px; max-width: 140px; }
}

/* ── Filter Bar ── */
.filter-bar { display: none; align-items: center; gap: 14px; background: #FFFBEB; border: 1px solid #FCD34D; border-radius: 10px; padding: 10px 16px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: #92400E; cursor: pointer; user-select: none; }
.filter-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--tim-blue); cursor: pointer; }
.filter-info { font-size: .78rem; color: var(--muted); font-style: italic; }
