:root {
  --bg: #090909;
  --bg-soft: #121212;
  --panel: #151515;
  --panel-2: #1b1b1b;
  --text: #f5f5f5;
  --text-strong: #ffffff;
  --muted: #a7a7a7;
  --text-inverse: #1a1a1a;
  --primary: #f4a000;
  --primary-soft: #3a2a0f;
  --secondary: #252525;
  --danger: #ff5f5f;
  --success: #24c26a;
  --warning: #f4a000;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(244, 160, 0, 0.07), transparent 22%),
    radial-gradient(circle at 90% 12%, rgba(244, 160, 0, 0.08), transparent 18%),
    var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0f0f0f, #0b0b0b);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffb62f, #e69800);
  color: #2f1d00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-btn.active {
  background: linear-gradient(90deg, var(--primary-soft), #221a0d);
  color: #ffd892;
  border-color: rgba(244, 160, 0, 0.25);
}

.nav-btn:hover {
  background: #1a1a1a;
  border-color: var(--border);
}

.backup-reminder {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: auto;
  padding: 10px;
  border-radius: 10px;
  background: #101010;
  border: 1px solid var(--border);
}

.main {
  flex: 1;
  padding: 18px 20px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0 2px;
}

.topbar h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-strong);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.badge {
  background: #1f3f2f;
  color: #98f0be;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(36, 194, 106, 0.25);
}

.section {
  display: none;
  animation: fade 0.2s ease;
}

.section.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
}

.card,
.panel {
  background: linear-gradient(180deg, var(--panel), #101010);
  border-radius: 14px;
  padding: 15px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dashboard-layout {
  display: grid;
  gap: 12px;
}

.top-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-card {
  min-height: 150px;
  background: radial-gradient(circle at 85% 8%, rgba(244, 160, 0, 0.22), transparent 30%), #141414;
}

.hero-subtitle {
  margin: 0;
  color: #dca44a;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.hero-card h3 {
  margin: 8px 0 6px;
  font-size: 2rem;
  line-height: 1.15;
  color: var(--text-strong);
}

.hero-card #clockText {
  font-size: 3rem;
  font-weight: 700;
  margin: 8px 0 2px;
  letter-spacing: 0.5px;
  color: var(--text-strong);
}

.quote-card {
  min-height: 150px;
  background: linear-gradient(180deg, #f0a307, #e49500);
  color: #2e1e00;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-author {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.quote {
  color: inherit;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.35;
  margin: 0;
  font-weight: 600;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 5px;
  min-height: 86px;
}

.stat-card span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.stat-card strong {
  font-size: 2rem;
  line-height: 1;
}

.progress-card {
  display: grid;
  gap: 8px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-head span {
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.09em;
  font-size: 0.75rem;
}

.progress-head strong {
  font-size: 0.85rem;
  color: #ffca76;
}

.quick-task-card h4,
.recent-card h4 {
  margin: 0 0 10px;
  color: var(--text-strong);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.quick-task-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.compact-list .list-item {
  padding: 9px 10px;
  border-radius: 10px;
}

.compact-list .list-item strong {
  font-size: 0.92rem;
}

.progress-wrap {
  margin-top: 10px;
  background: #222;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #c78100, #ffb424);
  transition: width 0.25s ease;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #111;
  color: var(--text-strong);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(244, 160, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(244, 160, 0, 0.12);
}

textarea {
  min-height: 210px;
  resize: vertical;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, #ffb326, #e79a00);
  color: #241900;
  font-weight: 600;
}

.btn-secondary {
  background: #1e1e1e;
  color: var(--text-strong);
  border-color: var(--border);
}

.btn-warning {
  background: linear-gradient(180deg, #ffb326, #e79a00);
  color: #241900;
  font-weight: 700;
}

.filters {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.filter-btn {
  border: 1px solid var(--border);
  background: #131313;
  color: var(--text-strong);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--primary-soft);
  color: #ffd89c;
  border-color: rgba(244, 160, 0, 0.32);
}

.list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.list-item {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #121212;
}

.list-item.dragging {
  opacity: 0.5;
}

.task-main {
  display: grid;
  gap: 3px;
}

.meta,
.subtitle,
.note-text {
  color: var(--muted);
  font-size: 0.85rem;
}

.overdue {
  border-left: 4px solid var(--danger);
}

.due-today {
  border-left: 4px solid var(--warning);
}

.task-actions,
.habit-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.notes-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
}

.preview {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  min-height: 120px;
  background: #101010;
}

.focus-overlay {
  margin-top: 14px;
  border: 1px solid rgba(244, 160, 0, 0.4);
  background: linear-gradient(180deg, #18130a, #0f0f0f);
  padding: 22px;
  border-radius: 14px;
  text-align: center;
}

.focus-timer {
  font-size: 2.4rem;
  font-weight: 700;
  margin: 8px 0 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 70;
  backdrop-filter: blur(5px);
}

.modal {
  width: min(460px, 100%);
  background: linear-gradient(180deg, #191919, #121212);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.pin-modal {
  width: min(360px, 100%);
  text-align: center;
}

.qr {
  width: 220px;
  height: 220px;
  object-fit: cover;
  display: block;
  margin: 10px auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 0, rgba(244, 160, 0, 0.15), transparent 28%),
    radial-gradient(circle at 80% 0, rgba(244, 160, 0, 0.1), transparent 25%),
    #0a0a0a;
  padding: 16px;
}

.landing-card {
  width: min(740px, 100%);
  background: linear-gradient(180deg, #171717, #111111);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  color: var(--text-strong);
}

.benefits {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.landing-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.mobile-menu-btn {
  display: none;
  border: 0;
  background: transparent;
  color: #e8e8e8;
  font-size: 1.4rem;
  cursor: pointer;
}

.error-text {
  color: var(--danger);
}

body.theme-light {
  --bg: #f4f5f7;
  --bg-soft: #e7e9ee;
  --panel: #ffffff;
  --panel-2: #f7f8fb;
  --text: #1e2430;
  --text-strong: #111827;
  --muted: #4f5c73;
  --text-inverse: #ffffff;
  --primary: #f09a00;
  --primary-soft: #ffeacc;
  --secondary: #eceff7;
  --border: rgba(0, 0, 0, 0.08);
}

body.theme-light .sidebar {
  background: linear-gradient(180deg, #fefefe, #f7f8fb);
}

body.theme-light .nav-btn {
  color: #1f2937;
}

body.theme-light .nav-btn:hover {
  background: #eceff6;
}

body.theme-light .nav-btn.active {
  background: linear-gradient(90deg, #ffe9c8, #f6e5cb);
  color: #3c2a09;
  border-color: rgba(240, 154, 0, 0.3);
}

body.theme-light .card,
body.theme-light .panel,
body.theme-light .modal,
body.theme-light .list-item,
body.theme-light .preview,
body.theme-light .backup-reminder,
body.theme-light input,
body.theme-light select,
body.theme-light textarea,
body.theme-light .filter-btn,
body.theme-light .btn-secondary {
  background: #fff;
}

body.theme-light .topbar h2,
body.theme-light .hero-card h3,
body.theme-light .hero-card #clockText,
body.theme-light .quick-task-card h4,
body.theme-light .recent-card h4,
body.theme-light .stat-card strong,
body.theme-light .task-main strong,
body.theme-light .list-item strong,
body.theme-light .quote-author {
  color: #111827;
}

body.theme-light .meta,
body.theme-light .note-text,
body.theme-light .subtitle,
body.theme-light .stat-card span {
  color: #55637c;
}

body.theme-light .btn-secondary,
body.theme-light .filter-btn,
body.theme-light input,
body.theme-light select,
body.theme-light textarea {
  color: #111827;
}

body.theme-light .landing {
  background:
    radial-gradient(circle at 20% 0, rgba(240, 154, 0, 0.14), transparent 28%),
    radial-gradient(circle at 80% 0, rgba(240, 154, 0, 0.08), transparent 25%),
    #f3f4f6;
}

body.theme-light .landing-card {
  background: linear-gradient(180deg, #ffffff, #f7f8fb);
  color: #111827;
}

body.theme-dark {
  --bg: #090909;
  --panel: #151515;
  --text: #f5f5f5;
  --muted: #a7a7a7;
  --primary: #f4a000;
  --primary-soft: #3a2a0f;
  --secondary: #252525;
  --border: rgba(255, 255, 255, 0.08);
}

body.theme-minimal {
  --bg: #f7f7f7;
  --panel: #ffffff;
  --text: #181818;
  --muted: #5a5a5a;
  --primary: #111111;
  --primary-soft: #efefef;
  --secondary: #f1f1f1;
  --border: rgba(0, 0, 0, 0.1);
}

body.theme-minimal .btn-primary,
body.theme-minimal .btn-warning {
  background: #111;
  color: #fff;
}

body.theme-neon {
  --bg: #05040b;
  --panel: #101123;
  --text: #d9fff7;
  --muted: #99bfb8;
  --primary: #17ffc8;
  --primary-soft: rgba(23, 255, 200, 0.17);
  --secondary: #1a2140;
  --border: rgba(23, 255, 200, 0.2);
}

body.theme-neon .btn-primary,
body.theme-neon .btn-warning {
  background: linear-gradient(180deg, #17ffc8, #02c698);
  color: #04120f;
}

body.theme-pastel {
  --bg: #fff8fb;
  --panel: #ffffff;
  --text: #5a4c68;
  --muted: #8b7a98;
  --primary: #ff77b4;
  --primary-soft: #ffe5f1;
  --secondary: #fff0f7;
  --border: rgba(255, 119, 180, 0.2);
}

body.theme-pastel .btn-primary,
body.theme-pastel .btn-warning {
  background: linear-gradient(180deg, #ff9fca, #ff77b4);
  color: #4a1232;
}

body.focus-active .sidebar,
body.focus-active .topbar {
  display: none;
}

body.focus-active .main {
  padding: 24px;
}

@media (max-width: 920px) {
  .top-hero-row,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .hero-card #clockText {
    font-size: 2.4rem;
  }

  .quote {
    font-size: 1.2rem;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: -274px;
    top: 0;
    height: 100vh;
    z-index: 60;
    transition: left 0.25s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-menu-btn {
    display: inline-block;
  }
}
