:root {
  --bg: #0a1510;
  --surface: #132a1f;
  --surface2: #1a3d2a;
  --surface-elevated: #163528;
  --text: #ecfdf5;
  --muted: #86d9b0;
  --accent: #4ade80;
  --accent-soft: #6ee7b7;
  --accent-border: #22c55e;
  --danger: #fb7185;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(165deg, #05120c 0%, #0c2418 40%, #143527 100%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.view {
  min-height: 100dvh;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.login-card {
  max-width: 400px;
  margin: 10vh auto;
}

.parking-select-card #btn-logout-from-select {
  margin-top: 16px;
  width: 100%;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

h2 {
  margin: 0;
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select,
textarea {
  background: var(--surface2);
  border: 1px solid #2d6b4a;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 1rem;
}

input:focus,
select:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #2d6b4a;
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn.primary {
  background: linear-gradient(135deg, #22c55e, #15803d);
  border: none;
  font-weight: 600;
}

.btn.ghost {
  background: transparent;
  border-color: #3d8f62;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 8px;
}

.top-bar {
  margin-bottom: 16px;
}

.top-bar-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-sign {
  flex-shrink: 0;
  color: #22c55e;
  filter: drop-shadow(0 2px 6px rgba(34, 197, 94, 0.35));
}

.parking-title-box {
  flex: 1;
  min-width: 0;
  margin: 0;
  margin-left: auto;
  text-align: right;
  padding: 10px 14px;
  border: 2px solid var(--accent-border);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.top-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

.menu-tile {
  text-align: left;
  padding: 12px 10px 12px 14px;
  border-radius: var(--radius);
  border: 1px solid #2d6b4a;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  min-height: 88px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s;
}

.menu-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.menu-tile:hover:not(.accent) .menu-tile-art {
  color: var(--accent);
}

.menu-tile.accent:hover .menu-tile-art {
  color: var(--accent-soft);
}

.menu-tile.wide {
  grid-column: 1 / -1;
  min-height: auto;
}

.menu-tile.accent {
  border-color: var(--accent-border);
  background: linear-gradient(145deg, #132a1f, #14532d);
}

.menu-tile-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  text-align: left;
  z-index: 1;
}

.menu-tile-title {
  font-weight: 700;
  font-size: 1rem;
}

.menu-tile-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.menu-tile-hint:empty {
  display: none;
}

/* Схемы справа: цвет как у обводки кнопки, плавное исчезновение к тексту */
.menu-tile-art {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  align-self: center;
  position: relative;
  color: #2d6b4a;
  pointer-events: none;
  mask-image: linear-gradient(to left, #000 0%, #000 45%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 0%, #000 45%, transparent 100%);
}

.menu-tile.accent .menu-tile-art {
  color: var(--accent-border);
}

.menu-tile-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -35deg,
    transparent,
    transparent 5px,
    currentColor 5px,
    currentColor 5.5px
  );
  opacity: 0.07;
  border-radius: 8px;
  mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.5) 0%, transparent 75%);
  -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.5) 0%, transparent 75%);
}

.menu-tile-art svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.side-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(5, 18, 12, 0.97);
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  animation: slide 0.2s ease;
}

@keyframes slide {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #2d6b4a;
}

.panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.panel-foot {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid #2d6b4a;
  background: var(--surface);
}

.panel-foot .panel-back-menu {
  width: 100%;
  box-sizing: border-box;
  padding-top: 12px;
  padding-bottom: 12px;
  font-weight: 600;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20;
}

.parking-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.parking-list li {
  margin-bottom: 8px;
}

.parking-list button {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #2d6b4a;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}

.parking-list button:hover {
  border-color: var(--accent);
}

.parking-list .addr {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.spot-cell {
  padding: 12px 8px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid #2d6b4a;
  background: var(--surface2);
  cursor: pointer;
  font-weight: 600;
  color: #ffffff;
}

.spot-cell:hover {
  border-color: var(--accent);
}

.spot-cell.sub {
  background: rgba(34, 197, 94, 0.15);
  border-color: #3d8f62;
}

.spot-cell.muted-hint {
  cursor: default;
  opacity: 0.85;
}

.subs-admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.subs-admin-list li {
  padding: 12px 0;
  border-bottom: 1px solid #2d6b4a;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #f4fff8;
}

.subs-admin-list li .muted {
  color: #d4fbe6;
}

.subs-admin-list li:last-child {
  border-bottom: none;
}

.ending-today-wrap {
  max-width: 560px;
  margin: 14px auto 0;
  padding: 14px 16px;
}

.ending-today-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.ending-today-list li {
  padding: 10px 0;
  border-bottom: 1px solid #2d6b4a;
  font-size: 0.95rem;
  line-height: 1.45;
}

.ending-today-list li:last-child {
  border-bottom: none;
}

.ending-today-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}

.modal-inner {
  width: 100%;
  max-width: 400px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .btn {
  width: 100%;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--surface);
  border: 1px solid #2d6b4a;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
