﻿:root {
  --red: #b92c24;
  --red-dark: #8e211b;
  --ink: #242527;
  --muted: #686b70;
  --line: #ddd8d1;
  --paper: #fffefa;
  --wash: #f5f1eb;
  --soft: #fbf8f3;
  --green: #2f6b52;
  --blue: #31566d;
  --shadow: 0 18px 48px rgba(38, 35, 31, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(145deg, #f7f3ed 0%, #fff 48%, #f1ede7 100%);
}
a { color: inherit; }
button, input, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(185, 44, 36, .22);
  outline-offset: 2px;
}
.page-shell {
  width: min(1120px, calc(100% - 34px));
  margin: 0 auto;
  padding: 30px 0 40px;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 34px));
  margin: 0 auto;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.logo-link img { display: block; width: 168px; max-width: 44vw; height: auto; }
.top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; }
.top-nav a, .link-button { color: var(--muted); text-decoration: none; }
.link-button { border: 0; background: transparent; cursor: pointer; padding: 0; }
.top-nav a:hover, .link-button:hover { color: var(--red); text-decoration: underline; }
.brand-header { text-align: center; padding: 8px 0 4px; }
.kanzlei-logo { display: block; width: min(760px, 92vw); height: auto; margin: 0 auto; }
.hero { text-align: center; padding: 4px 8px 26px; }
.admin-hero { text-align: left; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.08;
  font-size: clamp(32px, 5vw, 56px);
  margin: 0;
}
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 26px;
  margin: 0 0 14px;
}
.lead {
  max-width: 780px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
}
.admin-hero .lead { margin-left: 0; }
.card, .alert, .tool-tile, .metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, .94);
  box-shadow: var(--shadow);
}
.card { padding: clamp(22px, 4vw, 40px); margin: 0 0 18px; }
.narrow-card { max-width: 680px; margin-inline: auto; }
.alert { padding: 15px 17px; margin: 0 0 18px; box-shadow: none; }
.alert.warning { background: #fff7e8; border-color: #ead4a6; }
.alert.danger { background: #fff0ef; border-color: #e4b6b2; }
.alert.success { background: #eef8f2; border-color: #b9d8c6; }
.muted, .privacy { color: var(--muted); line-height: 1.6; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s, background .16s, border-color .16s;
}
.btn:hover { transform: translateY(-1px); border-color: #b9b0a6; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.secondary { background: #fff; }
.btn.small { min-height: 34px; padding: 7px 10px; font-size: 13px; }
.btn.danger-btn { background: #fff0ef; border-color: #d9aaa5; color: #8e211b; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.stack-form { display: grid; gap: 16px; }
.stack-form label, .message-label { display: grid; gap: 7px; font-weight: 750; }
input, textarea {
  width: 100%;
  border: 1px solid #d4cfc8;
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
.form-grid, .detail-grid { display: grid; grid-template-columns: .86fr 1.14fr; gap: 28px; align-items: start; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.vertical-actions { align-items: stretch; flex-direction: column; }
.vertical-actions form { display: contents; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.tool-tile { display: grid; gap: 8px; padding: 22px; text-decoration: none; }
.tool-tile strong { font-size: 22px; }
.tool-tile small, .metric small, .data-table small { color: var(--muted); display: block; }
.tile-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: #f3e6e3; color: var(--red); font-weight: 900; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { padding: 17px; box-shadow: none; }
.metric strong { font-size: 26px; }
.admin-headline, .section-header, .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.toolbar input { max-width: 460px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tabs a { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--muted); background: #fff; }
.tabs a.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 920px; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { background: var(--soft); font-weight: 800; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 8px; background: #eef3f0; color: #31523f; font-weight: 750; }
.detail-list { display: grid; grid-template-columns: minmax(140px, .36fr) 1fr; gap: 10px 16px; }
.detail-list dt { color: var(--muted); font-weight: 800; }
.detail-list dd { margin: 0; min-width: 0; }
.copy-input { font-size: 13px; }
.audit-list p { display: grid; grid-template-columns: 1fr 160px; gap: 8px 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.audit-list small { grid-column: 1 / -1; color: var(--muted); }
.section-kicker { color: var(--red); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; }
.limit-list { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0 0 18px; }
.limit-list dt { color: var(--muted); font-weight: 800; }
.limit-list dd { margin: -6px 0 8px; }
.drop-zone {
  min-height: 300px;
  border: 2px dashed #cfc8bf;
  border-radius: 8px;
  background: linear-gradient(160deg, #fff, #faf6f0);
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.drop-zone.drag { border-color: var(--red); background: #fff9f7; }
.upload-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 8px; background: #f3e6e3; color: var(--red); font-size: 30px; font-weight: 900; margin-bottom: 16px; }
.drop-title { font-family: Georgia, "Times New Roman", serif; font-size: 25px; margin: 0 0 7px; }
.drop-sub { max-width: 430px; margin: 0 auto 18px; color: var(--muted); line-height: 1.55; }
.file-list { margin-top: 15px; border: 1px solid #e1ddd7; border-radius: 8px; background: white; overflow: hidden; }
.file-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 13px; border-bottom: 1px solid #eeeae5; font-size: 13px; }
.file-row:last-child { border-bottom: 0; }
.file-row progress { grid-column: 1 / -1; width: 100%; }
.file-row .name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.file-row .state { color: var(--muted); text-align: right; }
.file-row.has-error .state { color: var(--red-dark); font-weight: 750; }
.file-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.submit-wrap { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; }
.status-text { margin: 0; color: var(--muted); }
.portal-footer { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 18px 4px 0; color: #74777b; font-size: 12px; }
.powered-label { color: var(--red); font-style: italic; font-weight: 750; }
.idealium-logo { display: block; width: 180px; height: auto; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(1px, 1px, 1px, 1px) !important; white-space: nowrap !important; }
@media (max-width: 860px) {
  .form-grid, .detail-grid, .tile-grid { grid-template-columns: 1fr; }
  .metric-grid, .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .app-header, .admin-headline, .toolbar, .section-header, .submit-wrap { align-items: stretch; flex-direction: column; }
}
@media (max-width: 560px) {
  .page-shell { width: min(100% - 20px, 1120px); padding-top: 16px; }
  .card { padding: 20px; }
  .metric-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .drop-zone { min-height: 260px; }
  .idealium-logo { width: 145px; }
}

