:root {
  --taxi-yellow: #F7C948;
  --taxi-yellow-dark: #E5B22E;
  --taxi-yellow-soft: #FFF6D6;
  --taxi-ink: #1A1A1A;

  --bg: #FAFAF7;
  --bg-soft: #F3F1EA;
  --card: #ffffff;
  --text: #1A1A1A;
  --muted: #6B7280;
  --muted-2: #4B5563;
  --line: #E8E4D9;
  --line-soft: #F0ECE2;
  --brand: #F7C948;
  --brand-dark: #E5B22E;
  --brand-soft: #FFF6D6;
  --brand-ring: rgba(247, 201, 72, 0.35);

  --sidebar-bg: #ffffff;
  --sidebar-bg-active: var(--brand-soft);
  --sidebar-bg-hover: var(--bg-soft);
  --accent: #F7C948;
  --accent-dark: #E5B22E;
  --btn-primary: #F7C948;
  --content-bg: #FAFAF7;
  --card-bg: #ffffff;
  --text-muted: #6B7280;
  --border: #E8E4D9;
  --header-h: 64px;
  --sidebar-w: 260px;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 10px rgba(26, 26, 26, 0.05);
  --shadow-lift: 0 10px 28px rgba(26, 26, 26, 0.08);
  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

body.theme-dark {
  --bg: #161616;
  --bg-soft: #1f1f1f;
  --card: #222222;
  --text: #f5f5f5;
  --muted: #9ca3af;
  --muted-2: #d1d5db;
  --line: #333333;
  --line-soft: #2a2a2a;
  --brand: #F7C948;
  --brand-dark: #E5B22E;
  --brand-soft: rgba(247, 201, 72, 0.18);
  --brand-ring: rgba(247, 201, 72, 0.28);
  --sidebar-bg: #141414;
  --sidebar-bg-active: rgba(247, 201, 72, 0.2);
  --sidebar-bg-hover: rgba(255, 255, 255, 0.06);
  --content-bg: #161616;
  --card-bg: #222222;
  --text-muted: #9ca3af;
  --border: #333333;
  --btn-primary: #F7C948;
  --accent: #F7C948;
  --accent-dark: #E5B22E;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 10px 28px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  background: var(--content-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

h1, h2, h3, h4, .topbar-title, .section-head h2, .sidebar-brand,
.login-card h1, .login-card h3, .modal-card header h5 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--taxi-yellow-soft) 0%, transparent 55%),
    var(--bg);
}
body.theme-dark .app-shell {
  background: var(--bg);
}

/* —— Brand / car mark —— */
.brand-mark,
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--taxi-yellow);
  border: 1px solid var(--taxi-yellow-dark);
  color: var(--taxi-ink);
}

.brand-mark svg,
.brand-logo svg {
  width: 26px;
  height: 26px;
  display: block;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--taxi-yellow);
  border: 1px solid var(--taxi-yellow-dark);
  color: var(--taxi-ink);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
}

/* —— Sidebar —— */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 24px rgba(26, 26, 26, 0.03);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #F7C948 0%, #F0D060 55%, #E5B22E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--taxi-ink);
  flex-shrink: 0;
  border: 1px solid var(--taxi-yellow-dark);
  font-family: var(--font-display);
}

.avatar.sm { width: 32px; height: 32px; font-size: 11px; }

.sidebar-profile-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  color: var(--muted-2);
  font-size: 0.925rem;
  font-weight: 550;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-radius: 11px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

[hidden],
.nav-item[hidden],
body:not([data-role="admin"]) [data-admin-only] {
  display: none !important;
}

.nav-item:hover {
  background: var(--sidebar-bg-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--sidebar-bg-active);
  color: var(--taxi-ink);
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--taxi-yellow) 55%, var(--border));
}

.nav-item .ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.nav-item .ico .ico-svg,
.nav-item .chev .ico-svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.nav-item .chev {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: inherit;
  opacity: 0.85;
}

.nav-item .chev .ico-svg {
  width: 16px;
  height: 16px;
}

.nav-sub {
  display: none;
  background: transparent;
  margin: 0 0 4px;
}
.nav-sub.open { display: block; }
.nav-sub .nav-item { padding-left: 44px; font-size: 13px; }

.sidebar-footer {
  border-top: 1px solid var(--line-soft);
  padding: 8px 10px 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--taxi-ink);
}

.sidebar-brand .brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.sidebar-brand .brand-logo svg {
  width: 16px;
  height: 16px;
}

/* —— Main —— */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
body.theme-dark .topbar {
  background: rgba(34, 34, 34, 0.94);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--text);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  background: #fff;
  color: var(--text);
  white-space: nowrap;
  min-height: 38px;
}
body.theme-dark .btn { background: var(--card-bg); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--btn-primary);
  color: var(--taxi-ink);
  border-color: var(--taxi-yellow-dark);
  box-shadow: none;
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: var(--taxi-ink);
  border-color: var(--taxi-yellow-dark);
  box-shadow: none;
}
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); }

.btn-outline {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--taxi-yellow-dark);
  color: var(--taxi-ink);
  background: var(--brand-soft);
}

.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: #fecaca;
}
.btn-danger:hover:not(:disabled) { background: #fef2f2; }
body.theme-dark .btn-danger {
  background: transparent;
  border-color: #7f1d1d;
}

.btn-warn {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.btn-lunch {
  background: var(--brand-soft);
  color: var(--taxi-ink);
  border-color: color-mix(in srgb, var(--taxi-yellow) 50%, var(--border));
}

.shift-timer {
  background: var(--ok);
  color: #fff;
  padding: 7px 12px;
  border-radius: 11px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  min-width: 96px;
  text-align: center;
}
.shift-timer.paused { background: var(--warn); color: #111; }
.shift-timer.idle { background: #94a3b8; }

.notif-wrap { position: relative; }
.notif-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.notif-btn:hover {
  border-color: var(--taxi-yellow-dark);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.notif-badge {
  display: none;
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.notif-badge.show { display: block; }
.notif-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 300px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  padding: 8px 0;
  z-index: 80;
}
.notif-dropdown.open { display: block; }
.notif-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread {
  color: var(--text);
  background: var(--brand-soft);
  font-weight: 600;
}
.notif-item .notif-time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}
.notif-empty {
  padding: 16px 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.content {
  padding: 24px 28px 48px;
  flex: 1;
}

.panel {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.subnav {
  background: var(--taxi-yellow);
  display: flex;
  gap: 4px;
  padding: 0 12px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--taxi-yellow-dark);
}
.subnav a, .subnav span {
  color: rgba(26, 26, 26, 0.72);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.subnav a.active, .subnav span.active {
  color: var(--taxi-ink);
  border-bottom-color: var(--taxi-ink);
  font-weight: 700;
}

.panel-body { padding: 16px 18px 20px; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.filter-chip {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 11px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
}
.filter-chip.active {
  background: var(--accent);
  border-color: var(--taxi-yellow-dark);
  color: var(--taxi-ink);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.section-head .meta { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.appt-table {
  width: 100%;
  border-collapse: collapse;
}
.appt-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.appt-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}
.appt-table tr:hover td { background: var(--brand-soft); }
.appt-table .night-row td { background: rgba(247, 201, 72, 0.1); }

.badge {
  display: inline-block;
  background: var(--taxi-ink);
  color: var(--taxi-yellow);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 650;
}
.price-tag { color: var(--danger); font-weight: 700; font-size: 13px; }
.svc-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.loc-city { color: var(--taxi-ink); font-weight: 700; font-size: 13px; }
.loc-addr { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.locked-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  text-align: center;
  padding: 40px 20px;
}
.locked-box p {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
  font-family: var(--font-display);
}

.settings-list { max-width: 520px; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row label { font-weight: 600; font-size: 14px; }
.settings-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.settings-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.settings-admin-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--taxi-yellow); border: 1px solid var(--taxi-yellow-dark); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.select-fake {
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 13px;
}

.support-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  background: var(--taxi-yellow);
  color: var(--taxi-ink);
  border: 1px solid var(--taxi-yellow-dark);
  border-radius: 11px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
}
.support-fab .info {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--taxi-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.support-toast {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 72px;
  z-index: 91;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lift);
  font-size: 13px;
  max-width: 280px;
}
.support-toast.open { display: block; }

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
body.theme-dark .alert-danger { background: #450a0a; color: #fecaca; border-color: #7f1d1d; }
body.theme-dark .alert-warning { background: #451a03; color: #fde68a; border-color: #92400e; }

.modal-backdrop-custom {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.42);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-backdrop-custom.open { display: flex; }
.modal-card {
  background: var(--card-bg);
  color: var(--text);
  width: 100%;
  max-width: 720px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(26, 26, 26, 0.14);
  border: 1px solid var(--line);
  max-height: 92vh;
  overflow-y: auto;
}
.modal-card header {
  background: var(--taxi-yellow);
  color: var(--taxi-ink);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--taxi-yellow-dark);
}
.modal-card header h5 { margin: 0; font-size: 16px; }
.modal-card .body { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-card .body .full { grid-column: 1 / -1; }
.modal-card footer {
  padding: 12px 18px 18px;
  display: flex;
  gap: 10px;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.form-control, .form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--taxi-yellow-dark);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.btn-close-x {
  background: transparent;
  border: none;
  color: var(--taxi-ink);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.break-banner, .lunch-banner {
  display: none;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
}
.break-banner {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.lunch-banner {
  background: var(--brand-soft);
  color: var(--taxi-ink);
  border: 1px solid color-mix(in srgb, var(--taxi-yellow) 55%, var(--border));
}
.break-banner.open, .lunch-banner.open { display: block; }

.staff-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  align-items: start;
}
.staff-salon-field { margin-bottom: 4px; }
.badge-admin { background: #b91c1c; }
.badge-senior { background: #d97706; color: #111; }
.badge-barber { background: #16a34a; }
.badge-operator { background: var(--taxi-ink); color: var(--taxi-yellow); }

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px 40px;
  margin: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, var(--taxi-yellow-soft) 0%, transparent 58%),
    var(--bg);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.3;
}
.login-brand small {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-body);
  letter-spacing: 0;
}
.login-card {
  width: 100%;
  max-width: 420px;
  margin-top: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px 36px 32px;
  box-shadow: 0 14px 40px rgba(26, 26, 26, 0.07);
}
.login-card h1,
.login-card h3 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  text-align: left;
}
.login-card .login-sub,
.login-card .lead {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 22px;
  text-align: left;
}
.login-card .btn-primary {
  width: 100%;
  padding: 12px 18px;
  margin-top: 8px;
  min-height: 44px;
}
.login-card .form-row { margin-bottom: 14px; }

@media (max-width: 900px) {
  .sidebar { width: 72px; }
  .sidebar-profile-name,
  .nav-item span.label,
  .nav-item .chev,
  .sidebar-brand span { display: none; }
  .sidebar-profile { justify-content: center; padding: 14px 8px; }
  .nav-item { justify-content: center; padding: 12px 8px; }
  .main { margin-left: 72px; }
  .modal-card .body { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 12px; }
  .staff-layout { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
