:root { font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #241b0b; background: #fff9ed; }
* { box-sizing: border-box; }
body { margin: 0; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top left, #fff0c8, transparent 42%), #fff9ed; }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid #f2dcae; border-radius: 20px; background: white; box-shadow: 0 18px 50px rgb(124 78 0 / .12); }
.login-card h1 { font-size: 2rem; }
.login-card form { display: grid; gap: 16px; margin-top: 25px; }
.login-card form .message { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; border: 1px solid #d5c5a8; border-radius: 8px; background: white; padding: 10px 13px; }
.with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button-icon { width: 1.05em; height: 1.05em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button:disabled { cursor: wait; opacity: .62; }
button.primary { border-color: #fda109; background: #fda109; color: #241b0b; font-weight: 800; }
.container { max-width: 1200px; margin: 0 auto; padding: 44px 24px; }
.page-header { display: flex; justify-content: space-between; gap: 28px; align-items: start; margin-bottom: 28px; }
.header-actions {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 6px;
  align-items: center;
  padding: 5px;
  border: 1px solid #f0dfbd;
  border-radius: 14px;
  background: rgb(255 255 255 / .82);
  box-shadow: 0 8px 22px rgb(112 73 8 / .07);
}
.header-actions > * { min-height: 42px; white-space: nowrap; }
.button-link { display: inline-flex; align-items: center; border: 1px solid #d5c5a8; border-radius: 8px; padding: 10px 13px; color: #241b0b; background: white; text-decoration: none; }
.eyebrow { margin: 0 0 8px; color: #9b5e00; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
.subtitle { color: #6f6655; }
.message, #status { margin: 14px 0; color: #6f6655; }
.message[hidden] { display: none; }
.message[data-state="error"], #status[data-state="error"] {
  padding: 12px 14px;
  border: 1px solid #f2bbbb;
  border-radius: 10px;
  background: #fff1f1;
  color: #a61b1b;
  font-weight: 650;
  box-shadow: 0 4px 14px rgb(166 27 27 / .08);
}
.message[data-state="success"], #status[data-state="success"] { color: #9b5e00; }
.page-message { margin: 0 0 18px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.toolbar input { flex: 1; }
input, select { width: 100%; border: 1px solid #d9ccb6; border-radius: 8px; background: white; padding: 10px 11px; }
input::placeholder { color: #9a907f; opacity: 1; }
input:focus, select:focus { outline: 3px solid rgb(253 161 9 / .22); border-color: #fda109; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid #f0dfbd; border-radius: 12px; }
table { width: 100%; min-width: 960px; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 16px; border-bottom: 1px solid #f2eadb; vertical-align: middle; }
th { background: #fff3d8; color: #624718; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
td:nth-child(2) { color: #9b5e00; font-family: ui-monospace, monospace; font-size: .85rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffaf0; }
.empty-state { padding: 32px; color: #6f6655; text-align: center; }
.row-actions { white-space: nowrap; }
.row-action-list { display: flex; justify-content: flex-end; gap: 2px; padding: 3px; border: 1px solid #f0dfbd; border-radius: 9px; background: #fffdf9; }
.text-button { border: 0; border-radius: 6px; padding: 6px 7px; color: #9b5e00; background: transparent; font-size: .85rem; }
.text-button:hover { background: #fff0ce; }
.text-button.with-icon { gap: 4px; }
.danger { color: #bd1e1e; }
dialog { width: min(1080px, calc(100% - 28px)); max-height: calc(100vh - 40px); overflow-y: auto; border: 0; border-radius: 20px; padding: 0; box-shadow: 0 28px 80px rgb(0 0 0 / .3); }
dialog::backdrop { background: rgb(18 30 22 / .55); }
dialog form, .details-dialog { padding: 26px; }
.dialog-header { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 22px; }
.icon-button { min-width: 38px; padding: 4px 10px; border: 0; font-size: 1.75rem; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
label { display: grid; gap: 6px; color: #594d39; font-size: .9rem; }
.checkboxes { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.checkboxes label { display: flex; align-items: center; gap: 7px; }
.checkboxes input { width: auto; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; margin-top: 24px; }
.details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.details-grid div { min-height: 86px; padding: 14px; border: 1px solid #f1e4cc; border-radius: 12px; background: #fffdf9; }
dt { color: #6f6655; font-size: .8rem; }
dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.documents-section { margin-top: 30px; padding-top: 24px; border-top: 1px solid #f1e4cc; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 16px; }
.section-heading p:last-child { max-width: 320px; margin: 0; color: #6f6655; font-size: .9rem; text-align: right; }
.form-documents { margin-top: 24px; padding: 20px; border: 1px solid #f2dcae; border-radius: 14px; background: #fffaf0; }
.document-input-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.document-input-card { min-height: 170px; padding: 15px; border: 1px solid #f0d8a7; border-radius: 12px; background: white; }
.document-input-card > span { color: #6a4300; font-size: .95rem; font-weight: 750; }
.document-input-card small { color: #786d5a; }
.document-input-card input { padding: 8px; font-size: .78rem; }
.document-input-card input::file-selector-button { margin-right: 8px; border: 0; border-radius: 6px; padding: 6px 8px; background: #ffedc4; color: #784900; font-weight: 700; }
.existing-file { display: flex; min-height: 34px; align-items: center; overflow: hidden; }
.existing-file.is-empty { color: #807563; font-size: .78rem; }
.existing-file a { display: flex; min-width: 0; align-items: center; gap: 7px; color: #9b5e00; font-size: .78rem; text-decoration: none; }
.existing-file a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.existing-image { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.document-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.document-preview-card { display: grid; gap: 10px; padding: 13px; border: 1px solid #f2dcae; border-radius: 12px; background: #fffdf9; }
.document-preview-card h4 { margin: 0; color: #6a4300; font-size: .9rem; }
.document-preview { min-height: 110px; display: grid; place-items: center; overflow: hidden; border: 1px solid #f1e4cc; border-radius: 9px; background: white; }
.document-preview.is-empty { color: #807563; font-size: .85rem; }
.document-preview a { display: grid; width: 100%; height: 100%; gap: 7px; color: #9b5e00; text-align: center; text-decoration: none; }
.document-preview a span { overflow: hidden; padding: 0 8px 8px; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.document-image { width: 100%; height: 135px; object-fit: cover; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
@media (max-width: 820px) { .document-input-grid, .document-list { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .container { padding: 24px 14px; }
  .page-header, .toolbar, .section-heading { flex-direction: column; align-items: stretch; }
  .header-actions { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-actions > *, .toolbar button { width: 100%; text-align: center; }
  h1 { font-size: 2.25rem; }
  .table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  table, tbody { display: block; width: 100%; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid #f0dfbd; border-radius: 14px; background: white; }
  th, td { padding: 12px; }
  tbody td { display: grid; gap: 4px; min-width: 0; border-bottom: 1px solid #f2eadb; overflow-wrap: anywhere; }
  tbody td::before { content: attr(data-label); color: #80612c; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  tbody td:nth-child(1), tbody td:nth-child(3), tbody td:nth-child(8) { grid-column: 1 / -1; }
  tbody td:nth-child(7), tbody td:nth-child(8) { border-bottom: 0; }
  .empty-state { display: block !important; }
  .empty-state::before { display: none; }
  .row-actions { padding: 10px; }
  .row-action-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 0; border: 0; background: transparent; }
  .text-button { min-width: 0; padding: 8px 4px; border: 1px solid #f0dfbd; font-size: .78rem; }
  .text-button.with-icon { gap: 3px; }
  dialog { width: calc(100% - 16px); max-height: calc(100vh - 16px); border-radius: 16px; }
  dialog form, .details-dialog { padding: 20px 16px; }
  .form-grid, .details-grid { grid-template-columns: 1fr; }
  .section-heading p:last-child { text-align: left; }
  .dialog-actions { position: sticky; bottom: -20px; margin: 22px -16px -20px; padding: 12px 16px; background: white; border-top: 1px solid #f1e4cc; }
  .dialog-actions button { flex: 1; }
  .document-input-card { min-height: 112px; }
  .document-item { align-items: start; flex-direction: column; }
}
