* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
  min-height: 100vh;
}

/* Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
}
.login-box {
  background: #020617;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}
.login-box h1 {
  margin: 0 0 .25rem;
  font-size: 1.9rem;
}
.login-box .subtitle {
  margin: 0 0 1.5rem;
  font-size: .9rem;
  color: #9ca3af;
}
.login-box label {
  display: block;
  margin-top: 1rem;
  font-size: .85rem;
  color: #9ca3af;
}
.login-box input {
  width: 100%;
  padding: .55rem .8rem;
  margin-top: .25rem;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #020617;
  color: #e5e7eb;
  font-size: .95rem;
}
.login-box input:focus {
  outline: 2px solid #3b82f633;
  border-color: #3b82f6;
  background: #020617;
}
.login-box button {
  width: 100%;
  margin-top: 1.7rem;
  padding: .7rem 1rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
}
.login-box button:hover {
  background: #2563eb;
}
.login-box .erro {
  color: #fecaca;
  font-size: .85rem;
  margin-bottom: 1rem;
}

/* Layout painel */
.painel-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 250px;
  background: #020617;
  border-right: 1px solid #111827;
  padding: 1.25rem 1rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar h2 {
  font-size: 1rem;
  margin: 0 0 .25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sidebar .logo {
  width: 32px;
  height: 32px;
  background: #3b82f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
  color: #ffffff;
}
.sidebar .sub {
  font-size: .75rem;
  color: #6b7280;
  margin: 0 0 1.5rem;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .8rem;
  color: #9ca3af;
  text-decoration: none;
  border-radius: 999px;
  margin-bottom: 2px;
  font-size: .9rem;
}
.sidebar nav a:hover {
  background: #0f172a;
  color: #e5e7eb;
}
.sidebar nav a.ativo {
  background: #3b82f6;
  color: #020617;
}
.sidebar .sair {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  font-size: .85rem;
}
.sidebar .sair a {
  color: #f97373;
  text-decoration: none;
}
.main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow: auto;
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
}
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.main h1 {
  margin: 0;
  font-size: 1.6rem;
}
.main .desc {
  color: #9ca3af;
  font-size: .9rem;
  margin-top: .25rem;
}

/* Cards de dashboard */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.card {
  background: #020617;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  border: 1px solid #1f2937;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: .85rem;
  color: #9ca3af;
  margin-bottom: .35rem;
}
.card .numero {
  font-size: 1.8rem;
  font-weight: 700;
  color: #60a5fa;
}
.card .label {
  font-size: .8rem;
  color: #6b7280;
  margin-top: .2rem;
}

.card-main-content {
  display: flex;
  flex-direction: column;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}
.card-icon svg {
  width: 20px;
  height: 20px;
}

.card--primary {
  border-left: 6px solid #3b82f6;
}
.card--secondary {
  border-left: 6px solid #a855f7;
}
.card--warning {
  border-left: 6px solid #f97316;
}
.card--success {
  border-left: 6px solid #22c55e;
}
.card--danger {
  border-left: 6px solid #ef4444;
}

/* Tabelas */
.tabela-wrapper {
  overflow-x: auto;
  background: #020617;
  border-radius: 16px;
  border: 1px solid #1f2937;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.6);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: .65rem .9rem;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
  font-size: .85rem;
}
th {
  background: #020617;
  color: #9ca3af;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
tr:hover {
  background: #020617;
}

.btn {
  display: inline-block;
  padding: .45rem .85rem;
  border-radius: 999px;
  font-size: .85rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: #3b82f6;
  color: #ffffff;
}
.btn-primary:hover {
  background: #2563eb;
}
.btn-secondary {
  background: #111827;
  color: #e5e7eb;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-small {
  padding: .3rem .7rem;
  font-size: .8rem;
  margin-right: .25rem;
}
.mb {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  margin-bottom: .25rem;
  font-size: .85rem;
  color: #9ca3af;
}
.form-group input,
.form-group select,
.form-group textarea,
.input {
  width: 100%;
  max-width: 400px;
  padding: .6rem .9rem;
  border: 1px solid #1f2937;
  border-radius: 999px;
  background: #020617;
  color: #e5e7eb;
  font-size: .9rem;
}
.form-group input:focus,
.form-group select:focus,
.input:focus {
  outline: 2px solid #3b82f633;
  border-color: #3b82f6;
  background: #020617;
}
.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .85rem;
}
.alert-ok {
  background: #064e3b;
  color: #bbf7d0;
}
.alert-erro {
  background: #7f1d1d;
  color: #fecaca;
}

.link-tse {
  margin-top: .5rem;
}
.link-tse a {
  color: #60a5fa;
  font-size: .85rem;
}

.top-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

/* Modal de cadastro de apoiador */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 50;
}
.modal-backdrop.ativo {
  display: flex;
}
.modal-apoiador {
  width: 520px;
  max-width: 100%;
  background: #020617;
  border-left: 1px solid #1f2937;
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.9);
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
}

.modal-lideranca,
.modal-projeto {
  width: 520px;
  max-width: 100%;
  background: #020617;
  border-left: 1px solid #1f2937;
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.9);
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.2rem;
  cursor: pointer;
}
.section-title {
  margin: 1rem 0 .5rem;
  font-size: .9rem;
  font-weight: 600;
}
.section-divider {
  border-top: 1px solid #1f2937;
  margin-bottom: .75rem;
  position: relative;
}
.section-divider span {
  position: absolute;
  top: -0.65rem;
  left: 0;
  font-size: .75rem;
  color: #64748b;
  background: #020617;
  padding-right: .5rem;
}
.input-with-icon {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.input-with-icon span {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  font-size: .85rem;
}


/* TSE Consultation Box */
.tse-consulta-box {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}
.tse-consulta-title {
  font-weight: 600;
  font-size: .95rem;
  color: #60a5fa;
  margin-bottom: .4rem;
}
.tse-consulta-desc {
  font-size: .8rem;
  color: #9ca3af;
  margin: 0 0 .75rem;
}
.btn-tse {
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .5rem 1rem;
  font-size: .9rem;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}
.btn-tse:hover { background: #1e40af; }
.btn-tse:disabled { opacity: .5; cursor: not-allowed; }
.tse-consulta-status { margin-top: .5rem; font-size: .85rem; }
.tse-error { color: #fca5a5; }
.tse-success { color: #6ee7b7; }
.tse-loading { color: #93c5fd; }
