/* ==================================================
   ActPost Dashboard — Stylesheet
   Identidade visual alinhada com a landing page
   ================================================== */

:root {
  --primary: #2DD4A0;
  --primary-dark: #1BAF80;
  --primary-darker: #0f7a5a;
  --light: #e8faf5;
  --dark: #0d1b2a;
  --darker: #0a1320;
  --text: #1a1a2e;
  --text-soft: #4a5568;
  --text-muted: #718096;
  --bg: #ffffff;
  --bg-soft: #f7fafc;
  --bg-section: #f0f4f8;
  --border: #e2e8f0;
  --border-soft: #edf2f7;
  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #3b82f6;
  --rainbow: linear-gradient(90deg, #ff5e3a, #ff2a68, #af52de, #5856d6, #007aff, #34aadc, #5ac8fa, #4cd964, #ffcc00, #ff9500);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 2px 4px rgba(15,23,42,.04);
  --shadow-md: 0 4px 6px rgba(15,23,42,.05), 0 10px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 50px rgba(15,23,42,.12), 0 8px 20px rgba(15,23,42,.06);
  --shadow-xl: 0 30px 80px rgba(15,23,42,.18);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --sidebar-w: 260px;
  --topbar-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-weight: 500;
  background: var(--bg-section);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select, button { font-family: inherit; }

/* ==================================================
   APP SHELL (Sidebar + Main)
   ================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: linear-gradient(180deg, var(--dark) 0%, #0a3d2e 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  box-shadow: 0 0 30px rgba(0,0,0,.1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px 26px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}
.brand-name {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.4px;
}
.brand-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  transition: all .2s;
  position: relative;
}
.sidebar-nav a .ico {
  font-size: 18px;
  width: 22px;
  text-align: center;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.sidebar-nav a.active {
  background: rgba(45,212,160,.15);
  color: #fff;
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-nav a.nav-cta {
  background: var(--primary);
  color: #fff;
  margin-top: 16px;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(45,212,160,.4);
}
.sidebar-nav a.nav-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}
.sidebar-nav a.nav-cta .ico {
  font-size: 18px;
  font-weight: 900;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,.06);
  border-radius: 12px;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--rainbow);
  background-size: 300% 100%;
  animation: shine 8s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  font-size: 16px;
}
@keyframes shine { to { background-position: 300% 0; } }
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-logout {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .2s;
}
.btn-logout:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* ===== MAIN ===== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 0 var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--text);
}
.topbar-title p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 8px 14px;
  background: var(--bg-soft);
  border-radius: 999px;
}

.menu-toggle {
  display: none;
  background: var(--bg-soft);
  padding: 10px;
  border-radius: 8px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  border-radius: 2px;
}

.content {
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ==================================================
   FLASH MESSAGES
   ================================================== */
.flash {
  margin: 16px 32px 0;
  padding: 14px 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  animation: slideDown .4s cubic-bezier(.16,1,.3,1);
}
.flash-success {
  background: var(--light);
  color: var(--primary-darker);
  border: 1px solid var(--primary);
}
.flash-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.flash-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}
.flash-success .flash-ico {
  background: var(--primary);
  color: #fff;
}
.flash-error .flash-ico {
  background: var(--danger);
  color: #fff;
}
.flash-close {
  margin-left: auto;
  font-size: 22px;
  font-weight: 900;
  color: inherit;
  opacity: .5;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flash-close:hover { opacity: 1; background: rgba(0,0,0,.05); }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}

/* ==================================================
   STATS CARDS (Dashboard)
   ================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: center;
  transition: all .3s;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(45,212,160,.3);
}
.stat-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.stat-ico-mint { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.stat-ico-gray { background: linear-gradient(135deg, #e2e8f0, #cbd5e0); }
.stat-ico-green { background: linear-gradient(135deg, #fef3c7, #fbbf24); }
.stat-ico-purple { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); }
.stat-body { flex: 1; min-width: 0; }
.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.stat-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -1px;
  margin-top: 2px;
  line-height: 1.1;
}
.stat-foot {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* ==================================================
   PANELS / DASHBOARD GRID
   ================================================== */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.panel {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.panel-flat { padding: 0; overflow: hidden; }
.panel-flat .panel-head { padding: 24px 24px 16px; }
.panel-full { grid-column: 1 / -1; }
.panel-hint { background: linear-gradient(135deg, #fff 0%, var(--light) 100%); }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  gap: 16px;
}
.panel-head h2, .panel-head h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}
.panel-head p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.panel h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.btn-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-darker);
  transition: opacity .2s;
}
.btn-link:hover { opacity: .7; }
.btn-link.btn-sm { font-size: 12px; }

/* ==================================================
   QUICK ACTIONS (Dashboard right panel)
   ================================================== */
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all .2s;
}
.quick-action:hover {
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
.qa-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--light);
  color: var(--primary-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
}
.qa-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.qa-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.qa-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-weight: 900;
}
.quick-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.qi-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.qi-rainbow {
  height: 4px;
  background: var(--rainbow);
  border-radius: 4px;
  margin-bottom: 12px;
}
.qi-text {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
  line-height: 1.6;
}

/* ==================================================
   TABLES
   ================================================== */
.table-responsive { overflow-x: auto; }
.table-clean {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table-clean th {
  text-align: left;
  padding: 12px 24px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.table-clean td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.table-clean tbody tr:hover { background: var(--bg-soft); }
.table-clean tbody tr:last-child td { border-bottom: none; }

.cell-strong {
  font-weight: 700;
  color: var(--text);
}
.cell-soft {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-soft);
  transition: all .2s;
  border: 1px solid transparent;
}
.btn-icon:hover {
  background: var(--light);
  color: var(--primary-darker);
  border-color: var(--primary);
}
.btn-icon.btn-danger:hover {
  background: #fee2e2;
  color: var(--danger);
  border-color: var(--danger);
}
.delete-inline { display: inline; }

/* ==================================================
   BADGES
   ================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.badge-free {
  background: var(--bg-section);
  color: var(--text-soft);
}
.badge-pago {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(45,212,160,.3);
}

/* ==================================================
   EMPTY STATE
   ================================================== */
.empty-state {
  background: #fff;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 32px;
  text-align: center;
}
.empty-ico {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: .4;
}
.empty-state h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}
.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

/* ==================================================
   BUTTONS
   ================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
  border: none;
  text-align: center;
}
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(45,212,160,.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(45,212,160,.4);
}
.btn-primary .arr { transition: transform .2s; }
.btn-primary:hover .arr { transform: translateX(4px); }

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--light);
  border-color: var(--primary);
}
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover { color: var(--text); background: var(--bg-soft); }
.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #fca5a5;
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* ==================================================
   TOOLBAR (Lista clientes)
   ================================================== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 540px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 4px 4px 16px;
  box-shadow: var(--shadow-sm);
}
.search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(45,212,160,.12);
}
.search-ico {
  color: var(--text-muted);
  font-size: 14px;
}
.search-form input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 8px;
  font-size: 14px;
  background: transparent;
  color: var(--text);
}

/* ==================================================
   FORM CARD
   ================================================== */
.form-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.form-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-child { border-bottom: none; }
.form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.form-section-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(45,212,160,.3);
}
.form-section-head h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  text-transform: none;
  letter-spacing: -.3px;
  margin: 0;
}
.form-section-head p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.muted-warning {
  color: var(--warning) !important;
  font-weight: 700 !important;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field-full { grid-column: 1 / -1; }
.form-field-third { /* compartilha linha de 2 cols quando combinado */ }

.form-field label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-soft);
  transition: all .2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(45,212,160,.12);
}
.form-field textarea { resize: vertical; min-height: 100px; font-family: inherit; }

.field-error {
  font-size: 12px;
  color: var(--danger);
  font-weight: 600;
  margin-top: 2px;
}

.input-with-icon {
  position: relative;
}
.input-with-icon input { padding-right: 46px; }
.toggle-pwd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.toggle-pwd:hover {
  background: var(--bg-section);
  color: var(--text);
}
.toggle-pwd.inline {
  position: static;
  transform: none;
  width: 28px;
  height: 28px;
  margin-left: 6px;
}

/* ==================================================
   PLAN PICKER
   ================================================== */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.plan-option { cursor: pointer; }
.plan-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.plan-card {
  position: relative;
  padding: 20px 22px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
.plan-option input[type="radio"]:checked ~ .plan-card {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--light) 0%, #fff 100%);
  box-shadow: 0 8px 24px rgba(45,212,160,.2);
  transform: translateY(-2px);
}
.plan-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.plan-icon { font-size: 22px; }
.plan-name {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.3px;
}
.plan-desc {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.plan-check {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-darker);
  background: var(--primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all .2s;
}
.plan-option input[type="radio"]:checked ~ .plan-card .plan-check {
  opacity: 1;
  transform: none;
}

.plan-card-compact {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
}
.plan-card-compact.plan-pago {
  background: linear-gradient(135deg, var(--light), #fff);
  border: 2px solid var(--primary);
}
.plan-card-compact.plan-free {
  background: var(--bg-soft);
  border: 2px solid var(--border);
}
.pcc-ico { font-size: 28px; }
.pcc-name { font-size: 17px; font-weight: 900; color: var(--text); }
.pcc-desc { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ==================================================
   FORM ACTIONS
   ================================================== */
.form-actions {
  padding: 24px 32px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}

/* ==================================================
   VIEW (Cliente detalhes)
   ================================================== */
.view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.view-toolbar > div { display: flex; gap: 8px; }

.client-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.client-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 20%, rgba(45,212,160,.4), transparent 50%);
}
.client-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--rainbow);
  background-size: 300% 100%;
  animation: shine 8s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.client-info { position: relative; z-index: 1; }
.client-info h2 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.5px;
  margin-bottom: 6px;
}
.client-resp {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.client-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.meta-pill-pago {
  background: var(--primary);
  border-color: var(--primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.detail-list > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.detail-list span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.detail-list strong {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.masked-pwd {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, monospace;
}
.info-warning {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  border-left: 3px solid var(--warning);
}
.obs-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  white-space: pre-wrap;
}
.audit-row {
  display: flex;
  gap: 60px;
  flex-wrap: wrap;
}
.audit-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.audit-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ==================================================
   LOGIN PAGE
   ================================================== */
.login-body {
  background: linear-gradient(135deg, #0d1b2a 0%, #0a3d2e 50%, #1BAF80 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}
.login-glow-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -100px;
  left: -100px;
}
.login-glow-2 {
  width: 400px;
  height: 400px;
  background: #ffd166;
  bottom: -100px;
  right: -100px;
  opacity: .2;
}
.login-glow-3 {
  width: 300px;
  height: 300px;
  background: #8B5CF6;
  top: 40%;
  right: 20%;
  opacity: .15;
}

.login-wrap {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  animation: fadeUp .6s cubic-bezier(.16,1,.3,1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.login-brand img { height: 42px; }
.login-brand-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.4px;
}
.login-brand-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-darker);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}
.login-card h1 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.5px;
  margin-bottom: 6px;
  color: var(--text);
}
.login-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 3px solid var(--danger);
}
.alert-info {
  background: var(--light);
  color: var(--primary-darker);
  border-left: 3px solid var(--primary);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-foot {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.error-card { text-align: center; }
.error-detail {
  background: var(--bg-soft);
  padding: 12px;
  border-radius: 10px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 24px;
  word-break: break-word;
}

/* ==================================================
   RESPONSIVE
   ================================================== */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -280px;
    width: 260px;
    transition: left .3s cubic-bezier(.16,1,.3,1);
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: block; }
  .topbar { padding: 0 18px; }
  .content { padding: 18px; }
  .flash { margin: 12px 18px 0; }
  .topbar-date { display: none; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-title p { display: none; }
  .form-section { padding: 22px 20px; }
  .form-actions { padding: 18px 20px; flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-form { max-width: 100%; }
  .login-card { padding: 30px 22px; }
  .client-hero { flex-direction: column; text-align: center; padding: 24px; }
}
