/* =========================================================================
   DeltaRondas — tema corporativo (overlay sobre Bootstrap 5)
   Paleta: Grafite & Teal
   ========================================================================= */

:root {
  /* Marca */
  --graphite:   #11181f;
  --graphite-2: #1a2530;
  --brand:      #0d9488;
  --brand-2:    #0b7c72;
  --brand-soft: rgba(13, 148, 136, .12);

  /* Recolore o "primary" do Bootstrap (componentes que usam --bs-primary-rgb) */
  --bs-primary: #0d9488;
  --bs-primary-rgb: 13, 148, 136;
  --bs-link-color: #0d9488;
  --bs-link-color-rgb: 13, 148, 136;
  --bs-link-hover-color: #0b7c72;
  --bs-focus-ring-color: rgba(13, 148, 136, .25);
  --bs-body-color: #1f2937;
  --bs-body-bg: #f8fafc;
  --bs-border-color: #e5e9ef;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}

/* ---- Botões primary em teal (BS usa vars locais no .btn-primary) ---- */
.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-2);
  --bs-btn-hover-border-color: var(--brand-2);
  --bs-btn-active-bg: #0a6b62;
  --bs-btn-active-border-color: #0a6b62;
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand);
  --bs-btn-active-border-color: var(--brand);
}
.btn { font-weight: 600; }

/* ---- Inputs ---- */
.form-control, .form-select { border-color: var(--bs-border-color); }
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color);
}
.form-label { font-weight: 600; font-size: .85rem; color: #475569; }

a { color: var(--brand); }
a:hover { color: var(--brand-2); }

/* ---- Marca / logo ---- */
.logo, .brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.2rem; letter-spacing: -.3px;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; box-shadow: 0 6px 16px rgba(13, 148, 136, .35);
}
.brand .brand-accent { color: var(--brand); }

/* =========================================================================
   Login (super admin e empresa)
   ========================================================================= */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(13, 148, 136, .25), transparent 60%),
    linear-gradient(160deg, #0b1117, var(--graphite-2));
}
.auth-card {
  background: #fff; border-radius: 18px; padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}
.auth-card .logo { justify-content: center; }
.auth-sub { color: #64748b; font-size: .9rem; }

/* =========================================================================
   Shell do painel (sidebar grafite + conteúdo)
   ========================================================================= */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 260px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--graphite); color: #cbd5e1; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.app-sidebar .brand { color: #fff; padding: 20px 20px 14px; }
.app-sidebar .nav { padding: 10px; gap: 2px; flex: 1; overflow-y: auto; }
.app-sidebar .nav-link {
  display: flex; align-items: center; gap: 11px;
  color: #9aa7b6; font-weight: 600; font-size: .92rem; border-radius: 9px; padding: 10px 13px;
}
.app-sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.app-sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.app-sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 6px 16px rgba(13, 148, 136, .35);
}
.app-sidebar .sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-section {
  font-size: .68rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: #64748b; padding: 14px 14px 6px;
}

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  background: #fff; border-bottom: 1px solid var(--bs-border-color);
  height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 22px;
  position: sticky; top: 0; z-index: 20;
}
.app-content { padding: 26px 24px; width: 100%; }
.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; margin: 0; }
.page-sub { color: #64748b; font-size: .92rem; margin: 0; }

/* botão "hambúrguer" (mobile) */
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 767.98px) {
  .app-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; z-index: 1045;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .app-sidebar.open { transform: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 1040; }
  .sidebar-backdrop.show { display: block; }
  .sidebar-toggle { display: inline-flex; }
}

/* =========================================================================
   Cards / tabelas / utilitários
   ========================================================================= */
.card { border: 1px solid var(--bs-border-color); border-radius: 14px; box-shadow: 0 10px 40px rgba(15, 23, 42, .05); }
.stat-card { transition: .15s; text-decoration: none; color: inherit; display: block; height: 100%; }
a.stat-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 11px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 1.3rem;
  background: var(--brand-soft); color: var(--brand);
}
.stat-n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.stat-l { color: #64748b; font-size: .85rem; }
.soon {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .68rem;
  font-weight: 700; background: var(--brand-soft); color: var(--brand); vertical-align: middle;
}

.table > :not(caption) > * > * { padding: 13px 16px; }
.table thead th {
  background: #f1f5f9; color: #64748b; font-weight: 700;
  text-transform: uppercase; font-size: .72rem; letter-spacing: .5px; border-bottom: 0;
}
.table tbody tr:hover { background: #f8fafc; }
.user-chip { font-size: .9rem; color: #64748b; }
.user-chip b { color: var(--bs-body-color); }
.empty-state { padding: 50px 20px; text-align: center; color: #64748b; }
.empty-state i { font-size: 2.4rem; color: #cbd5e1; }
