:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar: #1e293b;
  --sidebar-ink: #cbd5e1;
  --sidebar-active: #0ea5e9;
  --accent: #0ea5e9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 2rem;
}
.brand img { border-radius: 8px; background: #fff; padding: 4px; }
.nav-menu { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.nav-menu a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  color: var(--sidebar-ink);
  text-decoration: none;
  border-radius: 8px;
  font-size: .95rem;
  transition: background .15s;
}
.nav-menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-menu a.active { background: var(--sidebar-active); color: #fff; }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; }
.user-chip { display: flex; align-items: center; gap: .5rem; color: #fff; font-size: .9rem; margin-bottom: .5rem; }
.logout-link { color: var(--sidebar-ink); text-decoration: none; font-size: .85rem; }
.logout-link:hover { color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-weight: 600; font-size: 1.05rem; }
.btn-burger { background: none; border: 0; font-size: 1.4rem; padding: 0; color: var(--ink); }

.content { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 50;
}

@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 100;
    transition: left .2s;
  }
  body.sidebar-open .sidebar { left: 0; }
  body.sidebar-open .sidebar-overlay { display: block; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.card .card-body { padding: 1.25rem; }

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--accent);
}
.hero-label { color: var(--muted); text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; font-weight: 600; }
.hero-date { font-size: 1.5rem; font-weight: 700; margin: .25rem 0 .75rem; }
.hero-status { font-size: 1.5rem; display: flex; align-items: center; gap: .75rem; }
.hero-warn { margin-top: .75rem; padding: .5rem .75rem; background: #fef3c7; color: #92400e; border-radius: 8px; font-size: .9rem; display: inline-flex; align-items: center; gap: .5rem; }
@media (max-width: 700px) {
  .hero-card { grid-template-columns: 1fr; }
}

.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: middle;
}
.dot-x { background: linear-gradient(135deg, #fbbf24, #f97316); }

.calendar-wrap { margin-bottom: 1.5rem; }
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.calendar-title { margin: 0; font-size: 1.4rem; text-transform: capitalize; }

.calendar-legend {
  display: flex;
  gap: 1.25rem;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.calendar-legend .dot { width: 10px; height: 10px; margin-right: .25rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  text-align: center;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .5rem 0;
}
.cal-day {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .5rem;
  text-decoration: none;
  color: var(--ink);
  font-size: .85rem;
  position: relative;
  border: 2px solid transparent;
  transition: transform .1s;
}
.cal-day:hover { transform: scale(1.03); z-index: 2; }
.cal-day.out { opacity: .35; }
.cal-day.today { border-color: var(--ink); }
.cal-day.p-mama { background: #e0f2fe; color: #075985; }
.cal-day.p-papa { background: #ffedd5; color: #9a3412; }
.cal-day.is-exc::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}
.cal-num { font-weight: 700; font-size: 1.1rem; }
.cal-chg { position: absolute; bottom: 4px; right: 4px; font-size: .7rem; color: rgba(0,0,0,.4); }
.cal-day.is-sun { box-shadow: inset 0 -4px 0 rgba(245,158,11,.4); }

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  border-left: 6px solid var(--accent);
}
.result-date { color: var(--muted); text-transform: capitalize; font-size: .95rem; }
.result-big {
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .5rem 0;
}
.result-big .dot { width: 18px; height: 18px; }
.result-sub { color: var(--muted); }
.result-note {
  background: #fef3c7;
  border-radius: 8px;
  padding: .75rem;
  margin-top: 1rem;
  color: #92400e;
}
.result-warn { margin-top: .75rem; padding: .5rem .75rem; background: #fef3c7; color: #92400e; border-radius: 8px; font-size: .9rem; display: inline-flex; align-items: center; gap: .5rem; }
.result-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.auth-body {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-card {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand img { border-radius: 12px; background: #f1f5f9; padding: 8px; margin-bottom: .5rem; }
.auth-title { font-size: 1.75rem; font-weight: 700; }
.auth-subtitle { color: var(--muted); font-size: .9rem; }
.auth-form .form-label { font-size: .85rem; color: var(--muted); }

.alert { border-radius: 10px; border: none; }
