:root {
  color-scheme: dark;
  --bg: #070d1c;
  --panel: rgba(37, 45, 66, 0.72);
  --panel-solid: rgba(42, 51, 74, 0.82);
  --panel-deep: rgba(17, 24, 42, 0.82);
  --text: #f8fafc;
  --muted: #b8c2d8;
  --line: rgba(255, 255, 255, 0.13);
  --blue: #38bdf8;
  --green: #10b981;
  --red: #fb7185;
  --orange: #f59e0b;
  --pink: #ec4899;
  --summer-bg: rgba(245, 158, 11, 0.2);
  --winter-bg: rgba(56, 189, 248, 0.17);
  --note: #c084fc;
  --holiday: #fb923c;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(115deg, rgba(96, 21, 75, 0.78) 0%, rgba(11, 18, 36, 0.92) 38%, rgba(7, 13, 28, 1) 62%, rgba(57, 39, 112, 0.78) 100%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 8px 14px;
  background: #f59e0b;
  color: #111827;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.offline-banner[hidden] {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 24% 18%, rgba(236, 72, 153, 0.22), transparent 34%),
    radial-gradient(circle at 78% 88%, rgba(56, 189, 248, 0.22), transparent 34%),
    rgba(5, 9, 24, 0.72);
  backdrop-filter: blur(22px);
}

.auth-pending .auth-screen,
.auth-locked .auth-screen {
  display: grid;
}

.auth-pending .app-shell,
.auth-locked .app-shell {
  visibility: hidden;
}

.auth-card {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(48, 35, 64, 0.92), rgba(17, 24, 42, 0.94) 54%, rgba(31, 43, 75, 0.9)),
    var(--panel-deep);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.auth-card h1 {
  margin-bottom: 14px;
}

.auth-copy {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-choices {
  display: grid;
  gap: 10px;
}

.auth-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-choice:not(:disabled):hover {
  border-color: rgba(56, 189, 248, 0.48);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.24), rgba(56, 189, 248, 0.16));
}

.auth-choice:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.auth-choice span {
  font-weight: 800;
}

.auth-choice small {
  color: var(--muted);
  font-weight: 700;
}

.auth-status {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: #bfdbfe;
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 6vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.top-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(28, 35, 54, 0.08);
  font-size: 1.35rem;
  line-height: 1;
}

.file-button input {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-card {
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.summary-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.summary-card .period {
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-card .metric {
  margin-top: 14px;
  font-size: 1.9rem;
  font-weight: 800;
}

.summary-card .caption {
  color: var(--muted);
  font-size: 0.82rem;
}

.segmented {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(232, 234, 240, 0.9);
  backdrop-filter: blur(20px);
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segment.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(28, 35, 54, 0.1);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.toolbar {
  justify-content: center;
  margin: 12px 0;
}

#monthTitle {
  min-width: 230px;
  text-align: center;
  text-transform: capitalize;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.period-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.period-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.period-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.period-card-head span,
.period-labels {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.period-track {
  position: relative;
  height: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--summer-bg) 0 41.66%, var(--winter-bg) 41.66% 100%);
}

.period-segment {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 999px;
  background: #20232a;
  opacity: 0.88;
}

.period-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

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

.year-month {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.year-month h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
  text-transform: capitalize;
}

.year-month h3 span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.year-weekdays,
.year-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.year-weekdays span {
  padding: 5px 2px;
  background: #f7f8fb;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  text-align: center;
}

.year-day {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 38px;
  border: 0;
  padding: 4px;
  color: var(--text);
  text-align: left;
}

.year-day.is-empty {
  background: #fafbfe;
}

.year-day.is-summer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 245, 204, 0.96)), var(--summer-bg);
}

.year-day.is-winter {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(233, 243, 255, 0.96)), var(--winter-bg);
}

.year-day.is-non-working {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(251, 146, 60, 0.22)),
    #fff7ed;
}

.year-day.has-note {
  box-shadow: inset 0 0 0 2px rgba(91, 60, 196, 0.46);
}

.year-day.has-holiday {
  box-shadow: inset 0 0 0 2px rgba(194, 65, 12, 0.42);
}

.year-day.has-note.has-holiday {
  box-shadow:
    inset 0 0 0 2px rgba(91, 60, 196, 0.46),
    inset 0 0 0 5px rgba(194, 65, 12, 0.18);
}

.year-day.has-rtt::before,
.year-day.has-leave::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
}

.year-day.has-rtt::before {
  top: 0;
  background: var(--blue);
}

.year-day.has-leave::after {
  bottom: 0;
  background: var(--green);
}

.year-day-number {
  font-size: 0.72rem;
  font-weight: 850;
}

.year-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.year-markers i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.year-markers .note-marker {
  background: var(--note);
}

.year-markers .holiday-marker {
  background: var(--holiday);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-summer {
  background: var(--summer-bg);
  border: 1px solid #d8b94c;
}

.legend-winter {
  background: var(--winter-bg);
  border: 1px solid #8eb8e8;
}

.legend-note {
  background: var(--note);
}

.legend-holiday {
  background: var(--holiday);
}

.legend-rtt {
  background: var(--blue);
}

.legend-leave {
  background: var(--green);
}

.weekday,
.day-cell {
  background: #fff;
}

.weekday {
  padding: 10px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.day-cell {
  min-height: 112px;
  padding: 8px;
  border: 0;
  color: inherit;
  position: relative;
  text-align: left;
}

.day-cell.is-muted {
  color: #a1a7b3;
  opacity: 0.62;
}

.day-cell.is-summer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 245, 204, 0.94)), var(--summer-bg);
}

.day-cell.is-winter {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(233, 243, 255, 0.96)), var(--winter-bg);
}

.day-cell.is-non-working {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(251, 146, 60, 0.24)),
    #fff7ed;
}

.day-cell.is-selecting {
  outline: 3px solid rgba(56, 189, 248, 0.74);
  outline-offset: -4px;
  background:
    linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(56, 189, 248, 0.24)),
    #fff;
}

.day-cell.has-note {
  box-shadow: inset 0 0 0 2px rgba(91, 60, 196, 0.52);
}

.day-cell.has-holiday {
  box-shadow: inset 0 0 0 2px rgba(194, 65, 12, 0.44);
}

.day-cell.has-note.has-holiday {
  box-shadow:
    inset 0 0 0 2px rgba(91, 60, 196, 0.52),
    inset 0 0 0 5px rgba(194, 65, 12, 0.2);
}

.day-cell.has-rtt::before,
.day-cell.has-leave::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
}

.day-cell.has-rtt::before {
  left: 0;
  background: var(--blue);
}

.day-cell.has-leave::after {
  right: 0;
  background: var(--green);
}

.day-number {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
  font-weight: 800;
}

.today-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.day-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 18px;
}

.day-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 850;
}

.note-badge {
  background: var(--note);
}

.holiday-badge {
  background: var(--holiday);
}

.rtt-badge {
  background: var(--blue);
}

.leave-badge {
  background: var(--green);
}

.leave-pill {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 5px 6px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leave-pill.is-rtt-pill {
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

.day-cell:focus-visible,
.leave-pill:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.28);
  outline-offset: -3px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-wide {
  grid-column: span 2;
}

label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fafc;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

textarea {
  min-height: 260px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 122, 255, 0.62);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.toggle {
  display: flex;
  align-items: end;
  gap: 9px;
  color: var(--text);
  padding-bottom: 8px;
}

.toggle input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--blue);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font-weight: 800;
}

.primary-button {
  background: var(--blue);
}

.secondary-button {
  background: #20232a;
}

.danger-button {
  background: var(--red);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.list-header select {
  max-width: 220px;
}

.request-list,
.people-settings {
  display: grid;
  gap: 10px;
}

.request-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.request-color {
  width: 10px;
  height: 48px;
  border-radius: 999px;
}

.request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.person-panel {
  padding: 14px;
}

.person-heading {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  margin-bottom: 12px;
}

.person-name {
  font-size: 1.2rem;
  font-weight: 850;
}

.renewal-row,
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.quota-table {
  display: grid;
  gap: 8px;
}

.quota-row {
  display: grid;
  grid-template-columns: 18px 1fr 110px auto;
  gap: 10px;
  align-items: center;
}

.quota-color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.quota-row input[type="number"] {
  text-align: right;
}

.compact-form {
  padding: 14px;
}

.color-field input {
  padding: 4px;
}

.notes-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.season-settings {
  display: grid;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.season-settings h2 {
  margin: 0;
}

.season-person-block {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.season-person-block h3 {
  margin: 0;
  font-size: 1rem;
}

.season-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.season-exclusions {
  display: grid;
  gap: 10px;
}

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

.check-row {
  display: grid;
  grid-template-columns: 20px 18px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fafc;
  color: var(--text);
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.rule-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.rule-card.is-warning {
  border-left-color: #ff9500;
}

.rule-card strong,
.rule-card span {
  display: block;
}

.rule-card span,
.rule-card p {
  color: var(--muted);
  font-size: 0.82rem;
}

.rule-card p {
  margin: 4px 0 0;
}

.rule-metric {
  margin: 10px 0 4px;
  font-size: 1.65rem;
  font-weight: 850;
}

.session-settings {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.session-item.is-current {
  border-color: rgba(16, 185, 129, 0.55);
}

.session-item span,
.session-item small {
  color: var(--muted);
}

.day-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: min(760px, calc(100vh - 34px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(20, 21, 26, 0.26);
  padding: 0;
}

.day-dialog::backdrop {
  background: rgba(20, 21, 26, 0.28);
  backdrop-filter: blur(8px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.day-dialog-body,
.day-note-form,
.quick-day-form {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.day-note-form {
  grid-template-columns: 1fr auto;
  align-items: end;
  border-top: 1px solid var(--line);
}

.day-note-form textarea {
  min-height: 88px;
}

.quick-day-form {
  grid-template-columns: 1fr 1fr 1.4fr auto auto;
  align-items: end;
  border-top: 1px solid var(--line);
}

.day-request {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

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

.day-note-card {
  padding: 12px;
  border: 1px solid rgba(91, 60, 196, 0.22);
  border-left: 5px solid var(--note);
  border-radius: var(--radius);
  background: #f5f2ff;
}

.day-note-card p {
  margin: 6px 0 0;
  color: #303743;
  white-space: pre-wrap;
}

.holiday-card {
  padding: 12px;
  border: 1px solid rgba(194, 65, 12, 0.22);
  border-left: 5px solid var(--holiday);
  border-radius: var(--radius);
  background: #fff7ed;
}

.holiday-card p {
  margin: 6px 0 0;
  color: #303743;
}

.detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 10px 0 0;
  list-style: none;
}

.detail-list li {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef1f6;
  color: #303743;
  font-size: 0.78rem;
  font-weight: 700;
}

.topbar,
.view.is-active {
  position: relative;
}

h1 {
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  color: #f0abfc;
}

.summary-card,
.panel,
.period-card,
.year-month,
.rule-card,
.season-person-block,
.request-item,
.day-dialog,
.day-request {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    var(--panel);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.summary-card {
  border-top-color: rgba(255, 255, 255, 0.2);
}

.summary-card .metric {
  color: #ffffff;
}

.segmented {
  background: rgba(15, 23, 42, 0.58);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.segment {
  color: #cbd5e1;
}

.segment.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 22px rgba(0, 0, 0, 0.2);
}

.icon-button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.calendar,
.year-weekdays,
.year-days {
  background: rgba(255, 255, 255, 0.1);
}

.weekday,
.year-weekdays span {
  background: rgba(15, 23, 42, 0.84);
  color: #aebbd3;
}

.day-cell,
.year-day {
  color: #f8fafc;
}

.day-cell.is-summer,
.year-day.is-summer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(245, 158, 11, 0.16)),
    rgba(30, 34, 52, 0.9);
}

.day-cell.is-winter,
.year-day.is-winter {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(56, 189, 248, 0.13)),
    rgba(22, 30, 49, 0.94);
}

.year-day.is-empty {
  background: rgba(15, 23, 42, 0.52);
}

.calendar-legend span,
.check-row {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.period-track {
  background:
    linear-gradient(90deg, rgba(14, 165, 233, 0.24) 0 25%, rgba(251, 191, 36, 0.28) 25% 62.5%, rgba(14, 165, 233, 0.24) 62.5% 100%);
}

.period-segment {
  background: linear-gradient(90deg, #facc15 0%, #f472b6 48%, #22d3ee 100%);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.24);
}

input,
select,
textarea {
  background: rgba(15, 23, 42, 0.64);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: rgba(203, 213, 225, 0.55);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.13);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 38px;
  padding: 0 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.primary-button {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
}

.secondary-button {
  background: linear-gradient(135deg, #475569, #1e293b);
}

.danger-button {
  background: linear-gradient(135deg, #fb7185, #e11d48);
}

.rule-card.is-warning {
  border-left-color: var(--orange);
}

.leave-pill,
.day-badge,
.detail-list li {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.detail-list li {
  background: rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
}

.day-note-card {
  background: rgba(88, 28, 135, 0.25);
  border-color: rgba(192, 132, 252, 0.28);
}

.holiday-card {
  background: rgba(154, 52, 18, 0.24);
  border-color: rgba(251, 146, 60, 0.28);
}

.day-note-card p,
.holiday-card p {
  color: #f8fafc;
}

/* Contrast pass + bonus-card inspired accents */
:root {
  --bg: #050918;
  --panel: rgba(28, 36, 58, 0.82);
  --panel-solid: rgba(33, 43, 68, 0.9);
  --panel-deep: rgba(10, 16, 31, 0.9);
  --text: #ffffff;
  --muted: #d5dcee;
  --line: rgba(255, 255, 255, 0.18);
  --blue: #22d3ee;
  --green: #20d39b;
  --red: #fb5c7c;
  --orange: #f59e0b;
  --pink: #f472b6;
  --note: #d8b4fe;
  --holiday: #fb923c;
  --bonus-gradient: linear-gradient(135deg, #facc15 0%, #f472b6 44%, #22d3ee 100%);
  --bonus-glow: 0 0 0 1px rgba(244, 114, 182, 0.25), 0 18px 46px rgba(34, 211, 238, 0.12), 0 26px 70px rgba(0, 0, 0, 0.34);
}

body {
  background:
    radial-gradient(circle at 12% 4%, rgba(244, 114, 182, 0.34), transparent 28%),
    radial-gradient(circle at 88% 78%, rgba(34, 211, 238, 0.2), transparent 32%),
    linear-gradient(120deg, #14071e 0%, #080e1e 42%, #060b19 66%, #1b1640 100%);
}

.app-shell {
  width: min(1240px, calc(100% - 28px));
}

h1,
h2,
.summary-card strong,
.request-item strong,
.rule-card strong,
.period-card-head strong,
.season-person-block h3 {
  color: #ffffff;
}

.summary-card,
.panel,
.period-card,
.year-month,
.rule-card,
.season-person-block,
.request-item,
.day-dialog,
.day-request {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    var(--panel);
  border-color: rgba(255, 255, 255, 0.18);
}

.summary-card:nth-child(odd),
.period-card,
.rule-card {
  position: relative;
  overflow: hidden;
}

.summary-card:nth-child(odd)::before,
.period-card::before,
.rule-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--bonus-gradient);
  opacity: 0.72;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.summary-card .period,
.summary-card .caption,
.request-meta,
.rule-card span,
.rule-card p,
.period-card-head span,
.period-labels,
label {
  color: var(--muted);
}

.segmented {
  background: rgba(7, 12, 27, 0.76);
  border-color: rgba(255, 255, 255, 0.2);
}

.segment {
  color: #dbeafe;
}

.segment.is-active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    rgba(34, 211, 238, 0.08);
  box-shadow: var(--bonus-glow);
}

.icon-button {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
}

.calendar,
.year-month {
  border-color: rgba(255, 255, 255, 0.2);
}

.weekday,
.year-weekdays span {
  background: rgba(8, 13, 29, 0.94);
  color: #e2e8f0;
}

.day-cell.is-summer,
.year-day.is-summer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(245, 158, 11, 0.24)),
    #1b2032;
}

.day-cell.is-winter,
.year-day.is-winter {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(34, 211, 238, 0.2)),
    #121b31;
}

.day-cell.is-non-working,
.year-day.is-non-working {
  background:
    linear-gradient(180deg, rgba(251, 146, 60, 0.18), rgba(194, 65, 12, 0.32)),
    #1f1720;
}

.day-cell.is-muted {
  opacity: 0.5;
}

.day-badge,
.leave-pill,
.detail-list li {
  color: #ffffff;
}

.calendar-legend span,
.check-row {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #edf2ff;
}

input,
select,
textarea {
  background: rgba(5, 10, 24, 0.72);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.primary-button {
  background: linear-gradient(135deg, #22d3ee, #7c3aed);
}

.secondary-button {
  background: linear-gradient(135deg, #334155, #111827);
}

.rule-card.is-warning {
  border-left-color: #facc15;
}

.rule-card.is-warning::before {
  background: linear-gradient(135deg, #facc15 0%, #fb923c 42%, #f472b6 100%);
}

.day-note-card {
  background:
    linear-gradient(180deg, rgba(216, 180, 254, 0.18), rgba(34, 211, 238, 0.08)),
    rgba(17, 24, 39, 0.76);
  box-shadow: var(--bonus-glow);
}

body.theme-light {
  color-scheme: light;
  --bg: #eef3fb;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: rgba(255, 255, 255, 0.9);
  --panel-deep: rgba(248, 250, 252, 0.92);
  --text: #101827;
  --muted: #526179;
  --line: rgba(15, 23, 42, 0.12);
  --blue: #0284c7;
  --green: #059669;
  --red: #e11d48;
  --orange: #d97706;
  --pink: #db2777;
  --note: #7c3aed;
  --holiday: #ea580c;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.13);
  --bonus-glow: 0 0 0 1px rgba(219, 39, 119, 0.14), 0 18px 44px rgba(2, 132, 199, 0.1), 0 24px 60px rgba(15, 23, 42, 0.12);
  background:
    radial-gradient(circle at 12% 4%, rgba(244, 114, 182, 0.22), transparent 28%),
    radial-gradient(circle at 88% 78%, rgba(34, 211, 238, 0.18), transparent 32%),
    linear-gradient(120deg, #fdf2f8 0%, #eef6ff 42%, #f8fafc 68%, #eef2ff 100%);
}

body.theme-light h1,
body.theme-light h2,
body.theme-light .summary-card strong,
body.theme-light .request-item strong,
body.theme-light .rule-card strong,
body.theme-light .period-card-head strong,
body.theme-light .season-person-block h3 {
  color: #0f172a;
}

body.theme-light .eyebrow {
  color: #be185d;
}

body.theme-light .summary-card,
body.theme-light .panel,
body.theme-light .period-card,
body.theme-light .year-month,
body.theme-light .rule-card,
body.theme-light .season-person-block,
body.theme-light .request-item,
body.theme-light .day-dialog,
body.theme-light .day-request {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68)),
    var(--panel);
  border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .summary-card .metric,
body.theme-light .segment.is-active,
body.theme-light .icon-button {
  color: #0f172a;
}

body.theme-light .segmented {
  background: rgba(226, 232, 240, 0.74);
  border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .segment {
  color: #475569;
}

body.theme-light .segment.is-active {
  background: rgba(255, 255, 255, 0.86);
}

body.theme-light .icon-button,
body.theme-light .calendar-legend span,
body.theme-light .check-row {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 23, 42, 0.13);
}

body.theme-light .weekday,
body.theme-light .year-weekdays span {
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
}

body.theme-light .day-cell,
body.theme-light .year-day {
  color: #0f172a;
}

body.theme-light .day-cell.is-summer,
body.theme-light .year-day.is-summer {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(251, 191, 36, 0.28)),
    #fff7ed;
}

body.theme-light .day-cell.is-winter,
body.theme-light .year-day.is-winter {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(14, 165, 233, 0.2)),
    #eff6ff;
}

body.theme-light .day-cell.is-non-working,
body.theme-light .year-day.is-non-working {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(251, 146, 60, 0.24)),
    #fff7ed;
}

body.theme-light .year-day.is-empty {
  background: rgba(248, 250, 252, 0.72);
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}

body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
  color: rgba(71, 85, 105, 0.58);
}

body.theme-light .detail-list li {
  background: rgba(15, 23, 42, 0.08);
  color: #1e293b;
}

body.theme-light .day-note-card {
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.12), rgba(2, 132, 199, 0.07)),
    rgba(255, 255, 255, 0.86);
}

body.theme-light .holiday-card {
  background: rgba(255, 247, 237, 0.9);
}

body.theme-light .day-note-card p,
body.theme-light .holiday-card p {
  color: #1e293b;
}

@media (max-width: 860px) {
  .summary-grid,
  .rules-grid,
  .period-overview,
  .season-settings-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .field-wide {
    grid-column: span 2;
  }

  .day-cell {
    min-height: 92px;
    padding: 6px;
  }

  .quick-day-form {
    grid-template-columns: 1fr 1fr;
  }

  .day-note-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 14px;
  }

  .topbar {
    align-items: end;
  }

  .summary-grid,
  .rules-grid,
  .season-settings-grid,
  .exclusion-list,
  .form-grid,
  .person-heading,
  .renewal-row,
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: span 1;
  }

  .segmented {
    grid-template-columns: repeat(2, 1fr);
    position: static;
  }

  .period-overview,
  .year-grid {
    grid-template-columns: 1fr;
  }

  .year-day {
    min-height: 34px;
  }

  .weekday {
    padding: 8px 2px;
    font-size: 0.68rem;
  }

  .day-cell {
    min-height: 76px;
  }

  .leave-pill {
    padding: 4px;
    font-size: 0.64rem;
  }

  .request-item,
  .quota-row {
    grid-template-columns: 8px 1fr auto;
  }

  .quick-day-form {
    grid-template-columns: 1fr;
  }

  .quota-row input[type="number"] {
    grid-column: 2 / 4;
  }
}
