:root {
  --bg: #0b1118;
  --panel: #121b25;
  --panel2: #182431;
  --line: #263545;
  --text: #e9f1f8;
  --muted: #8ea0b2;
  --cyan: #29d7ee;
  --green: #45d483;
  --yellow: #ffc44d;
  --red: #ff6b73;
  --radius: 14px;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--cyan);
  font-weight: 800;
  margin: 0 0 5px;
}
.error {
  color: var(--red);
  font-size: 13px;
}
.signal-line {
  height: 5px;
  background: linear-gradient(90deg, var(--cyan), #187ab3);
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      circle at 70% 15%,
      rgba(41, 215, 238, 0.12),
      transparent 32%
    ),
    var(--bg);
}
.login-card {
  width: min(390px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.login-content {
  padding: 34px;
}
.login-content h1 {
  margin: 0;
  font-size: 25px;
}
.login-content label,
.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 18px;
}
input,
select,
textarea {
  width: 100%;
  background: #0d1620;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(41, 215, 238, 0.1);
}
.btn {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: 750;
  cursor: pointer;
}
.btn:hover {
  border-color: #4b657c;
}
.btn.primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #05212a;
}
.btn.danger {
  color: var(--red);
}
.btn.small {
  padding: 6px 9px;
  font-size: 12px;
}
.wide {
  width: 100%;
  margin-top: 20px;
}
.link-btn,
.icon-btn {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn {
  font-size: 25px;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #0e161f;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.logo {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.logo-car {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 7px rgba(41, 215, 238, 0.18));
}
.logo strong,
.logo small {
  display: block;
}
.logo strong {
  font-size: 13px;
  letter-spacing: 0.14em;
}
.logo small {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}
.sidebar nav {
  padding: 12px 9px;
  overflow-y: auto;
  display: grid;
  gap: 3px;
}
.sidebar nav button {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.sidebar nav button:hover,
.sidebar nav button.active {
  background: rgba(41, 215, 238, 0.1);
  color: var(--cyan);
}
.sidebar nav button.subnav { padding-left: 2.25rem; font-size: 0.92em; }
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.workspace {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.workspace > header {
  height: 78px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
}
.workspace > header h1 {
  margin: 0;
  font-size: 23px;
}
.menu-toggle {
  display: none;
}
.health {
  margin-left: auto;
  color: var(--green);
  font-size: 12px;
  background: rgba(69, 212, 131, 0.08);
  padding: 8px 11px;
  border-radius: 999px;
}
.health i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 5px;
}
.workspace #content {
  padding: 25px 28px 60px;
  min-width: 0;
  max-width: 100%;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card {
  padding: 18px;
  border-top: 3px solid #33485b;
}
.card.cyan {
  border-top-color: var(--cyan);
}
.card.green {
  border-top-color: var(--green);
}
.card.yellow {
  border-top-color: var(--yellow);
}
.card.red {
  border-top-color: var(--red);
}
.card .value {
  font-size: 28px;
  font-weight: 850;
  margin: 7px 0 2px;
}
.card .label {
  font-size: 12px;
  color: var(--muted);
}
.panel {
  margin-top: 16px;
  overflow: hidden;
}
.panel-head {
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head h2 {
  font-size: 15px;
  margin: 0;
}
.panel-body {
  padding: 17px;
}
.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.led-preview {
  background: #070b0e;
  border: 2px solid #2c3e49;
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  color: #7dff7a;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(125, 255, 122, 0.45);
}
.card.clickable {
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}
.card.clickable:hover,
.card.clickable:focus-visible {
  transform: translateY(-2px);
  background: #182631;
  outline: none;
}
.card.clickable.green:focus-visible {
  border-color: var(--green);
}
.card.clickable.yellow:focus-visible {
  border-color: var(--yellow);
}
.card.clickable.red:focus-visible {
  border-color: var(--red);
}
.card-hint {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}
.notification-templates {
  display: grid;
  gap: 14px;
}
.notification-templates section {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.notification-templates h3 {
  margin: 0 0 12px;
}
.message-preview {
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--muted);
}
.profile-photo {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 4px 0 16px;
  color: var(--muted);
  font-size: 11px;
}
.profile-photo img {
  width: min(100%, 360px);
  max-height: 240px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}
.event-photo-preview {
  text-align: center;
}
.event-photo-preview img {
  display: block;
  width: min(100%, 560px);
  max-height: 62vh;
  object-fit: contain;
  margin: 0 auto 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.toolbar > label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  white-space: nowrap;
}
.toolbar .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.permission-picker { display: grid; gap: 0.55rem; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--panel2); }
.permission-grid label { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.permission-grid label { margin: 0; color: var(--text); font-size: 13px; text-align: left; justify-content: flex-start; }
.permission-grid input[type="checkbox"] { width: auto; flex: 0 0 auto; }
@media (max-width: 720px) { .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .permission-grid { grid-template-columns: 1fr; } }
.toolbar .grow {
  flex: 1;
  min-width: 220px;
}
.toolbar input,
.toolbar select {
  flex: 0 0 auto;
  width: auto;
  min-width: 160px;
}
.table-scroll {
  overflow-x: hidden;
  max-width: 100%;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}
.data-table th,
.data-table td { overflow-wrap: anywhere; word-break: break-word; }
.data-table th {
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--panel2);
  padding: 11px 13px;
}
.data-table td {
  padding: 12px 13px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.012);
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.plate {
  display: inline-flex;
  background: #ecf2f6;
  color: #111b23;
  border-radius: 5px;
  padding: 4px 8px;
  font-family: monospace;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.badge.green {
  color: var(--green);
  background: rgba(69, 212, 131, 0.1);
}
.badge.yellow {
  color: var(--yellow);
  background: rgba(255, 196, 77, 0.1);
}
.badge.red {
  color: var(--red);
  background: rgba(255, 107, 115, 0.1);
}
.badge.cyan {
  color: var(--cyan);
  background: rgba(41, 215, 238, 0.1);
}
.spaces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
}
.space {
  --space-border: #030609;
  --space-glow: rgba(0, 0, 0, 0.34);
  background: var(--panel);
  border: 1px solid var(--space-border);
  border-radius: 11px;
  padding: 13px;
  box-shadow: 0 0 3px var(--space-glow);
}
.space strong {
  font-size: 18px;
}
.space small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.space.assigned {
  --space-border: var(--cyan);
  --space-glow: rgba(41, 215, 238, 0.48);
}
.space.type-motorcycle {
  --space-border: var(--yellow);
  --space-glow: rgba(255, 196, 77, 0.48);
}
.space.inside {
  box-shadow:
    0 0 4px var(--space-glow),
    inset 0 0 0 1px var(--green);
}
.space.blocked {
  opacity: 0.5;
}
.space.clickable {
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.space.clickable:hover,
.space.clickable:focus-visible {
  transform: translateY(-2px);
  background: #182631;
  outline: 1px solid var(--space-border);
  outline-offset: 1px;
  box-shadow: 0 0 7px var(--space-glow);
}
.profile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 0 12px;
}
.profile-summary > div {
  display: grid;
  gap: 5px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}
.profile-summary .badge {
  justify-self: start;
}
.event-list {
  display: grid;
}
.event {
  display: grid;
  grid-template-columns: 75px 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.event:last-child {
  border: 0;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 35px;
}
.bars {
  height: 210px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 20px;
}
.bar-col {
  flex: 1;
  display: grid;
  align-content: end;
  gap: 7px;
  text-align: center;
  color: var(--muted);
  font-size: 9px;
}
.bar-pair {
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}
.bar {
  background: linear-gradient(var(--cyan), #1472b5);
  border-radius: 5px 5px 2px 2px;
  min-height: 2px;
  width: 42%;
}
.bar.income {
  background: linear-gradient(var(--green), #158c57);
}
.bar.expense {
  background: linear-gradient(var(--red), #a93345);
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.income-dot,
.expense-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.income-dot {
  background: var(--green);
}
.expense-dot {
  background: var(--red);
  margin-left: 8px;
}
.user-status-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  white-space: nowrap;
}
.user-status-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.user-status-slider {
  position: relative;
  width: 42px;
  height: 23px;
  border-radius: 999px;
  background: var(--line);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background 160ms ease, box-shadow 160ms ease;
}
.user-status-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease;
}
.user-status-switch input:checked + .user-status-slider {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(69, 212, 131, 0.18);
}
.user-status-switch input:checked + .user-status-slider::after {
  transform: translateX(19px);
}
.user-status-switch input:disabled + .user-status-slider {
  opacity: 0.55;
  cursor: not-allowed;
}
.user-status-switch strong {
  font-size: 0.82rem;
  color: var(--muted);
}
.user-status-switch input:checked ~ strong {
  color: var(--green);
}
.invoice-fetch-test .panel-head h2,
.invoice-fetch-test .panel-head p {
  margin: 0;
}
.invoice-fetch-test .panel-head p {
  margin-top: 5px;
}
.invoice-scan-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 12px 0;
}
.invoice-scan-log-wrap {
  margin: 12px 0 18px;
}
.invoice-scan-log {
  min-height: 118px;
  max-height: 240px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #081019;
  color: #aee9d0;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
.clickable-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
.clickable-row:hover,
.clickable-row:focus-visible {
  background: rgba(41, 215, 238, 0.08);
  outline: 1px solid rgba(41, 215, 238, 0.32);
  outline-offset: -1px;
}
.invoice-source {
  display: grid;
  gap: 7px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
}
.invoice-source .btn {
  justify-self: start;
  margin-top: 4px;
}
.duplicate-warning {
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--yellow);
  border-radius: 10px;
  background: rgba(255, 196, 77, 0.1);
  color: var(--yellow);
}
.light-theme .invoice-scan-log {
  background: #edf4f8;
  color: #1f5c48;
}
.compact-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.compact-cards .card .value {
  font-size: 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 11, 0.74);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
}
.modal {
  width: min(620px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-size: 18px;
  margin: 0;
}
.modal #modalBody {
  padding: 20px;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #173126;
  border: 1px solid var(--green);
  color: #dfffea;
  padding: 12px 16px;
  border-radius: 9px;
  z-index: 30;
  box-shadow: var(--shadow);
}
@media (max-width: 980px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 15;
    width: 248px;
    transform: translateX(-100%);
    transition: 0.2s;
  }
  .sidebar.open {
    transform: none;
  }
  .menu-toggle {
    display: block;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 22px;
  }
  .workspace > header {
    padding: 0 16px;
  }
  .workspace #content {
    padding: 18px 14px;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar > label {
    display: grid;
    grid-template-columns: minmax(88px, max-content) minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }
  .toolbar > label input,
  .toolbar > label select {
    width: 100%;
    min-width: 0;
  }
  .toolbar .grow {
    flex-basis: 100%;
    min-width: 0;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .health {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .event {
    grid-template-columns: 60px 95px 1fr;
  }
  .event > *:last-child {
    display: none;
  }
}
@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
