﻿:root {
  --bg: #101010;
  --text: #f5f5f5;
  --card: #181818;
  --line: #2b2b2b;
  --accent: #ff8a00;
  --accent-2: #ff6a00;
  --danger: #e14949;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--text); }
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.topbar { background: #0b0b0b; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 800; text-decoration: none; color: #fff; display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.6px; }
.brand-mark {
  width: 46px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #000;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.ui-mode-form { margin-left: auto; display: inline-flex; align-items: center; }
.ui-mode-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
}
.nav a { text-decoration: none; margin-left: 10px; color: #ddd; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { background: #1f1f1f; color: #fff; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.narrow { max-width: 420px; margin: 40px auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input, select, textarea, button { padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
input, select, textarea { background: #121212; color: #fff; }
textarea { min-height: 90px; width: 100%; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { display: block; margin: 0; }
.auth-form input { width: 100%; display: block; }
.auth-form button { width: 100%; }
button, .btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}
.btn { padding: 10px 12px; border-radius: 10px; }
.sm { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.danger { background: var(--danger); color: #fff; }
td .row {
  align-items: center;
  justify-content: flex-end;
}
td .row form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
td .row form button,
td .row a.btn {
  margin: 0;
}
table { width: 100%; border-collapse: collapse; background: #121212; border: 1px solid var(--line); }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.th-sort { color: #fff; text-decoration: none; font-weight: 700; }
.th-sort:hover { color: #ffb458; text-decoration: underline; }
.th-sort.active { color: #ff8a00; }
.flash { padding: 10px; border-radius: 10px; margin: 10px 0; }
.flash.success { background: #1f3a2b; color: #b8f2ce; }
.flash.error { background: #452020; color: #ffc2c2; }
.hint { color: #acacac; font-size: 14px; }
.hidden { display: none; }
.staggered-box { border-color: #3a2a10; background: #15110c; }
.slot-filter { align-items: stretch; }
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.slot-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #141414; }
.slot-card.state-green { border-color: #2e7d32; background: #0f1a12; }
.slot-card.state-yellow { border-color: #c78d00; background: #1c170b; }
.slot-card.state-red { border-color: #8f2f2f; background: #1a1212; }
.slot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.slot-time { font-weight: 800; color: #fff; }
.slot-free { font-size: 12px; padding: 4px 8px; border-radius: 999px; font-weight: 700; }
.slot-free.badge-green { background: #1d3a24; color: #8cffb1; }
.slot-free.badge-yellow { background: #3a2d10; color: #ffd166; }
.slot-free.badge-red { background: #3d1717; color: #ff8e8e; }
.slot-bookings { display: grid; gap: 8px; }
.booking-item { border: 1px solid #333; border-radius: 10px; padding: 8px; background: #111; }
.booking-name { display: block; font-weight: 700; }
.booking-meta, .booking-phone { display: block; color: #d4d4d4; font-size: 13px; }
.slot-empty { color: #8f8f8f; font-size: 13px; }
.montage-car { font-weight: 700; }
.montage-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.montage-address, .montage-note {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}
.montage-address { background: #1c170b; color: #ffd166; border: 1px solid #59420d; }
.montage-note { background: #151a23; color: #cfe2ff; border: 1px solid #2d4367; }
#export-address-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 460px;
  width: calc(100vw - 32px);
}
#export-address-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.export-dialog-card {
  margin: 0;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #343434;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  background:
    radial-gradient(circle at top right, rgba(255, 138, 0, 0.16), transparent 34%),
    linear-gradient(180deg, #1a1a1a, #141414);
}
.export-dialog-card h3 { margin: 0 0 6px; }
.export-dialog-hint { margin: 0 0 12px; }
.export-dialog-actions { gap: 12px; }
.notify-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  max-width: 420px;
}
.notify-toast {
  background: #121826;
  color: #f4f7ff;
  border: 1px solid #25314a;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.notify-toast.hide {
  opacity: 0;
  transform: translateY(8px);
}
.notify-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.notify-icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
}
.notify-title {
  font-size: 14px;
  font-weight: 800;
  flex: 1;
}
.notify-message {
  color: #d9e3ff;
  font-size: 13px;
  line-height: 1.35;
}
.notify-close {
  background: transparent;
  border: none;
  color: #c6d2ee;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
.notify-close:hover {
  color: #fff;
}

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
  .notify-root { right: 10px; left: 10px; bottom: 10px; max-width: none; }
}

body.mobile-ui .container {
  max-width: 100%;
  padding: 10px;
}
body.mobile-ui .topbar .container {
  gap: 8px;
  flex-wrap: nowrap;
}
body.mobile-ui .brand {
  gap: 6px;
  letter-spacing: 0.3px;
}
body.mobile-ui .nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  max-width: calc(100vw - 135px);
  gap: 2px;
  scrollbar-width: none;
}
body.mobile-ui .nav::-webkit-scrollbar {
  display: none;
}
body.mobile-ui .nav a {
  margin-left: 0;
  padding: 7px 9px;
  font-size: 13px;
}
body.mobile-ui .hint {
  font-size: 12px;
  white-space: nowrap;
}
body.mobile-ui h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 6px 0 10px;
}
body.mobile-ui .card {
  border-radius: 10px;
  padding: 12px;
}
body.mobile-ui .row {
  gap: 8px;
}
body.mobile-ui input,
body.mobile-ui select,
body.mobile-ui textarea,
body.mobile-ui button,
body.mobile-ui .btn {
  min-height: 42px;
}
body.mobile-ui table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
body.mobile-ui th,
body.mobile-ui td {
  font-size: 13px;
  padding: 8px;
}
body.mobile-ui .ui-mode-form {
  margin-left: 6px;
}
body.mobile-ui .narrow {
  max-width: 100%;
  margin: 20px auto;
}
body.mobile-ui .auth-form {
  gap: 8px;
}
body.mobile-ui .auth-form button {
  width: 100%;
}

@media (max-width: 430px) {
  .brand { font-size: 14px; }
  .brand-mark { width: 44px; height: 28px; font-size: 11px; }
  .ui-mode-toggle { width: 32px; height: 32px; font-size: 15px; }
  body.mobile-ui .nav { max-width: calc(100vw - 122px); }
}

@media (max-width: 390px) {
  body.mobile-ui h1 { font-size: 24px; }
  body.mobile-ui .card { padding: 10px; }
  body.mobile-ui input,
  body.mobile-ui select,
  body.mobile-ui textarea,
  body.mobile-ui button,
  body.mobile-ui .btn { min-height: 40px; }
}

@media (max-width: 360px) {
  body.mobile-ui .container { padding: 8px; }
  body.mobile-ui .nav a { padding: 6px 8px; font-size: 12px; }
  body.mobile-ui th,
  body.mobile-ui td { font-size: 12px; padding: 7px; }
}
