:root {
  --night: #112b3d;
  --blue: #174c70;
  --blue-light: #28678b;
  --gold: #c3a052;
  --gold-light: #deca8b;
  --parchment: #f2ead5;
  --paper: #fbf7ec;
  --paper-deep: #e9dfc5;
  --ink: #263441;
  --muted: #777d7d;
  --line: #d8ccb0;
  --silver: #d2d5d4;
  --red: #a34a3d;
  --green: #4f6c51;
  --serif: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 80% 8%, #ffffff66 0, transparent 38%),
    linear-gradient(145deg, #eee5cf, #f7f3e8 46%, #e8dfcc);
  color: var(--ink);
  font: 14px var(--sans);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Castle navigation */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 258px;
  padding: 25px 17px;
  color: #eee8d7;
  background:
    linear-gradient(160deg, #1a405a 0%, #102b3e 48%, #0d2435 100%);
  border-right: 3px solid var(--gold);
  box-shadow: 5px 0 20px #162b3820, inset -1px 0 #ffffff12;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 7px 25px;
  border-bottom: 1px solid #d5bd7840;
}
.brand-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 54px;
  overflow: hidden;
  background: #0a2639;
  border: 1px solid var(--gold);
  border-radius: 5px 5px 13px 13px;
  box-shadow: inset 0 0 0 3px #ffffff0d;
}
.brand-icon img { width: 32px; height: 44px; object-fit: contain; }
.brand span, .brand strong { display: block; }
.brand span { color: #c8c9c0; font-size: 9px; letter-spacing: 1.7px; }
.brand strong { margin-top: 5px; color: #f3e8c8; font: 600 15px var(--serif); letter-spacing: 1.8px; }
.side-label, .eyebrow { font-size: 9px; font-weight: 700; letter-spacing: 1.7px; }
.side-label { padding: 26px 12px 10px; color: #c2a663; }
.sidebar nav { display: grid; gap: 5px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  color: #d1d3cd;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
}
.nav-btn span { width: 19px; color: var(--gold-light); font: 17px var(--serif); text-align: center; }
.nav-btn:hover { background: #ffffff0c; border-color: #ffffff12; color: #fff8e7; }
.nav-btn.active {
  color: #fff8e7;
  background: linear-gradient(90deg, #2b5d7d, #214967);
  border-color: #bd9e58;
  box-shadow: inset 3px 0 var(--gold), 0 3px 10px #081b2840;
}
.sidebar-bottom {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: auto;
  padding: 18px 9px 4px;
  border-top: 1px solid #d5bd7840;
}
.sidebar-bottom b, .sidebar-bottom small { display: block; font-size: 11px; }
.sidebar-bottom b { color: #efe5c9; }
.sidebar-bottom small { margin-top: 4px; color: #aeb8b8; font-size: 9px; }
.status-dot { width: 8px; height: 8px; margin-top: 3px; background: #a3bd83; border-radius: 50%; box-shadow: 0 0 0 4px #a3bd8320; }

/* Main parchment and headings */
.main { min-height: 100vh; margin-left: 258px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 40px;
  background: #fbf7ecf2;
  border-bottom: 1px solid var(--gold);
  box-shadow: 0 3px 12px #182c3610;
  backdrop-filter: blur(8px);
}
.crumb { color: #727b7d; font-size: 11px; }
.crumb span { padding: 0 9px; color: #b39a5b; }
.crumb b { color: var(--blue); font-family: var(--serif); font-weight: 600; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; color: #fff2d1; background: var(--blue); border: 1px solid var(--gold); border-radius: 50%; font: 600 15px var(--serif); }
.user-menu b, .user-menu small { display: block; font-size: 11px; }
.user-menu b { color: var(--blue); }
.user-menu small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.quiet-btn { margin-left: 14px; padding: 7px 10px; color: #6d7474; background: transparent; border: 1px solid transparent; border-radius: 4px; font-size: 10px; }
.quiet-btn:hover { color: var(--red); border-color: #d6b6a4; background: #fff9f0; }
.page { max-width: 1500px; margin: auto; padding: 39px 40px 58px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.page-heading .eyebrow { margin: 0 0 8px; color: #9c7b34; }
.page h1 { margin: 0 0 8px; color: #193e58; font: 600 32px var(--serif); letter-spacing: -.35px; }
.muted { margin: 0; color: var(--muted); font-size: 12px; }

/* Gold and blue controls */
.button { padding: 10px 16px; border-radius: 4px; font-size: 11px; font-weight: 650; transition: .15s ease; }
.button.primary { color: #fff6df; background: linear-gradient(#28658a, #174c70); border: 1px solid #b8964d; box-shadow: inset 0 1px #ffffff24, 0 3px 8px #16364a20; }
.button.primary:hover { background: linear-gradient(#34789f, #1d587d); box-shadow: inset 0 1px #ffffff35, 0 5px 12px #16364a28; transform: translateY(-1px); }
.button.secondary { color: #485660; background: #eee7d5; border: 1px solid #d1c4a3; }
.button.secondary:hover { background: #e5dbc2; }

/* Overview counters and panels */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; margin-bottom: 18px; }
.stat-card {
  position: relative;
  min-height: 118px;
  padding: 18px 19px;
  overflow: hidden;
  background: linear-gradient(145deg, #fffdf7, #f2ead6);
  border: 1px solid #cdbd96;
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px #ffffff7a, 0 3px 10px #2938420b;
}
.stat-card::after { position: absolute; right: -14px; bottom: -26px; width: 78px; height: 78px; content: ""; border: 1px solid #c4a05222; border-radius: 50%; box-shadow: 0 0 0 8px #c4a0520a, 0 0 0 17px #c4a05208; }
.stat-card span, .stat-card small { display: block; color: #737a7b; font-size: 10px; }
.stat-card b { display: block; margin: 9px 0 3px; color: #1d4f70; font: 600 29px var(--serif); }
.stat-card small { font-size: 9px; }
.stat-card.warning-stat b { color: #9b6435; }
.content-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.panel, .table-wrap { background: var(--paper); border: 1px solid #cabb99; border-radius: 5px; box-shadow: inset 0 0 0 3px #eee6d45c, 0 4px 13px #2938420b; }
.panel { padding: 19px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-head .eyebrow { margin: 0 0 5px; color: #9c7b34; }
.panel h2, .modal h2 { margin: 0; color: #193e58; font: 600 19px var(--serif); }
.text-btn { padding: 5px; color: #255d7e; background: none; border: 0; font-size: 10px; font-weight: 650; }
.text-btn:hover { color: #936c26; text-decoration: underline; }
.item-list, .ledger-list { display: grid; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid #eae3d2; }
.item-row:last-child, .ledger-row:last-child { border: 0; }
.item-name { color: #2d3e48; font-size: 11px; font-weight: 650; }
.item-meta { margin-top: 4px; color: #858987; font-size: 9px; }
.stock-value { color: #1f4e6b; font-size: 12px; font-weight: 700; text-align: right; white-space: nowrap; }
.stock-value small { display: block; margin-top: 3px; color: #858987; font-size: 9px; font-weight: 400; }
.pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 20px; font-size: 8px; font-weight: 750; letter-spacing: .4px; }
.pill.low { color: #914938; background: #f2e2d9; }
.pill.ok { color: #456445; background: #e5ecdd; }
.ledger-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 11px 1px; border-bottom: 1px solid #eae3d2; }
.ledger-icon { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #d5c89f; border-radius: 50%; font-weight: 700; }
.ledger-icon.in { color: #4a6848; background: #e9eddf; }
.ledger-icon.out { color: #a04d3c; background: #f4e6dc; }
.ledger-title { color: #31424c; font-size: 10px; font-weight: 650; }
.ledger-detail { margin-top: 4px; color: #858987; font-size: 9px; }
.ledger-amount { font-size: 10px; font-weight: 700; }
.ledger-amount.in { color: #53724c; }
.ledger-amount.out { color: #a14f3e; }

/* Search, tables and notices */
.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.search { display: flex; flex: 1; align-items: center; gap: 8px; max-width: 450px; height: 38px; padding: 0 11px; color: #9b8144; background: var(--paper); border: 1px solid #d2c5a7; border-radius: 4px; font-size: 17px; }
.search input { width: 100%; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 11px; }
.toolbar select, .form-grid select { height: 38px; padding: 0 10px; color: #4c5a61; background: var(--paper); border: 1px solid #d2c5a7; border-radius: 4px; font-size: 10px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 10px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 13px 14px; color: #f2e8cb; text-align: left; background: linear-gradient(#245a7b, #173f5a); border-bottom: 2px solid var(--gold); font-size: 8px; font-weight: 700; letter-spacing: 1px; }
td { padding: 13px 14px; color: #586166; border-bottom: 1px solid #e8e0ce; font-size: 10px; }
tbody tr:nth-child(even) { background: #f7f1e3; }
tbody tr:hover { background: #eee5cf; }
tbody tr:last-child td { border-bottom: 0; }
.td-main { color: #32434c; font-weight: 650; }
.td-sub { display: block; margin-top: 4px; color: #858987; font-size: 9px; }
.qty { color: #275673; font-weight: 700; }
.qty.low { color: #a15c3f; }
.row-action { padding: 6px 9px; color: #245b7b; background: #f7f3e7; border: 1px solid #cbb780; border-radius: 4px; font-size: 9px; font-weight: 650; }
.row-action:hover { background: #eee2c4; }
.empty { padding: 46px 18px; color: var(--muted); text-align: center; }
.empty > span { display: block; margin-bottom: 9px; color: #a08a53; font-size: 25px; }
.empty b { color: #46555b; font-size: 11px; }
.empty p { font-size: 10px; }
.notice { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 15px; color: #675d46; background: #f4edd9; border: 1px solid #d4c296; border-left: 3px solid var(--gold); border-radius: 4px; font-size: 10px; }
.notice b { color: #6f5926; white-space: nowrap; }

/* Accounts and configurable permissions */
.users-grid, .groups-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(245px,1fr)); gap: 12px; }
.user-card, .group-card { padding: 16px; background: linear-gradient(145deg,#fffdf7,#f4eddc); border: 1px solid #d0c19a; border-radius: 5px; box-shadow: inset 0 0 0 2px #ffffff70, 0 3px 9px #2938420a; }
.user-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-card .avatar { flex: none; }
.user-card b { display: block; color: #314652; font-size: 10px; }
.user-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.user-card select { height: 29px; max-width: 145px; margin-left: auto; padding: 0 6px; color: #4c5a61; background: #fffdf8; border: 1px solid #d2c5a7; border-radius: 4px; font-size: 9px; }
.user-card .toggle { margin-left: auto; color: #984c3e; background: transparent; border: 0; font-size: 9px; font-weight: 650; }
.user-card .toggle.enable { color: #4b7149; }
.user-card select + .toggle { margin-left: 0; }
.group-card h3 { margin: 0 0 5px; color: #194562; font: 600 17px var(--serif); }
.group-card p { margin: 0 0 12px; color: var(--muted); font-size: 9px; }
.right-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.right-chip { padding: 4px 7px; color: #315c72; background: #e5ebea; border: 1px solid #cad5d1; border-radius: 20px; font-size: 8px; }
.rights-field { padding: 10px 12px; background: #f8f3e7; border: 1px solid #d9ceb4; border-radius: 4px; }
.rights-field legend { padding: 0 4px; color: #41515a; font-size: 10px; font-weight: 700; }
.rights-grid { display: grid; gap: 9px; }
.rights-grid label { display: flex; flex-direction: row; align-items: center; gap: 8px; color: #4c5a61; font-weight: 500; }
.rights-grid input { width: auto; accent-color: var(--blue); }

/* Login and dialogs */
.auth-screen { display: grid; min-height: 100vh; place-items: center; padding: 22px; background:
  radial-gradient(ellipse at 50% 35%, #275c7d 0%, transparent 55%),
  linear-gradient(145deg, #142e41, #0e2232 70%); }
.auth-card { width: min(420px,100%); padding: 33px 38px; text-align: center; background: linear-gradient(145deg,#fffdf7,#f0e7d1); border: 1px solid var(--gold); border-radius: 7px; box-shadow: 0 20px 65px #07182470, inset 0 0 0 4px #ffffff83; }
.crest { display: flex; justify-content: center; height: 122px; margin-bottom: 8px; }
.crest img { max-width: 100px; max-height: 120px; object-fit: contain; filter: drop-shadow(0 5px 8px #17304444); }
.auth-card .eyebrow { margin: 12px 0 7px; color: #9a7937; }
.auth-card h1 { margin: 0 0 8px; color: #183f5a; font: 600 26px var(--serif); }
.auth-card > .muted { line-height: 1.55; }
.stack { display: grid; gap: 12px; margin-top: 21px; text-align: left; }
.stack label, .form-grid label { display: flex; flex-direction: column; gap: 6px; color: #4c5960; font-size: 10px; font-weight: 650; }
.stack input, .form-grid input, .form-grid textarea { width: 100%; padding: 10px 11px; color: var(--ink); background: #fffdf8; border: 1px solid #d3c7aa; border-radius: 4px; outline: 0; font-size: 11px; }
.stack input:focus, .form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { border-color: #a88a45; box-shadow: 0 0 0 3px #c3a05220; }
.stack small { color: var(--muted); font-weight: 400; }
.stack .button { margin-top: 3px; }
.tiny { margin-top: 16px; font-size: 9px; }
dialog.modal-backdrop { position: fixed; inset: 0; z-index: auto; display: grid; place-items: center; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 18px; overflow: auto; border: 0; background: transparent; color: inherit; }
dialog.modal-backdrop:not([open]) { display: none; }
dialog.modal-backdrop::backdrop { background: #0a1d2bc2; }
.modal { position: relative; width: min(550px,100%); max-height: 92vh; overflow: auto; padding: 26px; background: linear-gradient(145deg,#fffdf7,#f1e8d2); border: 1px solid var(--gold); border-radius: 6px; box-shadow: 0 18px 60px #06131d66, inset 0 0 0 4px #ffffff76; }
.modal-x { position: absolute; top: 12px; right: 15px; color: #6e7777; background: none; border: 0; font: 24px var(--serif); }
.modal .eyebrow { margin: 0 0 7px; color: #9a7937; }
.modal > h2 { margin-bottom: 7px; font-size: 22px; }
.modal > p.muted { margin-bottom: 19px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid textarea { resize: vertical; }
.form-grid select { width: 100%; }
.form-grid .check-line { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.form-grid .check-line input { width: auto; accent-color: var(--blue); }
.form-grid small { color: var(--muted); font-size: 9px; font-weight: 400; }
.wide { grid-column: 1/-1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.inline-form { display: flex; gap: 8px; margin: 18px 0; }
.inline-form input { min-width: 0; flex: 1; padding: 10px 11px; color: var(--ink); background: #fffdf8; border: 1px solid var(--line); border-radius: 4px; }
.catalog-list { display: grid; gap: 6px; max-height: 350px; overflow: auto; }
.catalog-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; background: #f4eedf; border: 1px solid var(--line); border-radius: 4px; }
.catalog-row span { font-weight: 650; }
.catalog-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.catalog-row .text-btn:disabled { color: #9b9b92; cursor: not-allowed; text-decoration: none; }
.tax-history { margin-top: 22px; }
.error { min-height: 16px; margin-top: 7px; color: #a74435; font-size: 10px; }
.toast { position: fixed; right: 23px; bottom: 22px; z-index: 6; padding: 11px 16px; color: #fff4d8; background: #153e59; border: 1px solid var(--gold); border-radius: 4px; box-shadow: 0 5px 20px #0003; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; font-size: 10px; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2,1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .page { padding: 31px 23px; }
  .topbar { padding: 0 23px; }
}
@media (max-width: 700px) {
  .sidebar { position: fixed; inset: auto 0 0; display: block; width: auto; height: 65px; padding: 5px 7px; border-top: 2px solid var(--gold); border-right: 0; }
  .brand, .side-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; height: 100%; align-items: center; justify-content: space-around; }
  .nav-btn { display: flex; flex-direction: column; gap: 2px; padding: 5px 7px; font-size: 8px; }
  .nav-btn span { width: auto; font-size: 15px; }
  .nav-btn.active { box-shadow: inset 0 -2px var(--gold); }
  .main { margin: 0 0 65px; }
  .topbar { height: 57px; padding: 0 13px; }
  .page { padding: 25px 14px 32px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .heading-actions { justify-content: flex-start; width: 100%; }
  .heading-actions .button { flex: 1 1 auto; }
  .page h1 { font-size: 26px; }
  .page-heading > .button { align-self: stretch; }
  .stats { gap: 8px; }
  .stat-card { min-height: 101px; padding: 12px; }
  .stat-card b { font-size: 23px; }
  .stat-card span, .stat-card small { font-size: 9px; }
  .panel { padding: 14px; }
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; max-width: none; }
  .result-count { display: none; }
  .user-menu { gap: 6px; }
  .quiet-btn { margin-left: 1px; padding: 5px; }
  .crumb { font-size: 9px; }
  .modal { padding: 22px 17px; }
  .form-grid { gap: 9px; }
  .notice { align-items: flex-start; flex-direction: column; gap: 5px; }
  .auth-card { padding: 28px 22px; }
}

/* Soldier dossiers */
.personnel-editor { width: min(780px,100%); max-height: 94vh; }
.personnel-form { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.personnel-photo-field { grid-column: 1/-1; display: flex; align-items: center; gap: 17px; padding: 13px; background: #f1e8d4; border: 1px solid var(--line); border-radius: 6px; }
.personnel-photo-preview { display: grid; flex: 0 0 104px; width: 104px; height: 120px; place-items: center; overflow: hidden; color: #957b44; background: #e3d7ba; border: 1px solid var(--gold); border-radius: 5px; font: 38px var(--serif); }
.personnel-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-controls { display: grid; gap: 7px; }
.photo-controls input[type="file"] { display: block; max-width: 100%; margin-top: 6px; font-size: 11px; }
.training-editor-block { padding: 13px; background: #f7f1e3; border: 1px solid var(--line); border-radius: 6px; }
.training-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.training-editor-heading .eyebrow { margin: 0 0 3px; font-size: 9px; }
.training-editor-heading h3 { margin: 0; color: var(--blue); font: 600 18px var(--serif); }
.training-list { display: grid; gap: 9px; }
.training-entry { padding: 11px; background: #fffdf7; border: 1px solid #dfd3b8; border-radius: 5px; }
.training-entry-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--blue); }
.training-entry-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.training-entry-grid label { display: flex; flex-direction: column; gap: 5px; color: #4c5960; font-size: 10px; font-weight: 650; }
.training-entry-grid input,.training-entry-grid select { width: 100%; min-width: 0; padding: 8px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.training-notes { grid-column: 1/-1; }
.soldier-row { display: flex; align-items: center; gap: 9px; }
.soldier-thumb { display: block; width: 34px; height: 40px; object-fit: cover; border-radius: 3px; border: 1px solid var(--gold); }
.soldier-thumb-empty { display: grid; place-items: center; color: #947b46; background: var(--parchment); font: 18px var(--serif); }
.personnel-dossier { width: min(760px,100%); }
.dossier-heading { display: flex; align-items: center; gap: 15px; padding-bottom: 15px; border-bottom: 2px solid var(--gold); }
.dossier-heading > img:first-child { width: 58px; height: 68px; object-fit: contain; }
.dossier-heading h2 { margin: 0 0 4px; color: var(--blue); font: 600 26px var(--serif); }
.dossier-heading p:last-child { margin: 0; color: var(--muted); }
.dossier-photo { flex: 0 0 92px; width: 92px; height: 112px; object-fit: cover; margin-left: auto; border: 1px solid var(--gold); border-radius: 4px; }
.dossier-photo-empty { display: grid; place-items: center; color: #967b43; background: var(--parchment); font: 34px var(--serif); }
.dossier-status { display: flex; align-items: center; justify-content: space-between; margin: 13px 0; color: var(--muted); font-size: 10px; }
.dossier-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.dossier-facts > div { display: grid; gap: 4px; padding: 9px 11px; background: #f7f1e3; border: 1px solid #e5dac1; border-radius: 4px; }
.dossier-facts small { color: var(--muted); font-size: 9px; }
.dossier-facts b { font-size: 11px; }
.dossier-section { margin-top: 17px; }
.dossier-section h3 { margin: 0 0 8px; color: var(--blue); font: 600 18px var(--serif); }
.dossier-section > p { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.dossier-training { display: grid; gap: 7px; }
.dossier-training article { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px; background: #f7f1e3; border: 1px solid #e5dac1; border-radius: 4px; }
.dossier-training article small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.dossier-training article p { margin: 5px 0 0; font-size: 10px; }
.dossier-signature { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 10px; color: var(--muted); border-top: 1px solid var(--gold); font: italic 12px var(--serif); }
.dossier-actions { margin-top: 17px; }
.dashboard-agenda,.training-panel { margin-top: 18px; }
.agenda-list,.training-cards,.material-grid { display: grid; gap: 10px; }
.agenda-card { display: grid; grid-template-columns: 98px minmax(0,1fr) auto; align-items: start; gap: 14px; padding: 13px; background: #fffdf7; border: 1px solid #dfd3b8; border-left: 3px solid var(--gold); border-radius: 5px; }
.agenda-date { display: grid; gap: 3px; color: var(--blue); }
.agenda-date b { font: 600 15px var(--serif); }
.agenda-date span,.agenda-date small,.agenda-copy small { color: var(--muted); font-size: 10px; }
.agenda-copy { display: grid; gap: 5px; min-width: 0; }
.agenda-copy > b { color: var(--blue); font: 600 16px var(--serif); }
.agenda-copy p,.material-card p,.training-card p { margin: 2px 0; color: #4c5960; white-space: pre-wrap; line-height: 1.5; }
.training-card,.material-card { padding: 14px; background: #fffdf7; border: 1px solid #dfd3b8; border-radius: 5px; }
.training-card-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.training-card h3,.material-card h3 { margin: 4px 0 6px; color: var(--blue); font: 600 18px var(--serif); }
.training-card .eyebrow { font-size: 9px; }
.training-card small { color: var(--muted); font-size: 10px; }
.card-actions { display: flex; gap: 12px; margin-top: 9px; }
.danger-text { color: #9b3e2c !important; }
.material-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 12px; }
.material-card { display: flex; flex-direction: column; align-items: flex-start; }
.material-card p { overflow-wrap: anywhere; }
@media (max-width:700px) {
  .personnel-form,.training-entry-grid,.dossier-facts { grid-template-columns: 1fr; }
  .personnel-photo-field { align-items: flex-start; }
  .personnel-photo-preview { flex-basis: 82px; width: 82px; height: 100px; }
  .training-notes { grid-column: auto; }
  .dossier-heading { align-items: flex-start; gap: 9px; }
  .dossier-heading > img:first-child { width: 42px; height: 50px; }
  .dossier-heading h2 { font-size: 20px; }
  .dossier-photo { flex-basis: 64px; width: 64px; height: 82px; }
  .dossier-actions { flex-wrap: wrap; }
  .agenda-card { grid-template-columns: 1fr; gap: 8px; }
  .material-grid { grid-template-columns: 1fr; }
  .training-card-main { flex-direction: column; }
}
