:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #23323a;
  --muted: #667579;
  --line: #d9e3df;
  --strong-line: #bed5ce;
  --accent: #227c9d;
  --accent-dark: #23323a;
  --accent-hover: #1a6c87;
  --accent-contrast: #ffffff;
  --aqua: #86e3df;
  --aqua-soft: #c8f6f3;
  --gradient-start: #d8f7f4;
  --gradient-end: #f4f3f0;
  --sheet-ink: #23323a;
  --sheet-muted: #5f6b7b;
  --sheet-soft: #e9fbf8;
  --sheet-soft-2: #f6fbfa;
  --sheet-line: #d7d0c3;
  --sheet-status-soft: #eaf7f1;
  --sheet-status-warm: #fff6e2;
  --status-weekend-bg: #f5f0e7;
  --status-weekend-text: #778395;
  --status-vacation-bg: #dcf5e8;
  --status-vacation-text: #166b4b;
  --status-vacation-line: #1c9a67;
  --status-sick-bg: #fff0ce;
  --status-sick-text: #8a5608;
  --status-sick-line: #d19518;
  --status-holiday-bg: #ffe8eb;
  --status-holiday-text: #a9344a;
  --status-holiday-line: #e45468;
  --status-rest-bg: #f3eadb;
  --status-rest-text: #765836;
  --status-rest-line: #b18446;
  --status-transferred-bg: #eaf7fb;
  --status-transferred-text: #1b6f89;
  --status-transferred-line: #227c9d;
  --mint: #227c9d;
  --gold: #d7a528;
  --rose: #e45468;
  --paper: #ffffff;
  --shadow: 0 14px 34px rgba(35, 50, 58, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(180deg, var(--gradient-start) 0 255px, var(--gradient-end) 255px),
    var(--bg);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(520px, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 1420px;
  margin: 0 auto;
}

.app-donation-note {
  max-width: 1420px;
  margin: 20px auto 0;
  border-top: 1px solid rgba(35, 50, 58, 0.16);
  color: var(--muted);
  padding: 16px 4px 0;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.app-donation-note strong {
  color: var(--accent-dark);
  font-weight: 900;
}

.seo-landing,
.seo-update,
.seo-faq {
  background: #ffffff;
  padding: 42px 28px 0;
}

.seo-faq {
  padding-bottom: 48px;
}

.seo-landing-inner,
.seo-content-inner {
  max-width: 960px;
  margin: 0 auto;
  border-top: 1px solid rgba(35, 50, 58, 0.14);
  color: var(--ink);
  padding-top: 28px;
}

.seo-landing h2,
.seo-update h2,
.seo-faq h2 {
  color: var(--accent-dark);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
}

.seo-landing h3 {
  margin-top: 24px;
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 900;
}

.seo-landing p {
  max-width: 820px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.seo-landing ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  max-width: 860px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 14px;
}

.seo-landing li::marker {
  color: var(--accent);
}

.seo-update h2 {
  font-size: 18px;
}

.seo-update p,
.seo-faq p {
  max-width: 820px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq-list details {
  border-bottom: 1px solid rgba(35, 50, 58, 0.14);
  padding: 0 0 12px;
}

.faq-list summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 900;
  list-style-position: outside;
}

.faq-list summary:focus-visible {
  outline: 3px solid rgba(23, 107, 135, 0.18);
  outline-offset: 4px;
}

.faq-list p {
  margin-top: 8px;
}

.left-column,
.right-column {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.brand-row {
  display: grid;
  grid-template-columns: 142px 1fr;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  display: flex;
  min-height: 42px;
  align-items: center;
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

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

h1 {
  color: var(--accent-dark);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
}

.brand-row p,
.panel-heading p,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--strong-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.14);
}

.field-grid,
.button-row {
  display: grid;
  gap: 12px;
}

.field-grid {
  grid-template-columns: 1fr 1fr;
}

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

.button-row {
  grid-template-columns: 1.2fr 0.9fr;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.primary-button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.secondary-button {
  border: 1px solid var(--accent);
  background: var(--sheet-soft-2);
  color: var(--accent-dark);
}

.ghost-button {
  border: 1px solid var(--strong-line);
  background: #ffffff;
  color: #33445e;
}

.compact-button {
  min-height: 44px;
  padding: 0 14px;
}

.status-line,
.source-note {
  color: var(--muted);
  font-size: 12px;
}

.calendar-panel {
  padding: 18px;
}

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

.panel-heading h2 {
  font-size: 19px;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.weekday-row {
  margin-bottom: 8px;
}

.weekday-row span {
  color: #6d7a8c;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.day-empty,
.day-cell {
  aspect-ratio: 1 / 1;
  min-height: 58px;
}

.day-cell {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.day-cell.is-workday:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.10);
}

.day-cell.is-weekend {
  background: var(--status-weekend-bg);
  border-color: #e4d8c7;
  color: var(--status-weekend-text);
}

.day-cell.is-holiday,
.day-cell.is-rest {
  background: var(--status-holiday-bg);
  border-color: #efc8ce;
  color: var(--status-holiday-text);
}

.day-cell.is-rest {
  background: var(--status-rest-bg);
  border-color: #dac5a7;
  color: var(--status-rest-text);
}

.day-cell.is-sick {
  background: var(--status-sick-bg);
  border-color: var(--status-sick-line);
  color: var(--status-sick-text);
  box-shadow: inset 0 0 0 2px rgba(209, 149, 24, 0.34);
}

.day-cell.is-transferred {
  background: var(--status-transferred-bg);
  border-color: var(--status-transferred-line);
  color: var(--status-transferred-text);
}

.day-cell.is-vacation {
  background: var(--status-vacation-bg);
  border-color: var(--status-vacation-line);
  color: var(--status-vacation-text);
  box-shadow: inset 0 0 0 2px rgba(28, 154, 103, 0.34);
}

.day-number {
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.day-name {
  align-self: end;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.day-marker {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 21px;
  text-align: center;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.legend-dot.vacation {
  background: var(--status-vacation-line);
}

.legend-dot.sick {
  background: var(--status-sick-line);
}

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

.legend-dot.rest {
  background: var(--status-rest-line);
}

.legend-dot.transferred {
  background: var(--status-transferred-line);
}

.override-panel {
  padding: 16px 18px;
}

summary {
  color: #29384f;
  font-weight: 800;
  outline: none;
}

.override-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.override-form .field:nth-child(3),
.override-form .secondary-button {
  grid-column: span 2;
}

.custom-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.custom-item {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: #34435a;
  font-size: 13px;
}

.custom-item button {
  border: 0;
  background: transparent;
  color: var(--rose);
  font-weight: 800;
}

.long-weekend-panel {
  padding: 16px 18px;
}

.long-weekend-panel h2 {
  margin-bottom: 12px;
  font-size: 17px;
}

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

.long-weekend-item {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 2px 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.long-weekend-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.long-weekend-item strong {
  grid-row: span 2;
  color: var(--accent-dark);
  font-size: 13px;
}

.long-weekend-item span {
  color: #28384f;
  font-size: 13px;
  font-weight: 800;
}

.long-weekend-item small {
  color: var(--muted);
  font-size: 12px;
}

.sheet {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sheet-line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--sheet-ink);
  box-shadow: var(--shadow);
}

.sheet-header {
  display: block;
  min-height: 132px;
  border-bottom: 1px solid var(--sheet-line);
  background:
    linear-gradient(90deg, var(--sheet-soft), #ffffff 72%),
    #ffffff;
  padding: 28px 32px;
}

.sheet-kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sheet-header h2 {
  margin-top: 6px;
  font-size: 34px;
  line-height: 1.08;
}

.sheet-header p {
  color: var(--sheet-muted);
}

.employer-line {
  margin-top: 8px;
  color: var(--sheet-ink) !important;
  font-weight: 800;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--sheet-line);
  background: linear-gradient(90deg, #ffffff, var(--sheet-soft-2));
}

.summary-item {
  display: grid;
  gap: 2px;
  border-right: 1px solid var(--sheet-line);
  padding: 16px 18px;
}

.summary-item:last-child {
  border-right: 0;
}

.summary-number {
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.summary-label {
  color: var(--sheet-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sheet-table th,
.sheet-table td {
  border-bottom: 1px solid var(--sheet-line);
  padding: 9px 14px;
  text-align: left;
}

.sheet-table th {
  background: var(--sheet-soft-2);
  color: var(--sheet-ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sheet-table th:first-child,
.sheet-table td:first-child {
  width: 64px;
  font-weight: 900;
}

.sheet-table th:nth-child(2),
.sheet-table td:nth-child(2) {
  width: 116px;
}

.sheet-table th:nth-child(3),
.sheet-table td:nth-child(3) {
  width: 104px;
  font-weight: 850;
}

.sheet-table th:nth-child(4),
.sheet-table td:nth-child(4) {
  width: 66px;
  font-weight: 900;
}

.sheet-table th:last-child,
.sheet-table td:last-child {
  width: 104px;
  font-weight: 850;
}

.row-muted {
  color: var(--status-weekend-text);
  background: var(--sheet-soft-2);
}

.row-weekend {
  color: var(--status-weekend-text);
  background: var(--status-weekend-bg);
}

.row-holiday {
  color: var(--status-holiday-text);
  background: var(--status-holiday-bg);
}

.row-rest {
  color: var(--status-rest-text);
  background: var(--status-rest-bg);
}

.row-vacation {
  color: var(--status-vacation-text);
  background: var(--status-vacation-bg);
}

.row-sick {
  color: var(--status-sick-text);
  background: var(--status-sick-bg);
}

.row-transferred {
  color: var(--status-transferred-text);
  background: var(--status-transferred-bg);
}

.row-weekend td:first-child {
  border-left: 5px solid #d4c6b2;
}

.row-holiday td:first-child {
  border-left: 5px solid var(--status-holiday-line);
}

.row-rest td:first-child {
  border-left: 5px solid var(--status-rest-line);
}

.row-vacation td:first-child {
  border-left: 5px solid var(--status-vacation-line);
}

.row-sick td:first-child {
  border-left: 5px solid var(--status-sick-line);
}

.row-transferred td:first-child {
  border-left: 5px solid var(--status-transferred-line);
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-weight: 850;
  white-space: nowrap;
}

.status-text::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.status-work {
  color: var(--sheet-ink);
}

.status-work::before {
  display: none;
}

.sheet-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
  padding: 34px 32px 30px;
}

.sheet-footer div {
  border-top: 1px solid var(--sheet-muted);
  padding-top: 8px;
  color: var(--sheet-muted);
  font-size: 12px;
  text-align: center;
}

.pdf-exporting .sheet {
  width: 794px;
  max-width: 794px;
  height: 1123px;
  padding: 30px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.pdf-exporting .sheet::before {
  content: "";
  position: absolute;
  inset: 30px;
  border: 1px solid var(--sheet-line);
  pointer-events: none;
}

.pdf-exporting .sheet > * {
  position: relative;
  z-index: 1;
}

.pdf-exporting .sheet-header {
  min-height: 134px;
  padding: 22px 24px;
}

.pdf-exporting .sheet-header h2 {
  margin-top: 5px;
  font-size: 29px;
}

.pdf-exporting .sheet-header p {
  font-size: 12px;
}

.pdf-exporting .employer-line {
  margin-top: 8px;
}

.pdf-exporting .summary-item {
  padding: 12px 14px;
}

.pdf-exporting .summary-number {
  font-size: 22px;
}

.pdf-exporting .summary-label {
  font-size: 10px;
}

.pdf-exporting .sheet-table {
  font-size: 9.6px;
}

.pdf-exporting .sheet-table th,
.pdf-exporting .sheet-table td {
  padding: 6px 9px;
  line-height: 1.16;
}

.pdf-exporting .sheet-table th {
  font-size: 9px;
}

.pdf-exporting .sheet-table th:first-child,
.pdf-exporting .sheet-table td:first-child {
  width: 48px;
}

.pdf-exporting .row-weekend td:first-child,
.pdf-exporting .row-holiday td:first-child,
.pdf-exporting .row-rest td:first-child,
.pdf-exporting .row-vacation td:first-child,
.pdf-exporting .row-sick td:first-child,
.pdf-exporting .row-transferred td:first-child {
  border-left-width: 4px;
}

.pdf-exporting .status-text {
  gap: 4px;
}

.pdf-exporting .status-text::before {
  width: 5px;
  height: 5px;
}

.pdf-exporting .sheet-table th:nth-child(2),
.pdf-exporting .sheet-table td:nth-child(2) {
  width: 98px;
}

.pdf-exporting .sheet-table th:nth-child(3),
.pdf-exporting .sheet-table td:nth-child(3) {
  width: 88px;
}

.pdf-exporting .sheet-table th:nth-child(4),
.pdf-exporting .sheet-table td:nth-child(4) {
  width: 48px;
}

.pdf-exporting .sheet-table th:last-child,
.pdf-exporting .sheet-table td:last-child {
  width: 84px;
}

.pdf-exporting .sheet-footer {
  gap: 32px;
  padding: 20px 28px 18px;
}

.pdf-exporting .sheet-footer div {
  padding-top: 6px;
  font-size: 10px;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .right-column {
    order: 2;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .controls,
  .calendar-panel {
    padding: 16px;
  }

  .brand-row {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    min-height: 30px;
  }

  .seo-landing,
  .seo-update,
  .seo-faq {
    padding: 30px 16px 0;
  }

  .seo-faq {
    padding-bottom: 36px;
  }

  .seo-landing h2,
  .seo-update h2,
  .seo-faq h2 {
    font-size: 24px;
  }

  .seo-update h2 {
    font-size: 18px;
  }

  .seo-landing ul {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .button-row,
  .override-form,
  .summary-grid,
  .sheet-footer {
    grid-template-columns: 1fr;
  }

  .override-form .field:nth-child(3),
  .override-form .secondary-button {
    grid-column: auto;
  }

  .day-empty,
  .day-cell {
    min-height: 46px;
  }

  .day-cell {
    padding: 6px;
  }

  .day-number {
    font-size: 17px;
  }

  .day-marker {
    min-width: 20px;
    line-height: 18px;
    font-size: 10px;
  }

  .sheet {
    overflow-x: auto;
  }

  .sheet-header {
    padding: 22px;
  }

  .sheet-header h2 {
    font-size: 28px;
  }

  .summary-item {
    border-right: 0;
    border-bottom: 1px solid #ded6c7;
  }
}

@page {
  size: A4;
  margin: 11mm;
}

@media print {
  :root {
    --paper: #ffffff;
  }

  html,
  body {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
  }

  body {
    color: #111827;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .screen-only {
    display: none !important;
  }

  .app-shell {
    min-height: auto;
    padding: 0;
    background: #ffffff;
  }

  .workspace {
    display: block;
    max-width: none;
    margin: 0;
  }

  .left-column {
    display: none;
  }

  .right-column {
    display: block;
  }

  .sheet {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sheet-header {
    min-height: 0;
    padding: 0 0 8mm;
    background: #ffffff;
  }

  .sheet-header h2 {
    font-size: 24pt;
  }

  .summary-grid {
    page-break-inside: avoid;
  }

  .summary-item {
    padding: 4mm;
  }

  .summary-number {
    font-size: 20pt;
  }

  .sheet-table {
    font-size: 9.5pt;
  }

  .sheet-table th,
  .sheet-table td {
    padding: 2.2mm 3mm;
  }

  .sheet-footer {
    padding: 14mm 0 0;
  }
}
