:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --text: #203122;
  --muted: #657369;
  --primary: #2f7d4f;
  --danger: #b54444;
  --warning: #c2861c;
  --info: #2d68a8;
  --border: #dbe4dc;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.container { max-width: 1400px; margin: 0 auto; padding: 16px; }
.container.narrow { max-width: 900px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 18px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.sticky-panel { position: sticky; top: 0; z-index: 20; }
.app-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 18px; background: #e7f0e9; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.app-header h1 { margin: 0 0 4px; font-size: 1.6rem; }
.header-links { display: flex; gap: 8px; flex-wrap: wrap; }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(420px, 92vw); background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.login-card input, .toolbar-grid input, .toolbar-grid select, .settings-form input, .settings-form select, .note-row input { width: 100%; padding: 14px; font-size: 1rem; border-radius: 12px; border: 1px solid #c9d7cc; margin-top: 6px; }
.login-card label, .toolbar-form label, .settings-form label { display: block; font-weight: 700; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 14px; padding: 12px 16px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #e8ede9; color: var(--text); }
.btn-success { background: #2f8f56; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: #efc56d; color: #483205; }
.btn-info { background: #d6e6f9; color: #17406a; }
.alert { padding: 14px; border-radius: 12px; margin-bottom: 12px; }
.alert-success { background: #e3f3e6; }
.alert-error { background: #f8dfdf; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.demo-box { margin-top: 16px; padding: 12px; background: #f3f6f3; border-radius: 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { padding: 12px 18px; background: #eef3ef; border-radius: 999px; font-weight: 700; }
.tab.active { background: var(--primary); color: #fff; }
.toolbar-grid, .settings-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.toolbar-checks { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding-top: 28px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.summary-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 16px; }
.summary-card span { display: block; color: var(--muted); margin-bottom: 8px; }
.summary-card strong { font-size: 1.6rem; }
.summary-card.warning { border-color: #e8d5aa; background: #fffaf0; }
.records-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.resident-card { background: var(--panel); border: 2px solid var(--border); border-radius: 20px; padding: 16px; }
.resident-top { display: flex; justify-content: space-between; gap: 12px; }
.resident-top h2 { margin: 4px 0; font-size: 1.4rem; }
.room { font-size: 0.95rem; color: var(--muted); }
.status-pill { padding: 8px 12px; border-radius: 999px; font-weight: 700; height: fit-content; }
.flags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.flag { border-radius: 999px; padding: 6px 10px; font-size: 0.9rem; font-weight: 700; }
.flag-resume { background: #dcecff; }
.flag-early { background: #ffe4bf; }
.flag-delay { background: #fff2bf; }
.flag-room { background: #f0e8fb; }
.flag-note { background: #ebf6ed; }
.detail-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.detail-list.two-col { grid-template-columns: repeat(2, 1fr); }
.detail-list div { background: #f7faf7; padding: 10px; border-radius: 12px; }
.detail-list span { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }
.button-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.button-row.compact { grid-template-columns: repeat(2, 1fr); }
.note-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.link-btn { display: inline-block; margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: #edf3ee; }
.log-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.status-served { border-color: #8ed0a6; background: #f0faf3; }
.status-served .status-pill { background: #2f8f56; color: #fff; }
.status-skip { border-color: #e0c7c7; background: #fbf4f4; }
.status-skip .status-pill { background: #a85a5a; color: #fff; }
.status-resume { border-color: #bdd4f5; background: #f4f8ff; }
.status-resume .status-pill { background: #2d68a8; color: #fff; }
.status-early { border-color: #f2d2a0; background: #fff8ef; }
.status-early .status-pill { background: #cb8b1c; color: #fff; }
.status-delay { border-color: #eedb99; background: #fffceb; }
.status-delay .status-pill { background: #d2a423; color: #493809; }
.status-room { border-color: #d5c2ef; background: #faf6ff; }
.status-room .status-pill { background: #8a63bf; color: #fff; }
.status-hold { border-color: #dfc6a6; background: #fff7f0; }
.status-hold .status-pill { background: #aa6c24; color: #fff; }
.status-pending .status-pill { background: #e7ece8; color: #304032; }
@media (max-width: 768px) {
  .detail-list, .button-row, .button-row.compact, .note-row { grid-template-columns: 1fr; }
  .app-header { align-items: flex-start; flex-direction: column; }
}

.section-title { margin: 0 0 12px; font-size: 1.2rem; }
.info-panel { background: #edf7ef; }
.attention-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.attention-item { border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: grid; gap: 4px; }
.button-row.compact.four-col { grid-template-columns: repeat(4, 1fr); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
.data-table, .print-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td, .print-table th, .print-table td { border: 1px solid #cfd8d1; padding: 10px; text-align: left; vertical-align: top; }
.data-table th, .print-table th { background: #f1f5f2; }
.kitchen-category-box { margin-top: 14px; }
.category-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.kitchen-summary-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.print-body { background: #fff; }
.print-sheet { max-width: 1120px; margin: 0 auto; padding: 16px; background: #fff; }
.print-header { margin-bottom: 12px; }
.print-header h1 { margin: 0 0 6px; font-size: 1.5rem; }
.print-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.print-footer { margin-top: 14px; font-size: 0.95rem; }
.print-category-chips span { display: inline-block; padding: 4px 8px; border: 1px solid #cfd8d1; border-radius: 999px; margin-right: 6px; margin-bottom: 6px; }
@media print {
  .no-print, .app-header, .sticky-panel { display: none !important; }
  body { background: #fff; }
  .container, .print-sheet { max-width: none; margin: 0; padding: 0; }
  .panel { border: 0; box-shadow: none; padding: 0; margin: 0 0 10px; }
  .print-table th, .print-table td { font-size: 11px; padding: 6px; }
}
@media (max-width: 900px) {
  .button-row.compact.four-col { grid-template-columns: repeat(2, 1fr); }
}
