:root {
  color-scheme: light;
  --forest: #142538;
  --forest-light: #233d55;
  --ink: #17293b;
  --muted: #525e68;
  --paper: #f7f4ed;
  --surface: #fffefa;
  --line: #dedbd0;
  --accent: #d7b579;
  --danger: #882e27;
  font: 15px/1.5 "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }
:focus-visible { outline: 3px solid #946c31; outline-offset: 3px; }
.sidebar :focus-visible { outline-color: var(--accent); }
.skip { position: fixed; z-index: 3; top: 8px; left: 8px; padding: .7rem 1rem; background: white; transform: translateY(-160%); }
.skip:focus { transform: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 234px; padding: 31px 20px 20px; background: var(--forest); color: #f7f8ef; display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: .7rem; align-self: flex-start; padding: 0 .55rem; text-decoration: none; font: 30px/1 Georgia, serif; letter-spacing: -.06em; }
.brand img { display: block; width: min(158px, 100%); height: auto; padding: 7px; border-radius: 5px; background: var(--surface); }
.login-panel { max-width: 420px; }
.form-login { display: grid; gap: 14px; padding: 22px; }
.form-login .form-error:empty { display: none; }
.account-actions { display: flex; align-items: center; justify-content: end; gap: 10px; }
.process-history { margin: 0; padding: 0 24px 18px 42px; }
.process-history li + li { margin-top: 8px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); color: var(--forest); border-radius: 10px 10px 10px 2px; font: 23px/1 Georgia, serif; }
.sidebar nav { margin-top: 49px; display: grid; gap: 5px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 7px; text-decoration: none; color: #e3ebe1; font-weight: 600; }
.sidebar nav a:hover { background: var(--forest-light); }
.sidebar nav a[aria-current="page"] { color: #f6e7c7; background: var(--forest-light); }
.nav-icon { display: inline-block; width: 13px; height: 13px; border: 1px solid currentColor; }
.icon-dashboard { border-radius: 2px; box-shadow: inset 0 0 0 2px var(--forest-light); background: currentColor; }
.icon-folder { border-radius: 4px 2px 2px 2px; height: 11px; }
.icon-calendar { border-radius: 2px; background: linear-gradient(transparent 3px, currentColor 3px 4px, transparent 4px); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #4b584f; color: #c7d1c8; font-size: .83rem; }
.workspace { margin-left: 234px; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 36px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--muted); }
.topbar select { width: auto; min-height: 35px; padding-block: .3rem; }
main { max-width: 1390px; min-height: calc(100vh - 68px); padding: 34px 36px 56px; margin: 0 auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; letter-spacing: -.045em; }
h1 { margin-bottom: 9px; font-size: clamp(2.4rem, 4.8vw, 4rem); line-height: 1.04; overflow-wrap: anywhere; }
h2 { margin-bottom: 5px; font-size: 2rem; line-height: 1.15; }
h3 { margin-bottom: 4px; font-size: 1rem; }
.muted { color: var(--muted); }
.page-head, .section-head, .form-actions, .item-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-head { margin-bottom: 24px; }
.page-head p, .section-head p { margin-bottom: 0; }
.date-label { display: block; margin-bottom: 8px; font-size: .81rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 6px; font-weight: 650; text-decoration: none; background: var(--surface); color: var(--ink); }
.button:hover { background: #f2ede2; }
.button.primary { background: var(--forest); color: white; border-color: var(--forest); }
.button.primary:hover { background: var(--forest-light); }
.button[disabled] { cursor: wait; opacity: .65; }
.button.compact { min-height: 38px; padding-block: .3rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric { padding: 17px 19px; min-height: 103px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.metric:first-child { background: #f1e5cc; border-color: #e5d0ac; }
.metric strong { display: block; margin-bottom: 5px; font: 36px/1 Georgia, serif; }
.metric span { font-weight: 650; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 19px; }
.section-head { padding: 19px 20px; }
.table { margin: 0; padding: 0; list-style: none; }
.table-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; min-height: 64px; padding: 11px 20px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.case-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.table-row.heading { min-height: 0; background: #f5f6ef; color: var(--muted); font-size: .78rem; font-weight: 700; }
.table-row a, .detail-link { font-weight: 650; color: var(--forest-light); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.subline { display: block; font-size: .82rem; color: var(--muted); }
.tag { display: inline-block; max-width: 100%; padding: 3px 8px; border-radius: 4px; background: #edece2; color: #414638; font-size: .79rem; font-weight: 650; }
.tag.green { background: #e5efdd; color: #305735; }
.tag.attention { background: #f5ead0; color: #6b491e; }
.tag.overdue { background: #f7e7e2; color: var(--danger); }
.empty, .error { margin: 0; padding: 20px; }
.error { color: var(--danger); }
.toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; padding: 0 20px 16px; }
.toolbar label { flex: 1; min-width: min(230px, 100%); }
label { display: block; font-weight: 650; }
label input, label textarea, label select { display: block; margin-top: 5px; }
input, select, textarea { width: 100%; min-height: 42px; padding: .5rem .65rem; color: var(--ink); background: var(--surface); border: 1px solid #aab2a5; border-radius: 5px; }
textarea { min-height: 84px; resize: vertical; }
.movement { padding: 17px 20px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.movement-head { padding: 0; }
.movement-head > div { min-width: 0; }
.movement:target, .movement[data-highlight] { background: #f5ecd8; }
.deadline-item { margin-top: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; }
.deadline-item summary { cursor: pointer; padding-block: 7px; font-weight: 650; }
.deadline-item ol { margin: 0 0 4px; padding-left: 1.5rem; }
.item-actions { justify-content: flex-start; margin-top: 10px; }
.back { display: inline-block; margin-bottom: 10px; }
dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 23px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #12201999; }
dialog form { display: grid; gap: 12px; margin-top: 15px; }
.form-actions { justify-content: flex-end; }
.form-error { margin: 0; color: var(--danger); }
#notice:not(:empty) { position: fixed; z-index: 2; right: 15px; bottom: 15px; max-width: min(430px, calc(100% - 30px)); padding: 10px 16px; background: var(--forest); color: white; border-radius: 6px; }
@media (max-width: 850px) {
  .sidebar { width: 174px; padding-inline: 12px; }
  .workspace { margin-left: 174px; }
  main, .topbar { padding-inline: 20px; }
}
@media (max-width: 640px) {
  .sidebar { position: static; width: auto; padding: 13px 14px 9px; }
  .brand { font-size: 25px; padding: 0; }
  .brand-mark { width: 27px; height: 27px; font-size: 19px; }
  .sidebar nav { margin-top: 9px; display: flex; overflow-x: auto; }
  .sidebar nav a { gap: 7px; padding: 0 9px; min-height: 41px; }
  .sidebar-foot { display: none; }
  .workspace { margin: 0; }
  .topbar { min-height: 49px; gap: 8px; font-size: .85rem; }
  .topbar select { max-width: 155px; }
  main { padding: 24px 14px 34px; min-height: 0; }
  .topbar { padding-inline: 14px; }
  .metrics { gap: 6px; }
  .metric { padding: 10px; min-height: 73px; }
  .metric strong { font-size: 28px; }
  .metric span { font-size: .77rem; line-height: 1.2; display: block; }
  .section-head, .table-row, .movement { padding-inline: 12px; }
  .toolbar { padding-inline: 12px; }
  .table-row { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 6px; }
  .table-row.heading { display: none; }
  .table-row > :nth-child(2n) { justify-self: end; text-align: right; }
}
