/* ── スプレッドシート ── */
.sheet-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.sheet-header .staff-name { font-size: 20px; font-weight: 700; }
.sheet-header .staff-info { font-size: 11px; color: var(--ink-mute); }
.sheet-header-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.sheet-month-pill {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 6px 16px;
  box-shadow: 2px 2px 0 rgba(43,42,39,.08);
}
.sheet-month-label {
  font-weight: 700;
  font-size: 14px;
}

.sheet-toolbar {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 rgba(43,42,39,.08);
  padding: 10px 14px;
  margin-bottom: 10px;
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.summary-mini { }
.summary-mini .lbl { font-size: 10px; color: var(--ink-mute); }
.summary-mini .val { font-family: "Consolas", "SF Mono", "Menlo", monospace; font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 700; }
.summary-mini .unit-sm { font-size: 11px; color: var(--ink-mute); margin-left: 2px; }
.summary-mini .val.value-alert,
.summary-mini .unit-sm.value-alert { color: var(--bad); }
.toolbar-divider { width: 1px; height: 30px; background: var(--line); }
.sheet-summary-row {
  display: flex;
  gap: 18px;
  align-items: center;
}
.sheet-action-row {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.sheet-message {
  font-size: 11px;
  color: var(--ink-mute);
}

.legend-bar {
  background: var(--paper-warm);
  border: 1.3px dashed var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 10px;
  display: flex; gap: 14px; flex-wrap: wrap;
  align-items: center; font-size: 11px;
}
.legend-bar .legend-title { font-weight: 600; }
.legend-bar .lg-item { display: inline-flex; align-items: center; gap: 4px; }
.legend-bar .lg-sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1.2px solid var(--ink); }
.legend-bar .lg-sw-rounded { background: var(--ok-soft); border-color: var(--ok); }
.legend-bar .lg-sw-missing { background: var(--bad-soft); border-color: var(--bad); }
.legend-help {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--ink-mute);
  font-size: 11px;
}
.kbd {
  padding: 1px 6px; background: #fff;
  border: 1px solid var(--ink); border-radius: 3px;
  font-family: "Consolas", "SF Mono", "Menlo", monospace; font-variant-numeric: tabular-nums;
  font-size: 10px;
  box-shadow: 1px 1px 0 var(--ink);
  margin: 0 2px;
}

.sheet-scroll {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 rgba(43,42,39,.08);
  overflow: hidden;
}
.sheet-scroll-inner { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 240px); }
table.sheet { border-collapse: collapse; font-size: 12px; white-space: nowrap; width: 100%; table-layout: auto; }
table.sheet.hide-secondary .add-secondary { display: none; }
table.sheet td.c-edit { font-family: "Consolas", "SF Mono", "Menlo", monospace; font-variant-numeric: tabular-nums; text-align: center; }
table.sheet td.c-edit[data-field="note"] { font-family: inherit; text-align: left; }
table.sheet thead tr { background: var(--paper-warm); }
table.sheet th {
  padding: 6px 8px; font-size: 11px; font-weight: 600;
  color: var(--ink-soft); text-align: center;
  border-bottom: 1.5px solid var(--ink);
  border-right: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 2;
  background: var(--paper-warm);
}
table.sheet th.h-time { background: var(--sky-soft); }
table.sheet th.h-work { background: var(--accent-soft); }
table.sheet th.h-add { background: var(--ok-soft); }
table.sheet th.h-sub { font-size: 10px; font-weight: 400; color: var(--ink-mute); }
table.sheet th.h-sub-edit { font-size: 10px; color: var(--ok); background: var(--ok-soft); font-weight: 600; }
table.sheet td {
  padding: 5px 8px; font-size: 12px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  height: 26px; text-align: center;
}
table.sheet td.c-fix {
  position: sticky; left: 0; z-index: 1;
  font-weight: 700; text-align: center;
  background: var(--paper-warm);
  border-right: 1.5px solid var(--ink);
}
table.sheet td.c-fix2 {
  position: sticky; left: 38px; z-index: 1;
  text-align: center; font-weight: 600;
  background: var(--paper-warm);
}
table.sheet td.c-orig { background: #f5f1e9; color: var(--ink-mute); font-size: 11px; }
table.sheet td.c-edit { background: #fff; cursor: cell; outline: none; }
table.sheet td.c-ro { background: var(--accent-soft); font-weight: 700; }
table.sheet td.c-act {
  outline: 2px solid var(--accent); outline-offset: -2px;
  position: relative; overflow: visible; z-index: 3;
}
table.sheet td.c-fill { background: var(--accent-soft); outline: 1.5px dashed var(--accent); outline-offset: -1.5px; }
table.sheet td.c-sel  { background: var(--accent-soft); }
table.sheet td.c-rounded { background: var(--ok-soft); }
table.sheet td.c-missing  { background: var(--bad-soft); }
table.sheet tr.r-summary td {
  background: var(--paper-warm); font-weight: 700;
  border-top: 2px solid var(--ink); font-size: 12px;
}
table.sheet td.c-act::after {
  content: ''; position: absolute;
  width: 8px; height: 8px;
  background: var(--accent); border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px var(--ink);
  bottom: -4px; right: -4px;
  pointer-events: none;
}
.badge-mini {
  display: inline-block;
  padding: 0 4px; font-size: 9px; font-weight: 700;
  background: var(--ok-soft); color: var(--ok);
  border: 1px solid var(--ok); border-radius: 2px;
  margin-left: 3px;
}
.badge-tedo {
  display: inline-block;
  padding: 0 4px; font-size: 9px; font-weight: 700;
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid var(--warn); border-radius: 2px;
  margin-left: 3px;
}
table.sheet td select.svc-sel {
  width: 100%; border: none; background: transparent;
  font-size: 11px; outline: none; padding: 0;
  cursor: pointer; font-family: inherit;
}

.sheet-print-area {
  display: none;
}

.sheet-print-cell-value {
  display: inline-block;
  min-width: 1em;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 5mm;
  }

  @page sheet-print-compact {
    size: A4 portrait;
    margin: 5mm;
  }

  @page sheet-print-expanded {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    background: #fff;
    color: #000;
  }

  .sidebar-shell,
  .login-overlay,
  .modal-bg,
  .confirm-bg,
  .app-notification-region,
  .save-bar,
  .page:not(.page-sheet),
  .sheet-picker-wrap,
  .sheet-header,
  .sheet-toolbar,
  .legend-bar,
  .sheet-scroll,
  .extras-section {
    display: none;
  }

  .main-shell {
    display: block;
    margin: 0;
    width: auto;
    max-width: none;
    min-height: 0;
  }

  .page-sheet,
  .page-sheet.active {
    display: block;
    padding: 0;
  }

  .sheet-print-area {
    display: block;
    font-family: "Yu Gothic", "Meiryo", sans-serif;
  }

  .sheet-print-area--compact {
    page: sheet-print-compact;
  }

  .sheet-print-area--expanded {
    page: sheet-print-expanded;
  }

  .sheet-print-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6mm;
    border-bottom: 1.5px solid #111;
    padding-bottom: 3mm;
  }

  .sheet-print-head h1 {
    margin: 0 0 2mm;
    font-size: 16pt;
    line-height: 1.2;
  }

  .sheet-print-subtitle,
  .sheet-print-generated {
    font-size: 8pt;
    color: #333;
  }

  .sheet-print-generated {
    white-space: nowrap;
    text-align: right;
  }

  .sheet-print-meta,
  .sheet-print-summary {
    display: grid;
    gap: 2mm;
    margin-bottom: 4mm;
  }

  .sheet-print-meta {
    grid-template-columns: 1.2fr 1.5fr .7fr;
  }

  .sheet-print-summary {
    grid-template-columns: repeat(5, 1fr);
  }

  .sheet-print-meta div,
  .sheet-print-summary div {
    border: 1px solid #555;
    padding: 2mm 2.5mm;
    min-height: 10mm;
  }

  .sheet-print-meta span,
  .sheet-print-summary span {
    display: block;
    margin-bottom: 1mm;
    font-size: 6.5pt;
    color: #555;
  }

  .sheet-print-meta strong,
  .sheet-print-summary strong {
    display: block;
    font-size: 9pt;
    line-height: 1.25;
  }

  .sheet-print-meta small {
    display: block;
    margin-top: 1mm;
    font-size: 7pt;
    color: #333;
  }

  .sheet-print-table-wrap {
    overflow: visible;
  }

  table.sheet.sheet-print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    white-space: normal;
    font-size: 6.4pt;
  }

  table.sheet.sheet-print-table th,
  table.sheet.sheet-print-table td,
  table.sheet.sheet-print-table td.c-fix,
  table.sheet.sheet-print-table td.c-fix2 {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    box-shadow: none;
    border: .6px solid #777;
    padding: 1.1mm 1mm;
    height: auto;
    min-width: 0;
    color: #000;
    background: #fff;
    font-size: 6.4pt;
    line-height: 1.15;
  }

  table.sheet.sheet-print-table th {
    background: #e9e9e9;
    font-weight: 700;
  }

  table.sheet.sheet-print-table td.c-orig {
    color: #555;
  }

  table.sheet.sheet-print-table td.c-ro,
  table.sheet.sheet-print-table tr.r-summary td {
    background: #f2f2f2;
    font-weight: 700;
  }

  table.sheet.sheet-print-table td.c-rounded {
    background: #eef7ee;
  }

  table.sheet.sheet-print-table td.c-missing {
    background: #ffecec;
  }

  table.sheet.sheet-print-table td.c-act::after {
    display: none;
  }

  .sheet-print-area--compact {
    font-size: 6.2pt;
  }

  .sheet-print-area--compact .sheet-print-head {
    gap: 5mm;
    margin-bottom: 2mm;
    padding-bottom: 1.4mm;
    border-bottom-width: 1px;
  }

  .sheet-print-area--compact .sheet-print-head h1 {
    margin-bottom: .6mm;
    font-size: 12pt;
    line-height: 1.05;
  }

  .sheet-print-area--compact .sheet-print-subtitle,
  .sheet-print-area--compact .sheet-print-generated {
    font-size: 6.8pt;
    line-height: 1.1;
  }

  .sheet-print-area--compact .sheet-print-meta,
  .sheet-print-area--compact .sheet-print-summary {
    gap: 1mm;
    margin-bottom: 1.5mm;
  }

  .sheet-print-area--compact .sheet-print-meta div,
  .sheet-print-area--compact .sheet-print-summary div {
    min-height: 0;
    padding: .9mm 1.2mm;
  }

  .sheet-print-area--compact .sheet-print-meta span,
  .sheet-print-area--compact .sheet-print-summary span {
    margin-bottom: .3mm;
    font-size: 5.8pt;
    line-height: 1;
  }

  .sheet-print-area--compact .sheet-print-meta strong,
  .sheet-print-area--compact .sheet-print-summary strong {
    font-size: 7.2pt;
    line-height: 1.08;
  }

  .sheet-print-area--compact .sheet-print-meta small {
    margin-top: .2mm;
    font-size: 6pt;
    line-height: 1.05;
  }

  .sheet-print-area--compact table.sheet.sheet-print-table {
    table-layout: fixed;
    font-size: 6.1pt;
    line-height: 1.08;
  }

  .sheet-print-area--compact table.sheet.sheet-print-table th,
  .sheet-print-area--compact table.sheet.sheet-print-table td,
  .sheet-print-area--compact table.sheet.sheet-print-table td.c-fix,
  .sheet-print-area--compact table.sheet.sheet-print-table td.c-fix2 {
    padding: .55mm .4mm;
    height: 5.55mm;
    font-size: 6.1pt;
    line-height: 1.08;
  }

  .sheet-print-area--compact table.sheet.sheet-print-table th {
    font-size: 5.8pt;
    line-height: 1.05;
    word-break: keep-all;
  }

  .sheet-print-area--compact table.sheet.sheet-print-table td {
    overflow: hidden;
    text-overflow: clip;
  }

  .sheet-print-area--compact table.sheet.sheet-print-table td[data-field="note"] {
    text-align: left;
    white-space: normal;
    word-break: break-all;
  }

  .sheet-print-area--compact .sheet-print-col-date { width: 5.2%; }
  .sheet-print-area--compact .sheet-print-col-weekday { width: 3.2%; }
  .sheet-print-area--compact .sheet-print-col-service { width: 8.2%; }
  .sheet-print-area--compact .sheet-print-col-clock-origin { width: 6.7%; }
  .sheet-print-area--compact .sheet-print-col-clock-edit { width: 6.7%; }
  .sheet-print-area--compact .sheet-print-col-break { width: 4.6%; }
  .sheet-print-area--compact .sheet-print-col-work { width: 6.5%; }
  .sheet-print-area--compact .sheet-print-col-transport { width: 7.2%; }
  .sheet-print-area--compact .sheet-print-col-transfer-out,
  .sheet-print-area--compact .sheet-print-col-transfer-in,
  .sheet-print-area--compact .sheet-print-col-meal { width: 5.1%; }
  .sheet-print-area--compact .sheet-print-col-note { width: 23%; }

  .sheet-print-area--expanded table.sheet.sheet-print-table {
    table-layout: fixed;
  }

  .sheet-print-area--expanded .sheet-print-col-date { width: 3.8%; }
  .sheet-print-area--expanded .sheet-print-col-weekday { width: 2.4%; }
  .sheet-print-area--expanded .sheet-print-col-service { width: 5.7%; }
  .sheet-print-area--expanded .sheet-print-col-clock-origin { width: 4.7%; }
  .sheet-print-area--expanded .sheet-print-col-clock-edit { width: 4.7%; }
  .sheet-print-area--expanded .sheet-print-col-break { width: 3.2%; }
  .sheet-print-area--expanded .sheet-print-col-work { width: 4.5%; }
  .sheet-print-area--expanded .sheet-print-col-transport { width: 4.8%; }
  .sheet-print-area--expanded .sheet-print-col-transfer-out,
  .sheet-print-area--expanded .sheet-print-col-transfer-in,
  .sheet-print-area--expanded .sheet-print-col-meal,
  .sheet-print-area--expanded .sheet-print-col-visit,
  .sheet-print-area--expanded .sheet-print-col-medical,
  .sheet-print-area--expanded .sheet-print-col-trial,
  .sheet-print-area--expanded .sheet-print-col-community,
  .sheet-print-area--expanded .sheet-print-col-emergency,
  .sheet-print-area--expanded .sheet-print-col-intensive,
  .sheet-print-area--expanded .sheet-print-col-outside { width: 3.5%; }
  .sheet-print-area--expanded .sheet-print-col-note { width: 20.9%; }
}

