:root {
  --navy: #123a5e;
  --blue: #1f5f99;
  --blue-2: #2878b5;
  --pale: #edf5fb;
  --line: #d7e2eb;
  --text: #1b2b39;
  --muted: #64788a;
  --green: #138b60;
  --orange: #e58a15;
  --red: #c74444;
  --shadow: 0 8px 24px rgba(21, 57, 84, .09);
  --a: #2878b5;
  --i: #139b7a;
  --u: #e18a18;
  --e: #875fc1;
  --o: #d05274;
  --ni: #486b87;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; color: var(--text); background: #f5f8fa; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { background: var(--navy); color: white; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 25px; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; background: white; color: var(--blue); border-radius: 10px; font-weight: 800; font-size: 23px; }
.brand strong { display: block; font-size: 18px; }.brand span { display: block; opacity: .72; font-size: 12px; margin-top: 2px; }
nav { padding-top: 20px; }
nav button { width: 100%; border: 0; background: transparent; color: #d8e7f2; padding: 13px 14px; margin: 3px 0; border-radius: 8px; text-align: left; font-weight: 700; display: flex; gap: 12px; align-items: center; }
nav button span { width: 22px; font-size: 20px; text-align: center; }
nav button:hover, nav button.active { color: white; background: rgba(255,255,255,.13); }
.nav-label { font-size: 11px; letter-spacing: .15em; color: #8eacc3; margin: 22px 14px 6px; }
.sidebar-note { margin-top: auto; border-radius: 7px; padding: 11px; background: rgba(0,0,0,.14); color: #bcd0df; font-size: 12px; line-height: 1.6; }
.main { min-width: 0; }
.topbar { height: 92px; padding: 18px 32px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.eyebrow { color: var(--muted); font-size: 12px; margin-bottom: 3px; }.topbar h1 { font-size: 25px; margin: 0; }
.top-actions { display: flex; gap: 13px; align-items: center; }
.staff-select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.staff-select select { padding: 9px 30px 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.content { padding: 26px 32px 50px; max-width: 1500px; margin: 0 auto; }
.btn { border: 1px solid var(--line); border-radius: 7px; padding: 10px 18px; font-weight: 800; background: white; color: var(--text); min-height: 42px; }
.btn:hover { filter: brightness(.97); }.btn-primary { border-color: var(--blue); color: white; background: var(--blue); }
.btn-success { border-color: var(--green); color: white; background: var(--green); }
.btn-danger { border-color: #efc2c2; color: var(--red); background: #fff5f5; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.grid-stats { display: grid; grid-template-columns: repeat(4, minmax(160px,1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 700; }.stat-value { font-size: 33px; line-height: 1; font-weight: 900; margin-top: 10px; }.stat-value small { font-size: 14px; margin-left: 4px; }
.stat-accent { border-left: 5px solid var(--blue); }.stat-warning { border-left: 5px solid var(--orange); }.stat-danger { border-left: 5px solid var(--red); }
.card { background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.card-header { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 18px; }.card-body { padding: 20px; }
.split { display: grid; grid-template-columns: 1fr 1.8fr; gap: 20px; }
.pattern-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 10px; }
.pattern-box { border-radius: 9px; padding: 18px; color: white; }.pattern-box b { font-size: 27px; }.pattern-box span { display: block; opacity: .8; font-size: 12px; margin-bottom: 7px; }
.p-a { background: var(--a)!important; }.p-i { background: var(--i)!important; }.p-u { background: var(--u)!important; }.p-e { background: var(--e)!important; }.p-o { background: var(--o)!important; }.p-ni { background: var(--ni)!important; }
table { width: 100%; border-collapse: collapse; }
th { color: #51697c; background: #f5f8fa; text-align: left; font-size: 12px; letter-spacing: .04em; padding: 11px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 13px; border-bottom: 1px solid #e7edf2; vertical-align: middle; }
tbody tr:hover { background: #f7fbfe; }.clickable-row { cursor: pointer; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 12px; background: #eaf0f4; color: #526777; }
.badge.pattern { min-width: 34px; color: white; }.badge.warn { background: #fff0d8; color: #a15b00; }.badge.cancel { background: #f6e5e5; color: #9c3e3e; }.badge.ok { background: #dcf4e9; color: #14734f; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar input, .toolbar select { min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.toolbar .search { min-width: 240px; }
.calendar-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.calendar-title { font-size: 22px; font-weight: 900; min-width: 190px; text-align: center; }
.segmented { display: inline-flex; border: 1px solid var(--line); padding: 3px; border-radius: 8px; background: #f4f7f9; }
.segmented button { border: 0; padding: 7px 14px; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 800; }
.segmented button.active { color: var(--blue); background: white; box-shadow: 0 2px 6px #cfdae2; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: white; }
.weekday { padding: 10px; text-align: center; font-weight: 800; color: var(--muted); font-size: 12px; background: #eef4f8; border-right: 1px solid var(--line); }
.day { min-height: 142px; padding: 8px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); background: white; }
.day.other { background: #f8fafb; color: #a9b6c0; }.day.today .day-num { background: var(--blue); color: white; }
.day-num { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; margin-bottom: 4px; }
.slot-chip { border: 0; width: 100%; text-align: left; color: white; font-size: 11px; padding: 5px 7px; margin: 2px 0; border-radius: 5px; font-weight: 800; display: flex; justify-content: space-between; }
.slot-chip.full { background: #8795a0!important; }.holiday { font-size: 11px; color: var(--red); font-weight: 800; padding: 4px; }
.paste-calendar { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; margin-top: 12px; }
.paste-calendar .weekday { border: 0; border-radius: 5px; padding: 7px 2px; }
.paste-date { min-height: 52px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--text); font-weight: 900; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; }
.paste-date:hover:not(:disabled) { border-color: var(--blue); background: var(--pale); }
.paste-date.other { color: #9aa9b5; background: #f7f9fa; }
.paste-date.selected { color: white; border-color: var(--green); background: var(--green); }
.paste-date:disabled { cursor: not-allowed; color: #9aa9b5; background: #eef1f3; opacity: .75; }
.paste-date small { font-size: 9px; font-weight: 800; }
.week-grid { display: grid; grid-template-columns: 90px repeat(7,1fr); border: 1px solid var(--line); background: white; border-radius: 9px; overflow: hidden; }
.week-cell { min-height: 72px; padding: 6px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); }.week-label { background: #f3f7fa; font-weight: 800; font-size: 12px; }
.day-list { display: grid; gap: 10px; }.day-slot { display: grid; grid-template-columns: 90px 80px 1fr auto; align-items: center; gap: 16px; border: 1px solid var(--line); padding: 16px; border-radius: 9px; background: white; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px,.8fr); gap: 20px; align-items: start; }
.form-section { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.form-section:last-child { border: 0; }.form-section h3 { margin: 0 0 15px; font-size: 16px; color: var(--navy); }
.form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 800; color: #3f5668; }.required::after { content: " 必須"; color: var(--red); font-size: 10px; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 1px solid #bfcdd8; border-radius: 7px; padding: 10px 12px; background: white; font-size: 16px; }
.field textarea { min-height: 90px; resize: vertical; }.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid #c9e4f7; border-color: var(--blue); }
.era-input { display: flex; align-items: center; gap: 7px; min-height: 48px; flex-wrap: nowrap; }
.era-input .era-label { min-height: 48px; padding: 0 14px; display: grid; place-items: center; border-radius: 7px; background: var(--navy); color: white; font-weight: 900; white-space: nowrap; }
.era-input input { width: 72px; text-align: center; padding: 8px 5px; font-weight: 800; }
.era-input input:first-of-type { width: 82px; }
.era-input .unit { font-weight: 800; color: var(--muted); white-space: nowrap; }
.field-error { color: var(--red); font-size: 12px; min-height: 15px; }.invalid { border-color: var(--red)!important; background: #fffafa!important; }
.radio-group { display: flex; gap: 9px; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 85px; position: relative; }
.radio-card input { opacity: 0; position: absolute; }.radio-card span { min-height: 48px; border: 1px solid #bdcbd6; border-radius: 7px; display: grid; place-items: center; background: white; font-weight: 900; }
.radio-card input:checked + span { background: var(--pale); border: 2px solid var(--blue); color: var(--blue); }
.pattern-choice-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 9px; }
.pattern-choice-grid .radio-card { min-width: 0; grid-column: span 2; }
.notice { border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.6; margin: 10px 0; background: #eef7fd; color: #285979; border-left: 4px solid var(--blue); }
.notice.warning { background: #fff6e8; color: #8f570b; border-color: var(--orange); }.notice.danger { background: #fff0f0; color: #923535; border-color: var(--red); }
.summary-list { display: grid; gap: 0; }.summary-row { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid #e4ebf0; }.summary-row span:first-child { color: var(--muted); font-size: 13px; }.summary-row b { text-align: right; }
.sticky-actions { position: sticky; bottom: 0; background: white; border-top: 1px solid var(--line); padding: 15px 20px; margin: 20px -20px -20px; display: flex; gap: 10px; justify-content: flex-end; }
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 28px; }.detail-item { padding: 13px 2px; border-bottom: 1px solid var(--line); }.detail-item span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }.detail-item b { font-size: 16px; }
.modal-root { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(11,28,42,.6); padding: 24px; align-items: center; justify-content: center; }
.modal-root.open { display: flex; }.modal { width: min(620px,100%); max-height: 90vh; overflow: auto; background: white; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--line); }.modal-header h2 { margin: 0; font-size: 21px; }
.modal-body { padding: 22px 24px; }.modal-actions { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; right: 28px; top: 105px; z-index: 80; color: white; background: var(--green); padding: 14px 20px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 800; animation: enter .2s ease-out; }
@keyframes enter { from { transform: translateY(-8px); opacity: 0; } }
.empty { text-align: center; padding: 40px; color: var(--muted); }.muted { color: var(--muted); }.text-danger { color: var(--red); }.right { text-align: right; }
@media (max-width: 1050px) { .app-shell { grid-template-columns: 200px 1fr; }.grid-stats { grid-template-columns: repeat(2,1fr); }.split,.form-layout { grid-template-columns: 1fr; }.content { padding: 22px; }.day { min-height: 120px; } }
@media print { .sidebar,.topbar,.toolbar,.no-print { display:none!important; }.app-shell { display:block; }.content { padding:0; }.card { box-shadow:none; border:0; } body { background:white; font-size:12px; } }
