/* ==========================================================================
   VoIP Monitor — tema premium dark, acentos violeta
   ========================================================================== */
:root {
  --bg: #0b0910;
  --bg-soft: #110e1a;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  --violet: #d946ef;            /* fucsia - rosa-roxo forte */
  --violet-soft: #e879f9;
  --violet-faint: rgba(217, 70, 239, 0.14);
  --violet-glow: rgba(217, 70, 239, 0.35);

  --text: #f2f0f7;
  --muted: #8d87a0;
  --muted-2: #6b6580;

  --green: #a3e635;             /* verde limao vivo */
  --red: #f87171;
  --amber: #fbbf24;

  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 232px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { color-scheme: dark; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 15% -10%, rgba(217, 70, 239, 0.11), transparent 60%),
    radial-gradient(ellipse 50% 35% at 110% 110%, rgba(217, 70, 239, 0.07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ==========================================================================
   Layout: sidebar + main
   ========================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 16px;
  border-right: 1px solid var(--border);
  background: rgba(10, 8, 15, 0.6);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }

.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #a21caf, #e879f9);
  box-shadow: 0 4px 18px var(--violet-glow);
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: 0.2px; }
.brand-sub { font-size: 0.72rem; color: var(--muted); margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color .15s, background .15s;
}
.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active {
  color: #fff;
  background: var(--violet-faint);
  box-shadow: inset 0 0 0 1px rgba(217, 70, 239, 0.28);
}
.nav-item.active svg { color: var(--violet-soft); }

.sidebar-foot {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.foot-status { display: flex; align-items: center; gap: 9px; }

.foot-user {
  display: flex; align-items: center; gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.foot-avatar {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--violet-faint);
  color: var(--violet-soft);
  font-weight: 700; font-size: 0.8rem;
}
.foot-user-info { min-width: 0; flex: 1; }
.foot-user-name {
  color: var(--text); font-weight: 600; font-size: 0.78rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.foot-user-role { font-size: 0.66rem; color: var(--muted-2); }

.pulse-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(163, 230, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}

.main { flex: 1; min-width: 0; padding: 30px 36px 60px; }

/* ==========================================================================
   Cabeçalho de página
   ========================================================================== */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.3px; }
.page-sub { color: var(--muted); font-size: 0.85rem; margin-top: 3px; }

/* ==========================================================================
   Botões
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.86rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, #a21caf, #d946ef);
  color: #fff;
  box-shadow: 0 2px 14px rgba(192, 38, 211, 0.35);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 22px rgba(192, 38, 211, 0.55);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--panel);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--panel-strong); }

.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--red); box-shadow: inset 0 0 0 1px rgba(248,113,113,.3); }
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.2); }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; border-radius: 9px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.icon-btn:hover { background: var(--panel-strong); color: var(--text); }
.icon-btn.danger:hover { background: rgba(248, 113, 113, 0.14); color: var(--red); }
.icon-btn svg { width: 16px; height: 16px; }

/* ==========================================================================
   Summary bar
   ========================================================================== */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 5px;
}

.summary-label {
  font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
}
.summary-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.5px; }
.summary-value.accent { color: var(--violet-soft); }
.summary-value.danger { color: var(--red); }
.summary-value.mono { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; }

/* ==========================================================================
   Cards de fornecedor
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.supplier-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.supplier-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(217, 70, 239, 0.55), transparent);
  opacity: 0; transition: opacity .2s;
}
.supplier-card:hover {
  border-color: rgba(217, 70, 239, 0.38);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.supplier-card:hover::before { opacity: 1; }

.supplier-card.alert-mode {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.12);
}

.card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-bottom: 14px;
}
.supplier-name { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.2px; }
.supplier-url { font-size: 0.72rem; color: var(--muted-2); margin-top: 3px; font-family: var(--mono); }

.badge {
  padding: 3px 9px; border-radius: 999px;
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-prepaid  { background: rgba(163, 230, 53, 0.12); color: var(--green); }
.badge-postpaid { background: var(--violet-faint); color: var(--violet-soft); }
.badge-inactive { background: rgba(255,255,255,.06); color: var(--muted); }
.badge-master   { background: rgba(251, 191, 36, 0.14); color: var(--amber); }
.badge-admin    { background: var(--violet-faint); color: var(--violet-soft); }
.badge-operator { background: rgba(56, 189, 248, 0.12); color: #7dd3fc; }

.metrics-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  margin: 4px 0 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.metric-item { display: flex; flex-direction: column; min-width: 0; }
.metric-item.right { text-align: right; align-items: flex-end; }

.metric-label {
  font-size: 0.67rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600;
  margin-bottom: 4px;
}
.metric-value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.4px; font-family: var(--mono); }
.metric-value.balance-ok { color: var(--green); }
.metric-value.balance-alert { color: var(--red); }
.metric-value.consumption { color: var(--violet-soft); }
.metric-value.calls { color: var(--text); }
.metric-sub { font-size: 0.64rem; color: var(--muted-2); margin-top: 3px; }

.card-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 10px; font-size: 0.72rem; color: var(--muted);
}

.status-ok { color: var(--green); font-weight: 600; }
.status-error { color: var(--red); font-weight: 600; }
.status-pending { color: var(--amber); font-weight: 600; }

.error-hint {
  font-size: 0.66rem; color: var(--amber);
  max-width: 210px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  cursor: help;
}

.btn-card-refresh {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px; border-radius: 8px;
  cursor: pointer; font-size: 0.75rem; font-weight: 600;
  font-family: var(--font);
  white-space: nowrap;
  transition: all .15s; flex-shrink: 0;
}
.btn-card-refresh:hover:not(:disabled) {
  border-color: rgba(217, 70, 239, 0.5);
  color: var(--violet-soft);
  background: var(--violet-faint);
}
.btn-card-refresh:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Tabela de fornecedores (gestão)
   ========================================================================== */
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.provider-table { width: 100%; border-collapse: collapse; min-width: 860px; }

.provider-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.provider-table th.th-actions { text-align: right; }

.provider-table td {
  padding: 13px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.provider-table tr:last-child td { border-bottom: none; }
.provider-table tbody tr { transition: background .12s; }
.provider-table tbody tr:hover { background: rgba(217, 70, 239, 0.055); }

.td-name { font-weight: 700; }
.td-mono { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.td-actions { text-align: right; white-space: nowrap; }

.type-chip {
  display: inline-block;
  padding: 3px 9px; border-radius: 6px;
  font-size: 0.68rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--mono);
}

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600;
}
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-chip.on { color: var(--green); }
.status-chip.on .dot { background: var(--green); }
.status-chip.off { color: var(--muted); }
.status-chip.off .dot { background: var(--muted-2); }

/* ==========================================================================
   Drawer (form de fornecedor)
   ========================================================================== */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 4, 9, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 180;
}
.drawer-backdrop.active { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 94vw;
  background: var(--bg-soft);
  border-left: 1px solid var(--border-strong);
  z-index: 190;
  transform: translateX(102%);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
  box-shadow: -18px 0 60px rgba(0, 0, 0, 0.5);
}
.drawer.active { transform: translateX(0); }

.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: 1.1rem; font-weight: 800; }

.drawer form {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px;
  display: flex; flex-direction: column;
}

.form-section {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--violet-soft);
  margin: 16px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-section:first-of-type { margin-top: 0; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.form-group .hint { color: var(--muted-2); font-weight: 400; font-size: 0.7rem; }

.form-note {
  font-size: 0.72rem; color: var(--muted);
  background: var(--violet-faint);
  border: 1px solid rgba(217, 70, 239, 0.2);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 14px;
  line-height: 1.45;
}

input, select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 0.87rem;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.18);
}
input::placeholder { color: var(--muted-2); }

/* Switch */
.form-switch {
  flex-direction: row; align-items: center; gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-top: 6px;
}
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background .2s;
  cursor: pointer;
}
.slider::before {
  content: '';
  position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.switch input:checked + .slider { background: var(--violet); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch-label { font-size: 0.83rem; font-weight: 600; }
.switch-sub { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }

.drawer-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 0 6px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
  background: var(--bg-soft);
}

/* ==========================================================================
   Modal de confirmação
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 4, 9, 0.7);
  backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: center;
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity .18s;
}
.modal-backdrop.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 440px; max-width: 92vw;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.modal h3 { font-size: 1rem; font-weight: 800; margin-bottom: 12px; }

.confirm-body { font-size: 0.85rem; color: var(--muted); line-height: 1.55; }
.confirm-body strong { color: var(--text); }
.confirm-body ul { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.confirm-body li {
  font-size: 0.78rem;
  padding: 6px 10px;
  background: var(--panel);
  border-radius: 7px;
  font-family: var(--mono);
}
.confirm-body li b { color: var(--violet-soft); font-weight: 700; }

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ==========================================================================
   Popup de saldo baixo (mantido, adaptado ao tema)
   ========================================================================== */
.alert-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 4, 9, 0.8);
  backdrop-filter: blur(8px);
  display: flex; justify-content: center; align-items: center;
  z-index: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.alert-backdrop.active { opacity: 1; pointer-events: all; }

.alert-box {
  width: 520px; max-width: 92%;
  background: linear-gradient(165deg, #3d0a0a 0%, var(--bg-soft) 70%);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  animation: alert-pop 0.35s ease-out, alert-glow 1.6s ease-in-out infinite;
}
@keyframes alert-pop {
  0% { transform: scale(0.85) translateY(12px); opacity: 0; }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes alert-glow {
  0%, 100% { box-shadow: 0 0 25px rgba(248, 113, 113, 0.3); }
  50%      { box-shadow: 0 0 55px rgba(248, 113, 113, 0.65); }
}
.alert-icon { font-size: 3rem; line-height: 1; animation: alert-shake 1.4s ease-in-out infinite; }
@keyframes alert-shake {
  0%, 88%, 100% { transform: rotate(0); }
  91% { transform: rotate(-11deg); }
  94% { transform: rotate(11deg); }
  97% { transform: rotate(-6deg); }
}
.alert-title { color: #fff; font-size: 1.7rem; font-weight: 800; letter-spacing: 2px; margin-top: 10px; }
.alert-subtitle { color: #fecaca; font-size: 0.88rem; margin-top: 6px; }
.alert-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 22px 0; }
.alert-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
}
.alert-prov-name { font-weight: 700; font-size: 0.95rem; }
.alert-prov-threshold { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.alert-prov-balance { color: #fca5a5; font-weight: 800; font-size: 1.15rem; white-space: nowrap; font-family: var(--mono); }
.btn-alert-dismiss {
  background: var(--red); color: #fff;
  border: none; padding: 12px 34px;
  border-radius: 10px; font-size: 0.95rem; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  transition: background .2s;
}
.btn-alert-dismiss:hover { background: #ef4444; }
.alert-note { font-size: 0.7rem; color: var(--muted); margin-top: 14px; }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toasts {
  position: fixed; top: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 600;
}
.toast {
  background: var(--bg-soft);
  border: 1px solid rgba(217, 70, 239, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.83rem; font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: toast-in .25s ease-out;
  max-width: 340px;
}
.toast.error { border-color: rgba(248, 113, 113, 0.45); }
.toast.success { border-color: rgba(163, 230, 53, 0.45); }
@keyframes toast-in {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.out { animation: toast-out .25s ease-in forwards; }
@keyframes toast-out { to { transform: translateX(30px); opacity: 0; } }

/* ==========================================================================
   Responsivo
   ========================================================================== */
/* ==========================================================================
   Tela de login
   ========================================================================== */
.login-body { display: grid; place-items: center; padding: 24px; }

.login-wrap { width: 100%; max-width: 420px; }

.login-card {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 30px 26px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}

/* Marca centralizada: sem titulo/subtitulo, ela e o unico cabecalho do card,
   entao ganha o eixo central e mais respiro antes do formulario */
.login-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 11px;
  margin-bottom: 30px;
  text-align: left;
}

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 42px; width: 100%; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted-2); padding: 6px; border-radius: 8px;
  display: grid; place-items: center;
}
.pass-toggle:hover { color: var(--violet-soft); background: var(--violet-faint); }

.remember-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 0 20px;
  cursor: pointer; user-select: none;
}
.remember-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.remember-row .checkmark {
  width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  position: relative;
  transition: all .15s;
}
.remember-row input:checked + .checkmark {
  background: var(--violet); border-color: var(--violet);
}
.remember-row input:checked + .checkmark::after {
  content: ""; position: absolute;
  left: 5px; top: 1.5px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.remember-label { display: block; font-size: 0.8rem; color: var(--text); font-weight: 500; }
.remember-sub { display: block; font-size: 0.7rem; color: var(--muted-2); margin-top: 2px; }

.login-error {
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .3);
  color: var(--red);
  padding: 10px 13px; border-radius: var(--radius-sm);
  font-size: 0.79rem; margin-bottom: 16px;
}

.btn-login { width: 100%; justify-content: center; padding: 12px; font-size: 0.9rem; }

.login-foot {
  text-align: center; font-size: 0.72rem;
  color: var(--muted-2); margin-top: 20px;
}

/* ==========================================================================
   Gráficos — Consumo x Hora
   ========================================================================== */
.head-actions { display: flex; align-items: center; gap: 10px; }

.date-input {
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 8px 11px; font-family: var(--mono); font-size: 0.78rem;
  color-scheme: dark;
}
.date-input:focus { outline: none; border-color: var(--violet); }

.chart-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 14px;
  margin-bottom: 22px;
}

.chart-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.chart-title { font-size: 0.95rem; font-weight: 700; display: block; }
.chart-sub { font-size: 0.73rem; color: var(--muted-2); }
.chart-total { text-align: right; }
.chart-total-label {
  display: block; font-size: 0.64rem; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted-2);
}
.chart-total-value {
  display: block; font-family: var(--mono); font-weight: 700;
  font-size: 1.02rem; color: var(--violet-soft); margin-top: 3px;
}

/* O SVG tem viewBox fixo e escala sozinho; overflow-x segura telas estreitas */
.chart-canvas { width: 100%; overflow-x: auto; }
.chart-svg { width: 100%; height: auto; min-width: 520px; display: block; }

.grid-line { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.grid-line.faint { stroke: rgba(255,255,255,.035); }
.axis-line { stroke: rgba(255,255,255,.16); stroke-width: 1; }
.axis-label {
  fill: var(--muted-2); font-size: 11px; font-family: var(--mono);
}

.chart-empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.chart-empty-sub { font-size: 0.74rem; color: var(--muted-2); margin-top: 6px; }

/* Cards de consumo abaixo do gráfico — compactos e discretos de propósito,
   a leitura principal é a curva */
.consumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 11px;
}

.consumo-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  transition: border-color .15s, transform .15s;
}
.consumo-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.consumo-top { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.consumo-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.consumo-name {
  font-size: 0.76rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.consumo-top .badge { font-size: 0.58rem; padding: 2px 6px; }

.consumo-value {
  font-family: var(--mono); font-size: 1.02rem; font-weight: 700;
  color: var(--violet-soft);
}
.consumo-sub { font-size: 0.66rem; color: var(--muted-2); margin-top: 3px; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .brand { padding: 0; }
  .brand-sub, .sidebar-foot { display: none; }
  .nav { flex-direction: row; margin-left: auto; }
  .main { padding: 20px 16px 50px; }
  .drawer { width: 100vw; max-width: 100vw; }
}
