/* Extra UI for booking calendar, auth, admin */
.cal-grid, .slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cal-day, .slot-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  padding: .55rem .85rem;
  font: inherit;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.cal-day:hover, .slot-btn:hover { border-color: var(--line-strong); color: var(--gold-light); }
.cal-day.is-selected, .slot-btn.is-selected {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(241,220,174,.18), rgba(168,133,79,.12));
  color: var(--gold-light);
  box-shadow: var(--glow);
}
.cal-day.is-booked, .slot-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.auth-page, .admin-page, .account-page {
  min-height: 100vh;
  /* Clear sticky site-header (~72px) + breathing room */
  padding: calc(72px + 36px) 0 60px;
  padding-top: max(calc(72px + 36px), calc(env(safe-area-inset-top, 0px) + 108px));
}
.auth-card, .admin-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px;
}
.auth-card h1, .admin-shell h1, .account-page h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  line-height: 1.15;
  margin: 0 0 .4em;
}
.auth-card .field input,
.auth-card .field select,
.auth-card .field textarea,
.inline-form .field input,
.inline-form .field select,
.inline-form .field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1.2rem;
}
.tab-btn {
  flex: 1;
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  border-radius: 999px;
  padding: .55rem 1rem;
  font: inherit;
  cursor: pointer;
}
.tab-btn.is-active {
  color: var(--bg);
  background: var(--gold-grad);
  border-color: transparent;
  font-weight: 600;
}
.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 22px 60px;
}
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1rem 0 1.5rem;
}
.admin-nav button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem 1rem;
  font: inherit;
  cursor: pointer;
}
.admin-nav button.is-active {
  border-color: var(--gold);
  color: var(--gold-light);
}
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
table.data th, table.data td {
  border-bottom: 1px solid var(--line);
  padding: .65rem .5rem;
  text-align: left;
  vertical-align: top;
}
table.data th { color: var(--muted); font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.svc-photo {
  width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--surface-3);
}
.inline-form {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .inline-form.cols-2 { grid-template-columns: 1fr 1fr; }
  .inline-form .span-2 { grid-column: 1 / -1; }
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .8rem;
}
.chip.ok { color: var(--ok); border-color: rgba(156,195,163,.4); }
.chip.warn { color: var(--error); border-color: rgba(229,139,127,.4); }
.admin-day-list { display: grid; gap: 10px; margin-top: 1rem; }
.admin-day {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface);
}
.admin-day header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px;
}
.time-checks {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.time-checks label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .35rem .6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: .9rem;
}
.time-checks label.is-on {
  border-color: var(--gold);
  color: var(--gold-light);
}
.flash {
  padding: .75rem 1rem;
  border-radius: 12px;
  background: rgba(156,195,163,.12);
  border: 1px solid rgba(156,195,163,.35);
  color: var(--ok);
  margin-bottom: 1rem;
}
.flash.err {
  background: rgba(229,139,127,.1);
  border-color: rgba(229,139,127,.35);
  color: var(--error);
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Ensure [hidden] wins over display:flex utilities */
[hidden] { display: none !important; }

/* Flexible time editor */
.time-add-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px;
}
.time-add-row input[type=time] {
  min-width: 140px;
  width: auto;
  flex: 0 0 auto;
}
.slot-editor-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.slot-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .4rem .7rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: .92rem;
}
.slot-chip.is-booked { border-color: rgba(229,139,127,.45); color: var(--error); }
.slot-chip button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px;
}
.slot-chip button:hover { color: var(--error); }
.admin-day-title {
  font-family: var(--font-serif); font-size: 1.25rem; margin: 1.4rem 0 .6rem; font-weight: 500;
}

/* Bookings cards */
.bk-cards { display: grid; gap: 12px; }
.bk-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 14px 16px;
  display: grid; gap: 8px;
}
.bk-card.is-unread {
  border-color: var(--gold);
  box-shadow: var(--glow);
}
.bk-card-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center;
}
.bk-meta { color: var(--text-soft); font-size: .9rem; line-height: 1.5; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.badge-unread, .status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase;
}
.badge-unread {
  background: var(--gold-grad); color: #1a140c; margin-left: 8px;
}
.status-pill.new { background: rgba(212,180,131,.2); color: var(--gold-light); }
.status-pill.confirmed { background: rgba(156,195,163,.18); color: var(--ok); }
.status-pill.cancelled { background: rgba(229,139,127,.15); color: var(--error); }
.nav-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); margin-left: 4px; vertical-align: middle;
}

/* ==================== Admin dashboard («Сводка») ==================== */
.dash-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.dash-title { font-size: clamp(1.8rem, 4.5vw, 2.4rem); margin: 0 0 .15em; }
.dash-head .form-small { margin: 0; }
.dash-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg {
  display: inline-flex; padding: 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
}
.seg-btn {
  appearance: none; border: 0; background: transparent; color: var(--text-soft);
  font: inherit; font-size: .85rem; padding: .45rem 1rem; border-radius: 999px; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.seg-btn:hover { color: var(--gold-light); }
.seg-btn.is-active { background: var(--gold-grad); color: #1a140c; font-weight: 600; }

.stat-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-card {
  position: relative; overflow: hidden;
  padding: 18px 18px 16px; border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.stat-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,180,131,.45), transparent);
}
.stat-card-gold {
  border-color: rgba(212,180,131,.42);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(212,180,131,.16), transparent 60%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: var(--glow);
}
.stat-label {
  margin: 0; font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold);
}
.stat-value {
  margin: 0; font-family: var(--font-serif); font-weight: 500; line-height: 1.05;
  font-size: clamp(2rem, 6vw, 2.7rem); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-card-gold .stat-value {
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-note { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--text-soft); }
.stat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-pills .status-pill { font-size: .66rem; }

.type-split { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 18px; }
.type-chip {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: .85rem;
}
.type-chip .type-name { color: var(--text); font-weight: 600; }
.type-chip .type-val { color: var(--text-soft); }

.dash-cols { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 900px) { .dash-cols { grid-template-columns: 1fr 1fr; } }
.dash-block { padding: 18px 18px 14px; border-radius: 18px; min-width: 0; }
.dash-block-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.dash-block-head h3 { font-size: 1.4rem; margin: 0; }
.dash-block-head .link-btn { padding: 4px 0; font-size: .85rem; }
.dash-list { display: grid; }
.dash-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer;
}
.dash-row:first-child { border-top: 0; }
.dash-row:hover .dash-name { color: var(--gold-light); }
.dash-when {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-3);
  line-height: 1.15;
}
.dash-when strong { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; color: var(--gold-light); }
.dash-when span { font-size: .74rem; color: var(--text-soft); }
.dash-main { min-width: 0; }
.dash-name { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-name a { font-weight: 400; font-size: .82rem; text-decoration: none; margin-left: 4px; }
.dash-svc { font-size: .85rem; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-sub { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dash-price { font-size: .85rem; color: var(--gold-light); font-weight: 600; white-space: nowrap; }
.dash-search {
  min-width: 0; width: 100%; max-width: 320px;
  padding: .55rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: .88rem;
}
.dash-search:focus { outline: none; border-color: var(--gold); }
table.data th.num, table.data td.num { text-align: right; }
.clients-table td a { text-decoration: none; }
@media (max-width: 640px) {
  .clients-table thead { display: none; }
  .clients-table, .clients-table tbody, .clients-table tr, .clients-table td { display: block; width: 100%; }
  .clients-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.data.clients-table td { border: 0; padding: 2px 0; text-align: left !important; }
  .clients-table td[data-label]:not(:first-child)::before {
    content: attr(data-label) ": "; color: var(--muted); font-size: .78rem;
  }
  .clients-table td br { display: none; }
  .clients-table td small { margin-left: 6px; }
  .dash-search { max-width: none; }
}
.dash-block-head input.dash-search { width: auto; flex: 0 1 320px; min-height: 0; }
.stat-value, .dash-when strong, .dash-price { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
@media (max-width: 640px) { .dash-block-head input.dash-search { flex: 1 1 100%; } }

/* Header: keep logo + logged-in nav (Мои записи / Админ / Выйти) on one line */
@media (min-width: 900px) {
  .header-inner { gap: 24px; }
  .header-inner .logo { flex: none; }
  .site-nav ul { gap: clamp(14px, 1.7vw, 34px); }
  .site-nav a:not(.btn), .site-nav .btn { white-space: nowrap; }
}
@media (min-width: 900px) and (max-width: 1240px) {
  .site-nav a:not(.btn) { font-size: .72rem; letter-spacing: .08em; }
  .site-nav .btn-small { padding: .55em 1em; }
  .header-inner .logo { font-size: 1.35rem; }
}
