/* The Barber Brothers — тёмный премиум с золотом (по вывеске), mobile-first. */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --gold: #C9A227;
  --gold-soft: #D9B44A;
  --bg: #121212;
  --bg-2: #1B1B1D;
  --card: #222226;
  --line: #33333A;
  --text: #F2EFE6;
  --muted: #9A968A;
  --danger: #D9534F;
  --ok: #5CB85C;
  --warn: #E8A33D;
  --shadow: 0 8px 24px #00000066;
}

html[data-theme="light"] {
  --bg: #F5F2EA;
  --bg-2: #ECE8DD;
  --card: #FFFFFF;
  --line: #DDD8C8;
  --text: #1D1C18;
  --muted: #7A766A;
  --shadow: 0 6px 18px #00000022;
}

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

h1, h2, h3, .brand, .tab-label {
  font-family: "Oswald", "Inter", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#app { min-height: 100%; display: flex; flex-direction: column; padding-bottom: 76px; }

/* --- шапка --- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-2);
  border-bottom: 2px solid var(--gold);
  padding: 12px 16px calc(10px);
  padding-top: max(12px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px;
}

.brand { font-size: 18px; font-weight: 700; color: var(--gold); line-height: 1.1; }
.brand small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.28em; }

.topbar .spacer { flex: 1; }

.role-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px 4px 4px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}

/* --- аватары --- */

.avatar {
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold), #8a6d14);
  color: #121212;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Oswald", sans-serif; font-weight: 600;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--gold);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.a24 { width: 24px; height: 24px; font-size: 10px; }
.avatar.a32 { width: 32px; height: 32px; font-size: 13px; }
.avatar.a44 { width: 44px; height: 44px; font-size: 17px; }
.avatar.a72 { width: 72px; height: 72px; font-size: 28px; }
.avatar.inactive { filter: grayscale(1); opacity: 0.6; }

/* --- нижняя навигация --- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; border: none; background: none; color: var(--muted);
  padding: 8px 2px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: inherit;
}
.tab .ico { font-size: 20px; line-height: 1; }
.tab-label { font-size: 9.5px; letter-spacing: 0.08em; }
.tab.active { color: var(--gold); }
.tab.active .tab-label { font-weight: 600; }

/* --- контент --- */

.screen { padding: 16px; flex: 1; }
.screen h2 { font-size: 17px; margin-bottom: 14px; color: var(--gold-soft); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 12.5px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn {
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.06em;
  border: none; border-radius: 10px; cursor: pointer;
  background: var(--gold); color: #151515;
  padding: 11px 18px; font-size: 13.5px; font-weight: 600;
}
.btn.secondary { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn.small { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:active { transform: translateY(1px); }

.fab {
  position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 25;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--gold); color: #151515; border: none;
  font-size: 26px; cursor: pointer; box-shadow: var(--shadow);
}

/* --- формы --- */

label.fld { display: block; margin-bottom: 12px; }
label.fld span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px;
                 text-transform: uppercase; letter-spacing: 0.08em; }
input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button {
  flex: 1; border: none; background: none; color: var(--muted);
  padding: 9px 6px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.seg button.on { background: var(--gold); color: #151515; font-weight: 600; }

/* фильтр по барберу в статистике */
.barber-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.barber-chips .chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.barber-chips .chip.on { border-color: var(--gold); background: rgba(200, 164, 60, .15); color: var(--gold-soft); font-weight: 600; }

/* --- журнал (календарь) --- */

.day-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.day-nav .btn { flex-shrink: 0; }
.day-title { flex: 1; text-align: center; font-family: "Oswald", sans-serif; font-size: 15px; }

.cal-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.cal { display: flex; gap: 8px; min-width: min-content; }

.cal-times { flex-shrink: 0; width: 44px; padding-top: 56px; }
.cal-times .t { height: 44px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; }

.cal-col { flex-shrink: 0; width: 168px; }
.cal-head {
  height: 48px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px;
}
.cal-head .nm { font-family: "Oswald", sans-serif; font-size: 13.5px; }
.cal-head .st { font-size: 10.5px; color: var(--muted); }

.cal-body { position: relative; background: var(--bg-2); border-radius: 12px; border: 1px solid var(--line); }
.slot { height: 44px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.slot:last-child { border-bottom: none; }
.slot.off { background: repeating-linear-gradient(45deg, transparent 0 8px, #00000022 8px 16px); cursor: default; }
.slot:not(.off):hover { background: #C9A22711; }

.bkg {
  position: absolute; left: 4px; right: 4px; z-index: 2;
  border-radius: 9px; padding: 5px 8px; cursor: pointer;
  background: linear-gradient(160deg, #2b2417, #3a3220);
  border: 1px solid var(--gold);
  overflow: hidden;
}
.bkg .c { font-weight: 600; font-size: 12.5px; }
.bkg .s { font-size: 11px; color: var(--muted); }
.bkg.done { border-color: var(--ok); opacity: 0.75; }
.bkg.noshow { border-color: var(--danger); opacity: 0.6; text-decoration: line-through; }
.bkg.pending { border-color: var(--gold); border-style: dashed; }
.approve-card { border-color: var(--gold); margin-bottom: 12px; }
.bkg.cancelled { display: none; }

html[data-theme="light"] .bkg { background: linear-gradient(160deg, #fdf6e3, #f6ecd0); }

/* --- команда --- */

.staff-card .row { align-items: flex-start; }
.badge {
  display: inline-block; font-size: 10.5px; border-radius: 6px; padding: 2px 8px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.badge.active { background: #5CB85C22; color: var(--ok); }
.badge.vacation { background: #E8A33D22; color: var(--warn); }
.badge.fired { background: #D9534F22; color: var(--danger); }
.badge.bl { background: #D9534F22; color: var(--danger); }
.badge.trusted { background: rgba(200, 164, 60, .15); color: var(--gold-soft); }

.avatar-edit { position: relative; cursor: pointer; }
.avatar-edit::after {
  content: "📷"; position: absolute; right: -4px; bottom: -4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 50%;
  width: 26px; height: 26px; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

/* --- списки/статистика --- */

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat .v { font-family: "Oswald", sans-serif; font-size: 22px; color: var(--gold-soft); }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }

.hbar { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; margin-top: 6px; }
.hbar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }

.search { margin-bottom: 12px; }

/* --- модалки --- */

.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: #000000AA;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--bg-2);
  border-radius: 18px 18px 0 0;
  border-top: 2px solid var(--gold);
  width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up 0.22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.modal h3 { color: var(--gold-soft); font-size: 16px; margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .actions .btn { flex: 1; }

@media (min-width: 700px) {
  .modal-back { align-items: center; }
  .modal { border-radius: 18px; border: 1px solid var(--line); border-top: 2px solid var(--gold); }
  .screen { max-width: 960px; margin: 0 auto; width: 100%; }
  .cal-col { width: 200px; }
}

/* --- выбор языка при первом запуске --- */

.lang-gate {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 380px; margin: 0 auto; padding: 32px 24px;
}
.lang-list { display: flex; flex-direction: column; gap: 12px; }
.lang-pick { font-size: 16px; padding: 15px; text-transform: none; letter-spacing: 0.02em; }

/* --- онбординг --- */

.ob { position: relative; }
.ob-skip {
  position: absolute; top: max(18px, env(safe-area-inset-top)); right: 18px;
  background: none; border: none; color: var(--muted); font-size: 14px;
  cursor: pointer; font-family: inherit;
}
.ob-ico { font-size: 72px; text-align: center; margin-bottom: 18px; }
.ob-dots { display: flex; justify-content: center; gap: 8px; margin: 26px 0; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ob-dots i.on { background: var(--gold); width: 22px; border-radius: 4px; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }

.warn-box {
  background: #D9534F1A; border: 1px solid var(--danger); color: var(--danger);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
}
