/* MillionCharger Partner Portal — shared styles (owner + admin).
   Mobile-first, RTL-safe (logical properties), no external assets. */

:root {
  --bg: #faf7f0;
  --surface: #fff;
  --surface-2: #f4eeda;
  --text: #221f18;
  --muted: #8b8470;
  --primary: #0e7a56;
  --primary-dark: #0a5c42;
  --gold: #c9a227;
  --gold-deep: #a5790f;
  --danger: #cf364c;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(70, 58, 25, .10);

  /* derived */
  --primary-soft: #e3f3ec;
  --gold-soft: #fbf3d6;
  --danger-soft: #fbe4e7;
  --blue: #2f6fe4;
  --blue-soft: #e4ecfc;
  --amber: #d9891b;
  --amber-soft: #fdeed6;
  --line: #ebe4cf;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --topbar-h: 64px;
  --bottomnav-h: 64px;
  --shadow-sm: 0 2px 8px rgba(70, 58, 25, .08);
  --focus: 0 0 0 3px rgba(14, 122, 86, .28);
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }
/* Only plain links/buttons get a fallback radius; cards, inputs and pills keep their own. */
a:not(.card):not(.btn):focus-visible, button:not(.btn):focus-visible { border-radius: var(--radius-sm); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .9em; }
.num { font-variant-numeric: tabular-nums; }
.gold { color: var(--gold-deep); }
.text-start { text-align: start; }
.text-end { text-align: end; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100;
  background: var(--primary); color: #fff; padding: .5rem .9rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 240, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1120px; margin: 0 auto; padding: 0 1rem;
  min-height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); min-width: 0; }
.brand:hover { color: var(--text); }
.brand__bolt {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--gold); font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(14, 122, 86, .35);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand__name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; }
.brand__gold { color: var(--gold-deep); }
.brand__sub { font-size: .72rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.topbar__actions { display: flex; align-items: center; gap: .75rem; }

.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border-radius: var(--radius-pill);
}
.lang-switch button {
  border: 0; background: transparent; color: var(--muted);
  font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  padding: .3rem .6rem; border-radius: var(--radius-pill);
  transition: background .15s, color .15s;
}
.lang-switch button.is-active { background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.lang-switch button:focus-visible { box-shadow: var(--focus); }

.topnav { display: flex; align-items: center; gap: .25rem; }
.topnav__link {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem; border-radius: var(--radius-pill);
  color: var(--muted); font-weight: 600; font-size: .9rem;
  background: transparent; border: 0;
}
.topnav__link:hover { color: var(--primary-dark); background: var(--surface-2); }
.topnav__link.is-active { color: var(--primary-dark); background: var(--primary-soft); }
.topnav__link--danger:hover { color: var(--danger); background: var(--danger-soft); }
.topnav__icon { font-size: 1.05rem; line-height: 1; }

/* Mobile: nav becomes a bottom tab bar (thumb reach). */
@media (max-width: 639px) {
  .topnav {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding: .35rem .5rem env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(70, 58, 25, .08);
    justify-content: space-around; gap: 0;
  }
  .topnav__link { flex-direction: column; gap: .1rem; font-size: .7rem; padding: .35rem .6rem; flex: 1; border-radius: var(--radius-sm); }
  .topnav__icon { font-size: 1.3rem; }
  body.has-nav { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px); }
  .brand__sub { display: none; }
}

/* ------------------------------------------------------------ layout */
.app { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head__title { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.page-head__sub { color: var(--muted); font-size: .9rem; }
.page-head__actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.section { margin-top: 1.75rem; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .85rem; }
.section__title { display: flex; align-items: center; gap: .5rem; }
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* ------------------------------------------------------------- cards */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(235, 228, 207, .7);
}
.card--pad { padding: 1.25rem; }
.card--soft { background: var(--surface-2); box-shadow: none; }
.card__title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.card__foot { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
a.card { display: block; color: inherit; transition: transform .15s, box-shadow .15s; }
a.card:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(70, 58, 25, .14); }

/* ------------------------------------------------------------- stats */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }
.stat { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; position: relative; overflow: hidden; min-height: 108px; }
.stat__label { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat__value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; word-break: break-word; }
.stat__value small { font-size: .7em; font-weight: 600; color: var(--muted); margin-inline-start: .15em; }
.stat__sub { color: var(--muted); font-size: .78rem; margin-top: auto; }
.stat__icon { position: absolute; inset-inline-end: .85rem; top: .7rem; font-size: 1.15rem; opacity: .9; }
.stat--gold { background: linear-gradient(140deg, #fff8e1, #fff); border-color: rgba(201, 162, 39, .35); }
.stat--gold .stat__value { color: var(--gold-deep); }
.stat--primary { background: linear-gradient(140deg, var(--primary), var(--primary-dark)); color: #fff; border-color: transparent; }
.stat--primary .stat__label, .stat--primary .stat__sub, .stat--primary .stat__value small { color: rgba(255, 255, 255, .8); }
@media (min-width: 640px) { .stat__value { font-size: 1.75rem; } }

/* ---------------------------------------------------- station cards */
.station-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .station-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .station-grid { grid-template-columns: repeat(3, 1fr); } }
.station-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.station-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.station-card__name { font-size: 1.05rem; }
.station-card__meta { color: var(--muted); font-size: .85rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.station-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.mini-stat { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.mini-stat__label { color: var(--muted); font-size: .72rem; font-weight: 600; }
/* Figures are the owner's primary numbers: wrap rather than clip ("12,345.68 كيلوواط·س" at 375 px). */
.mini-stat__value { font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.mini-stat--gold .mini-stat__value { color: var(--gold-deep); }
@media (max-width: 420px) {
  .station-card__stats { grid-template-columns: 1fr 1fr; }
  .mini-stat--gold { grid-column: 1 / -1; }
}

/* -------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .65rem; border-radius: var(--radius-pill);
  font-size: .75rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; line-height: 1.4;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill--online { background: var(--primary-soft); color: var(--primary-dark); }
.pill--offline { background: var(--danger-soft); color: var(--danger); }
.pill--muted { background: var(--surface-2); color: var(--muted); }
.pill--gold { background: var(--gold-soft); color: var(--gold-deep); }
.pill--blue { background: var(--blue-soft); color: var(--blue); }
.pill--amber { background: var(--amber-soft); color: var(--amber); }
.pill--plain::before { display: none; }
.pill--online::before { box-shadow: 0 0 0 3px rgba(14, 122, 86, .18); }

/* ------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: var(--radius-pill);
  font-size: .78rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip__id { opacity: .75; font-weight: 600; }
.chip--ok { background: var(--primary-soft); color: var(--primary-dark); border-color: rgba(14, 122, 86, .18); }
.chip--charging { background: var(--blue-soft); color: var(--blue); border-color: rgba(47, 111, 228, .22); }
.chip--charging .chip__dot { animation: mc-pulse 1.4s ease-in-out infinite; }
.chip--bad { background: var(--danger-soft); color: var(--danger); border-color: rgba(207, 54, 76, .22); }
.chip--warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(217, 137, 27, .25); }
.chip--muted { background: var(--surface-2); color: var(--muted); }
@keyframes mc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 111, 228, .55); transform: scale(1); }
  50% { box-shadow: 0 0 0 6px rgba(47, 111, 228, 0); transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) { .chip--charging .chip__dot { animation: none; } }

/* connector grid (station page) */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.conn { padding: .9rem 1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: .35rem; }
.conn__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.conn__id { font-weight: 800; font-size: .95rem; }
.conn__meta { color: var(--muted); font-size: .78rem; display: flex; flex-direction: column; gap: .1rem; }
.conn__error { color: var(--danger); font-family: var(--mono); font-weight: 700; }
.conn--ok { border-color: rgba(14, 122, 86, .3); background: #f1faf6; }
.conn--charging { border-color: rgba(47, 111, 228, .35); background: #f0f4fe; }
.conn--bad { border-color: rgba(207, 54, 76, .35); background: #fdf1f3; }
.conn--warn { border-color: rgba(217, 137, 27, .35); background: #fef7ec; }

/* ----------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.1rem; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: .92rem; line-height: 1.2; white-space: nowrap;
  background: var(--surface-2); color: var(--text);
  transition: background .15s, color .15s, transform .1s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover { background: #ede6cf; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(14, 122, 86, .28); }
.btn--primary:hover { background: var(--primary-dark); color: #fff; }
.btn--gold { background: linear-gradient(140deg, var(--gold), var(--gold-deep)); color: #fff; box-shadow: 0 6px 16px rgba(165, 121, 15, .28); }
.btn--gold:hover { color: #fff; filter: brightness(1.05); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--sm { padding: .4rem .75rem; font-size: .82rem; border-radius: 10px; }
.btn--block { width: 100%; }
.btn--icon { padding: .5rem; width: 38px; height: 38px; border-radius: 10px; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }

/* ------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .field--full { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field__label { font-size: .85rem; font-weight: 700; color: var(--text); }
.field__hint { font-size: .78rem; color: var(--muted); }
.field__error { font-size: .78rem; color: var(--danger); font-weight: 600; }
.field--error .input, .field--error .select { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(207, 54, 76, .15); }
.input, .select, .textarea {
  width: 100%; padding: .7rem .9rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; min-height: 46px;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.input--mono { font-family: var(--mono); }
.select { appearance: none; -webkit-appearance: none; padding-inline-end: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; background-size: 16px; }
[dir="rtl"] .select { background-position: left .9rem center; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-inline-end: 5.2rem; }
.input-group__addon { position: absolute; inset-inline-end: .5rem; }
.input-group__unit { position: absolute; inset-inline-end: .9rem; color: var(--muted); font-size: .85rem; font-weight: 600; pointer-events: none; }
.form__actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ----------------------------------------------------------- notices */
.notice { padding: .85rem 1rem; border-radius: 12px; font-size: .9rem; display: flex; gap: .6rem; align-items: flex-start; line-height: 1.45; }
.notice__icon { flex: none; font-size: 1.05rem; line-height: 1.3; }
.notice--warn { background: var(--gold-soft); color: #6b4e08; border: 1px solid rgba(201, 162, 39, .4); }
.notice--error { background: var(--danger-soft); color: #8d2233; border: 1px solid rgba(207, 54, 76, .3); }
.notice--ok { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid rgba(14, 122, 86, .3); }
.notice--info { background: var(--blue-soft); color: #1f4aa3; border: 1px solid rgba(47, 111, 228, .3); }

/* --------------------------------------------------------------- kv */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; font-size: .88rem; }
.kv dt { color: var(--muted); font-weight: 600; margin: 0; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .7rem .8rem; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfaf3; }
.table .num { text-align: end; }
.table__actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }

/* Responsive table → stacked rows on phones (≤ 640 px) */
@media (max-width: 640px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .table--stack tr:last-child { border-bottom: 0; }
  .table--stack td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem .25rem; border: 0; text-align: end; }
  .table--stack td::before { content: attr(data-label); color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; text-align: start; flex: none; }
  .table--stack td.num { text-align: end; }
  /* Primary cell has no label; stack its lines (date / "#id · tag") instead of the label/value row. */
  .table--stack td.table__primary { font-weight: 700; font-size: 1rem; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: start; }
  .table--stack td.table__primary::before { display: none; }
  .table--stack td.table__actions { justify-content: flex-start; }
  .table--stack td.table__actions::before { display: none; }
}

/* -------------------------------------------------------------- bars */
.bars { display: flex; flex-direction: column; gap: .55rem; }
.bar { display: grid; grid-template-columns: 5.5rem 1fr auto; align-items: center; gap: .6rem; font-size: .85rem; }
.bar__label { color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__track { height: 14px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.bar__fill { height: 100%; width: var(--w, 0%); min-width: 2px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--primary), #33a57f); transition: width .5s ease; }
.bar--current .bar__fill { background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.bar--empty .bar__fill { min-width: 0; width: 0; }
.bar__value { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; text-align: end; }
.bar__value small { display: block; font-weight: 600; color: var(--muted); font-size: .75rem; }
@media (max-width: 400px) { .bar { grid-template-columns: 4.2rem 1fr auto; } }

/* ------------------------------------------------------------ toolbar */
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.toolbar .select, .toolbar .input { width: auto; min-width: 11rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding-top: 1rem; }
.pager__info { color: var(--muted); font-size: .85rem; }

/* ------------------------------------------------------------- empty */
.empty { text-align: center; padding: 2.5rem 1.25rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--muted); }
.empty__icon { font-size: 2.25rem; line-height: 1; margin-bottom: .35rem; filter: grayscale(.2); }
.empty__title { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.empty__body { max-width: 34rem; font-size: .9rem; }
.empty--compact { padding: 1.5rem 1rem; }

/* ------------------------------------------------------------- login */
.login { min-height: calc(100vh - var(--topbar-h)); display: grid; place-items: center; padding: 1.5rem 0; }
.login__card { width: 100%; max-width: 420px; padding: 2rem 1.5rem; }
.login__hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; margin-bottom: 1.5rem; }
.login__bolt { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; color: var(--gold); background: linear-gradient(145deg, var(--primary), var(--primary-dark)); box-shadow: 0 10px 24px rgba(14, 122, 86, .35); margin-bottom: .5rem; }
.login__hint { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .login__card { padding: 2.5rem 2.25rem; } }

/* -------------------------------------------------------------- toast */
.toast {
  position: fixed; inset-inline: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 90;
  margin: 0 auto; max-width: 480px; padding: .85rem 1.1rem; border-radius: 14px;
  background: var(--text); color: #fff; font-weight: 600; font-size: .9rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
  display: flex; align-items: center; gap: .6rem;
  animation: mc-toast-in .2s ease-out;
}
.toast--ok { background: var(--primary-dark); }
.toast--error { background: var(--danger); }
@media (max-width: 639px) { body.has-nav .toast { bottom: calc(var(--bottomnav-h) + 1rem + env(safe-area-inset-bottom)); } }
@keyframes mc-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------- loading */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: mc-spin .8s linear infinite; flex: none; }
@keyframes mc-spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 3rem 1rem; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #ece5cf 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: mc-shimmer 1.2s infinite; border-radius: 8px; color: transparent !important; }
@keyframes mc-shimmer { to { background-position: -200% 0; } }
.is-refreshing { opacity: .7; transition: opacity .2s; }

/* -------------------------------------------------------- station page */
.station-head { display: flex; flex-direction: column; gap: .75rem; }
.station-head__row { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.station-head__tags { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.charger-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem 1rem; padding: .9rem 1rem; border-radius: 12px; background: var(--surface-2); }
.charger-info__item { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.charger-info__label { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.charger-info__value { font-weight: 600; font-size: .9rem; word-break: break-word; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-weight: 600; font-size: .85rem; margin-bottom: .75rem; }
.back-link:hover { color: var(--primary-dark); }
.back-link__arrow { display: inline-block; }
[dir="rtl"] .back-link__arrow { transform: scaleX(-1); }

/* ---------------------------------------------------------- settings */
.profile-badge { display: flex; align-items: center; gap: .9rem; }
.avatar { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: #fff; background: linear-gradient(145deg, var(--gold), var(--gold-deep)); flex: none; }

/* ----------------------------------------------------- admin widgets */
.tabs { display: flex; gap: .25rem; padding: 3px; background: var(--surface-2); border-radius: var(--radius-pill); width: max-content; max-width: 100%; overflow-x: auto; }
.tabs__tab { border: 0; background: transparent; padding: .45rem .95rem; border-radius: var(--radius-pill); font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs__tab.is-active { background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-sm); }

.badge { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 6px; font-size: .72rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge--ok { background: var(--primary-soft); color: var(--primary-dark); }
.badge--bad { background: var(--danger-soft); color: var(--danger); }
.badge--gold { background: var(--gold-soft); color: var(--gold-deep); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }

.secret-box { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border-radius: 12px; border: 1px dashed var(--gold); background: var(--gold-soft); }
.secret-box__value { flex: 1; font-family: var(--mono); font-size: 1.05rem; font-weight: 700; letter-spacing: .06em; word-break: break-all; direction: ltr; text-align: start; user-select: all; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; background: rgba(34, 31, 24, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal__card { width: 100%; max-width: 560px; max-height: calc(100vh - 2rem); overflow: auto; padding: 1.5rem; animation: mc-toast-in .18s ease-out; }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 639px) { .modal { padding: 0; align-items: end; } .modal__card { max-width: none; border-radius: var(--radius) var(--radius) 0 0; max-height: 92vh; } }

/* ------------------------------------------------------------- misc */
.divider { height: 1px; background: var(--line); margin: 1.25rem 0; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media print { .topbar, .topnav, .toast, .btn { display: none !important; } .card { box-shadow: none; } }
