:root {
  --bg: #081326;
  --surface: #101f36;
  --surface-soft: #142744;
  --ink: #eaf4ff;
  --muted: #9eb5d4;
  --accent: #19c7b2;
  --accent-soft: rgba(25, 199, 178, 0.16);
  --ok: #4ade80;
  --warn: #fb7185;
  --line: rgba(140, 176, 224, 0.25);
  --radius: 18px;
  --shadow: 0 26px 50px rgba(3, 8, 20, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(14, 165, 233, 0.24), transparent 35%),
    radial-gradient(circle at 88% 14%, rgba(45, 212, 191, 0.18), transparent 40%),
    radial-gradient(circle at 50% 110%, rgba(59, 130, 246, 0.14), transparent 55%),
    linear-gradient(162deg, #060f21 0%, #0a1931 55%, #0d2040 100%);
  min-height: 100vh;
  overflow-x: clip;
}

a {
  color: inherit;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 18px 64px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}

.brand h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.45rem, 2vw + 1rem, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
}

.brand-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: clamp(26px, 1.7vw + 14px, 38px);
  aspect-ratio: 1;
  display: inline-block;
  background-color: var(--accent);
  -webkit-mask: url("/static/img/brand-logo.svg") center / contain no-repeat;
  mask: url("/static/img/brand-logo.svg") center / contain no-repeat;
  flex: 0 0 auto;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 32, 56, 0.72);
  font-weight: 700;
  font-size: 0.87rem;
}

.lang-dropdown {
  position: relative;
}

.lang-dropdown summary {
  list-style: none;
  cursor: pointer;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 32, 56, 0.72);
  font-weight: 700;
  font-size: 0.87rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.lang-dropdown summary::-webkit-details-marker {
  display: none;
}

.lang-dropdown[open] summary {
  border-color: rgba(25, 199, 178, 0.56);
  box-shadow: 0 0 0 2px rgba(25, 199, 178, 0.18);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 185px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(9, 21, 40, 0.97);
  box-shadow: var(--shadow);
  z-index: 30;
}

.lang-dropdown:not([open]) .lang-dropdown-menu {
  display: none;
}

.lang-dropdown-menu a {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(16, 32, 56, 0.72);
  font-weight: 600;
  font-size: 0.86rem;
}

.lang-dropdown-menu a[aria-current="page"] {
  border-color: rgba(25, 199, 178, 0.5);
  background: var(--accent-soft);
}

.card {
  background: linear-gradient(178deg, rgba(17, 34, 60, 0.92), rgba(11, 25, 45, 0.9));
  border: 1px solid rgba(168, 200, 244, 0.18);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: clamp(14px, 2vw, 24px);
  backdrop-filter: blur(6px);
  min-width: 0;
}

.stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  min-width: 0;
}

.grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.admin-split {
  display: grid;
  gap: 16px;
  min-width: 0;
  grid-template-columns: minmax(280px, 35%) minmax(0, 1fr);
  align-items: start;
}

.admin-split.admin-split--half {
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px dashed var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge.available,
.badge.active {
  color: var(--ok);
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.34);
}

.badge.completed {
  color: #c7d7ee;
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.32);
}

.badge.charging,
.badge.pending,
.badge.preparing,
.badge.finishing,
.badge.reserved,
.badge.suspended_ev,
.badge.suspended_evse {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(34, 211, 238, 0.42);
}

.badge.offline,
.badge.failed,
.badge.suspended,
.badge.unavailable,
.badge.faulted {
  color: var(--warn);
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.38);
}

.badge.unknown {
  color: #c7d7ee;
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.32);
}

form {
  display: grid;
  gap: 10px;
}

label {
  font-size: 0.86rem;
  color: var(--muted);
}

input,
select,
button,
textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(9, 21, 40, 0.86);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(158, 181, 212, 0.72);
}

button {
  cursor: pointer;
  background: linear-gradient(136deg, #0ea5e9, #14b8a6);
  color: #f3fbff;
  border: 0;
  font-weight: 700;
}

button.secondary {
  background: rgba(17, 33, 58, 0.94);
  color: var(--ink);
  border: 1px solid var(--line);
}

button.warn {
  background: linear-gradient(135deg, #ef4444, #f43f5e);
}

button:disabled {
  cursor: not-allowed;
  background: rgba(70, 90, 120, 0.58);
  color: rgba(190, 205, 227, 0.72);
  border: 1px solid rgba(126, 154, 192, 0.36);
  box-shadow: none;
  opacity: 0.75;
}

.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(136deg, #0ea5e9, #14b8a6);
  color: #f3fbff;
  font-weight: 700;
}

.btn.secondary {
  background: rgba(17, 33, 58, 0.94);
  color: var(--ink);
  border: 1px solid var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.actions > * {
  flex: 1;
}

.actions a {
  display: block;
}

.public-start-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.public-start-controls .public-start-button {
  margin: 0;
}

.public-start-controls .badge {
  white-space: nowrap;
}

.inline-form {
  display: inline-flex;
  margin-top: 6px;
}

.inline-form button {
  width: auto;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  min-width: 0;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(8, 20, 38, 0.82);
  min-width: 0;
}

.kpi p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
}

.home-kpis .kpi {
  text-align: center;
}

.home-kpis .kpi strong {
  margin-top: 0;
  font-size: clamp(1.5rem, 1.1vw + 1.1rem, 2rem);
  font-weight: 800;
  line-height: 1.15;
}

.home-kpis .kpi p {
  margin-top: 8px;
  font-size: 0.78rem;
}

.message {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.14);
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.home-bullets {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.home-bullets li {
  position: relative;
  padding-left: 16px;
}

.home-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
}

.payment-strip {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.payment-strip-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.payment-logos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.paymark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(8, 19, 38, 0.14);
  /* Light "glass" in the site's blue palette (keeps official logo colors readable). */
  background: linear-gradient(180deg, rgba(234, 244, 255, 0.88), rgba(204, 229, 255, 0.82));
  box-shadow: 0 12px 26px rgba(3, 8, 20, 0.22);
  color: #0a1931;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.paymark-logo {
  height: 20px;
  width: auto;
  max-width: 110px;
  display: block;
}

.paymark--mastercard .paymark-logo {
  height: 22px;
}

.paymark svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.paymark--cb,
.paymark--link {
  font-weight: 700;
}

.paymark--cb {
  letter-spacing: 0.04em;
  font-size: 1.12rem;
}

.paymark--cb .cb-c {
  color: #00529b;
}

.paymark--cb .cb-b {
  color: #e30613;
}

.paymark--link {
  color: #00b15c;
}

small.note {
  color: var(--muted);
  line-height: 1.35;
}

.admin-live-note {
  display: block;
  margin-top: -8px;
  margin-bottom: 4px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
}

.connector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.event-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.event-item {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(8, 22, 42, 0.78);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.event-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-item time {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.8rem;
}

dialog.modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(560px, calc(100vw - 24px));
  max-width: 560px;
}

dialog.modal::backdrop {
  background: rgba(2, 10, 22, 0.64);
  backdrop-filter: blur(2px);
}

.modal-card {
  background: var(--surface);
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid rgba(168, 200, 244, 0.2);
  box-shadow: 0 28px 44px rgba(2, 10, 22, 0.46);
  padding: 16px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  color: var(--ink);
}

.icon-close {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
}

@media (max-width: 640px) {
  .shell {
    padding: 16px 12px 52px;
  }

  .admin-split,
  .admin-split.admin-split--half,
  .grid,
  .grid.wide,
  .kpis {
    grid-template-columns: 1fr;
  }

  nav a {
    font-size: 0.79rem;
    padding: 8px 10px;
  }

  th,
  td {
    font-size: 0.9rem;
  }

  .event-item {
    flex-direction: column;
    gap: 4px;
  }

  .event-item time {
    white-space: normal;
  }
}

@media (max-width: 980px) {
  .admin-split {
    grid-template-columns: 1fr;
  }
  .admin-split.admin-split--half {
    grid-template-columns: 1fr;
  }
}
