:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #66746d;
  --line: #dce5df;
  --paper: #f8faf7;
  --panel: #ffffff;
  --green: #14795b;
  --green-dark: #0d5c45;
  --lime: #d9f077;
  --coral: #ef735e;
  --blue: #4078c0;
  --shadow: 0 18px 50px rgba(26, 45, 37, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.locked {
  display: none;
}

.app-shell.client-mode [data-owner-only] {
  display: none;
}

.client-dashboard-panel {
  display: none;
  margin-bottom: 16px;
}

.app-shell.client-mode .client-dashboard-panel {
  display: block;
}

.app-shell.client-mode .stats-grid {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.app-shell.client-mode .dashboard-layout {
  grid-template-columns: 1fr;
}

.debug-banner {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(20, 121, 91, 0.08);
  color: var(--green-dark);
  font-size: 0.95rem;
  border: 1px solid rgba(20, 121, 91, 0.16);
}

.client-diet-request {
  display: none;
}

.app-shell.client-mode .client-diet-request {
  display: grid;
}

.client-only-panel {
  display: none;
}

.app-shell.client-mode .client-only-panel {
  display: block;
}

.app-shell:not(.client-mode) .dashboard-layout {
  grid-template-columns: 1fr;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  background: #f4f8f5;
}

.auth-shell.hidden {
  display: none;
}

.auth-brand-panel {
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  background: #10251d;
  color: #ffffff;
}

.auth-brand {
  margin-bottom: 24px;
}

.auth-brand-panel h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.auth-brand-panel p {
  max-width: 520px;
  margin: 0;
  color: #d0ded8;
  font-size: 1.05rem;
  line-height: 1.65;
}

.auth-card {
  align-self: center;
  justify-self: center;
  width: min(720px, calc(100% - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 20px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  background: #eef5f1;
  margin-bottom: 18px;
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.active {
  background: #ffffff;
  color: var(--green-dark);
  box-shadow: 0 8px 20px rgba(16, 37, 29, 0.08);
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-form h2 {
  margin: 0;
  font-size: 1.6rem;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--green-dark);
  font-weight: 800;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #10251d;
  color: #f4fff9;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--lime);
  color: #10251d;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.coach-card span {
  color: #b8cec5;
  font-size: 0.85rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  color: #dcebe4;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(217, 240, 119, 0.14);
  border-color: rgba(217, 240, 119, 0.25);
  color: #ffffff;
}

.coach-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.coach-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1.15rem;
}

.coach-card p {
  display: inline-block;
  margin: 0 0 14px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(217, 240, 119, 0.14);
  color: var(--lime);
  font-weight: 900;
}

.sidebar-logout {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #ffffff;
  color: #10251d;
  font-weight: 900;
}

.sidebar-logout:hover {
  background: var(--lime);
}

.coach-card .account-meta {
  color: #d0ded8;
  line-height: 1.5;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
}

.topbar-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}


.primary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 800;
}

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

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

.ghost-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.danger-button {
  background: #fff1ee;
  color: #9b2d1d;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat {
  padding: 18px;
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.dashboard-layout,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.owner-panel {
  margin-top: 16px;
}

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

.owner-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.owner-field span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.owner-field strong {
  display: block;
  margin-top: 5px;
}

.content-grid {
  align-items: start;
}

.panel {
  padding: 18px;
  min-width: 0;
}

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

.panel h2 {
  font-size: 1.1rem;
}

.form-panel {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 121, 91, 0.12);
}

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

.form-row:has(label:nth-child(3)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.search-input {
  max-width: 220px;
}

.client-list,
.diet-list,
.progress-list,
.asana-grid,
.client-table {
  display: grid;
  gap: 10px;
}

.client-card,
.diet-card,
.progress-card,
.asana-card,
.attention-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfb;
}

.client-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--lime), #9ddfc4);
  font-weight: 900;
  color: #10251d;
}

.card-title {
  margin: 0;
  font-weight: 900;
}

.card-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-weight: 900;
}

.diet-card pre {
  white-space: pre-wrap;
  margin: 12px 0 0;
  color: var(--muted);
  font-family: inherit;
  line-height: 1.45;
}

.diet-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.diet-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

.diet-table th {
  background: #eef5f1;
  color: var(--green-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.diet-table td {
  color: var(--muted);
  line-height: 1.45;
}

.diet-table strong {
  color: var(--ink);
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef5f1;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.yoga-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.filter-chip.active,
.filter-chip:hover {
  border-color: var(--green);
  background: #eaf7f1;
  color: var(--green-dark);
}

.asana-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.asana-card {
  display: grid;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.asana-card:hover {
  border-color: var(--green);
  box-shadow: 0 14px 34px rgba(20, 121, 91, 0.12);
  transform: translateY(-1px);
}

.asana-card h3 {
  margin: 0;
  font-size: 1rem;
}

.asana-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.asana-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.asana-name {
  color: var(--green-dark);
  font-weight: 900;
}

.yoga-note p {
  color: var(--muted);
  line-height: 1.55;
}

.note-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.note-list span {
  border-left: 3px solid var(--green);
  padding: 8px 10px;
  background: #f1f7f4;
  color: var(--ink);
  border-radius: 0 8px 8px 0;
  font-weight: 700;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(16, 37, 29, 0.72);
}

.video-modal.active {
  display: grid;
}

.video-dialog {
  width: min(940px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  padding: 18px;
}

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

.video-header h2,
.video-header p {
  margin: 0;
}

.video-header p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.video-frame-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #10251d;
  position: relative;
}

.video-frame-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #10251d;
}

.video-missing {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: #ffffff;
  background: #10251d;
}

.video-missing.active {
  display: grid;
}

.video-missing strong,
.video-missing span {
  display: block;
}

.video-missing span {
  color: #d0ded8;
}

.video-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}


.attention-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.attention-row progress {
  width: 150px;
  height: 12px;
  accent-color: var(--green);
}

.macro-visual {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.macro-ring {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: conic-gradient(var(--green) 0 42%, var(--coral) 42% 72%, var(--blue) 72% 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.macro-ring::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: inherit;
  background: #10251d;
}

.macro-ring span,
.macro-ring small {
  position: relative;
  z-index: 1;
}

.macro-ring span {
  font-size: 1.8rem;
  font-weight: 900;
}

.macro-bars {
  display: grid;
  gap: 12px;
}

.macro-bar span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #edf3ef;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #fbfdfb;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    padding: 28px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid,
  .dashboard-layout,
  .content-grid,
  .yoga-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .auth-card {
    width: calc(100% - 24px);
    max-height: none;
    margin: 12px 0;
  }

  .auth-brand-panel {
    padding: 22px 16px;
  }

  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .panel-heading,
  .client-card,
  .attention-row,
  .macro-visual,
  .video-header {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .nav-list,
  .stats-grid,
  .dashboard-layout,
  .content-grid,
  .yoga-layout,
  .form-row,
  .form-row:has(label:nth-child(3)) {
    grid-template-columns: 1fr;
  }

  .search-input,
  .attention-row progress {
    max-width: none;
    width: 100%;
  }

  .card-actions {
    justify-content: stretch;
  }

  .icon-button {
    flex: 1;
  }
}
