:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66717a;
  --line: #d9e0e4;
  --paper: #edf4ef;
  --surface: #ffffff;
  --green: #1f7a5b;
  --red: #c23b2a;
  --yellow: #f2c84b;
  --blue: #247b9e;
  --teal: #10978f;
  --shadow: 0 18px 45px rgba(23, 32, 38, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(247, 244, 238, 0.92), rgba(237, 246, 245, 0.78)),
    url("/images/las-terrenas-playa-2.jpg?v=4") center / cover fixed;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.sidebar {
  background:
    linear-gradient(180deg, rgba(23, 32, 38, 0.84), rgba(21, 76, 82, 0.78)),
    url("/images/las-terrenas-playa-2.jpg?v=4") 18% center / cover;
  color: white;
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 12px 0 36px rgba(23, 32, 38, 0.18);
}

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

.brand span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  display: block;
  min-height: 44px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  text-align: left;
  padding: 0 14px;
  line-height: 44px;
  text-decoration: none;
}

.tab.active,
.tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.tab-link {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

main {
  padding: 28px;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(247, 244, 238, 0.68));
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 320px) auto;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
  min-height: 220px;
  padding: 30px;
  border-radius: 8px;
  background: linear-gradient(120deg, rgba(23, 32, 38, 0.92), rgba(21, 76, 82, 0.76));
  color: white;
  box-shadow: var(--shadow);
}

.hero-copy {
  align-self: center;
}

.hero-photo {
  width: 100%;
  align-self: center;
  aspect-ratio: 193 / 135;
  object-fit: contain;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #f8db70;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  padding: 8px 12px;
  font-size: 14px;
}

.install-button {
  min-height: 38px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 800;
  padding: 0 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.install-button[hidden] {
  display: none;
}

.status-pill.online {
  color: var(--green);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(23, 32, 38, 0.06);
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-bottom: 7px;
}

.metric strong {
  font-size: 26px;
}

.panel {
  display: none;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

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

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.account-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.form-grid button {
  min-height: 44px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 750;
  padding: 0 16px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.lesson-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.lesson-meta {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.lesson-card p {
  color: var(--muted);
}

.phrase-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.phrase {
  border-left: 4px solid var(--yellow);
  background: #fff8e7;
  border-radius: 6px;
  padding: 10px;
}

.phrase strong {
  display: block;
}

.phrase span {
  color: var(--muted);
  display: block;
  font-size: 14px;
  margin-top: 3px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.notes {
  color: var(--muted);
  padding-top: 8px;
}

.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eaf5f0;
  color: var(--green);
  font-weight: 750;
  font-size: 13px;
}

.cards-list {
  display: grid;
  gap: 10px;
}

.item-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.item-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.item-card button {
  min-height: 38px;
  border-radius: 8px;
  background: #172026;
  color: white;
  padding: 0 13px;
}

.item-card button.secondary {
  background: var(--blue);
}

.table-action {
  min-height: 34px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 800;
  padding: 0 10px;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  background: white;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  background: #172026;
  color: white;
  box-shadow: 0 18px 45px rgba(23, 32, 38, 0.24);
  padding: 14px 16px;
  font-weight: 750;
}

.toast.error {
  background: #c23b2a;
}

.toast.success {
  background: #1f7a5b;
}

.inline-toast {
  position: static;
  margin-top: 14px;
  max-width: none;
}

.auth-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-logo {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(23, 32, 38, 0.18);
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form button {
  min-height: 44px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.compact-form {
  margin-top: 14px;
}

.compact-form input,
.compact-form select,
.compact-form button {
  min-height: 40px;
}

.account-box strong {
  font-size: 22px;
}

.live-class-box strong {
  font-size: 22px;
}

.whatsapp-button {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  text-decoration: none;
}

.class-controls {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.class-request-card {
  align-items: start;
}

.class-request-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.form-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-top: 4px;
  text-transform: uppercase;
}

.student-request {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.student-request span:not(.badge),
.mini-copy {
  color: var(--muted);
  font-size: 13px;
}

.auth-hint {
  color: var(--muted);
  font-size: 14px;
  margin: 14px 0 0;
}

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

.student-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 230px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 32, 38, 0.76), rgba(23, 32, 38, 0.2)),
    url("/images/las-terrenas-playa-2.jpg?v=4") center / cover;
  color: white;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 18px;
}

.student-hero .eyebrow {
  color: #f8db70;
}

.student-hero p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.82);
}

.student-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  padding: 0;
}

.force-password {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 0;
}

.force-card {
  width: min(520px, 100%);
}

.student-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

form.offline {
  opacity: 0.58;
}

form.offline input,
form.offline select,
form.offline button {
  pointer-events: none;
}

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

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

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

  .tab {
    text-align: center;
  }

  .topbar,
  .section-heading {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .metrics,
  .form-grid,
  .student-grid {
    grid-template-columns: 1fr 1fr;
  }

  .student-grid {
    grid-template-columns: 1fr;
  }

  .student-hero {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  main {
    padding: 16px;
  }

  .tabs,
  .metrics,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .item-card {
    grid-template-columns: 1fr;
  }
}
