:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --text: #172033;
  --muted: #657084;
  --border: #dce3ed;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #dbeafe;
  --success: #047857;
  --success-soft: #d1fae5;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --neutral: #475569;
  --neutral-soft: #e2e8f0;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --shadow: 0 24px 60px rgba(24, 39, 75, 0.12);
  --shadow-soft: 0 12px 30px rgba(24, 39, 75, 0.08);
  --radius: 8px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 360px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  background: rgba(245, 247, 251, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

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

.sync-pill,
.ghost-link,
.mode-badge,
.count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--neutral);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  font-weight: 700;
}

.sync-pill[data-state="saved"] {
  color: var(--success);
  background: var(--success-soft);
  border-color: transparent;
}

.sync-pill[data-state="offline"] {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: transparent;
}

.ghost-link {
  color: var(--primary);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ghost-link:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  background: #ffffff;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: end;
  padding: 50px 0 30px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 5vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-text {
  max-width: 600px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

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

.stat-card,
.scheduler-panel,
.meetings-panel {
  border: 1px solid rgba(220, 227, 237, 0.9);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.stat-card {
  min-height: 118px;
  padding: 18px;
  border-radius: var(--radius);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-label {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  font-size: 2.1rem;
  line-height: 1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.scheduler-panel,
.meetings-panel {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.scheduler-panel {
  position: sticky;
  top: 86px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.mode-badge {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: transparent;
}

form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  color: #263248;
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #9aa4b2;
}

input:hover,
select:hover {
  border-color: #b8c4d4;
}

input:focus,
select:focus,
button:focus-visible,
.ghost-link:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.field-error,
.field-hint {
  min-height: 18px;
  margin: 0;
  font-size: 0.78rem;
}

.field-error {
  color: var(--danger);
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button {
  flex: 1;
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--primary-strong);
}

.secondary-button {
  padding: 0 16px;
  color: var(--neutral);
  background: var(--neutral-soft);
}

.secondary-button:hover {
  transform: translateY(-1px);
  background: #cbd5e1;
}

.meeting-heading {
  align-items: center;
  margin-bottom: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px);
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.search-field,
.filter-group {
  display: grid;
  gap: 8px;
}

.meeting-list {
  display: grid;
  gap: 14px;
}

.meeting-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(24, 39, 75, 0.04);
  animation: cardIn 280ms ease both;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.meeting-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: var(--shadow-soft);
}

.meeting-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.meeting-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.status-confirmed {
  color: var(--success);
  background: var(--success-soft);
}

.status-tentative {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-planning {
  color: var(--neutral);
  background: var(--neutral-soft);
}

.meeting-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  background: var(--surface-soft);
  border-radius: 999px;
}

.participants {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.participants strong {
  color: var(--text);
}

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

.icon-button {
  width: 42px;
  min-height: 42px;
  color: var(--neutral);
  background: var(--surface-soft);
}

.icon-button:hover {
  transform: translateY(-1px);
  color: var(--primary);
  background: var(--primary-soft);
}

.icon-button.delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 52px 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #c5d0df;
  border-radius: var(--radius);
  background: #fbfdff;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 16px;
}

.empty-icon svg {
  width: 30px;
  height: 30px;
}

.empty-state h3 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 1.1rem;
}

.empty-state p {
  max-width: 390px;
  margin: 0;
  line-height: 1.6;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero-section,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .scheduler-panel {
    position: static;
  }

  .stats-grid {
    max-width: 640px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-bottom: 28px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .sync-pill {
    display: none;
  }

  .hero-section {
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(2.15rem, 12vw, 3.4rem);
  }

  .stats-grid,
  .toolbar,
  .form-row {
    grid-template-columns: 1fr;
  }

  .scheduler-panel,
  .meetings-panel {
    padding: 18px;
  }

  .meeting-card {
    grid-template-columns: 1fr;
  }

  .card-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 460px) {
  .brand small,
  .ghost-link {
    display: none;
  }

  .stat-card {
    min-height: auto;
  }

  .section-heading {
    flex-direction: column;
  }

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

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

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