:root {
  --bg0: #0c1419;
  --bg1: #132028;
  --bg2: #1a2c36;
  --panel: rgba(22, 38, 46, 0.88);
  --line: rgba(214, 228, 220, 0.12);
  --text: #e8f0ea;
  --muted: #8fa39a;
  --accent: #3d9b78;
  --accent-2: #c4a35a;
  --ss: #6b8fd4;
  --fb: #d4844a;
  --danger: #d46464;
  --ok: #5cb88a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 155, 120, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(196, 163, 90, 0.12), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #0a1217);
  color: var(--text);
  font-family: var(--font);
}

body {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.login-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

.login-title {
  margin: 8px 0 6px;
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.login-hint {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 20, 25, 0.72);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-wrap {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-width: 180px;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.clock-block {
  display: flex;
  flex-direction: column;
}

.clock {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.date-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab.active {
  color: var(--text);
  background: rgba(61, 155, 120, 0.18);
  border-color: rgba(61, 155, 120, 0.35);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.main {
  flex: 1;
  padding: 20px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

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

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

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 400;
}

.section-head p,
.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.primary-btn,
.ghost-btn,
.text-btn,
.danger-btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary-btn {
  background: var(--accent);
  color: #04110c;
}

.primary-btn:hover {
  filter: brightness(1.08);
}

.primary-btn.wide {
  width: 100%;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--line);
}

.danger-btn {
  background: rgba(212, 100, 100, 0.15);
  color: #f0b4b4;
  border-color: rgba(212, 100, 100, 0.35);
}

.text-btn {
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid transparent;
}

.item:hover {
  border-color: var(--line);
}

.item.done .item-title {
  text-decoration: line-through;
  color: var(--muted);
}

.item-check {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-title {
  margin: 0;
  font-weight: 560;
  line-height: 1.35;
}

.item-meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge.general {
  background: rgba(143, 163, 154, 0.18);
  color: #c5d4cc;
}

.badge.sunday-school {
  background: rgba(107, 143, 212, 0.2);
  color: #b7caf0;
}

.badge.football {
  background: rgba(212, 132, 74, 0.2);
  color: #f0c4a0;
}

.badge.pending {
  background: rgba(196, 163, 90, 0.2);
  color: #e6d19a;
}

.badge.processed {
  background: rgba(92, 184, 138, 0.18);
  color: #a8e0c0;
}

.badge.ignored {
  background: rgba(143, 163, 154, 0.12);
  color: var(--muted);
}

.empty-hint {
  color: var(--muted);
  padding: 18px 4px;
  font-size: 0.95rem;
}

.event-chip {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 3px solid var(--accent);
}

.event-time {
  min-width: 72px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.event-title {
  margin: 0;
  font-weight: 560;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal-day {
  min-height: 110px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  padding: 8px;
}

.cal-day.today {
  border-color: rgba(61, 155, 120, 0.55);
  background: rgba(61, 155, 120, 0.08);
}

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.cal-day.today .cal-day-num {
  color: var(--accent);
}

.cal-event {
  font-size: 0.72rem;
  padding: 3px 5px;
  border-radius: 5px;
  margin-bottom: 3px;
  background: rgba(61, 155, 120, 0.22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
}

.note-card + .note-card {
  margin-top: 8px;
}

.note-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.note-card p {
  margin: 0;
  white-space: pre-wrap;
  color: #d5e2da;
  line-height: 1.45;
  font-size: 0.92rem;
}

.inbox-raw {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.status-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.dot.on {
  background: var(--ok);
}

.dot.off {
  background: var(--danger);
}

.compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px;
  }

  .brand {
    font-size: 1.5rem;
  }

  .cal-grid {
    grid-template-columns: 1fr;
  }

  .cal-day {
    min-height: auto;
  }
}
