:root {
  --text: #1f1f1d;
  --muted: #6b6a65;
  --border: #dcdad3;
  --bg: #ffffff;
  --row-hover: #f6f5f1;
  --accent: #1f5fa6;
  --danger: #a32d2d;
  --pill-grey-bg: #f1efe8; --pill-grey-fg: #444441;
  --pill-blue-bg: #e6f1fb; --pill-blue-fg: #0c447c;
  --pill-green-bg: #eaf3de; --pill-green-fg: #27500a;
  --notice-bg: #faeeda; --notice-fg: #633806;
  --capa-bg: #f7f9fc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  padding: 10px 12px;
  font: 13px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.message { padding: 24px; font-size: 14px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; margin-bottom: 10px; }
.toolbar label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.toolbar .user { margin-left: auto; font-size: 12px; }
select, input, textarea, button {
  font: inherit;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  background: #fff;
}
input[type="search"] { min-width: 220px; }
textarea { resize: vertical; width: 100%; }
input:read-only, textarea:read-only { background: #f6f5f1; }
button { cursor: pointer; }
button:hover { background: var(--row-hover); }
button.primary { background: var(--text); color: #fff; border-color: var(--text); }
button.primary:hover { background: #3a3a37; }
button:disabled { opacity: 0.6; cursor: wait; }
button.icon { border: none; font-size: 20px; line-height: 1; padding: 0 4px; }

.grid-wrap { overflow-x: auto; }
.grid { width: 100%; min-width: 1850px; border-collapse: collapse; table-layout: fixed; }
.grid tr.group th { font-weight: 600; font-size: 12px; color: var(--text); border-bottom: none; padding-bottom: 0; }
.grid th.capa, .grid td.capa { background: var(--capa-bg); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid th { overflow-wrap: break-word; text-align: left; font-weight: 600; color: var(--muted); padding: 6px; border-bottom: 1px solid var(--border); }
.grid td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.grid tbody tr:hover td { background: var(--row-hover); }
.w-action { width: 84px; } .w-date { width: 92px; } .w-loc { width: 200px; } .w-room { width: 100px; }
.w-medium { width: 120px; } .w-iso { width: 48px; } .w-status { width: 130px; } .w-by { width: 120px; }
.num { text-align: right; padding-right: 14px !important; }
.empty { padding: 16px 6px; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.pill.not_started { background: var(--pill-grey-bg); color: var(--pill-grey-fg); }
.pill.awaiting_approval { background: var(--pill-blue-bg); color: var(--pill-blue-fg); }
.pill.approved { background: var(--pill-green-bg); color: var(--pill-green-fg); }

dialog {
  width: min(680px, 96vw);
  max-height: 92vh;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.modal-head h2 { font-size: 15px; margin: 0 0 2px; font-weight: 600; }
.modal-head p { margin: 0 0 10px; font-size: 12px; }
.notice { background: var(--notice-bg); color: var(--notice-fg); padding: 6px 10px; border-radius: 6px; margin: 0 0 10px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
.fields label, label.wide { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.fields label input, .fields label textarea { color: var(--text); font-size: 13px; }
.fields .wide { grid-column: 1 / -1; }
label.wide { margin-top: 10px; }
.review { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.review dt { color: var(--muted); }
.review dd { margin: 0; white-space: pre-wrap; }
.changed { display: block; color: var(--danger); font-size: 11px; }
.history { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; color: var(--muted); }
.history summary { cursor: pointer; font-size: 12px; }
.history ol { margin: 6px 0 0; padding-left: 18px; }
.history li { margin-bottom: 4px; }
.error { color: var(--danger); margin: 10px 0 0; }
.modal-actions { display: flex; justify-content: end; gap: 8px; margin-top: 12px; }
.req { color: var(--danger); }
.fields select { width: 100%; font-size: 13px; color: var(--text); }
.other-box input { width: 100%; }
