/* ==========================================================================
   FORMS
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #31413a;
  font-size: 13px;
  font-weight: 800;
}

.field legend {
  margin: 0 0 8px;
  color: #31413a;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 3px solid rgba(47, 125, 92, 0.18);
  border-color: var(--primary);
}

.option-field {
  grid-column: 1 / -1;
  margin: 0;
  border: 0;
  padding: 0;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.choice,
.scale-choice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #ffffff;
  color: #31413a;
  font-weight: 700;
}

.choice input,
.scale-choice input {
  width: 16px;
  min-height: 16px;
}

.scale-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 1fr));
  gap: 10px;
  max-width: 520px;
}

.scale-choice {
  justify-content: center;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
/* ==========================================================================
   BUTTONS
   ========================================================================== */

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 7px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-btn {
  color: #ffffff;
  background: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  color: var(--primary-dark);
  background: #dcece3;
}

.ghost-btn {
  color: var(--ink);
  background: transparent;
}

.danger-btn {
  color: #ffffff;
  background: var(--danger);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.notice {
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 7px;
  color: #25513c;
  background: #e5f3eb;
  font-weight: 700;
}

.auth-notice {
  border: 1px solid #cfe2d9;
  border-radius: 8px;
  padding: 13px 14px;
  color: #25513c;
  background: #e8f5ef;
  font-weight: 800;
  line-height: 1.55;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  padding: 12px;
  color: #52616e;
  background: #fbfcfa;
  font-size: 14px;
  line-height: 1.55;
}

.consent-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

/* ==========================================================================
   DASHBOARD SHELL
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 244, 0.92);
  backdrop-filter: blur(12px);
  max-width: 100%;
}

.topbar .brand-mark {
  color: var(--ink);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dashboard-menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(39, 116, 93, 0.16);
  border-radius: 8px;
  background: #eef6f2;
  box-shadow: 0 12px 28px rgba(39, 116, 93, 0.1);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-menu-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary-dark);
  transition: transform 0.22s ease, opacity 0.18s ease, background 0.18s ease;
}

.dashboard-menu-toggle:hover,
.dashboard-menu-toggle:focus-visible {
  background: #e7f1ed;
  border-color: rgba(39, 116, 93, 0.28);
  box-shadow: inset 0 0 0 1px rgba(39, 116, 93, 0.08), 0 16px 34px rgba(39, 116, 93, 0.14);
  transform: translateY(-1px);
}

.topbar.is-open .dashboard-menu-toggle {
  background: linear-gradient(135deg, rgba(39, 116, 93, 0.16), rgba(61, 93, 169, 0.14));
}

.top-menu .ghost-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: #536173;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.top-menu .ghost-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(135deg, rgba(39, 116, 93, 0.16), rgba(61, 93, 169, 0.14));
  transition: transform 0.24s ease;
}

.top-menu .ghost-btn:hover,
.top-menu .ghost-btn:focus-visible {
  color: var(--primary-dark);
  background: #e7f1ed;
  border-color: rgba(39, 116, 93, 0.12);
  box-shadow: inset 0 0 0 1px rgba(39, 116, 93, 0.08), 0 12px 26px rgba(39, 116, 93, 0.12);
  transform: translateY(-1px);
}

.top-menu .ghost-btn:hover::before,
.top-menu .ghost-btn:focus-visible::before {
  transform: scaleX(1);
}

/* ==========================================================================
   CLIENT DASHBOARD
   ========================================================================== */

.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  height: fit-content;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.avatar-image {
  object-fit: cover;
}

.profile-mini strong,
.profile-mini span {
  display: block;
  min-width: 0;
}

.profile-mini span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-editor-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  border: 1px solid rgba(123, 142, 158, 0.18);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(231, 241, 237, 0.9), rgba(244, 248, 249, 0.96)),
    #ffffff;
}

.profile-editor-head strong,
.profile-editor-head span {
  display: block;
}

.profile-editor-head strong {
  color: var(--ink);
  font-size: 21px;
}

.profile-editor-head span {
  margin-top: 4px;
  color: var(--muted);
}

.avatar-upload-btn {
  width: fit-content;
  margin-top: 12px;
  cursor: pointer;
}

.avatar-upload-btn input {
  display: none;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  border-radius: 7px;
  padding: 0 11px;
  color: #43534b;
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.nav button > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-badge {
  display: inline-grid;
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  padding: 0 7px;
  color: #ffffff;
  background: #d65f75;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.nav button.active,
.nav button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.nav-submenu {
  display: grid;
  gap: 6px;
  margin: -3px 0 5px 28px;
  padding-left: 12px;
  border-left: 2px solid #dce8e4;
}

.nav-submenu button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-submenu button.active,
.nav-submenu button:hover {
  color: #1f6f5a;
  background: #eef6f3;
}

.content {
  display: grid;
  gap: 22px;
  min-width: 0;
  max-width: 100%;
}

.hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 26px;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(38, 97, 74, 0.95), rgba(42, 101, 128, 0.9)),
    url("https://images.unsplash.com/photo-1512621776951-a57141f2eefd?auto=format&fit=crop&w=1400&q=80");
  background-position: center;
  background-size: cover;
}

.hero-strip h2,
.page-title h2,
.panel h3,
.metric-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.hero-strip p,
.page-title p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.55;
}

.page-title p {
  color: var(--muted);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.client-card,
.appointment-slot,
.plan-item,
.photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.questionnaire-shell {
  min-height: 100vh;
  padding: 28px;
}

.questionnaire-card {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebe2;
}

.progress div {
  height: 100%;
  background: var(--primary);
  transition: width 0.2s ease;
}

.step-heading {
  margin: 22px 0;
}

.step-heading h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.step-heading p {
  margin: 0;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
}

.table th {
  color: var(--muted);
  font-size: 13px;
}

.summary-section th {
  padding-top: 18px;
  color: var(--primary-dark);
  background: #f4f8f3;
  font-size: 14px;
}

.compare-grid,
.client-grid,
.plan-grid,
.photo-grid,
.appointment-grid {
  display: grid;
  gap: 14px;
}

.compare-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.photo-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.appointment-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.client-card,
.appointment-slot,
.plan-item,
.photo-card {
  padding: 16px;
}

.client-card {
  display: grid;
  gap: 12px;
}

.client-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #225f46;
  background: #e1f0e8;
  font-size: 12px;
  font-weight: 800;
}

.photo-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 5;
  place-items: center;
  margin-bottom: 12px;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(50, 109, 143, 0.85), rgba(47, 125, 92, 0.88)),
    url("https://images.unsplash.com/photo-1579126038374-6064e9370f0f?auto=format&fit=crop&w=600&q=80");
  background-position: center;
  background-size: cover;
  font-weight: 800;
  cursor: pointer;
}

