/* ═══════════════════════════════════════════════════════════════
   ATALIUM — Painel Admin  v2.0
   Dark premium: navy base + purple accent
   Tipografia: Outfit (display) + DM Sans (corpo)
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

:root {
  --navy:          #060a18;
  --navy-mid:      #0b1126;
  --navy-light:    #111a38;
  --navy-border:   #1a2548;
  --navy-hover:    #16204a;

  --purple:        #7c3aed;
  --purple-bright: #a78bfa;
  --purple-dim:    #5b21b6;
  --purple-glow:   rgba(124,58,237,0.25);
  --purple-subtle: rgba(124,58,237,0.08);

  --white:         #f1f5f9;
  --white-80:      rgba(241,245,249,0.82);
  --white-60:      rgba(241,245,249,0.55);
  --white-40:      rgba(241,245,249,0.38);
  --white-20:      rgba(241,245,249,0.12);
  --white-10:      rgba(241,245,249,0.06);
  --white-05:      rgba(241,245,249,0.03);

  --green:         #34d399;
  --green-dim:     rgba(52,211,153,0.12);
  --yellow:        #fbbf24;
  --yellow-dim:    rgba(251,191,36,0.1);
  --red:           #f87171;
  --red-dim:       rgba(248,113,113,0.1);

  --font-display:  'Outfit', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --sidebar-w:     264px;
  --radius-xs:     6px;
  --radius-sm:     10px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --ease:          cubic-bezier(0.16,1,0.3,1);
  --ease-out:      cubic-bezier(0,0,0.2,1);
  --shadow-sm:     0 1px 3px rgba(0,0,0,.3);
  --shadow-md:     0 8px 30px rgba(0,0,0,.35);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.5);
  --shadow-purple: 0 8px 30px rgba(124,58,237,.2);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }

/* ── subtle grain texture ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ── ambient glow ── */
body::after {
  content: '';
  position: fixed;
  top: -30%; left: -10%;
  width: 50%; height: 80%;
  background: radial-gradient(circle, rgba(124,58,237,.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ═══ LAYOUT ═══ */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-mid);
  border-right: 1px solid var(--navy-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.35s var(--ease);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 26px 24px 22px;
  border-bottom: 1px solid var(--navy-border);
}
.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--white);
  background: linear-gradient(135deg, var(--white) 40%, var(--purple-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-logo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--purple-bright);
  box-shadow: 0 0 12px var(--purple-bright), 0 0 4px var(--purple-bright);
  animation: pdot 2.5s ease-in-out infinite;
}
@keyframes pdot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.35;transform:scale(.55)} }

.sidebar-section-label {
  font-size: .6rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--white-40);
  padding: 22px 24px 8px;
}

.sidebar-nav {
  flex: 1; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  color: var(--white-40);
  font-size: .85rem; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all .2s var(--ease-out);
  position: relative;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--white-10);
  color: var(--white-80);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--purple-subtle);
  color: var(--white);
  border-color: rgba(124,58,237,.18);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -1px; top: 20%; bottom: 20%;
  width: 2.5px; border-radius: 2px;
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple);
}
.nav-icon { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; opacity: .7; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--navy-border);
}
.sidebar-admin {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--white-05);
  border: 1px solid var(--navy-border);
  transition: background .2s;
}
.sidebar-admin:hover { background: var(--white-10); }
.admin-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--purple-dim), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: .9rem; font-weight: 700;
  color: var(--white); flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(124,58,237,.25);
}
.admin-name { display: block; font-size: .82rem; font-weight: 600; color: var(--white); }
.admin-role { display: block; font-size: .68rem; color: var(--white-40); text-transform: capitalize; }
.logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 9px;
  background: none; border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  font-size: .78rem; font-weight: 600;
  color: var(--white-40);
  transition: all .2s var(--ease-out);
  cursor: pointer;
  font-family: var(--font-body);
}
.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
}

/* ═══ MAIN ═══ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  padding: 0;
  display: flex; flex-direction: column;
}

/* ═══ TOPBAR ═══ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px;
  border-bottom: 1px solid var(--navy-border);
  background: rgba(6,10,24,.75);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-menu-btn {
  display: none; background: none; border: none;
  color: var(--white-40); font-size: 1.3rem; cursor: pointer;
  transition: color .2s;
}
.topbar-menu-btn:hover { color: var(--white); }
@media(max-width:900px){ .topbar-menu-btn { display: block; } }
.topbar-title { font-size: .82rem; color: var(--white-40); }
.topbar-title strong { color: var(--white); font-weight: 600; }
.topbar-time {
  font-size: .72rem; color: var(--white-40);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-body);
  letter-spacing: .04em;
}

/* ═══ PAGE BODY ═══ */
.page-body {
  padding: 32px 36px 48px;
  flex: 1;
  animation: fadeUp .4s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--white);
}
.page-sub { font-size: .8rem; color: var(--white-40); }

/* ═══ KPI GRID ═══ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 16px; margin-bottom: 28px;
}
.kpi-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  position: relative; overflow: hidden;
  transition: all .3s var(--ease);
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--navy-hover);
}
.kpi-card.accent {
  background: linear-gradient(145deg, rgba(124,58,237,.14), var(--navy-mid) 80%);
  border-color: rgba(124,58,237,.28);
}
.kpi-card.accent::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--purple-dim), var(--purple), var(--purple-bright));
}
.kpi-card.accent:hover {
  box-shadow: var(--shadow-purple);
}
.kpi-label {
  display: block;
  font-size: .65rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--white-40);
  margin-bottom: 12px;
}
.kpi-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 700;
  letter-spacing: -.01em; line-height: 1;
  margin-bottom: 8px;
}
.kpi-value.positive { color: var(--green); }
.kpi-value.negative { color: var(--red); }
.kpi-sub { font-size: .72rem; color: var(--white-40); }

/* ═══ PANEL ═══ */
.panel {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color .2s;
}
.panel:hover { border-color: var(--navy-hover); }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--navy-border);
}
.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 700;
  letter-spacing: .04em;
  color: var(--white-80);
}

/* ═══ DATA TABLE ═══ */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead tr { border-bottom: 1px solid var(--navy-border); }
.data-table th {
  padding: 12px 20px; text-align: left;
  font-size: .65rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--white-40);
  background: rgba(255,255,255,.01);
}
.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(26,37,72,.5);
  vertical-align: middle;
  transition: background .15s;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--white-05); }
.data-table .empty {
  text-align: center; color: var(--white-40);
  padding: 48px; font-size: .875rem;
}

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex; align-items: center;
  border-radius: 100px;
  padding: 3px 11px;
  font-size: .65rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  transition: all .2s;
}
.badge-active    { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,.2); }
.badge-trial     { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(251,191,36,.2); }
.badge-suspended { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.badge-cancelled { background: var(--white-05); color: var(--white-40); border: 1px solid var(--navy-border); }
.badge-paid      { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,.2); }
.badge-pending   { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(251,191,36,.2); }
.badge-new       { background: var(--purple-subtle); color: var(--purple-bright); border: 1px solid rgba(124,58,237,.25); }
.badge-contacted { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(251,191,36,.2); }
.badge-converted { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,.2); }
.badge-lost      { background: var(--white-05); color: var(--white-40); border: 1px solid var(--navy-border); }

/* ═══ BOTÕES ═══ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--purple); color: var(--white);
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .84rem; letter-spacing: .01em;
  border: none; cursor: pointer; font-family: var(--font-body);
  transition: all .2s var(--ease);
  box-shadow: 0 2px 8px rgba(124,58,237,.15);
}
.btn-primary:hover {
  background: #8b5cf6;
  box-shadow: var(--shadow-purple);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--white-80);
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: .84rem;
  border: 1px solid var(--navy-border); cursor: pointer; font-family: var(--font-body);
  transition: all .2s var(--ease-out);
}
.btn-secondary:hover {
  border-color: var(--white-40);
  color: var(--white);
  background: var(--white-10);
}
.btn-small {
  display: inline-flex; align-items: center;
  padding: 5px 13px; border-radius: var(--radius-xs);
  font-size: .73rem; font-weight: 600;
  background: var(--white-10); color: var(--white-80);
  border: 1px solid var(--navy-border);
  transition: all .15s var(--ease-out);
  cursor: pointer; font-family: var(--font-body);
}
.btn-small:hover {
  background: var(--purple-subtle);
  color: var(--white);
  border-color: rgba(124,58,237,.25);
}

/* ═══ FILTROS ═══ */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-input, .filter-select {
  padding: 9px 14px;
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  font-size: .84rem; font-family: var(--font-body); color: var(--white);
  transition: all .2s var(--ease-out);
}
.filter-input { min-width: 240px; }
.filter-input::placeholder { color: var(--white-40); }
.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: rgba(124,58,237,.45);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
  background: var(--navy-light);
}
.filter-select { appearance: none; cursor: pointer; }

/* ═══ FORM (modais e painéis) ═══ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--white-40);
}
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px;
  background: var(--navy); border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  font-size: .875rem; font-family: var(--font-body); color: var(--white);
  transition: all .2s var(--ease-out);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--white-40); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: rgba(124,58,237,.45);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
  background: var(--navy-light);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.error-msg { color: var(--red); font-size: .82rem; padding: 0 24px 8px; display: none; }

/* ═══ MODAL ═══ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  animation: modal-in .3s var(--ease);
  box-shadow: var(--shadow-lg);
}
.modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--purple) 50%, transparent 95%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.97) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--navy-border);
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 700;
  letter-spacing: .03em;
}
.modal-close {
  background: none; border: none; color: var(--white-40);
  font-size: 1.4rem; cursor: pointer;
  transition: all .2s;
  line-height: 1;
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--white); background: var(--white-10); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--navy-border);
}

/* ═══ INFO LIST ═══ */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 24px;
  border-bottom: 1px solid rgba(26,37,72,.5);
  font-size: .875rem;
  transition: background .15s;
}
.info-row:last-child { border-bottom: none; }
.info-row:hover { background: var(--white-05); }
.info-row > span { color: var(--white-40); }
.info-row > strong { font-weight: 600; }

/* ═══ TABS ═══ */
.finance-tabs {
  display: flex; gap: 2px;
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  padding: 4px; width: fit-content;
}
.finance-tab {
  padding: 8px 22px; border-radius: 7px;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  border: none; background: none; color: var(--white-40);
  font-family: var(--font-body);
  transition: all .2s var(--ease);
}
.finance-tab:hover { color: var(--white-60); }
.finance-tab.active {
  background: var(--purple); color: var(--white);
  box-shadow: 0 4px 16px var(--purple-glow);
}

/* ═══ FLASH ═══ */
.flash {
  margin: 0 36px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: flash-in .35s var(--ease);
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash-success { background: var(--green-dim); border: 1px solid rgba(52,211,153,.2); color: var(--green); }
.flash-error   { background: var(--red-dim); border: 1px solid rgba(248,113,113,.2); color: var(--red); }
.flash-info    { background: var(--purple-subtle); border: 1px solid rgba(124,58,237,.2); color: var(--purple-bright); }

/* ═══ TOAST ═══ */
#toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 500;
  padding: 14px 24px; border-radius: var(--radius-md);
  font-size: .875rem; font-weight: 600;
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  color: var(--white);
  display: none; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .3s var(--ease);
  backdrop-filter: blur(12px);
}
#toast.show { display: flex; }
#toast.success { border-color: rgba(52,211,153,.3); color: var(--green); }
#toast.error   { border-color: rgba(248,113,113,.3); color: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media(max-width:860px){ .login-page { grid-template-columns: 1fr; } }

.login-brand {
  background: var(--navy-mid);
  border-right: 1px solid var(--navy-border);
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: space-between;
  padding: 56px 60px;
  position: relative; overflow: hidden;
}
.login-brand::before {
  content: ''; position: absolute; bottom: -120px; left: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,.1), transparent 65%);
  pointer-events: none;
}
.login-brand::after {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(124,58,237,.05), transparent 70%);
  pointer-events: none;
}
@media(max-width:860px){ .login-brand { display: none; } }

.lb-logo { display: flex; align-items: center; gap: 10px; }
.lb-logo-text {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 800;
  letter-spacing: .06em;
  background: linear-gradient(135deg, var(--white) 40%, var(--purple-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lb-tagline {
  font-family: var(--font-display);
  font-size: clamp(2.4rem,3.8vw,3.6rem);
  font-weight: 900;
  letter-spacing: -.01em; line-height: .96;
  color: var(--white);
}
.lb-tagline .accent {
  background: linear-gradient(135deg, var(--purple), var(--purple-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lb-bottom p { font-size: .82rem; color: var(--white-40); }

.login-form-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 48px;
  background: var(--navy);
  position: relative;
}
@media(max-width:600px){ .login-form-wrap { padding: 40px 24px; } }

.login-form-box {
  width: 100%; max-width: 380px;
  animation: fadeUp .5s var(--ease) both;
}
.login-form-box h2 {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 800;
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.login-form-box > p {
  font-size: .875rem; color: var(--white-40);
  margin-bottom: 36px;
}
.login-field { margin-bottom: 18px; }
.login-label {
  display: block;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--white-40); margin-bottom: 8px;
}
.login-input {
  width: 100%; padding: 13px 16px;
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  font-size: .925rem; font-family: var(--font-body); color: var(--white);
  transition: all .25s var(--ease-out);
}
.login-input::placeholder { color: var(--white-40); }
.login-input:focus {
  outline: none;
  border-color: rgba(124,58,237,.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
  background: var(--navy-light);
}
.login-btn {
  width: 100%; margin-top: 10px; padding: 14px;
  background: var(--purple); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-size: .925rem; font-weight: 700; font-family: var(--font-body);
  cursor: pointer;
  transition: all .25s var(--ease);
  box-shadow: 0 4px 16px rgba(124,58,237,.2);
  letter-spacing: .01em;
}
.login-btn:hover {
  background: #8b5cf6;
  box-shadow: 0 8px 32px rgba(124,58,237,.3);
  transform: translateY(-2px);
}
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.login-error {
  color: var(--red); font-size: .82rem;
  margin-top: 14px; display: none;
  padding: 10px 14px;
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,.2);
  border-radius: var(--radius-sm);
}

/* ═══ DASHBOARD ═══ */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media(max-width:1100px){ .dashboard-grid { grid-template-columns: 1fr; } }

.tenant-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(26,37,72,.5);
  transition: background .15s;
}
.tenant-row:last-child { border-bottom: none; }
.tenant-row:hover { background: var(--white-05); }
.tenant-row-name { font-size: .875rem; font-weight: 600; margin-bottom: 2px; }
.tenant-row-sub  { font-size: .73rem; color: var(--white-40); }

/* ═══ EMPTY STATE ═══ */
.empty-state {
  padding: 56px 24px;
  text-align: center; color: var(--white-40);
  font-size: .88rem;
}

/* ═══ MOBILE SIDEBAR ═══ */
@media(max-width:900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 48px rgba(0,0,0,.6);
  }
  .main { margin-left: 0; }
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--navy-border);
  border-radius: 3px;
  transition: background .2s;
}
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,.35); }

/* ═══ SELECTION ═══ */
::selection { background: rgba(124,58,237,.3); color: var(--white); }

/* ═══ Stagger animation for cards ═══ */
.kpi-card:nth-child(1) { animation: fadeUp .4s var(--ease) .05s both; }
.kpi-card:nth-child(2) { animation: fadeUp .4s var(--ease) .1s both; }
.kpi-card:nth-child(3) { animation: fadeUp .4s var(--ease) .15s both; }
.kpi-card:nth-child(4) { animation: fadeUp .4s var(--ease) .2s both; }

.panel { animation: fadeUp .4s var(--ease) .25s both; }

/* ═══════════════════════════════════════════════════════════════
   R3 — Componentes adicionados pra telas de Clientes / formulários
   (paleta navy+purple consistente com o resto do painel)
═══════════════════════════════════════════════════════════════ */

/* ─── Page header (cabeçalho de página com título + ação) ─── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.page-header .page-title {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  color: var(--white); margin: 0 0 4px 0; letter-spacing: -0.01em;
}
.page-header .page-sub {
  font-size: .85rem; color: var(--white-60); margin: 0;
}
.page-header .header-actions { display: flex; gap: 8px; }

/* ─── Filter bar ─── */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
}
.filter-bar .filter-input,
.filter-bar .filter-select {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  color: var(--white); padding: 8px 12px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .875rem;
  transition: border-color .15s, background .15s;
}
.filter-bar .filter-input:focus,
.filter-bar .filter-select:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-subtle);
}

/* ─── Panel header (cabeçalho dentro de um .panel) ─── */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--navy-border);
}
.panel-header h2 {
  font-family: var(--font-display); font-size: 1rem; font-weight: 600;
  color: var(--white); margin: 0;
}

/* ─── Grid 2 colunas ─── */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ─── Lista chave-valor (.kv) ─── */
.kv {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 10px 18px; padding: 16px 20px; font-size: .875rem;
}
.kv dt { color: var(--white-60); font-weight: 500; }
.kv dd { color: var(--white); margin: 0; }

/* ─── Forms (detail page) ─── */
#tenantForm, #newTenantForm { padding: 16px 20px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row > label {
  font-size: .78rem; font-weight: 500; color: var(--white-60);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-row input, .form-row select, .form-row textarea {
  background: var(--navy-mid); border: 1px solid var(--navy-border);
  color: var(--white); padding: 9px 12px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .9rem;
  transition: border-color .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-subtle);
}
.form-row input:disabled, .form-row select:disabled {
  opacity: 0.55; cursor: not-allowed;
}
.form-row small.muted { font-size: .72rem; color: var(--white-40); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row-2 > div { display: flex; flex-direction: column; gap: 6px; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--navy-border);
}

/* ─── Modal (detail page extras) ─── */
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(6,10,24,.7); backdrop-filter: blur(6px);
}
.modal-content {
  position: relative; background: var(--navy-light);
  border: 1px solid var(--navy-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); width: min(540px, 92vw); max-height: 88vh;
  overflow-y: auto;
}
.modal-header h2 {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin: 0;
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--white-60);
}
.empty-state p { margin-bottom: 16px; }

/* ─── Badge extras (overdue / executed / failed) ─── */
.badge-overdue  { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.badge-executed { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,.2); }
.badge-failed   { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.badge-approved { background: var(--purple-subtle); color: var(--purple-bright); border: 1px solid rgba(124,58,237,.25); }
.badge-rejected { background: var(--white-05); color: var(--white-40); border: 1px solid var(--navy-border); }

/* ─── Utilitários ─── */
.muted { color: var(--white-60); }
.small { font-size: .78rem; }
.text-right { text-align: right; }
.link-strong { color: var(--white); font-weight: 600; text-decoration: none; }
.link-strong:hover { color: var(--purple-bright); }
.link-muted { color: var(--white-60); text-decoration: none; }
.link-muted:hover { color: var(--white); }

/* ═══════════════════════════════════════════════════════════════
   R5 — Refinamentos do dashboard e header
═══════════════════════════════════════════════════════════════ */

/* Page header padronizado pro layout novo */
.page-header { margin-bottom: 28px; }
.page-header .page-title {
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 700;
  background: linear-gradient(180deg, var(--white) 60%, var(--purple-bright));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin: 0 0 6px 0; letter-spacing: -0.02em;
}
.page-header .page-sub { font-size: .88rem; }

/* KPI grid mais respirável */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .kpi-grid { grid-template-columns: 1fr; } }

/* Botões consistentes — base unificado */
.btn-primary, .btn-secondary, .btn-small, .btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-body); font-weight: 500;
  border: 1px solid transparent; transition: all .15s var(--ease-out);
  text-decoration: none;
}
