:root {
  --bg: #f6faf8;
  --surface: #ffffff;
  --surface-2: #eef8f3;
  --text: #13201b;
  --muted: #60736b;
  --line: #dce8e2;
  --primary: #0f9f6e;
  --primary-dark: #08734f;
  --primary-soft: #def7eb;
  --gold: #f5b700;
  --gold-soft: #fff4c7;
  --indigo: #4f46e5;
  --indigo-soft: #e9e8ff;
  --red: #dc2626;
  --green: #16a34a;
  --shadow: 0 18px 50px rgba(18, 32, 27, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 260px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", "Noto Sans Telugu", "Noto Sans Devanagari", system-ui, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 480px) 1fr;
  gap: 36px;
  align-items: center;
  padding: 36px;
}

.brand-panel {
  min-height: 620px;
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(15, 159, 110, 0.92), rgba(79, 70, 229, 0.88)),
    radial-gradient(circle at 70% 20%, rgba(245, 183, 0, 0.42), transparent 34%);
  color: #fff;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.brand-panel .logo-mark {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.brand-copy h1 {
  margin: 0 0 14px;
  max-width: 560px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.brand-copy p {
  margin: 0;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
  line-height: 1.7;
}

.preview-card {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(12px);
}

.mini-word {
  display: grid;
  gap: 8px;
  color: #fff;
}

.mini-word strong {
  font-size: 32px;
}

.auth-card {
  width: min(100%, 440px);
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h2,
.page-title h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.auth-card p,
.page-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 159, 110, 0.12);
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-row,
.top-actions,
.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--text);
  background: #eef3f0;
  font-weight: 800;
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

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

.btn.gold {
  background: var(--gold);
  color: #3c2b00;
}

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

.btn.icon {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  padding: 0;
}

.dashboard-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-align: left;
  font-weight: 800;
}

.nav-btn.active,
.nav-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: #edf4f0;
  border-radius: 14px;
}

.role-switch button {
  border: 0;
  padding: 10px;
  border-radius: 11px;
  background: transparent;
  font-weight: 800;
  color: var(--muted);
}

.role-switch button.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 5px 18px rgba(18, 32, 27, 0.08);
}

.main {
  min-width: 0;
  padding: 26px;
  padding-bottom: 92px;
}

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

.topbar .search {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

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

.stat-card,
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(18, 32, 27, 0.04);
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

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

.learning-command,
.dictionary-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid rgba(15, 159, 110, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(222, 247, 235, 0.92), rgba(233, 232, 255, 0.9)),
    #fff;
  box-shadow: 0 14px 38px rgba(18, 32, 27, 0.06);
}

.learning-command h2,
.dictionary-hero h2 {
  margin: 10px 0 8px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.12;
}

.learning-command p,
.dictionary-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 680px;
}

.command-actions {
  display: grid;
  gap: 10px;
  min-width: 210px;
}

.dictionary-hero form {
  width: min(420px, 100%);
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.card,
.panel {
  padding: 18px;
}

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

.card h3,
.panel h3 {
  margin: 0;
  font-size: 18px;
}

.card p,
.panel p {
  color: var(--muted);
  line-height: 1.55;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--surface-2);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.gold {
  background: var(--gold-soft);
  color: #6c4c00;
}

.badge.indigo {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.progress {
  width: 100%;
  height: 10px;
  background: #e8efeb;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 40%);
  background: linear-gradient(90deg, var(--primary), #34d399);
  border-radius: inherit;
}

.task-card {
  display: grid;
  gap: 12px;
  min-height: 188px;
}

.task-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.word-hero {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface-2);
}

.word-hero .telugu {
  font-family: "Noto Sans Telugu", sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.2;
}

.word-hero .translations {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.conversation {
  display: grid;
  gap: 14px;
}

.bubble {
  max-width: 84%;
  padding: 14px;
  border-radius: 16px;
  background: #f0f5f2;
}

.bubble.right {
  margin-left: auto;
  background: var(--primary-soft);
}

.speaker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.multi-line {
  display: grid;
  gap: 5px;
  line-height: 1.55;
}

.quiz-option {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  border-radius: 12px;
  text-align: left;
  font-weight: 800;
}

.quiz-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.mic-button {
  width: 138px;
  height: 138px;
  border: 0;
  border-radius: 50%;
  margin: 14px auto;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 159, 110, 0.28);
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #fff;
}

.bottom-tabs {
  display: none;
}

.mobile-top {
  display: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 13px 15px;
  border-radius: 14px;
  background: #13201b;
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow);
  z-index: 10;
  transform: translateY(120px);
  opacity: 0;
  transition: 0.22s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 32, 27, 0.42);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
}

.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.hide {
  display: none !important;
}

svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

  .brand-panel {
    min-height: auto;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 18px;
    padding-top: 84px;
    padding-bottom: 98px;
  }

  .mobile-top {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 8;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(246, 250, 248, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
  }

  .topbar {
    display: none;
  }

  .bottom-tabs {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 8px;
    z-index: 8;
    box-shadow: 0 16px 42px rgba(18, 32, 27, 0.16);
  }

  .bottom-tabs button,
  .bottom-tabs a {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 12px;
    padding: 7px 3px;
    min-height: 56px;
  }

  .bottom-tabs button.active,
  .bottom-tabs a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
  }

  .bottom-tabs .mobile-fab {
    transform: translateY(-18px);
    min-height: 66px;
    width: 66px;
    justify-self: center;
    border-radius: 22px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 28px rgba(15, 159, 110, 0.32);
  }

  .bottom-tabs .mobile-fab.active {
    background: var(--primary-dark);
    color: #fff;
  }

  .learning-command,
  .dictionary-hero {
    display: grid;
    padding: 17px;
  }

  .command-actions {
    min-width: 0;
  }

  .stat-row,
  .grid.cards,
  .grid.two {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .auth-shell {
    padding: 0;
  }

  .brand-panel {
    display: none;
  }

  .auth-card {
    min-height: 100vh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .split-fields {
    grid-template-columns: 1fr;
  }

  .stat-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-card strong {
    font-size: 18px;
  }

  .card,
  .panel {
    padding: 15px;
  }

  .bubble {
    max-width: 100%;
  }

  .btn {
    width: 100%;
  }

  .btn.icon,
  .chip-row .btn {
    width: auto;
  }
}
