:root {
  --brand-navy: #001d3d;
  --brand-blue: #0071ff;
  --brand-orange: #ff9933;
  --brand-mint: #00c49a;
  --team-header-height: 92px;
  --team-row-height: 56px;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --border: rgba(0, 29, 61, 0.1);
  --text: #11243d;
  --muted: #60718a;
  --shadow: 0 24px 70px rgba(0, 29, 61, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 113, 255, 0.12), transparent 32%),
    radial-gradient(circle at right 20%, rgba(255, 153, 51, 0.2), transparent 28%),
    linear-gradient(180deg, #f4f7fc 0%, #edf2f9 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar,
.page-shell,
.login-shell,
.centered-shell {
  width: min(90vw, 1800px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand__logo,
.login-hero__logo,
.error-logo {
  width: 52px;
  height: auto;
}

.brand__copy,
.topbar__user,
.identity-chip,
.directory-item,
.team-card,
.day-card,
.login-panel__meta {
  display: flex;
  flex-direction: column;
}

.brand__copy strong,
.topbar__user span,
.hero-card h1,
.panel h2,
.login-panel h2,
.glass-card h1 {
  font-weight: 700;
}

.brand__copy small,
.topbar__user small,
.identity-chip span,
.identity-chip small,
.directory-item span,
.directory-item small,
.team-card span,
.team-card small,
.empty-state,
.day-card__empty,
.login-panel__meta span {
  color: var(--muted);
}

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

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover,
.mini-button:hover {
  transform: translateY(-1px);
}

.button--primary {
  color: white;
  background: linear-gradient(135deg, var(--brand-blue), #2b8cff);
  box-shadow: 0 16px 35px rgba(0, 113, 255, 0.28);
}

.button--ghost {
  border-color: rgba(0, 29, 61, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.button--full {
  width: 100%;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
}

.login-shell {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  min-height: calc(100vh - 24px);
  gap: 28px;
  padding: 12px 0 24px;
}

.login-hero,
.glass-card,
.panel,
.hero-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.login-hero {
  min-height: 720px;
  padding: 44px;
  border-radius: 36px;
  background:
    linear-gradient(120deg, rgba(0, 29, 61, 0.9), rgba(0, 29, 61, 0.35)),
    url("/assets/hero-street.png") center/cover no-repeat;
  color: white;
}

.login-hero__content {
  max-width: 620px;
}

.login-hero__content h1 {
  margin: 0 0 18px;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 0.98;
}

.login-hero__text {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
  line-height: 1.7;
}

.login-hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.login-hero__pills span,
.status-pill,
.mini-button {
  border-radius: 999px;
}

.login-hero__pills span {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
}

.login-panel {
  display: flex;
  align-items: center;
}

.glass-card {
  width: 100%;
  padding: 36px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
}

.glass-card--narrow {
  max-width: 420px;
}

.login-panel__meta {
  gap: 6px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.centered-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.page-shell {
  padding: 12px 0 32px;
}

.hero-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(0, 29, 61, 1) 0%, rgba(0, 113, 255, 0.92) 100%);
  color: white;
}

.hero-card--compact {
  margin-bottom: 24px;
}

.hero-card p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.8);
}

.hero-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  min-width: min(100%, 390px);
}

.hero-card__stats article {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-card__stats strong {
  display: block;
  font-size: 1.9rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.96fr);
  gap: 24px;
  margin-top: 24px;
}

.dashboard-grid--single {
  grid-template-columns: 1fr;
}

.tabs-shell {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.tabs-nav {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  width: fit-content;
  box-shadow: var(--shadow);
}

.tab-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.tab-link.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));
}

.month-switcher {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.month-switcher strong {
  min-width: 180px;
  text-align: center;
  text-transform: lowercase;
}

.month-switcher--inline {
  display: inline-flex;
  gap: 10px;
}

.stack {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 24px;
  border-radius: 28px;
  background: var(--surface);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel__header--tight {
  align-items: end;
}

.inline-form,
.bulk-form,
.admin-form,
.pattern-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  grid-template-columns: repeat(3, minmax(120px, auto));
  align-items: end;
}

.inline-form--compact {
  grid-template-columns: repeat(2, minmax(140px, auto));
}

.team-filter {
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(180px, auto) auto;
  gap: 12px;
  align-items: end;
}

.team-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

label span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(0, 29, 61, 0.12);
  border-radius: 16px;
  background: white;
}

.identity-chip {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(0, 113, 255, 0.08);
}

.calendar {
  display: grid;
  gap: 12px;
}

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

.calendar__weekdays {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.day-card {
  min-height: 156px;
  padding: 14px;
  border-radius: 22px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.day-card.is-muted {
  opacity: 0.45;
}

.day-card.is-today {
  border-color: rgba(0, 113, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 255, 0.18);
}

.day-card.has-plan {
  background: linear-gradient(180deg, white 0%, rgba(0, 113, 255, 0.04) 100%);
}

.day-card.is-blocked {
  background: linear-gradient(180deg, rgba(96, 113, 138, 0.08) 0%, rgba(96, 113, 138, 0.03) 100%);
}

.day-card.is-absence {
  background:
    linear-gradient(180deg, rgba(0, 29, 61, 0.08) 0%, rgba(0, 113, 255, 0.06) 100%),
    var(--surface-strong);
  border-color: rgba(0, 113, 255, 0.16);
}

.day-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-pill--office {
  color: #8a4f00;
  background: rgba(255, 153, 51, 0.18);
}

.status-pill--remote {
  color: #005d49;
  background: rgba(0, 196, 154, 0.16);
}

.status-pill--absence {
  color: white;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));
}

.day-card__actions {
  display: grid;
  gap: 8px;
}

.day-card__badge {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 14px;
  font-size: 0.76rem;
  font-weight: 700;
}

.day-card__badge--holiday {
  color: #7a2b00;
  background: rgba(255, 153, 51, 0.2);
}

.day-card__badge--weekend {
  color: var(--muted);
  background: rgba(96, 113, 138, 0.12);
}

.mini-button {
  min-height: 34px;
  border: 0;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-button--office {
  color: #8a4f00;
  background: rgba(255, 153, 51, 0.18);
}

.mini-button--remote {
  color: #005d49;
  background: rgba(0, 196, 154, 0.18);
}

.mini-button--clear {
  color: var(--muted);
  background: rgba(96, 113, 138, 0.12);
}

.team-list,
.directory-list,
.admin-grid {
  display: grid;
  gap: 14px;
}

.team-panel {
  padding: 18px;
}

.team-board {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 245, 255, 0.92));
  color: var(--text);
  border: 1px solid rgba(0, 29, 61, 0.08);
}

.team-board__people {
  padding: 0;
  background: linear-gradient(180deg, rgba(0, 29, 61, 0.98), rgba(0, 113, 255, 0.92));
  color: white;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.team-board__summary {
  height: var(--team-header-height);
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.team-board__summary strong {
  font-size: 1.15rem;
}

.team-board__summary span {
  color: rgba(255, 255, 255, 0.78);
}

.person-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  height: var(--team-row-height);
  padding: 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.person-row.is-current {
  background: rgba(255, 255, 255, 0.12);
}

.person-copy strong,
.person-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.person-copy span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.84rem;
  margin-top: 3px;
}

.person-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 700;
  color: white;
}

.avatar-tone-0 { background: #8c1d40; }
.avatar-tone-1 { background: #935d00; }
.avatar-tone-2 { background: #6c4cff; }
.avatar-tone-3 { background: #005b8f; }
.avatar-tone-4 { background: #0f766e; }
.avatar-tone-5 { background: #9a3412; }
.avatar-tone-6 { background: #374151; }
.avatar-tone-7 { background: #7e22ce; }

.team-board__grid {
  overflow-x: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 245, 255, 0.82));
}

.timeline-header,
.timeline-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(38px, 1fr);
}

.timeline-day,
.timeline-cell {
  border-left: 1px solid rgba(0, 29, 61, 0.08);
  border-top: 1px solid rgba(0, 29, 61, 0.08);
}

.timeline-day {
  position: relative;
  height: var(--team-header-height);
  padding: 12px 6px 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.timeline-day.is-blocked {
  background: rgba(96, 113, 138, 0.12);
}

.timeline-day.is-today {
  box-shadow: inset 2px 0 0 var(--brand-blue);
}

.timeline-day__week,
.timeline-day__weekday,
.timeline-day__number {
  display: block;
  text-align: center;
}

.timeline-day__week,
.timeline-day__weekday {
  color: var(--muted);
  font-size: 0.74rem;
}

.timeline-day__number {
  margin-top: 6px;
  font-weight: 700;
}

.timeline-cell {
  display: grid;
  place-items: center;
  height: var(--team-row-height);
  background: rgba(255, 255, 255, 0.74);
  color: transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.timeline-cell.is-blocked {
  background: rgba(96, 113, 138, 0.14);
}

.timeline-cell.is-office {
  background: rgba(255, 153, 51, 0.78);
  color: #2a1600;
}

.timeline-cell.is-remote {
  background: rgba(0, 196, 154, 0.78);
  color: #032c23;
}

.timeline-cell.is-absence {
  background: linear-gradient(135deg, rgba(0, 29, 61, 0.94), rgba(0, 113, 255, 0.84));
  color: white;
}

.timeline-row.is-current .timeline-cell {
  box-shadow: inset 0 1px 0 rgba(0, 113, 255, 0.18), inset 0 -1px 0 rgba(0, 113, 255, 0.18);
}

.team-card,
.directory-item {
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
}

.team-card__meta,
.directory-item__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.bulk-form {
  grid-template-columns: minmax(260px, 360px) minmax(320px, 460px) minmax(180px, 240px);
  align-items: start;
}

.pattern-form {
  grid-template-columns: minmax(260px, 360px) minmax(320px, 460px) minmax(0, 1fr);
  align-items: start;
}

.range-mode-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0, 113, 255, 0.06);
  border: 1px solid var(--border);
}

.range-mode-picker > span {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.range-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.range-mode-option span {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
}

.range-mode-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.range-fields {
  display: grid;
  gap: 14px;
}

.range-fields--period {
  grid-template-columns: repeat(2, minmax(180px, 220px));
}

.range-fields--month {
  grid-template-columns: minmax(180px, 220px);
}

.is-hidden {
  display: none !important;
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.pattern-picker {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(0, 113, 255, 0.08), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(0, 29, 61, 0.08);
}

.pattern-picker__header strong,
.pattern-picker__header span {
  display: block;
}

.pattern-picker__header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pattern-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1.3fr) repeat(2, minmax(120px, 1fr));
  gap: 10px 12px;
  align-items: center;
}

.pattern-grid__head {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.pattern-day {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  font-weight: 700;
}

.pattern-choice {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(0, 29, 61, 0.12);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
}

.pattern-choice input {
  display: none;
}

.pattern-choice span {
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 29, 61, 0.18);
}

.pattern-choice--office input:checked + span {
  background: var(--brand-orange);
  border-color: #d67f1f;
  box-shadow: 0 0 0 5px rgba(255, 153, 51, 0.18);
}

.pattern-choice--remote input:checked + span {
  background: var(--brand-mint);
  border-color: #0d9677;
  box-shadow: 0 0 0 5px rgba(0, 196, 154, 0.18);
}

.employee-search-form {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) minmax(180px, 220px) auto;
  gap: 14px;
  align-items: end;
}

.employee-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.employee-search-result {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.employee-search-result:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 29, 61, 0.08);
}

.employee-search-result.is-selected {
  border-color: rgba(0, 113, 255, 0.34);
  background: linear-gradient(180deg, rgba(0, 113, 255, 0.1), rgba(255, 255, 255, 0.92));
}

.employee-search-result span {
  color: var(--muted);
  font-size: 0.9rem;
}

.weekday-picker {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0, 113, 255, 0.06);
  border: 1px solid var(--border);
}

.weekday-picker span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.weekday-picker label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.weekday-picker input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form {
  margin-top: 18px;
}

@media (max-width: 1080px) {
  .login-shell,
  .dashboard-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .bulk-form,
  .pattern-form,
  .employee-search-form,
  .pattern-grid,
  .hero-card__stats {
    grid-template-columns: 1fr;
  }

  .hero-card {
    align-items: start;
    flex-direction: column;
  }

  .team-board {
    grid-template-columns: 1fr;
  }

  .team-board__people {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .team-toolbar,
  .form-actions {
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar__actions,
  .panel__header {
    flex-direction: column;
  }

  .calendar__weekdays,
  .calendar__week {
    gap: 8px;
  }

  .day-card {
    min-height: 132px;
    padding: 12px;
  }

  .login-hero {
    min-height: 520px;
    padding: 30px;
  }

  .login-hero__content h1 {
    font-size: 2.5rem;
  }
}
