:root {
  --navy: #1B2A4A;
  --navy-dark: #121C33;
  --navy-light: #2C3E63;
  --navy-ultra-light: #EEF2F8;
  --gold: #C89B3C;
  --gold-light: #E4C878;
  --gold-soft: #FBF6EA;
  --green: #215E43;
  --green-light: #E4F2E9;
  --red: #B3382C;
  --red-light: #FDECEB;
  --bg: #F5F5F3;
  --card: #FFFFFF;
  --border: #E1E0DA;
  --border-light: #EDEDE8;
  --text: #22262E;
  --text-muted: #6B7078;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(27,42,74,0.06);
  --shadow-md: 0 4px 16px rgba(27,42,74,0.08);
  --shadow-lg: 0 8px 30px rgba(27,42,74,0.12);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.screen { min-height: 100vh; }

/* ---------- Central Login Page Styles ---------- */
body.auth-page {
  background: radial-gradient(circle at top right, #2C3E63 0%, #1B2A4A 45%, #121C33 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 50%, var(--green) 100%);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(27,42,74,0.15);
}

.auth-header h1 {
  font-size: 24px;
  color: var(--navy);
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.auth-badge {
  display: inline-block;
  background: var(--navy-ultra-light);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 999px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 42px 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,42,74,0.12);
}

.input-icon {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.toggle-pass-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  color: var(--text-muted);
  border-radius: 4px;
}

.toggle-pass-btn:hover {
  color: var(--navy);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-muted);
}

.auth-submit-btn {
  margin-top: 6px;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
}

.auth-submit-btn:hover {
  background: var(--navy-light);
}

.auth-submit-btn:active {
  transform: scale(0.98);
}

.alert-banner {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.alert-banner.info {
  background: var(--green-light);
  border: 1px solid #C3E5CE;
  color: var(--green);
}

.alert-banner.warning {
  background: var(--gold-soft);
  border: 1px solid var(--gold-light);
  color: #78520A;
}

.alert-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-icon {
  font-size: 18px;
  line-height: 1;
}

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

.error-banner {
  background: var(--red-light);
  color: var(--red);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 0;
  text-align: left;
  border: 1px solid #F5C6CB;
}

.success-banner {
  background: var(--green-light);
  color: var(--green);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 0;
  text-align: left;
  border: 1px solid #C3E5CE;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.auth-footer p { margin: 0 0 8px; }

.auth-quick-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-quick-links a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
}

.auth-quick-links a:hover {
  text-decoration: underline;
}

.dot-separator { color: var(--border); }

/* ---------- Unified Top Navigation Bar ---------- */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.nav-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.muted-small {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.nav-tabs {
  display: flex;
  align-items: center;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--navy);
}

.nav-tab.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(27,42,74,0.1);
}

.tab-icon { font-size: 15px; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  background: var(--navy-ultra-light);
  padding: 6px 12px;
  border-radius: 999px;
  display: none;
}

@media (min-width: 720px) {
  .user-badge { display: inline-flex; align-items: center; gap: 4px; }
}

.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.icon-btn:hover {
  background: var(--bg);
}

/* ---------- Status Pill ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}

.pill .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pill-synced { background: var(--green-light); color: var(--green); }
.pill-synced .dot { background: var(--green); }
.pill-offline { background: var(--gold-soft); color: #8A5A0A; }
.pill-offline .dot { background: var(--gold); }
.pill-syncing { background: var(--navy-ultra-light); color: var(--navy); }
.pill-syncing .dot { background: var(--navy); }

.pill-ongoing {
  background: #FFE8E8;
  color: var(--red);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  animation: pulse 1.5s infinite;
}

.pill-today {
  background: var(--gold-soft);
  color: #8A5A0A;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.pill-future {
  background: var(--navy-ultra-light);
  color: var(--navy);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* ---------- Upcoming Page Layout ---------- */
.upcoming-page .content-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Spotlight Hero Card ---------- */
.spotlight-card {
  background: linear-gradient(135deg, #1B2A4A 0%, #2C3E63 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.spotlight-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(200,155,60,0.15) 0%, rgba(200,155,60,0) 70%);
  pointer-events: none;
}

.spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gold-light);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 0 0 rgba(228,200,120,0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(228,200,120,0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(228,200,120,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(228,200,120,0); }
}

.spotlight-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 680px) {
  .spotlight-body {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

.spotlight-title {
  font-size: 22px;
  margin: 0 0 10px;
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
}

.spotlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
}

.meta-item { display: inline-flex; align-items: center; gap: 5px; }

.spotlight-notes {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin: 8px 0 0;
  line-height: 1.4;
  border-left: 2px solid var(--gold);
  padding-left: 10px;
}

/* Countdown Clock Widget */
.countdown-widget {
  background: rgba(18, 28, 51, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
}

.countdown-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 8px;
}

.countdown-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.clock-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.clock-num {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 6px 4px;
  width: 100%;
}

.clock-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}

.clock-colon {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}

.spotlight-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ---------- Stats & Ribbon ---------- */
.stats-ribbon {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 680px) {
  .stats-ribbon {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 1;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.upcoming-icon { background: var(--navy-ultra-light); color: var(--navy); }
.today-icon { background: var(--gold-soft); color: #8A5A0A; }
.timers-icon { background: var(--green-light); color: var(--green); }

.stat-details { display: flex; flex-direction: column; }
.stat-number { font-size: 18px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

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

.btn-sound-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-sound-toggle:hover {
  background: var(--bg);
  border-color: var(--navy);
}

.btn-create-event {
  background: var(--navy);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(27,42,74,0.18);
  transition: background 0.15s, transform 0.1s;
}

.btn-create-event:hover { background: var(--navy-light); }
.btn-create-event:active { transform: scale(0.98); }
.btn-plus { font-size: 16px; font-weight: 700; }

/* ---------- Controls Panel (Filters + Search) ---------- */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 640px) {
  .controls-panel {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.chip:hover {
  color: var(--navy);
  border-color: var(--navy);
}

.chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  padding: 8px 32px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,42,74,0.1);
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}

/* ---------- Timeline & Event Groups ---------- */
.events-timeline {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.event-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
}

.group-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.2px;
}

.group-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Event Cards */
.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}

.event-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.event-color-bar {
  width: 6px;
  background: var(--event-color, var(--navy));
  flex-shrink: 0;
}

.event-card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.event-time-col {
  display: flex;
  flex-direction: column;
}

.event-time-main {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.event-date-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.event-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.countdown-badge {
  background: var(--navy-ultra-light);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  border: 1px solid #D6E0EE;
}

.timer-badge {
  background: var(--gold-soft);
  color: #8A5A0A;
  border: 1px solid var(--gold-light);
}

.badge-ongoing {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #F5C6CB;
  animation: pulse 1.5s infinite;
}

.event-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 2px 0 0;
  line-height: 1.35;
}

.event-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-icon { font-size: 14px; }

.event-notes-snippet {
  background: var(--bg);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.4;
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.action-link-btn {
  background: none;
  border: none;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-link-btn:hover {
  background: var(--navy-ultra-light);
}

.card-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-text-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.icon-text-btn:hover {
  background: var(--bg);
}

.icon-text-btn.danger {
  color: var(--red);
  border-color: #F5C6CB;
}

.icon-text-btn.danger:hover {
  background: var(--red-light);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon { font-size: 44px; margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 6px; color: var(--navy); font-size: 18px; }
.empty-state p { margin: 0 0 20px; }

/* Loading State */
.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.spinner-large {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18,28,51,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  width: 100%;
  max-width: 520px;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -4px 32px rgba(27,42,74,0.2);
}

@media (min-width: 560px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius-lg); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h2 {
  font-size: 18px;
  color: var(--navy);
  margin: 0;
  font-weight: 700;
}

.modal-x-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-x-btn:hover { color: var(--navy); }

#event-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.field-label-inline {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  margin-right: 6px;
}

#event-form input[type="text"],
#event-form input[type="datetime-local"],
#event-form input[type="number"],
#event-form select,
#event-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s;
}

#event-form input:focus,
#event-form select:focus,
#event-form textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,42,74,0.1);
}

.row { display: flex; gap: 12px; }
.row label, .row .form-field { flex: 1; }
.items-center { align-items: center; justify-content: space-between; }

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

/* Color Picker */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-options {
  display: flex;
  gap: 6px;
}

.color-option {
  cursor: pointer;
  position: relative;
  display: inline-block;
}

.color-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-dot {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}

.color-option input:checked + .color-dot {
  transform: scale(1.15);
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--c);
}

/* Timer Configuration Card */
.timer-config-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.timer-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timer-config-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
  font-size: 14px;
}

.timer-icon { font-size: 16px; }

.timer-options {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timer-features-hints {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider { background-color: var(--navy); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.modal-actions-right { display: flex; gap: 8px; margin-left: auto; }

.primary-btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.primary-btn:hover { background: var(--navy-light); }

.btn-sm {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-sm.primary {
  background: var(--gold);
  color: var(--navy);
}

.btn-sm.secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}

.btn-sm.outline {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}

/* ---------- Alarm Banner / Modal ---------- */
.alarm-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-dark);
  color: #fff;
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 90%;
  max-width: 500px;
  animation: slide-up 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slide-up {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.alarm-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alarm-icon-pulse {
  font-size: 26px;
  animation: alarm-shake 0.8s infinite;
}

@keyframes alarm-shake {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(-15deg); }
  40%, 80% { transform: rotate(15deg); }
}

.alarm-heading {
  font-size: 11px;
  color: var(--gold-light);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.alarm-title {
  font-size: 15px;
  font-weight: 700;
  margin: 1px 0;
}

.alarm-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}

.alarm-btn.primary {
  background: var(--gold);
  color: var(--navy-dark);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

/* Floating add button */
.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  border: none;
  font-size: 28px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(27,42,74,0.25);
  cursor: pointer;
  line-height: 1;
  z-index: 40;
}

.fab:active { transform: scale(0.96); }

/* FullCalendar Customizations */
#calendar { padding: 16px 16px 90px; max-width: 900px; margin: 0 auto; }
.fc { font-family: inherit; }
.fc-toolbar-title { font-size: 16px !important; color: var(--navy); font-weight: 700; }
.fc-button-primary {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
}
.fc-button-primary:hover { background: var(--navy-light) !important; }
.fc-daygrid-day-number { color: var(--text); font-size: 13px; }
.fc-day-today { background: var(--gold-soft) !important; }
.fc-event {
  border: none;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ---------- Missing Utility Classes ---------- */

/* Text Button (Cancel, Delete in modals) */
.text-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.text-btn:hover {
  color: var(--navy);
  background: var(--bg);
}

.text-btn.danger {
  color: var(--red);
}

.text-btn.danger:hover {
  background: var(--red-light);
  color: var(--red);
}

/* Form Select (Timer Preset Dropdown) */
.form-select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  background: #fff;
  appearance: auto;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,42,74,0.1);
}

/* Error Text (inline form errors) */
.error-text {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  padding: 8px 12px;
  background: var(--red-light);
  border-radius: var(--radius-sm);
  border: 1px solid #F5C6CB;
}

/* Muted Text Utilities */
.muted {
  color: var(--text-muted);
  font-size: 14px;
}

/* Status Indicator (spotlight header) */
.status-indicator {
  display: flex;
  align-items: center;
}

/* Hint Items (timer features hints) */
.hint-item {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Notes Text truncation in event cards */
.notes-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Setup Form Actions (login page split layout) */
.form-actions-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

/* Spinner inline in buttons */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Pulse animation (used by ongoing pills and badges) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---------- Responsive Navigation ---------- */

/* On small screens, stack nav vertically and hide tab labels */
@media (max-width: 639px) {
  .app-nav {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .nav-tab {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .brand-section { gap: 8px; }
  .nav-logo { width: 30px; height: 30px; }
  .nav-title { font-size: 15px; }

  /* Stats grid: 3 columns still but tighter */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .stat-card {
    padding: 10px;
    gap: 6px;
  }

  .stat-icon-wrap {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .stat-number { font-size: 15px; }
  .stat-label { font-size: 10px; }

  /* Ribbon actions wrap */
  .ribbon-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Search box full width */
  .search-box {
    min-width: 0;
    width: 100%;
  }

  /* Event card footer stacks on narrow screens */
  .event-card-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-right-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Spotlight body stacks */
  .spotlight-card { padding: 16px; }
  .spotlight-title { font-size: 18px; }
  .clock-num { font-size: 20px; }

  /* FAB */
  .fab { width: 50px; height: 50px; font-size: 24px; right: 16px; bottom: 16px; }

  /* Modal full width */
  .modal { padding: 18px; }
  .row { flex-direction: column; gap: 10px; }

  /* Alarm banner */
  .alarm-banner {
    width: 95%;
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* Hide FAB on desktop when the inline button is visible */
@media (min-width: 640px) {
  #fab-add-btn {
    display: none;
  }
}

/* Tab label hidden on mid-small screens for compactness */
@media (max-width: 479px) {
  .tab-label { display: none; }
  .nav-tab { padding: 8px 12px; }
  .tab-icon { font-size: 18px; }
}

/* ---------- Calendar Navigation Toolbar ---------- */
.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.cal-nav-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.cal-nav-btn:hover {
  background: var(--navy-light);
  transform: scale(1.05);
}
.cal-nav-btn:active {
  transform: scale(0.95);
}

.cal-select {
  background: var(--navy-ultra-light);
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231B2A4A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.cal-select:hover, .cal-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.1);
}

.cal-today-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.cal-today-btn:hover {
  background: var(--gold-light);
  box-shadow: 0 2px 8px rgba(200, 155, 60, 0.3);
  transform: translateY(-1px);
}
.cal-today-btn:active {
  transform: translateY(0);
}

@media (max-width: 479px) {
  .calendar-toolbar {
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
  }
  .cal-select {
    padding: 6px 10px;
    font-size: 13px;
    padding-right: 26px;
  }
}
