:root {
  --studio-bg: #f7f6f8;
  --studio-surface: #ffffff;
  --studio-surface-soft: #fbfafb;
  --studio-ink: #241c23;
  --studio-muted: #766c74;
  --studio-line: #e8e3e7;
  --studio-brand: #b83280;
  --studio-brand-soft: #fbecf4;
  --studio-brand-strong: #952064;
  --studio-green: #2f8f64;
  --studio-green-soft: #e9f6f0;
  --studio-amber: #b87520;
  --studio-amber-soft: #fff6e8;
  --studio-red: #c14f5a;
  --studio-red-soft: #fff0f1;
  --studio-shadow: 0 8px 24px rgba(36, 28, 35, .06);
}

html { scroll-behavior: smooth; }

body.studio-app {
  padding: 0 !important;
  background: var(--studio-bg) !important;
  background-image: none !important;
  color: var(--studio-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.studio-app a { text-decoration: none; }
.studio-app button,
.studio-app input,
.studio-app select,
.studio-app textarea { letter-spacing: 0; }

.studio-app .phone-shell {
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0 !important;
  overflow: visible !important;
  box-shadow: none;
  background: var(--studio-bg);
}

.studio-app .app-top {
  min-height: 72px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--studio-line);
  box-shadow: 0 1px 0 rgba(36, 28, 35, .02);
  backdrop-filter: blur(14px);
}

.studio-app .app-brand { gap: 11px; }
.studio-app .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--studio-brand);
  box-shadow: 0 6px 16px rgba(184, 50, 128, .2);
  font-size: 19px;
}

.studio-brand-copy { display: grid; gap: 1px; }
.studio-brand-copy strong { color: var(--studio-ink); font-size: 15px; font-weight: 750; line-height: 1.2; }
.studio-brand-copy small { color: var(--studio-muted); font-size: 10px; font-weight: 600; line-height: 1.2; }

.studio-app .header-actions { gap: 8px; }
.header-icon-button,
.admin-menu-toggle {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: var(--studio-surface);
  color: var(--studio-ink);
  font-size: 17px;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.header-icon-button:hover,
.admin-menu-toggle:hover { border-color: #d8cbd3; background: var(--studio-brand-soft); color: var(--studio-brand); }
.header-icon-button .notification-dot { top: -5px; right: -5px; }
.studio-app .profile-photo,
.studio-app .avatar { border: 2px solid var(--studio-surface); box-shadow: 0 0 0 1px var(--studio-line); }
.studio-app .logout-chip {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: var(--studio-surface);
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 650;
}

/* Admin shell */
.studio-app .admin-desktop-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
  max-width: 1600px;
  margin: 0 auto;
}
.studio-app .admin-main { min-width: 0; }
.studio-app .admin-main > .content {
  max-width: none;
  width: 100%;
  padding: 30px 32px 48px;
}
.studio-app .admin-sidebar {
  position: sticky;
  top: 72px;
  width: 248px;
  height: calc(100vh - 72px);
  padding: 0;
  border: 0;
  border-right: 1px solid var(--studio-line);
  background: #fcfbfc;
  overflow: hidden auto;
}
.studio-app .admin-sidebar .offcanvas-header { display: none; }
.studio-app .admin-sidebar .offcanvas-body {
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  overflow: visible;
}
.admin-nav { display: grid; gap: 18px; }
.admin-nav-group { display: grid; gap: 3px; }
.admin-nav-label,
.sidebar-kicker {
  display: block;
  padding: 0 10px 6px;
  color: #9a8e96;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}
.admin-nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #554b53;
  font-size: 12px;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.admin-nav a i { width: 18px; color: #897c85; font-size: 15px; text-align: center; }
.admin-nav a:hover { background: #f5f1f4; color: var(--studio-ink); }
.admin-nav a.active {
  border-color: #efd5e3;
  background: var(--studio-brand-soft);
  color: var(--studio-brand-strong);
  font-weight: 700;
}
.admin-nav a.active i { color: var(--studio-brand); }
.sidebar-support {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: var(--studio-surface);
}
.sidebar-support > i { color: var(--studio-brand); }
.sidebar-support div { display: grid; gap: 3px; }
.sidebar-support strong { color: var(--studio-ink); font-size: 11px; }
.sidebar-support span { color: var(--studio-muted); font-size: 10px; line-height: 1.45; }

/* Universal application components */
.studio-app .panel,
.studio-app .stat,
.studio-app .quick-card,
.studio-app .reservation-card,
.studio-app .salon-card,
.studio-app .user-card,
.studio-app .worker-card,
.studio-app .notice,
.studio-app .portal-action-card {
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow);
}
.studio-app .panel { padding: 20px; }
.studio-app .page-head { margin: 0 0 20px; }
.studio-app .page-head h1,
.studio-app .studio-page-header h1,
.studio-app .member-welcome h1 {
  margin: 4px 0 6px;
  color: var(--studio-ink);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 760;
  letter-spacing: 0;
}
.studio-app .page-head p,
.studio-app .studio-page-header p,
.studio-app .member-welcome p { margin: 0; color: var(--studio-muted); font-size: 13px; }
.studio-app .eyebrow,
.studio-app .section-kicker {
  color: var(--studio-brand);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}
.studio-app .section-title { gap: 16px; }
.studio-app .section-title h2 { margin: 2px 0 0; color: var(--studio-ink); font-size: 17px; font-weight: 730; }
.studio-app .text-action,
.studio-app .section-title > a { color: var(--studio-brand); font-size: 11px; font-weight: 700; }

.studio-app .btn,
.studio-app .mini-action,
.studio-app button.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.studio-app .btn:hover { transform: translateY(-1px); }
.studio-app .btn.primary,
.studio-app .mini-action { border: 1px solid var(--studio-brand); background: var(--studio-brand); color: #fff; box-shadow: 0 6px 15px rgba(184, 50, 128, .16); }
.studio-app .btn.primary:hover { background: var(--studio-brand-strong); }
.studio-app .btn.secondary { border: 1px solid var(--studio-line); background: var(--studio-surface); color: var(--studio-ink); box-shadow: none; }
.studio-app .btn.danger { border-color: var(--studio-red); background: var(--studio-red); color: #fff; }

.studio-app label { color: #4e444c; font-size: 11px; font-weight: 650; }
.studio-app input:not([type="checkbox"]):not([type="radio"]),
.studio-app select,
.studio-app textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid #dcd5da;
  border-radius: 7px;
  background: #fff;
  color: var(--studio-ink);
  font-size: 12px;
  box-shadow: none;
}
.studio-app select {
  padding-right: 36px;
  background-image: var(--bs-form-select-bg-img);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 10px;
  appearance: none;
}
.studio-app textarea { min-height: 90px; resize: vertical; }
.studio-app .slot-picker,
.studio-app .payment-choice > label { border-radius: 7px; }
.studio-app input:focus,
.studio-app select:focus,
.studio-app textarea:focus {
  border-color: var(--studio-brand);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(184, 50, 128, .1);
}
.studio-app .tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: #f1eef0;
}
.studio-app .tabs a { min-height: 36px; padding: 9px 13px; border-radius: 6px; color: var(--studio-muted); font-size: 11px; font-weight: 650; }
.studio-app .tabs a.active { background: var(--studio-surface); color: var(--studio-brand); box-shadow: 0 2px 7px rgba(36, 28, 35, .07); }
.studio-app table { width: 100%; color: var(--studio-ink); font-size: 11px; }
.studio-app th { color: #8d8189; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.studio-app th,
.studio-app td { padding: 11px 10px; border-color: var(--studio-line); vertical-align: middle; }
.studio-app tbody tr:hover { background: #fcf9fb; }
.studio-app .pill { border-radius: 999px; font-size: 9px; font-weight: 700; }

/* Admin dashboard */
.studio-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.studio-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 20px;
}
.studio-app .kpi-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 15px;
}
.kpi-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--studio-brand-soft);
  color: var(--studio-brand);
  font-size: 16px;
}
.kpi-copy { min-width: 0; display: grid; gap: 3px; }
.studio-app .kpi-copy > span { color: var(--studio-muted); font-size: 10px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-app .kpi-copy > strong { color: var(--studio-ink); font-size: clamp(19px, 2vw, 25px); font-weight: 760; line-height: 1.1; white-space: nowrap; }
.kpi-context { color: var(--studio-muted); font-size: 9px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-context.positive { color: var(--studio-green); }
.studio-dashboard-grid { display: block !important; }
.schedule-panel { width: 100%; margin-bottom: 14px; }
.demo-schedule-head,
.demo-schedule-row {
  grid-template-columns: 110px minmax(220px, 1.6fr) minmax(160px, 1fr) minmax(140px, .8fr) !important;
}
.demo-schedule-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--studio-line);
  color: #93868e;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}
.studio-app .demo-schedule-row {
  min-height: 60px;
  padding: 9px 12px;
  border-bottom: 1px solid #f0ecef;
  color: #4e444c;
}
.studio-app .demo-schedule-row:last-child { border-bottom: 0; }
.studio-app .demo-schedule-row > strong { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.studio-app .demo-schedule-row > span { display: grid; gap: 2px; font-size: 11px; }
.studio-app .demo-schedule-row > span b { color: var(--studio-ink); font-size: 12px; font-weight: 700; }
.studio-app .demo-schedule-row > span small { color: var(--studio-muted); font-size: 9px; }
.schedule-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--studio-green); }
.schedule-dot.busy { background: var(--studio-amber); }
.schedule-dot.full { background: var(--studio-red); }
.studio-app .demo-schedule-row em { display: grid; grid-template-columns: 34px minmax(70px, 1fr); align-items: center; gap: 8px; color: var(--studio-ink); font-size: 10px; font-style: normal; }
.capacity-track { height: 5px; border-radius: 999px; background: #efe9ed; overflow: hidden; }
.capacity-track i { display: block; height: 100%; border-radius: inherit; background: var(--studio-brand); }
.dashboard-secondary-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 14px; }
.studio-app .demo-activity,
.studio-app .demo-attention {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid #f0ecef;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.studio-app .demo-activity:last-child,
.studio-app .demo-attention:last-child { border-bottom: 0; }
.activity-icon,
.attention-index {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--studio-brand-soft);
  color: var(--studio-brand);
  font-size: 13px;
  font-weight: 750;
}
.attention-index { background: var(--studio-amber-soft); color: var(--studio-amber); }
.demo-activity > div,
.demo-attention > div { min-width: 0; display: grid; gap: 3px; }
.studio-app .demo-activity strong,
.studio-app .demo-attention strong { color: var(--studio-ink); font-size: 10px; font-weight: 650; }
.studio-app .demo-activity small,
.studio-app .demo-attention small { color: var(--studio-muted); font-size: 9px; }

/* Member app */
.studio-mode-user .phone-shell.user { max-width: 1120px !important; margin: 0 auto; background: var(--studio-bg); }
.studio-mode-user .content { max-width: 100%; padding: 28px 28px 110px; }
.studio-mode-user .app-top { max-width: 1120px; margin: 0 auto; }
.member-welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.member-date { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--studio-line); border-radius: 7px; background: #fff; color: var(--studio-muted); font-size: 10px; font-weight: 650; }
.member-next-class {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 22px !important;
  border-color: #eed9e5 !important;
  background: #fff !important;
}
.next-class-time { height: 74px; display: grid; place-content: center; text-align: center; border-radius: 8px; background: var(--studio-brand); color: #fff; }
.next-class-time strong { font-size: 25px; line-height: 1; }
.next-class-time span { margin-top: 4px; font-size: 9px; font-weight: 700; }
.next-class-copy h2 { margin: 4px 0 7px; font-size: 22px; font-weight: 750; }
.next-class-copy p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--studio-muted); font-size: 11px; }
.next-class-actions { display: grid; justify-items: end; gap: 9px; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.status-chip.confirmed { background: var(--studio-green-soft); color: var(--studio-green); }
.member-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px !important; margin: 14px 0 24px; }
.studio-app .member-summary-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  text-align: left;
}
.summary-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: var(--studio-brand-soft); color: var(--studio-brand); }
.member-summary-card > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.studio-app .member-summary-card strong { color: var(--studio-ink); font-size: 16px; line-height: 1.2; }
.studio-app .member-summary-card small { color: var(--studio-muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-summary-card > i { color: #a497a0; font-size: 11px; }
.member-section-title { margin-top: 4px; }
.studio-app .reservation-card { min-height: 82px; padding: 14px; box-shadow: none; }
.studio-app .portal-action-card.reservation-action {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px;
  color: var(--studio-ink);
}
.reservation-action > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; background: var(--studio-brand); color: #fff; }
.reservation-action > div { display: grid; gap: 3px; }
.reservation-action strong { font-size: 12px; }
.reservation-action small { color: var(--studio-muted); font-size: 10px; }
.reservation-action > i { color: var(--studio-brand); }
.studio-app .bottom-nav.user {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 14px;
  left: 0;
  transform: none;
  width: min(calc(100% - 28px), 620px);
  margin: 0 auto;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-columns: auto;
  overflow: hidden;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 32px rgba(36, 28, 35, .14);
  backdrop-filter: blur(14px);
}
.studio-app .bottom-nav.user a { min-height: 52px; display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 6px; color: #80747c; font-size: 9px; font-weight: 650; }
.studio-app .bottom-nav.user a i { font-size: 16px; }
.studio-app .bottom-nav.user a.active { background: var(--studio-brand-soft); color: var(--studio-brand); }
.studio-mode-user .user-quick-row { display: none; }
.studio-app .salon-splash,
.studio-app .welcome-screen { background: #8f1f62; background-image: none; }

@media (max-width: 1199.98px) {
  .studio-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 991.98px) {
  .studio-app .app-top { padding: 10px 16px; }
  .studio-app .admin-desktop-layout { display: block; min-height: calc(100vh - 64px); }
  .studio-app .admin-main > .content { padding: 22px 18px 42px; }
  .studio-app .admin-sidebar {
    display: block !important;
    position: fixed;
    top: 0;
    width: min(300px, 88vw);
    height: 100vh;
    border-right: 1px solid var(--studio-line);
  }
  .studio-app .admin-sidebar .offcanvas-header { display: flex; padding: 18px 16px 10px; }
  .studio-app .admin-sidebar .offcanvas-header h2 { margin: 2px 0 0; font-size: 18px; }
  .studio-app .admin-sidebar .offcanvas-body { padding-top: 8px; }
  .dashboard-secondary-grid { grid-template-columns: 1fr; }
  .demo-schedule-table { overflow-x: auto; }
  .demo-schedule-head,
  .demo-schedule-row { min-width: 700px; }
}

@media (max-width: 767.98px) {
  .studio-app .app-top { min-height: 64px; }
  .studio-brand-copy small { display: none; }
  .studio-app .header-logout-form { display: none; }
  .studio-page-header { align-items: stretch; flex-direction: column; gap: 14px; }
  .studio-page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .studio-kpi-grid { grid-template-columns: 1fr !important; }
  .studio-app .kpi-card { grid-template-columns: 40px minmax(0, 1fr); }
  .studio-mode-user .content { padding: 22px 14px 104px; }
  .member-next-class { grid-template-columns: 68px minmax(0, 1fr); gap: 14px; padding: 15px !important; }
  .next-class-time { height: 64px; }
  .next-class-time strong { font-size: 20px; }
  .next-class-copy h2 { font-size: 18px; }
  .next-class-actions { grid-column: 1 / -1; width: 100%; grid-template-columns: 1fr 1fr; align-items: center; justify-items: stretch; }
  .next-class-actions .status-chip { justify-content: center; }
  .member-summary-grid { grid-template-columns: 1fr !important; }
  .studio-app .bottom-nav.user { bottom: 8px; width: calc(100% - 16px); }
  .studio-app .bottom-nav.user a { min-height: 50px; }
  .studio-app .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
