/* Admin panel + dealer view + login — layered on top of styles.css.
   Uses the same tokens, so the palette and radii come from one place. */

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 390px; max-width: 100%; background: var(--card); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(16, 35, 64, .08); padding: 28px 26px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-card h1 { font-size: 17px; margin: 0 0 2px; letter-spacing: -.01em; }
/* The i18n toggle is prepended into the brand row — keep it small and trailing
   rather than letting the full-width button rule below swallow the header. */
.login-card #langSwitch {
  order: 3; margin-left: auto; width: auto; align-self: flex-start;
  padding: 4px 9px; font-size: 11px;
}
.login-card .field { margin-bottom: 13px; }
.login-card input[type=text], .login-card input[type=password] {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 11px; font-size: 14px; outline: none; width: 100%;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; margin-top: 4px; }
.form-error {
  color: var(--danger); font-size: 13px; background: var(--danger-soft);
  border: 1px solid var(--danger-line); border-radius: var(--radius); padding: 9px 12px; margin-bottom: 14px;
}
.form-ok {
  color: var(--success-dark); font-size: 13px; background: var(--success-soft);
  border: 1px solid #c8e2d5; border-radius: var(--radius); padding: 9px 12px; margin-bottom: 14px;
}

/* ---- Tabs ---- */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  margin: 0 auto; max-width: 1320px; padding: 0 28px; background: transparent;
}
.tab {
  border: 0; background: none; padding: 12px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-weight: 600; letter-spacing: .01em;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabpanel { display: flex; flex-direction: column; gap: 18px; }
.tabpanel.hidden { display: none; }

/* ---- Masthead extras ---- */
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who .role {
  background: rgba(255, 255, 255, .13); color: #cfe0f5; border-radius: 3px;
  padding: 3px 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
}

/* ---- Inline forms ---- */
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding-top: 14px; }
.inline-form .field { min-width: 150px; }
input[type=text], input[type=password], input[type=number], input[type=email] {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 11px; font-size: 13px; outline: none; font-family: inherit;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- Table helpers ---- */
td.actions { display: flex; gap: 6px; }
.pill {
  display: inline-block; border-radius: 3px; padding: 2px 8px; font-size: 10.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.pill.on { background: var(--success-soft); color: var(--success-dark); }
.pill.off { background: var(--line-2); color: var(--muted); }
.pill.admin { background: #ece6f8; color: #56349f; }
.pill.dealer { background: var(--accent-soft); color: var(--accent); }
.pill.contacted { background: var(--accent-soft); color: var(--accent); }
.pill.sold { background: var(--success-soft); color: var(--success-dark); }
.pill.invalid { background: var(--danger-soft); color: var(--danger); }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Usage meter ---- */
.meter { width: 120px; height: 6px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.usage { display: flex; align-items: center; gap: 9px; }

/* ---- Dealer block cards ---- */
.blocks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px; padding-top: 14px;
}
.block { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; background: var(--card-2); }
.block .city { font-weight: 650; font-size: 13px; margin-bottom: 3px; }
.block .nums { font-size: 12px; color: var(--muted); margin: 8px 0 9px; font-variant-numeric: tabular-nums; }
.block .meter { width: 100%; }
.block .block-actions { display: flex; gap: 6px; margin-top: 11px; }

.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px; }
.section-note { color: var(--muted); font-size: 12px; margin-top: 4px; text-transform: none; letter-spacing: 0; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--masthead); color: #fff; padding: 10px 18px; border-radius: var(--radius);
  font-size: 13px; box-shadow: 0 10px 28px rgba(16, 35, 64, .3); z-index: 100;
}
.toast.err { background: var(--danger); }

@media (max-width: 760px) {
  .tabs { overflow-x: auto; padding: 0 16px; }
  .inline-form { flex-direction: column; align-items: stretch; }
}
