:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5d687a;
  --line: #dce2ea;
  --primary: #1f5fbf;
  --primary-dark: #17478f;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px clamp(16px, 4vw, 44px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.brand-logo { display: inline-flex; align-items: center; justify-content: center; }
.brand-logo img { display: block; width: auto; height: min(80px, 70vw); }
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto; }
.footer-nav {
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 18px 16px;
}
.footer-nav nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-nav a { color: var(--muted); text-decoration: none; font-weight: 700; }
.footer-nav a:hover { color: var(--primary); }
.hero, .auth-panel, .tile, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
.hero { margin-bottom: 18px; }
h1, h2 { margin: 0 0 10px; }
p { color: var(--muted); line-height: 1.55; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { display: block; text-decoration: none; }
.tile:hover { border-color: var(--primary); }
.tile-visual {
  display: block;
  height: 150px;
  max-width: min(100%);
  margin: 0 auto 24px;
  object-fit: contain;
}
.auth-panel { width: min(440px, 100%); margin: 56px auto; }
.form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 650; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  background: #fff;
}
button, .button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover, .button:hover { background: var(--primary-dark); }
button.danger, .button.danger { background: var(--danger); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.alert {
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #e8f6ef;
  color: #0f6840;
}
.alert.error, .inline-error { color: var(--danger); background: #fff1f0; }
.inline-error { margin: 0; padding: 8px; border-radius: 6px; min-height: 0; }
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
#calendar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 32, 51, .28);
  width: min(620px, calc(100% - 24px));
}
dialog::backdrop { background: rgba(23, 32, 51, .45); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.document-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 10px;
  width: min(980px, 100%);
  margin: 0 auto;
}
.document-date {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 400;
}
.document-date:hover { color: var(--primary); }
.document-date img {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
@media (max-width: 980px) {
  .document-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .page-head { align-items: flex-start; flex-direction: column; }
  .grid.two { grid-template-columns: 1fr; }
  .document-list { grid-template-columns: 1fr; }
}
