:root {
  --bg: #050b14;
  --surface: #0b1625;
  --surface-2: #101f32;
  --surface-3: #162940;
  --text: #ffffff;
  --muted: #91a0b5;
  --blue: #238cff;
  --blue-dark: #1265c4;
  --green: #35d58a;
  --orange: #ffb454;
  --red: #ff5c72;
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(
      circle at 90% 0%,
      rgba(20, 77, 130, 0.45),
      transparent 34%
    ),
    radial-gradient(
      circle at 0% 50%,
      rgba(14, 48, 82, 0.2),
      transparent 30%
    ),
    var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.topbar {
  width: 100%;
  max-width: 1180px;
  margin: auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 1px;
}

.brand span {
  color: var(--blue);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 13px;
}

.connection-status {
  font-size: 12px;
  font-weight: bold;
}

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

.connection-status.offline {
  color: var(--orange);
}

.icon-button {
  width: 43px;
  height: 43px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
}

.page-container {
  width: 100%;
  max-width: 1180px;
  margin: auto;
  padding: 35px 24px 70px;
}

.hero-section {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 32px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-section h1 {
  font-size: clamp(34px, 5vw, 61px);
  line-height: 1.06;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
}

.hero-section h1 span {
  color: #7ebcff;
}

.hero-description {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-date-card {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hero-date-icon {
  font-size: 27px;
}

.hero-date-card strong,
.hero-date-card small {
  display: block;
}

.hero-date-card strong {
  margin-bottom: 5px;
}

.hero-date-card small {
  color: var(--muted);
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 19px;
  background: rgba(11, 22, 37, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 21px;
  font-weight: bold;
}

.stat-icon.blue {
  background: rgba(35, 140, 255, 0.14);
  color: var(--blue);
}

.stat-icon.orange {
  background: rgba(255, 180, 84, 0.14);
  color: var(--orange);
}

.stat-icon.green {
  background: rgba(53, 213, 138, 0.14);
  color: var(--green);
}

.stat-icon.red {
  background: rgba(255, 92, 114, 0.14);
  color: var(--red);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.stat-card strong {
  display: block;
  font-size: 28px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 35px;
}

.primary-button,
.secondary-button {
  border: none;
  border-radius: 13px;
  padding: 14px 18px;
  font-weight: bold;
  transition: 0.2s ease;
}

.primary-button {
  color: white;
  background: linear-gradient(
    135deg,
    var(--blue),
    var(--blue-dark)
  );
  box-shadow: 0 9px 25px rgba(35, 140, 255, 0.18);
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.primary-button span {
  font-size: 20px;
  margin-right: 5px;
}

.secondary-button {
  color: white;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.toolbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search-box {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.search-box span {
  color: var(--muted);
  font-size: 23px;
}

.search-box input {
  min-width: 0;
  border: none;
  padding: 13px 0;
  background: transparent;
}

input,
textarea,
select {
  width: 100%;
  color: white;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #66788f;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
}

#filterSelect {
  width: auto;
  min-width: 145px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.section-title-row h2 {
  font-size: 25px;
  margin-bottom: 6px;
}

.section-title-row p {
  color: var(--muted);
  font-size: 13px;
}

.total-badge {
  color: #b8c9dd;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 12px;
  font-size: 12px;
}

.reminders-list {
  display: grid;
  gap: 13px;
}

.reminder-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 19px;
  background: rgba(11, 22, 37, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.13);
}

.reminder-card.completed {
  opacity: 0.55;
}

.reminder-card.completed .reminder-title {
  text-decoration: line-through;
}

.reminder-main {
  min-width: 0;
  flex: 1;
}

.reminder-title {
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}

.reminder-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  margin-bottom: 12px;
}

.reminder-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-tag {
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--surface-3);
  color: #bfd0e5;
  font-size: 12px;
}

.meta-tag.overdue {
  color: var(--red);
}

.meta-tag.completed-tag {
  color: var(--green);
}

.reminder-actions {
  display: flex;
  gap: 7px;
}

.action-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  background: var(--surface-3);
}

.action-button.delete {
  color: var(--red);
}

.empty-state {
  padding: 55px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 45px;
  margin-bottom: 14px;
}

.empty-state h3 {
  color: white;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.78);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 530px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 25px;
  background: #0a1626;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.modal-header h2 {
  font-size: 25px;
}

.close-button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  color: white;
  background: var(--surface-3);
  font-size: 25px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  color: #c7d5e6;
  font-size: 13px;
  margin-bottom: 8px;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c7d5e6;
  font-size: 13px;
  margin-top: 10px;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.full-button {
  width: 100%;
  margin-top: 24px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  z-index: 200;
  max-width: calc(100% - 40px);
  padding: 13px 17px;
  border-radius: 12px;
  color: white;
  background: #172b43;
  box-shadow: var(--shadow);
  transform: translate(-50%, 120px);
  transition: transform 0.25s ease;
  text-align: center;
  font-size: 14px;
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-section {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-date-card {
    min-width: 100%;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-tools {
    width: 100%;
  }

  .search-box {
    flex: 1;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 18px 15px;
  }

  .page-container {
    padding: 20px 15px 55px;
  }

  .brand {
    font-size: 23px;
  }

  .connection-status {
    font-size: 10px;
  }

  .hero-section h1 {
    font-size: 37px;
  }

  .stats-grid {
    gap: 9px;
  }

  .stat-card {
    padding: 13px;
    gap: 9px;
  }

  .stat-icon {
    width: 37px;
    height: 37px;
    font-size: 17px;
  }

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

  .stat-card span {
    font-size: 11px;
  }

  .toolbar-tools {
    align-items: stretch;
    flex-direction: column;
  }

  #filterSelect {
    width: 100%;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .reminder-card {
    padding: 14px;
  }

  .reminder-actions {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}