/* ===================================================================
   Sistema de Notificações Extrajudiciais - Rede Sol Fuel Distribuidora
   Design System oficial Rede Sol
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Paleta oficial Rede Sol */
  --sol-orange:       #F58220;
  --sol-orange-dark:  #D96E0E;
  --sol-orange-light: #FFF3E6;
  --sol-orange-glow:  #FFAB40;

  --white:    #FFFFFF;
  --gray-50:  #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-400: #BDBDBD;
  --gray-500: #9E9E9E;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;

  --red:         #E53935;
  --red-light:   #FFEBEE;
  --green:       #43A047;
  --green-light: #E8F5E9;
  --blue:        #1E88E5;
  --blue-light:  #E3F2FD;

  --radius:    12px;
  --shadow:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(245,130,32,0.15);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--gray-100);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============== HEADER / TOPBAR ============== */
.topbar {
  background: var(--white);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-bottom: 3px solid var(--sol-orange);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand img {
  height: 48px;
  width: auto;
}
.brand-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--gray-900);
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--sol-orange);
  margin-top: 2px;
}
.topbar-right .badge {
  background: var(--sol-orange-light);
  color: var(--sol-orange-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ============== CONTAINER ============== */
.container {
  max-width: 1000px;
  margin: 32px auto 24px;
  padding: 0 20px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.hidden { display: none !important; }

h1 {
  font-size: 1.5rem;
  margin: 0 0 8px 0;
  color: var(--gray-900);
  font-weight: 700;
}
h2 {
  font-size: 1.25rem;
  margin: 0 0 14px 0;
  color: var(--gray-900);
  font-weight: 700;
}
h3 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sol-orange);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 24px 0 12px 0;
}
.lead {
  color: var(--gray-700);
  margin: 0 0 22px 0;
  font-size: 0.94rem;
}

/* ============== DROPZONE ============== */
.dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 50px 20px;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s;
}
.dropzone:hover {
  border-color: var(--sol-orange);
  background: var(--sol-orange-light);
}
.dropzone.dragover {
  border-color: var(--sol-orange);
  background: var(--sol-orange-light);
  transform: scale(1.005);
  box-shadow: var(--shadow-md);
}
.dropzone-icon {
  color: var(--gray-400);
  margin-bottom: 12px;
}
.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  color: var(--sol-orange);
}
.dropzone-text {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.dropzone-hint {
  font-size: 0.82rem;
  color: var(--gray-500);
}

.file-info {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--sol-orange-light);
  border: 1px solid var(--sol-orange-glow);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.file-icon { font-size: 1.4rem; }
.file-name { font-weight: 600; flex: 1; color: var(--gray-900); }
.file-size { font-size: 0.82rem; color: var(--gray-700); }

/* ============== BOTÕES ============== */
.btn {
  border: 0;
  padding: 12px 26px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  background: var(--sol-orange);
  color: white;
  box-shadow: 0 4px 12px rgba(245,130,32,0.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--sol-orange-dark);
  box-shadow: 0 6px 16px rgba(245,130,32,0.35);
}
.btn-primary:disabled {
  background: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-ghost:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}
.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}
.link-btn {
  background: transparent;
  border: 0;
  color: var(--sol-orange);
  cursor: pointer;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
  font-family: 'Inter', sans-serif;
}
.link-btn:hover { color: var(--sol-orange-dark); }

.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.actions-center { justify-content: center; }

/* ============== KPIs ============== */
.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}
.kpi:hover {
  border-color: var(--sol-orange-glow);
  box-shadow: var(--shadow);
}
.kpi-label {
  font-size: 0.72rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sol-orange);
  font-variant-numeric: tabular-nums;
}

/* ============== AVISOS ============== */
.avisos {
  background: var(--sol-orange-light);
  border: 1px solid var(--sol-orange-glow);
  color: var(--sol-orange-dark);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.avisos ul { margin: 4px 0 0 18px; padding: 0; }

/* ============== SECTION HEADING ROW ============== */
.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-heading-row h3 { margin: 0; }
.select-actions {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-500);
}
.select-actions .sep { color: var(--gray-300); }

/* ============== TABELA ============== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.orgaos-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.orgaos-tbl th, .orgaos-tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
}
.orgaos-tbl thead th {
  background: var(--sol-orange-light);
  font-weight: 700;
  color: var(--sol-orange-dark);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.orgaos-tbl tbody tr:last-child td { border-bottom: 0; }
.orgaos-tbl tbody tr:hover { background: var(--gray-50); }
.orgaos-tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.orgaos-tbl tbody tr.deselected td:not(.col-check) { opacity: 0.4; }
.orgaos-tbl tbody tr.deselected td strong { font-weight: 500; }
.col-check { width: 42px; text-align: center; padding-left: 14px !important; padding-right: 0 !important; }
.cb-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  margin: -4px;
}
.cb-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--sol-orange);
  cursor: pointer;
  margin: 0;
}

/* ============== LOADING ============== */
.loading {
  text-align: center;
  padding: 40px 20px;
}
.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 24px;
  border: 5px solid var(--gray-200);
  border-top-color: var(--sol-orange);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-list {
  text-align: left;
  max-width: 360px;
  margin: 28px auto 0;
  padding: 0;
  list-style: none;
}
.progress-list li {
  padding: 8px 0 8px 30px;
  position: relative;
  color: var(--gray-500);
  font-size: 0.92rem;
}
.progress-list li::before {
  content: '○';
  position: absolute;
  left: 4px;
  color: var(--gray-300);
}
.progress-list li.done { color: var(--green); }
.progress-list li.done::before { content: '✓'; color: var(--green); font-weight: bold; }
.progress-list li.active { color: var(--sol-orange); font-weight: 600; }
.progress-list li.active::before {
  content: '●';
  color: var(--sol-orange);
  animation: pulse 1s infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* ============== SUCESSO ============== */
.success {
  text-align: center;
  padding: 40px 20px;
}
.success-check {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  background: linear-gradient(135deg, var(--green), #2E7D32);
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(67, 160, 71, 0.3);
}
.hint {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-top: 20px;
}

/* ============== ERRO ============== */
.error-box {
  text-align: center;
  padding: 30px 20px;
}
.error-icon {
  font-size: 3.5rem;
  color: var(--red);
  margin-bottom: 12px;
}

/* ============== FOOTER ============== */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--gray-500);
  font-size: 0.8rem;
  margin-top: 12px;
}
.footer-dev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}
.footer-dev img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}
.footer-dev .credit-text {
  font-size: 0.78rem;
  color: var(--gray-700);
  letter-spacing: 0.3px;
}
.footer-dev .credit-text strong {
  color: #1E40AF; /* azul royal AR Souza */
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ============== RESPONSIVO ============== */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .topbar-right { display: none; }
  .container { padding: 0 14px; margin-top: 18px; }
  .card { padding: 20px; }
  .kpis { grid-template-columns: 1fr; gap: 10px; }
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
}
