:root {
  color-scheme: light;
  --bg: #f5f4f9;
  --panel: #fff;
  --ink: #241e36;
  --muted: #625d72;
  --line: #ddd9e8;
  --accent: #2b1c69;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .18em; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-inner, main { max-width: 1200px; margin: auto; padding-inline: 24px; }
.top-inner, nav, .signout, .actions, .page-head, .section-head, .pagination { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.top-inner { min-height: 80px; padding-block: 8px; }
.brand img { display: block; object-fit: contain; }
nav { flex: 1; }
nav a { text-decoration: none; font-weight: 600; }
nav a:hover { text-decoration: underline; }
.signout { margin-left: auto; color: var(--muted); }
main { padding-block: 25px 48px; }
.page-head, .section-head { justify-content: space-between; }
.page-head { margin-bottom: 14px; }
h1, h2 { margin: 0; line-height: 1.18; }
h1 { font-size: clamp(25px, 5vw, 35px); letter-spacing: -.035em; }
h2 { margin-bottom: 13px; font-size: 17px; color: var(--accent); }
.section-head h2 { margin: 0; }
.section-head { margin-bottom: 12px; }
.panel { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 15px; }
.login { max-width: 460px; margin: 6vh auto; padding: 30px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 5px; min-width: 0; }
.field span, .check { font-weight: 600; }
.field.wide { grid-column: 1 / -1; }
input, textarea, select, button { font: inherit; }
.field input, .field textarea, .field select {
  background: white; color: var(--ink); border: 1px solid #bcb6cc; border-radius: 7px;
  padding: 8px 10px; width: 100%; min-height: 41px;
}
textarea { resize: vertical; }
:focus-visible { outline: 3px solid #7861d2; outline-offset: 2px; }
button { cursor: pointer; }
.button {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; text-decoration: none;
  padding: 8px 13px; min-height: 41px; border-radius: 7px; border: 1px solid #bcb6cc;
  color: var(--accent); background: #fff; font-weight: 650;
}
.button:hover { background: #f0ecfc; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: #413081; }
.button:disabled { opacity: .55; cursor: default; }
.plain { border: 0; color: var(--accent); background: transparent; text-decoration: underline; }
.actions { justify-content: flex-end; margin-top: 13px; }
.filter { display: grid; grid-template-columns: 2fr 1fr auto; align-items: end; gap: 14px; }
.table-box { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
td, th { padding: 10px 13px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
thead { background: #efedf6; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-block; white-space: nowrap; border-radius: 5px; padding: 3px 8px; font-weight: 650; }
.open { background: #ebe5fe; color: #40247f; }
.working { background: #fff0d4; color: #713b05; }
.closed { background: #dff4e7; color: #15502e; }
.canceled { background: #f9e5e8; color: #832337; }
.pagination { justify-content: center; }
fieldset { min-width: 0; margin: 14px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
legend { font-weight: 650; }
.item-row { display: grid; grid-template-columns: minmax(160px, 2fr) 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.total { display: flex; gap: 12px; justify-content: flex-end; font-weight: 700; margin-bottom: 0; }
.hint { margin-bottom: 0; color: var(--muted); }
.notice { border: 1px solid #b8dfc8; background: #e9f7ef; padding: 10px 14px; border-radius: 7px; }
@media (max-width: 720px) {
  .top-inner, main { padding-inline: 14px; }
  .top-inner { gap: 8px 14px; }
  nav { order: 3; flex-basis: 100%; }
  .panel { padding: 13px; }
  .table-box { padding: 0; }
  .grid, .grid.three, .filter { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .item-row > label:first-of-type { grid-column: 1 / -1; }
}
