:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --today: #1d4ed8;
  --hour-height: 48px;
  --visible-hours: 18; /* 6am–midnight */
  --header-height: 56px;
  --all-day-min-height: 36px;
  --day-width: 180px;
  --axis-width: 72px;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-md: 0.92rem;
  --text-lg: 1.05rem;
  --text-xl: 1.25rem;
  --text-display: 3.2rem;
  --weight-medium: 600;
  --weight-bold: 700;
  font-family: var(--font);
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  font-family: var(--font);
}

body {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  font-size: var(--text-md);
  line-height: 1.45;
}

.app {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.1rem 0.85rem;
  background: #121a26;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.2rem 0.55rem 0.35rem;
  color: var(--text);
  text-decoration: none;
}

.sidebar-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
}

.sidebar-tag {
  color: var(--muted);
  font-size: var(--text-xs);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-auth {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}


.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-md);
}

.nav-link .icon {
  color: var(--muted);
}

.nav-link:hover .icon,
.nav-link.active .icon {
  color: var(--accent);
}

.nav-link:hover {
  background: var(--surface-2);
}

.nav-link.active {
  background: #1e3a5f;
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: var(--weight-medium);
}

.nav-toggle {
  display: none;
  position: fixed;
  top: 0.55rem;
  right: 0.75rem;
  z-index: 45;
  min-width: 2.7rem;
  padding: 0.28rem 0.45rem 0.32rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-icon {
  font-size: var(--text-xl);
  line-height: 1;
}

.nav-toggle-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.sidebar-backdrop {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.field input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

.icon {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, #152033 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.brand h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
}

.brand h1 .icon {
  width: 1.15em;
  height: 1.15em;
  color: var(--accent);
}

.subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: var(--text-md);
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
}

.btn-primary {
  background: #0ea5e9;
  border-color: #0284c7;
  color: #041018;
  font-weight: var(--weight-medium);
}


.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: #121a26;
}

.range-text {
  font-weight: var(--weight-medium);
  min-width: 16rem;
}

.status {
  color: var(--muted);
  font-size: var(--text-sm);
}

.status.error {
  color: #fca5a5;
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    padding-right: 4rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 44;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 43;
    background: rgba(2, 6, 23, 0.55);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }
}
