:root {
  --bg: #f4eee8;
  --bg-soft: #fbf7f2;
  --panel: #fffaf5;
  --panel-2: #f3e7dd;
  --panel-3: #ead9cd;
  --line: rgba(93, 63, 56, 0.18);
  --line-strong: rgba(93, 63, 56, 0.28);
  --text: #2f2321;
  --muted: #7a6660;
  --accent: #8e0d14;
  --accent-dark: #6e060c;
  --accent-soft: rgba(142, 13, 20, 0.08);
  --danger: #bb4d53;
  --success: #446d52;
  --warning: #8b6338;
  --shadow: 0 18px 50px rgba(82, 46, 38, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(142,13,20,.06), transparent 24%),
    linear-gradient(180deg, #f7f0ea 0%, var(--bg) 42%, #f0e6dc 100%);
  color: var(--text);
}
body.client-page { background: linear-gradient(180deg, #f5ece4 0%, #efe3d8 100%); }
body.admin-page { background: linear-gradient(180deg, #f7f1eb 0%, #efe6dc 100%); }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}
.hero {
  position: relative;
  overflow: hidden;
  padding: 34px 30px;
  border-radius: 34px;
  margin: 10px 0 22px;
  background: linear-gradient(135deg, #8a0911 0%, #9a1119 38%, #6e050b 100%);
  color: #f7ede3;
  box-shadow: 0 26px 70px rgba(98, 11, 16, 0.24);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
}
.brand-kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  opacity: 0.88;
  margin-bottom: 14px;
}
.brand-title,
.card h1,
.card h2,
.card h3,
.topbar h1,
.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
  font-weight: 600;
}
.hero p {
  margin: 0;
  line-height: 1.65;
  max-width: 780px;
  color: rgba(247, 237, 227, 0.88);
  font-size: 16px;
}
.brand-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr); }
.card {
  background: linear-gradient(180deg, rgba(255,250,245,0.96), rgba(252,246,239,0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h1, .card h2, .card h3 { margin: 0 0 10px; }
.section-intro { margin-bottom: 14px; color: var(--muted); line-height: 1.65; }
.master-grid { display: grid; gap: 14px; }
.master-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffaf6 0%, #f7ede6 100%);
  border-radius: 24px;
  padding: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: 90px 1fr;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.master-card:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(78, 45, 40, 0.09); }
.master-card.selected {
  border-color: rgba(142,13,20,0.45);
  box-shadow: 0 16px 34px rgba(122, 15, 21, 0.14);
  background: linear-gradient(180deg, #fff7f4 0%, #f6e4de 100%);
}
.master-card img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(93,63,56,.12);
}
.master-name {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.prices { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-bottom: 8px; }
.pill {
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(142,13,20,.14);
  color: var(--accent);
  font-weight: 600;
}
label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
input, select, textarea, button {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffaf6;
  color: var(--text);
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.3;
  min-height: 54px;
}
input::placeholder, textarea::placeholder { color: #a28d86; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(142,13,20,0.45);
  box-shadow: 0 0 0 4px rgba(142,13,20,.08);
}
textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}
button {
  cursor: pointer;
  border: none;
  background: linear-gradient(180deg, #9c1119 0%, #7a0910 100%);
  color: #fff3eb;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 24px rgba(123, 9, 16, 0.2);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
button:hover { filter: brightness(1.02); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { opacity: .62; cursor: not-allowed; box-shadow: none; }
button.secondary {
  background: linear-gradient(180deg, #fffaf7 0%, #f0e3d8 100%);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
button.danger {
  background: linear-gradient(180deg, #c35b62 0%, #a53b42 100%);
  color: #fff5f3;
}
button.success {
  background: linear-gradient(180deg, #5d8368 0%, #3d634b 100%);
  color: #f3fbf4;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-weight: 600;
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  min-height: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
  box-shadow: none;
  border-radius: 6px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 10px; margin-top: 8px; }
.slot-btn {
  padding: 12px 10px;
  min-height: 50px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf6 0%, #f3e6dd 100%);
  border: 1px solid var(--line);
  text-align: center;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
}
.slot-btn.selected {
  background: linear-gradient(180deg, #981018 0%, #7a0910 100%);
  color: #fff6ef;
  border-color: transparent;
}
.notice {
  padding: 13px 15px;
  border-radius: 16px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.notice.success {
  background: rgba(68,109,82,.1);
  border: 1px solid rgba(68,109,82,.24);
  color: #345340;
}
.notice.error {
  background: rgba(187,77,83,.1);
  border: 1px solid rgba(187,77,83,.24);
  color: #80353b;
}
.topbar {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.topbar .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab {
  width: auto;
  padding: 12px 16px;
  border-radius: 999px;
  min-height: 46px;
  background: linear-gradient(180deg, #fffaf7 0%, #f0e3d8 100%);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
.tab.active {
  background: linear-gradient(180deg, #9b1118 0%, #7a0910 100%);
  color: #fff5ef;
  border-color: transparent;
}
.hidden { display: none !important; }
.planner-columns { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.planner-column {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, #fffaf6 0%, #f6ece4 100%);
  min-height: 260px;
}
.appointment-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.56);
  margin-bottom: 10px;
  cursor: pointer;
}
.status {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(93,63,56,.08);
}
.status.booked { background: rgba(142,13,20,.1); color: var(--accent); }
.status.in_progress { background: rgba(139,99,56,.12); color: var(--warning); }
.status.completed { background: rgba(90,112,146,.12); color: #47617a; }
.status.paid { background: rgba(68,109,82,.12); color: var(--success); }
.status.cancelled { background: rgba(187,77,83,.12); color: var(--danger); }
.details-panel { position: sticky; top: 20px; }
.auth-user { display: flex; gap: 14px; align-items: center; }
.auth-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}
.auth-avatar.fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fffaf6 0%, #f0e3d8 100%);
  color: var(--accent);
  font-weight: 800;
}
.auth-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffaf6 0%, #f5ebe3 100%);
  border: 1px solid var(--line);
}
.info-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.info-badge {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff3e8;
  font-size: 14px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.compact-list { display: grid; gap: 10px; }
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
@media (max-width: 900px) {
  .container { padding: 16px; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .details-panel { position: static; }
  .hero { padding: 26px 20px; border-radius: 28px; }
  .hero p { font-size: 15px; }
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 12px; }
  .card { padding: 16px; border-radius: 22px; }
  .hero { margin-top: 0; padding: 22px 18px; border-radius: 24px; }
  .hero h1 { font-size: 34px; }
  .brand-kicker { font-size: 11px; }
  .master-card {
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
  }
  .master-card img { width: 72px; height: 72px; border-radius: 16px; }
  .master-name { font-size: 17px; }
  .prices { gap: 8px; }
  .pill { font-size: 13px; padding: 8px 11px; }
  input, select, textarea, button { font-size: 16px; min-height: 52px; padding: 13px 14px; }
  textarea { min-height: 104px; }
  .slot-grid { gap: 8px; }
  .slot-btn { min-height: 48px; border-radius: 14px; }
  .appointment-card { padding: 12px; }
  .topbar .actions { grid-template-columns: 1fr; }
  .auth-user { align-items: flex-start; }
  .section-heading { flex-direction: column; align-items: flex-start; }
  .brand-actions { display: grid; grid-template-columns: 1fr; }
}
