* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background: #f3f4f6;
  color: #111827;
  min-height: 100vh;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* LOGIN CORRIGIDO */
body.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.55), transparent 35%),
    linear-gradient(135deg, #0f172a, #1e3a8a 55%, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 430px;
}

.login-card {
  width: 100%;
  background: #ffffff;
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.45);
}

.login-logo {
  width: 100%;
  min-height: 145px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo img {
  width: 380px;
  max-width: 98%;
  max-height: 160px;
  height: auto;
  object-fit: contain;
}

.logo-fallback {
  width: 220px;
  height: 110px;
  border-radius: 18px;
  color: #b48a3c;
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  letter-spacing: 2px;
  border: 1px solid rgba(180,138,60,0.25);
  background: linear-gradient(135deg, rgba(180,138,60,0.12), rgba(255,255,255,0.9));
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: #111827;
}

.login-header p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.login-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  color: #6b7280;
  font-size: 12px;
}

/* FORMULÁRIOS */
.input-group,
.field {
  margin-bottom: 16px;
}

.input-group label,
.field label,
label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  outline: none;
  font-size: 14px;
  background: #fff;
  color: #111827;
}

input:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.btn,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-size: 14px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary,
.btn-muted {
  background: #e5e7eb;
  color: #111827;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-full {
  width: 100%;
}

.alert,
.alert-error,
.alert-success {
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.alert.error,
.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
}

/* APP */
.app-shell,
.app {
  display: flex;
  min-height: 100vh;
  background: #f3f4f6;
}

.sidebar {
  width: 280px;
  background: #111827;
  color: #fff;
  padding: 22px 18px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 10;
}

.content {
  margin-left: 280px;
  width: calc(100% - 280px);
  padding: 24px;
}

.brand,
.brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  padding: 0;
  background: transparent;
  border: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.brand-card img,
.side-fallback {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px;
  max-width: 54px;
  border-radius: 14px;
  object-fit: contain;
}

.brand h2,
.brand-card h2 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}

.brand span,
.brand-card p {
  display: block;
  margin: 4px 0 0;
  color: #9ca3af;
  font-size: 12px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-title {
  color: #9ca3af;
  font-size: 12px;
  margin: 24px 0 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-item,
.menu a {
  display: block;
  color: #d1d5db;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 4px;
  font-weight: 700;
  font-size: 14px;
  background: transparent;
  border: 0;
}

.menu-item:hover,
.menu-item.active,
.menu a:hover,
.menu a.active {
  background: #1f2937;
  color: #fff;
}

.menu-item.logout,
.menu a[href*="logout"] {
  margin-top: 12px;
}

.topbar {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05);
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p,
.muted {
  color: #6b7280;
  margin: 6px 0 0;
}

.user-badge {
  text-align: right;
  color: #111827;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.cards-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card,
.card,
.panel {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05);
  border: 1px solid #eef2f7;
}

.stat-label,
.card h3 {
  display: block;
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 8px;
  font-weight: 700;
}

.stat-card strong,
.card .number {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: #111827;
  margin-top: 8px;
}

.panel {
  margin-bottom: 22px;
}

.panel h2 {
  margin-top: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.filters-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  grid-column: 1 / -1;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
}

.data-table,
.table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td,
.table th,
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table th,
.table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 800;
  white-space: nowrap;
}

.data-table tr:hover,
.table tr:hover {
  background: #f9fafb;
}

.sub-item {
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.empty-cell {
  text-align: center !important;
  color: #6b7280;
  padding: 28px !important;
}

.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge-admin {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-gerente {
  background: #fef3c7;
  color: #92400e;
}

.badge-suporte {
  background: #dcfce7;
  color: #166534;
}

.badge-off {
  background: #fee2e2;
  color: #991b1b;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.form-actions {
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .cards-grid,
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell,
  .app {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    bottom: auto;
  }

  .content {
    margin-left: 0;
    width: 100%;
  }

  .topbar {
    display: block;
  }

  .user-badge {
    text-align: left;
    margin-top: 12px;
  }
}

@media (max-width: 720px) {
  body.login-page {
    padding: 16px;
  }

  .login-card {
    padding: 26px 22px;
    border-radius: 22px;
  }

  .login-logo {
    min-height: 120px;
    margin-bottom: 16px;
  }

  .login-logo img {
    width: 320px;
    max-width: 98%;
    max-height: 125px;
  }

  .content {
    padding: 16px;
  }

  .cards-grid,
  .grid,
  .filters-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .filters-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}


/* MÓDULO CAPTAÇÃO */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-aguardando { background:#fef3c7; color:#92400e; }
.status-dados-enviados { background:#dbeafe; color:#1d4ed8; }
.status-aprovado { background:#dcfce7; color:#166534; }
.status-reprovado { background:#fee2e2; color:#991b1b; }
.status-sem-interesse { background:#e5e7eb; color:#374151; }
.status-outra-agencia { background:#f3e8ff; color:#6b21a8; }

.actions-row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.kpi-note { color:#6b7280; font-size:12px; margin-top:6px; }
.detail-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:16px; }
.detail-item { background:#f9fafb; border:1px solid #e5e7eb; border-radius:14px; padding:14px; }
.detail-item span { display:block; font-size:12px; color:#6b7280; font-weight:800; margin-bottom:5px; }
.detail-item strong { font-size:15px; color:#111827; }
.tabs-row { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.tab-btn { padding:10px 14px; border-radius:12px; background:#e5e7eb; color:#111827; font-weight:800; }
.tab-btn.active { background:#2563eb; color:#fff; }
.form-section-title { margin:20px 0 10px; font-size:16px; }
.required-note { font-size:12px; color:#991b1b; margin-top:6px; }
@media(max-width:720px){ .detail-grid{ grid-template-columns:1fr; } }


/* HISTÓRICO / AUDITORIA DA CAPTAÇÃO */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  margin-top: 7px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.timeline-content {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.timeline-head span,
.timeline-meta,
.timeline-note {
  color: #6b7280;
  font-size: 13px;
}

.timeline-meta,
.timeline-status,
.timeline-note {
  margin-top: 6px;
}

.timeline-status {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}


/* LOGO CENTRAL DO STREAMER NO MENU LATERAL */
.brand-card-logo,
.sidebar .brand-card.brand-card-logo,
.sidebar .brand.brand-card-logo {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 0 26px !important;
  padding: 8px 0 18px !important;
  background: transparent !important;
  border: 0 !important;
}

.sidebar-main-logo,
.brand-card-logo img.sidebar-main-logo,
.sidebar .brand-card img.sidebar-main-logo,
.sidebar .brand img.sidebar-main-logo {
  width: 235px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 82px !important;
  min-width: 0 !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  display: block !important;
}

@media (max-width: 900px) {
  .sidebar-main-logo,
  .brand-card-logo img.sidebar-main-logo {
    width: 220px !important;
    max-height: 78px !important;
  }
}


/* AGÊNCIAS PARCEIRAS - ADMIN */
.partner-grid{
  display:grid;
  gap:14px;
}

.partner-card{
  background:#fff;
  border:1px solid #eef2f7;
  border-radius:18px;
  padding:18px;
  box-shadow:0 8px 25px rgba(0,0,0,0.05);
}

.partner-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:12px;
}

.partner-head h3{
  margin:0;
  font-size:1.1rem;
}

.partner-meta{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin:12px 0;
}

.partner-meta div{
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:12px;
}

.partner-meta span{
  display:block;
  color:#6b7280;
  font-size:12px;
  font-weight:800;
  margin-bottom:4px;
}

.partner-meta strong{
  font-size:14px;
}

.partner-actions{
  display:grid;
  grid-template-columns:220px 1fr 160px;
  gap:10px;
  align-items:end;
  margin-top:12px;
}

.partner-actions textarea{
  width:100%;
  min-height:42px;
  border:1px solid #d1d5db;
  border-radius:12px;
  padding:10px;
  font-family:inherit;
  resize:vertical;
}

.partner-actions select{
  width:100%;
}

.btn-whats{
  background:#25d366;
  color:#fff;
  border-radius:12px;
  padding:10px 12px;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

@media(max-width:900px){
  .partner-meta,
  .partner-actions{
    grid-template-columns:1fr;
  }

  .partner-head{
    display:block;
  }

  .btn-whats{
    margin-top:10px;
    width:100%;
  }
}


/* CELULAR - OCULTAR COMPLETAMENTE O TOPO DOS STREAMERS */
@media (max-width: 900px){

  .topbar{
    display:none !important;
  }

}


/* AJUSTE MOBILE - ESPAÇO DA LOGO NO TOPO */
@media (max-width: 900px){

  .brand-card-logo,
  .sidebar .brand-card.brand-card-logo,
  .sidebar .brand.brand-card-logo{
      padding: 8px 0 8px !important;
      margin-bottom: 12px !important;
  }

  .mobile-menu-btn{
      margin-top: 8px !important;
  }

}
