:root {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  color: #202b31;
  background: #f6f8f8;
  font-synthesis: none;
  --accent: #056654;
  --line: #e3e9e7;
  --muted: #5e6e74;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #35a792; outline-offset: 3px; }
.shell { display: grid; grid-template-columns: 258px minmax(0,1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 48px; padding: 26px 18px 19px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; margin: 1px 6px; font-size: 22px; font-weight: 750; text-decoration: none; color: #182928; letter-spacing: -.05em; }
.brand strong { color: var(--accent); }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .01em; }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; background: #065d4d; color: #fff; font-size: 23px; font-weight: 760; letter-spacing: -.05em; }
nav { display: grid; gap: 7px; }
nav button { display: flex; align-items: center; gap: 13px; border: 0; border-radius: 10px; padding: 11px 14px; text-align: left; color: #4b5b61; background: transparent; font-size: 14px; font-weight: 620; }
nav button span { width: 18px; text-align: center; font-size: 20px; line-height: 1; }
nav button:hover { background: #f2f6f5; }
nav button.active { background: #e4f2ee; color: #075c4d; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.avatar { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e4f2ee; color: var(--accent); font-weight: 800; }
.sidebar-foot button { margin-left: auto; }
.icon-button { border: 0; border-radius: 6px; padding: 3px 8px; color: var(--muted); background: transparent; font-size: 23px; }
.icon-button:hover { background: #edf3f1; }
.topbar { height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 clamp(22px,4vw,50px); border-bottom: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 650; }
#mode { color: #365c54; background: #eef5f3; border: 1px solid #deeae6; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.workspace { max-width: 1500px; margin: auto; padding: 37px clamp(22px,4vw,50px) 50px; }
h1 { margin: 0; color: #20312e; font-size: clamp(32px,4vw,43px); letter-spacing: -.05em; line-height: 1.1; }
.page-heading p, .signin p { color: var(--muted); margin: 12px 0 0; }
.records { margin-top: 29px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 4px #162c2705; overflow: hidden; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; padding: 17px; }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 175px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.search span { font-size: 23px; color: var(--muted); }
input { min-width: 0; flex: 1; padding: 9px 1px; background: #fff; border: 0; font-size: 14px; color: inherit; }
select { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; font-size: 14px; }
.primary { background: var(--accent); border: 1px solid var(--accent); border-radius: 8px; padding: 9px 15px; color: #fff; font-weight: 650; font-size: 14px; }
.primary:hover { background: #034d41; }
.table-viewport { overflow: auto; }
table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 14px; }
th { background: #f7f9f9; text-align: left; color: var(--muted); font-weight: 650; font-size: 12px; }
th, td { padding: 13px 17px; border-top: 1px solid var(--line); }
td:nth-child(3) { white-space: nowrap; color: var(--muted); }
.doc-title { display: block; width: 100%; color: #173e37; padding: 0; border: 0; text-align: left; background: transparent; font-weight: 680; }
.doc-title:hover { text-decoration: underline; }
.doc-number { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.badge { display: inline-block; white-space: nowrap; padding: 4px 9px; border-radius: 12px; font-size: 11px; font-weight: 650; background: #eef0f1; color: #3e4d55; }
.badge.waiting { background: #fff3dc; color: #724800; }
.badge.partial { background: #e9effb; color: #315495; }
.badge.signed { background: #e4f2eb; color: #176244; }
.records-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 12px 17px; color: var(--muted); font-size: 13px; }
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination button { min-width: 29px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: inherit; font-size: 19px; }
.pagination button:disabled { opacity: .5; cursor: default; }
.empty { text-align: center; color: var(--muted); padding: 25px; }
.signin { max-width: 450px; margin: clamp(35px,10vh,95px) auto; padding: clamp(22px,4vw,38px); background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.signin h1 { margin-top: 20px; font-size: 33px; }
.signin .primary { margin-top: 25px; }
.signin .hint { font-size: 13px; }
dialog { width: min(485px, calc(100% - 26px)); border: 1px solid var(--line); padding: 24px; border-radius: 16px; color: inherit; }
dialog::backdrop { background: #182f2b70; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
h2 { letter-spacing: -.04em; margin: 13px 0; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; margin: 20px 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.error { width: fit-content; max-width: 100%; margin: 16px auto; padding: 10px 14px; color: #742822; background: #fcebe9; border-radius: 8px; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { gap: 16px; padding: 16px 18px 10px; border: 0; }
  nav { display: flex; overflow: auto; gap: 3px; }
  nav button { white-space: nowrap; padding: 7px 8px; }
  .sidebar-foot { padding-top: 8px; }
  .topbar { height: 48px; }
  .workspace { padding-top: 24px; }
  .signin { margin-inline: auto; width: calc(100% - 40px); }
}

#preview-label { display: block; margin-top: 18px; font-size: 14px; }
#preview-code { display: block; width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
