@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap");

:root {
  --bg: #FAFAF9;
  --surface: #ffffff;
  --text: #0f172b;
  --muted: #62748e;
  --primary: #007956;
  --accent: #00bb7f;
  --border: #e2e8f0;
  --shadow: 0 12px 28px rgba(0, 44, 34, 0.08);
  --font-base: "Poppins", "Roboto", "Segoe UI", sans-serif;
  --sidebar-width: 260px;
  --header-height: 72px;
}

[data-theme="dark"] {
  --bg: #002c22;
  --surface: #004e3b;
  --text: #f8fafc;
  --muted: #d0fae5;
  --primary: #00bb7f;
  --accent: #00d294;
  --border: #005f46;
  --shadow: 0 16px 32px rgba(0, 20, 14, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: radial-gradient(circle at top, rgba(0, 187, 127, 0.14), transparent 55%),
              radial-gradient(circle at 15% 25%, rgba(0, 121, 86, 0.12), transparent 45%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1100;
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  .header-left {
    width: auto !important;
    justify-content: flex-start !important;
    gap: 8px;
  }

  .brand {
    display: none !important;
  }

  .header-actions {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 0;
  }

  .profile-menu,
  .theme-toggle {
    order: 0;
    margin-right: 6px;
    flex-shrink: 0;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
  }

  .nav {
    display: none;
  }
}

[data-theme="dark"] .site-header {
  background: #002325;
  border-color: rgba(255, 255, 255, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions {
  gap: 14px;
}

.profile-menu {
  position: relative;
  align-self: flex-start;
}

.profile-button {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 121, 86, 0.3), rgba(0, 187, 127, 0.35));
  color: var(--text);
  font-weight: 600;
  font-size: 0.8rem;
}

.profile-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  background: #e40014;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}

.profile-menu {
  align-self: flex-start;
  margin: 0 4px;
}

.profile-dropdown {
  position: fixed;
  left: 0;
  top: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1200;
}

.profile-menu.is-open .profile-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-dropdown-header {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.profile-name {
  font-weight: 600;
}

.profile-role {
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.profile-link:hover {
  background: rgba(0, 187, 127, 0.12);
  color: var(--primary);
}

.profile-link-badge {
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 187, 127, 0.16);
  color: var(--primary);
}

.profile-link--danger {
  color: #e40014;
}

.profile-link--danger:hover {
  background: rgba(251, 44, 54, 0.12);
  color: #e40014;
}

.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-item {
  color: var(--muted);
  font-size: 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.nav-item:hover {
  border-color: rgba(0, 187, 127, 0.5);
  background: rgba(0, 187, 127, 0.08);
  color: var(--primary);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.25s ease, transform 0.25s ease;
}

.theme-toggle:hover {
  background: rgba(0, 187, 127, 0.12);
}

.theme-toggle .toggle-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 187, 127, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.theme-toggle .toggle-icon svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.toggle-text {
  font-size: 0.85rem;
}

.hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.hamburger-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.sidebar-open .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.sidebar-open .hamburger-line:nth-child(2) {
  opacity: 0;
}

body.sidebar-open .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
  min-height: calc(100vh - var(--header-height));
  padding: 0 0 40px;
  width: min(1200px, 92%);
  margin: 0 auto;
}

.app-content {
  min-width: 0;
}

.app-content .container {
  width: 100%;
  margin: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin: 40px 0 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sidebar-title {
  font-weight: 600;
}

.sidebar-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

.sidebar-close {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-nav {
  display: grid;
  gap: 16px;
}

.sidebar-quick {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 187, 127, 0.08);
  border: 1px solid rgba(0, 187, 127, 0.2);
  margin-bottom: 18px;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
}

.sidebar-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 187, 127, 0.25);
  color: var(--primary);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .sidebar-action {
  background: rgba(0, 44, 34, 0.6);
  border-color: rgba(0, 187, 127, 0.35);
  color: var(--text);
}

.sidebar-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 121, 86, 0.14);
}

.sidebar-section {
  display: grid;
  gap: 8px;
}

.sidebar-section + .sidebar-section {
  margin-top: 4px;
}

.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.sidebar-section-body {
  display: grid;
  gap: 8px;
}

.sidebar-section.is-collapsed .sidebar-section-body {
  display: none;
}

.sidebar-toggle-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.sidebar-section.is-collapsed .sidebar-toggle-icon svg {
  transform: rotate(-90deg);
}

.sidebar-section-title {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.65rem;
  color: var(--muted);
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid transparent;
  transition: background 0.2s ease, border 0.2s ease, color 0.2s ease;
}

.sidebar-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(0, 187, 127, 0.35);
  background: rgba(0, 187, 127, 0.16);
  color: var(--primary);
}

.sidebar-badge--warning {
  border-color: rgba(255, 204, 0, 0.5);
  background: rgba(255, 204, 0, 0.2);
  color: #a36100;
}

.sidebar-badge--success {
  border-color: rgba(0, 187, 127, 0.35);
  background: rgba(0, 187, 127, 0.16);
  color: var(--primary);
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(0, 187, 127, 0.08);
  border-color: rgba(0, 187, 127, 0.2);
  color: var(--primary);
}

.sidebar-link.is-active {
  background: rgba(0, 187, 127, 0.16);
  color: var(--primary);
  border-color: rgba(0, 187, 127, 0.35);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.sidebar-link--danger {
  color: #e40014;
}

.sidebar-link--danger:hover {
  background: rgba(251, 44, 54, 0.12);
  border-color: rgba(251, 44, 54, 0.3);
  color: #e40014;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 15, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

main {
  flex: 1;
  padding: 40px 0 60px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.hero {
  display: grid;
  gap: 16px;
}

.home-hero {
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(0, 187, 127, 0.12), transparent 55%),
    linear-gradient(120deg, rgba(0, 121, 86, 0.08), transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 220px;
  }

  .header-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
  }

  .header-left {
    flex: 1;
    min-width: 0;
    gap: 8px;
  }

  .header-left .brand {
    font-size: 1.1rem;
  }

  .nav {
    flex: 1;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }

  .nav-item {
    font-size: 0.85rem;
  }

  .theme-toggle {
    padding: 8px 10px;
  }

  .hamburger {
    display: flex;
  }

  .sidebar {
    margin-top: 20px;
    padding: 16px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0 auto;
    gap: 16px;
  }

  main {
    padding: 20px 0 40px;
  }

  .sidebar-section {
    gap: 6px;
  }

  .sidebar-link {
    padding: 8px 10px;
  }

  .sidebar-quick {
    margin-bottom: 12px;
  }

  .card {
    padding: 22px;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }

  .card-header {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1300;
    background: rgba(0, 28, 18, 0.95);
    border-bottom: none;
  }

  .site-header .container {
    width: 100%;
    padding: 0 16px;
  }

  .header-inner {
    padding: 10px 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
  }

  .header-left {
    width: auto;
    justify-content: flex-start;
    gap: 6px;
  }

  .brand {
    display: none;
  }

  .header-actions {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .nav {
    order: 1;
    display: flex;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
  }

  .nav-item {
    margin: 0;
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .profile-menu,
  .theme-toggle {
    order: 0;
    margin-right: 6px;
    flex-shrink: 0;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
  }

  .toggle-text {
    display: none;
  }

  .sidebar {
    margin: 0;
    border-radius: 0;
  }

  .app-shell {
    gap: 0;
  }

  main {
    padding: 16px 0 32px;
  }

  .card {
    border-radius: 12px;
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    gap: 6px;
  }

  .brand {
    font-size: 0.9rem;
  }

  .nav {
    gap: 4px;
  }

  .nav-item {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
    padding: 0;
  }

  .toggle-text {
    display: none;
  }

  .theme-toggle svg {
    width: 12px;
    height: 12px;
  }

  .hidden-on-mobile,
  .sidebar-action span,
  .sidebar-link span,
  .profile-name,
  .profile-role {
    font-size: 0.85rem;
  }

  .profile-avatar {
    width: 26px;
    height: 26px;
  }

  .hamburger {
    width: 38px;
    height: 38px;
  }

  .sidebar {
    padding: 14px;
  }

  .sidebar-link {
    padding: 8px;
    font-size: 0.85rem;
  }

  .sidebar-quick {
    padding: 12px;
  }

  .sidebar-actions {
    gap: 6px;
  }

  .card-header {
    gap: 8px;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 187, 127, 0.28), transparent 65%);
  pointer-events: none;
}

.home-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
}

.home-hero-content h1 {
  margin: 0;
  font-size: 2.4rem;
}

@media (max-width: 640px) {
  .home-hero-content h1 {
    font-size: 1.6rem;
    line-height: 1.25;
  }

  .home-lead {
    font-size: 0.95rem;
  }

  .auth-aside h1 {
    font-size: 1rem;
    line-height: 1.2;
  }
  .auth-aside p {
    font-size: 0.85rem;
  }
}

.home-lead {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.home-hero-panel {
  display: grid;
  gap: 14px;
}

.panel-card {
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .panel-card {
  background: rgba(0, 44, 34, 0.7);
}

.panel-card h3 {
  margin: 0 0 8px;
}

.panel-card-accent {
  background: linear-gradient(140deg, rgba(0, 121, 86, 0.18), rgba(0, 187, 127, 0.05));
}

.hero-visual {
  background: linear-gradient(140deg, rgba(0, 121, 86, 0.18), rgba(0, 187, 127, 0.02));
  border-color: rgba(0, 187, 127, 0.25);
}

.hero-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hero-visual-title {
  font-weight: 600;
}

.hero-visual-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 187, 127, 0.16);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-visual-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-items: end;
  height: 90px;
  margin-bottom: 12px;
}

.hero-visual-bar {
  display: block;
  width: 100%;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  animation: bar-pulse 2.8s ease-in-out infinite;
}

.hero-visual-bar:nth-child(1) { height: 28%; }
.hero-visual-bar:nth-child(2) { height: 46%; animation-delay: 0.2s; }
.hero-visual-bar:nth-child(3) { height: 38%; animation-delay: 0.4s; }
.hero-visual-bar:nth-child(4) { height: 62%; animation-delay: 0.6s; }
.hero-visual-bar:nth-child(5) { height: 54%; animation-delay: 0.8s; }
.hero-visual-bar:nth-child(6) { height: 72%; animation-delay: 1s; }

.hero-visual-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-visual-footer strong {
  color: var(--text);
}

.stat-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-item {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(0, 187, 127, 0.08);
}

.stat-item .stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-item .stat-value {
  font-weight: 600;
}

.home-section {
  margin-top: 32px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.7rem;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.feature-grid {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card h3 {
  margin-top: 0;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.6;
}

.exam-grid {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.exam-card h3 {
  margin-top: 0;
}

.exam-card .list {
  color: var(--muted);
}

.step-grid {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step-card {
  position: relative;
  padding-top: 18px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 187, 127, 0.18);
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 10px;
}

.cta {
  margin-top: 32px;
  display: grid;
  gap: 16px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.cta h2 {
  margin: 0 0 8px;
}

.cta p {
  margin: 0;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-size: 2.1rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.button-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.button-whatsapp {
  border-color: var(--accent);
  color: var(--primary);
}

.form-card {
  max-width: 520px;
  margin: 0 auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

label {
  font-size: 0.9rem;
  color: var(--muted);
}

input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

select option {
  background: var(--surface);
  color: var(--text);
}

textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  min-height: 120px;
  resize: vertical;
}

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(251, 44, 54, 0.12);
  color: #e40014;
  border: 1px solid rgba(251, 44, 54, 0.3);
  margin-bottom: 16px;
}

.alert-success {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 187, 127, 0.12);
  color: #007956;
  border: 1px solid rgba(0, 187, 127, 0.35);
  margin-bottom: 16px;
}

.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 26px;
  align-items: stretch;
}

.auth-aside {
  position: relative;
  border-radius: 24px;
  padding: 40px;
  color: #f5f7ff;
  background: linear-gradient(135deg, #004e3b 0%, #007956 45%, #00bb7f 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-aside::before,
.auth-aside::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 60%);
  animation: float 8s ease-in-out infinite;
}

.auth-aside::before {
  width: 240px;
  height: 240px;
  top: -60px;
  right: -40px;
}

.auth-aside::after {
  width: 180px;
  height: 180px;
  bottom: -60px;
  left: -20px;
  animation-delay: 2s;
}

.auth-aside-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: rgba(245, 247, 255, 0.7);
}

[data-theme="light"] .home-hero .eyebrow {
  color: rgba(15, 23, 43, 0.6);
}

[data-theme="light"] .home-hero h1,
[data-theme="light"] .home-hero .home-lead {
  color: #0f172b;
}

.auth-aside h1 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.15;
}

.auth-aside p {
  margin: 0;
  color: rgba(245, 247, 255, 0.78);
  line-height: 1.6;
}

.auth-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-card {
  display: grid;
  gap: 18px;
  animation: fade-up 0.6s ease;
}

.auth-card-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.auth-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  width: 100%;
  padding-right: 42px;
}

.icon-button {
  position: absolute;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-password-visible="true"] .icon-show {
  display: none;
}

[data-password-visible="false"] .icon-hide {
  display: none;
}

.auth-help {
  margin-top: 16px;
  color: var(--muted);
}

.link {
  color: var(--accent);
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 2rem;
}

.dashboard-header p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(0, 187, 127, 0.12), transparent 45%);
  pointer-events: none;
}

.stat-card .stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 600;
  margin: 8px 0 4px;
}

.stat-card .stat-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.panel-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(0, 187, 127, 0.12);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 500;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.panel-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.table tr:last-child td {
  border-bottom: none;
}

.table-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-flag {
  display: grid;
  gap: 6px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.input-sm {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.button-sm {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge--success {
  background: rgba(0, 187, 127, 0.12);
  color: var(--primary);
}

.badge--warning {
  background: rgba(255, 240, 133, 0.4);
  color: #a36100;
}

.badge--danger {
  background: rgba(251, 44, 54, 0.12);
  color: #e40014;
}

.badge--neutral {
  background: rgba(98, 116, 142, 0.12);
  color: var(--muted);
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(0, 44, 34, 0.08);
}

.image-link {
  color: var(--primary);
  font-size: 0.85rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.page-info {
  color: var(--muted);
  font-size: 0.85rem;
}

.page-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-current {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 187, 127, 0.12);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(0, 187, 127, 0.35);
}

.chart {
  display: grid;
  gap: 12px;
}

.chart-svg {
  width: 100%;
  height: 180px;
  color: var(--primary);
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 180px;
  padding: 10px 0;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bar-fill {
  width: min(90px, 100%);
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 12px;
  min-height: 8px;
}

.bar-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.bar-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.quiz-card {
  display: grid;
  gap: 18px;
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.quiz-timer {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(0, 187, 127, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
}

.quiz-panel {
  position: sticky;
  top: 90px;
}

.question-block {
  display: none;
}

.question-block.is-active {
  display: block;
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.question-text {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.question-image {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.option input {
  margin-top: 4px;
}

.quiz-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.nav-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
}

.nav-button {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 10px;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}

.nav-button.is-active {
  border-color: var(--accent);
  color: var(--primary);
}

.nav-button.is-answered {
  background: rgba(0, 187, 127, 0.15);
}

.review-list {
  display: grid;
  gap: 16px;
}

.review-item {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.review-item .panel-text {
  color: var(--text);
}

.review-item .field-hint {
  color: var(--muted);
}

.review-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.forum-list {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.forum-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.forum-meta {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.forum-dot {
  color: var(--border);
}

.forum-body {
  color: var(--text);
  line-height: 1.7;
}

.forum-actions,
.comment-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form {
  display: inline-flex;
}

.comment-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.comment-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 187, 127, 0.08);
}

.comment-meta {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  color: var(--text);
}

.comment-body {
  color: var(--text);
  line-height: 1.6;
}

.comment-form {
  margin-top: 16px;
}

.chat-shell {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 0;
  min-height: 560px;
  overflow: hidden;
}

.chat-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(0, 121, 86, 0.08);
}

.chat-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.chat-list-body {
  padding: 12px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.chat-thread {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.chat-thread:hover {
  border-color: rgba(0, 187, 127, 0.6);
  box-shadow: 0 10px 18px rgba(0, 44, 34, 0.08);
  transform: translateY(-1px);
}

.chat-thread.is-active {
  border-color: var(--accent);
  background: rgba(0, 187, 127, 0.12);
}

.chat-thread-title {
  font-weight: 600;
}

.chat-thread-preview {
  color: var(--muted);
  font-size: 0.85rem;
}

.chat-thread-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}

.chat-member {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-member-status {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(98, 116, 142, 0.5);
  flex: 0 0 auto;
}

.chat-member.is-online .chat-member-status {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 187, 127, 0.15);
}

.chat-member.is-me {
  border-color: rgba(0, 187, 127, 0.55);
  background: rgba(0, 187, 127, 0.12);
}

.chat-member-name {
  font-weight: 600;
}

.chat-member-role {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: capitalize;
  margin-left: auto;
}

.chat-window {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  background: var(--surface);
}

.chat-window-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 121, 86, 0.05);
}

.chat-messages {
  flex: 1;
  padding: 18px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(0, 187, 127, 0.08), rgba(0, 121, 86, 0.02));
}

.chat-message {
  max-width: 78%;
  display: grid;
  gap: 4px;
}

.chat-sender {
  font-size: 0.72rem;
  color: var(--muted);
}

.chat-typing {
  padding: 8px 18px 0;
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 20px;
}

.chat-message.is-me {
  justify-self: end;
  text-align: right;
}

.chat-message.is-them {
  justify-self: start;
  text-align: left;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(0, 44, 34, 0.05);
  white-space: pre-wrap;
}

.chat-message.is-me .chat-bubble {
  background: rgba(0, 187, 127, 0.18);
  border-color: rgba(0, 187, 127, 0.35);
}

.chat-message-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.chat-form {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.chat-form.is-flash {
  box-shadow: 0 0 0 2px rgba(0, 187, 127, 0.3);
  border-radius: 12px;
}

.chat-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-form-row label {
  font-weight: 500;
}

.chat-form-row select {
  flex: 1;
  min-width: 0;
}

.chat-input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  min-height: 56px;
  resize: none;
}

.chat-input-row .button {
  height: 44px;
}

.chat-error {
  color: #e40014;
  min-height: 18px;
}

.ai-chat {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 0;
  min-height: 560px;
  overflow: hidden;
}

.ai-chat-info {
  padding: 20px;
  border-right: 1px solid var(--border);
  background: rgba(0, 121, 86, 0.08);
  display: grid;
  gap: 16px;
  align-content: start;
}

.ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-suggestions .pill {
  justify-content: flex-start;
  border: 1px solid transparent;
  cursor: pointer;
}

.ai-chat-window {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.ai-messages {
  flex: 1;
  padding: 20px;
  display: grid;
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(0, 187, 127, 0.08), rgba(0, 121, 86, 0.02));
}

.ai-message {
  max-width: 78%;
  display: grid;
  gap: 6px;
}

.ai-message.is-user {
  justify-self: end;
  text-align: right;
}

.ai-message.is-assistant {
  justify-self: start;
}

.ai-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(0, 44, 34, 0.05);
  white-space: pre-wrap;
  text-align: left;
}

.ai-bubble code {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  background: rgba(0, 187, 127, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.ai-bubble .ai-code {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 121, 86, 0.12);
  overflow-x: auto;
}

.ai-bubble .ai-code code {
  display: block;
  padding: 0;
  background: transparent;
}

.ai-bubble a {
  color: var(--primary);
  text-decoration: underline;
}

.ai-list {
  margin: 8px 0 8px 18px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.ai-list li {
  line-height: 1.6;
}

.ai-message.is-user .ai-bubble {
  background: rgba(0, 187, 127, 0.2);
  border-color: rgba(0, 187, 127, 0.35);
}

.ai-typing {
  padding: 8px 20px 0;
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ai-typing.is-visible {
  opacity: 1;
}

.ai-form {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.ai-error {
  color: #e40014;
  min-height: 18px;
  font-size: 0.85rem;
}

.ai-input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ai-input-row textarea {
  flex: 1;
  min-height: 56px;
  resize: none;
}

.ai-input-row .button {
  height: 44px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.detail-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.notification-grid {
  display: grid;
  gap: 16px;
}

.notification-card h3 {
  margin: 0 0 6px;
}

.notification-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.notification-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notification-meta {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.notification-card.is-unread {
  border-color: rgba(0, 187, 127, 0.4);
  box-shadow: 0 14px 26px rgba(0, 121, 86, 0.12);
}

.notification-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.push-card .form-actions {
  align-items: center;
}

.push-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.push-status.is-success {
  color: var(--primary);
  font-weight: 600;
}

.push-status.is-error {
  color: #e40014;
  font-weight: 600;
}

.push-test-card {
  margin-top: 18px;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bar-pulse {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.9;
  }
  50% {
    transform: scaleY(1.06);
    opacity: 1;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-inner {
  text-align: center;
}

@media (max-width: 720px) {
  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .profile-dropdown {
    right: 0;
    left: auto;
    width: min(260px, 92vw);
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    padding: 28px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .chat-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-input-row .button {
    width: 100%;
  }

  .chat-message {
    max-width: 90%;
  }

  .ai-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-input-row .button {
    width: 100%;
  }

  .ai-message {
    max-width: 90%;
  }

  .home-hero-grid {
    grid-template-columns: 1fr;
  }

  .cta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-left {
    width: auto;
  }

  .nav {
    flex-wrap: nowrap;
    row-gap: 0;
  }

  .header-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    row-gap: 0;
  }

  .nav-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
  }

  .nav-greeting {
    display: none;
  }

  .profile-menu {
    order: 0;
  }

  .theme-toggle {
    order: 0;
    margin-left: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .brand {
    font-size: 1.05rem;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0;
    padding: 0 4% 40px;
  }

  .chat-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .chat-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .chat-list-body {
    max-height: 240px;
  }

  .chat-window {
    min-height: 420px;
  }

  .ai-chat {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ai-chat-info {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .ai-messages {
    min-height: 360px;
  }

  .profile-dropdown {
    width: min(260px, 92vw);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(82vw, 320px);
    transform: translateX(-110%);
    transition: transform 0.2s ease;
    z-index: 1001;
    margin: 0;
    border-radius: 0 20px 20px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 40px;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .sidebar-backdrop {
    z-index: 1000;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .hamburger {
    display: inline-flex;
  }

  .site-footer {
    padding: 14px 0;
    font-size: 0.75rem;
  }
}

@media (min-width: 961px) {
  .sidebar-section-toggle {
    cursor: default;
    pointer-events: none;
  }

  .sidebar-toggle-icon {
    display: none;
  }
}
.site-header,
.nav,
.nav-item,
.theme-toggle {
  transition: color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 43, 0.1);
  color: #0f172b;
}

[data-theme="light"] .site-header .brand,
[data-theme="light"] .site-header .nav-item,
[data-theme="light"] .site-header .theme-toggle {
  color: #0f172b;
  border-color: rgba(15, 23, 43, 0.3);
}
