:root {
  --page-bg: #f8fafc;
  --surface-bg: #ffffff;
  --card-bg: #ffffff;
  --muted-bg: #f3f4f6;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e1dfdd;
  --accent-color: #2563eb;
  --accent-contrast: #ffffff;
}

:root[data-theme='dark'],
[data-theme='dark'] {
  color-scheme: dark;
  --page-bg: #0f172a;
  --surface-bg: #101828;
  --card-bg: #1f2937;
  --muted-bg: #111827;
  --text-primary: #e2e8f0;
  --text-secondary: #cbd5f5;
  --border-color: rgba(255,255,255,0.14);
  --accent-color: #60a5fa;
  --accent-contrast: #0b1120;
}

body {
  background-color: var(--page-bg);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

header,
.toolbar,
.user-docs,
.modal-content,
.share-card,
.template-modal,
.productivity-panel,
.stats-panel,
.outline-panel,
.chat-wrapper,
.sheet-toolbar,
.sheet-container,
.settings-card,
.app-switch,
.docs-grid li {
  background-color: var(--surface-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.docs-grid li,
.stats-card,
.outline-panel,
.modal-content,
.toolbar,
.app-switch,
.settings-card {
  box-shadow: 0 12px 24px -22px rgba(15, 23, 42, 0.45);
}

[data-theme='dark'] .docs-grid li,
[data-theme='dark'] .stats-card,
[data-theme='dark'] .outline-panel,
[data-theme='dark'] .modal-content,
[data-theme='dark'] .toolbar,
[data-theme='dark'] .app-switch,
[data-theme='dark'] .settings-card {
  box-shadow: 0 18px 32px -28px rgba(2, 6, 23, 0.8);
}

.theme-toggle {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--muted-bg);
}

[data-theme='dark'] .theme-toggle:hover {
  background: rgba(255,255,255,0.08);
}

button,
input,
textarea,
select {
  background-color: #fff;
  color: #111;
}

[data-theme='dark'] button,
[data-theme='dark'] input,
[data-theme='dark'] textarea,
[data-theme='dark'] select {
  background-color: #1d2939;
  color: #f8fafc;
  border-color: rgba(255,255,255,0.18);
}

[data-theme='dark'] .news-update {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
}

[data-theme='dark'] .hero {
  background: #0b1120;
  color: #e2e8f0;
}

[data-theme='dark'] .hero-content h1 span {
  color: #60a5fa;
}

[data-theme='dark'] footer {
  background: #020617;
  color: #cbd5f5;
}

[data-theme='dark'] .slide-text {
  color: #e2e8f0;
}

[data-theme='dark'] .slide-btn {
  background: #1d4ed8;
}

