/* Grundlayout und kleine Utility-Klassen fuer die lokale Leitstellen-Oberflaeche. */
body { background-color: #1a1a1a; color: #fff; font-family: sans-serif; }
.panel { background: rgba(30, 40, 30, 0.9); border: 2px solid #b38f00; border-radius: 4px; }
.panel-header { background: repeating-linear-gradient(45deg, #1e3a1e, #1e3a1e 10px, #142a14 10px, #142a14 20px); border-bottom: 2px solid #b38f00; padding: 10px; font-weight: bold; text-transform: uppercase; }
.btn-gold { background: #b38f00; color: black; font-weight: bold; text-transform: uppercase; }
.input-dark { background: #000; border: 1px solid #333; padding: 5px; width: 100%; color: #fff; }
* { box-sizing: border-box; }
body.p-4 { padding: 16px; }
.max-w-7xl { max-width: 1280px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.overflow-hidden { overflow: hidden; }
.block { display: block; }
.h-9 { height: 36px; }
.h-12 { height: 48px; }
.h-16 { height: 64px; }
.min-h-24 { min-height: 96px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.pt-3 { padding-top: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.border { border: 1px solid currentColor; }
.border-t { border-top: 1px solid currentColor; }
.border-blue-500 { border-color: #3b82f6; }
.border-gray-600 { border-color: #4b5563; }
.border-gray-700 { border-color: #374151; }
.bg-black { background: #000; }
.text-xs { font-size: 12px; line-height: 16px; }
.text-sm { font-size: 14px; line-height: 20px; }
.text-xl { font-size: 20px; line-height: 28px; }
.text-3xl { font-size: 30px; line-height: 36px; }
.text-\[10px\] { font-size: 10px; line-height: 14px; }
.text-\[11px\] { font-size: 11px; line-height: 15px; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.rounded-full { border-radius: 9999px; }
.text-blue-300 { color: #93c5fd; }
.text-blue-400 { color: #60a5fa; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-green-400 { color: #4ade80; }
.text-red-400 { color: #f87171; }
.text-yellow-500 { color: #eab308; }
.hidden { display: none; }

/* Navigation, Tabellen und fachliche Komponenten. */
.top-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 24px; }
.nav-btn { background: #050505; border: 1px solid #b38f00; color: #fff; font-weight: 700; font-size: 11px; padding: 8px 12px; text-transform: uppercase; }
.nav-main-btn { min-width: 132px; border-width: 2px; }
.nav-sub-btn { font-size: 10px; padding: 7px 10px; border-color: #6f5b12; }
.nav-btn.active { background: #b38f00; color: #000; }
.admin-only.hidden { display: none; }
.table-wrap { overflow: auto; border: 1px solid #333; background: #111; }
.table-actions { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 720px; }
.data-table th { background: #050505; color: #fff; position: sticky; top: 0; z-index: 1; }
.data-table th, .data-table td { border: 1px solid #222; padding: 7px 8px; vertical-align: top; }
.data-table tbody tr:nth-child(odd) { background: #3a3a3a; }
.data-table tbody tr:nth-child(even) { background: #2f2f2f; }
.data-table td:empty::after { content: "-"; color: #666; }
.employee-directory-table { min-width: 620px; }
.employee-directory-row td:first-child { box-shadow: inset 5px 0 0 var(--rank-color); }
.employee-directory-row:hover td { filter: brightness(1.12); }
.employee-number { font-family: Consolas, monospace; font-weight: 900; color: #f8fafc; white-space: nowrap; }
.employee-rank-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}
.employee-rank-chip {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: #050807;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}
.employee-role-badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
.employee-role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 2px 8px;
    background: #060807;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}
.employee-role-badge-trainer {
    color: #22c55e;
    background: rgba(34, 197, 94, .08);
}
.employee-role-badge-lead {
    color: #facc15;
    background: rgba(250, 204, 21, .1);
}
.employee-role-badge-weapon {
    color: #c084fc;
    background: rgba(168, 85, 247, .12);
}
.employee-role-badge-probe {
    color: #fb923c;
    background: rgba(249, 115, 22, .12);
}
.employee-role-badge-trust {
    color: #38bdf8;
    background: rgba(14, 165, 233, .12);
}
.employee-rank-button {
    cursor: pointer;
    font-family: inherit;
}
.employee-rank-button:hover,
.employee-rank-button:focus {
    background: rgba(234, 179, 8, .12);
    outline: 1px solid #eab308;
}
.management-employee-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.management-employee-summary > div {
    border: 1px solid #334155;
    background: rgba(5, 8, 7, .86);
    padding: 12px 14px;
}
.management-employee-summary span {
    display: block;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}
.management-employee-summary strong {
    display: block;
    color: #eab308;
    font-size: 24px;
    line-height: 30px;
}
.management-employee-table {
    min-width: 1100px;
}
.management-employee-row.is-staged td {
    background: rgba(20, 76, 39, .55);
}
.management-note-input {
    width: 100%;
    min-width: 260px;
    resize: vertical;
}
.management-rank-editor-row td {
    background: #07110d !important;
}
.management-rank-editor {
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.management-rank-editor label span {
    display: block;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 900;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.management-staged-pill,
.management-promotion-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #22c55e;
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: #bbf7d0;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}
.management-promotion-chip {
    cursor: pointer;
    margin: 2px 4px 2px 0;
    font-family: inherit;
}
.management-promotion-group {
    display: grid;
    grid-template-columns: minmax(220px, .5fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border-bottom: 1px solid rgba(179, 143, 0, .28);
    padding: 8px 0;
}
.management-promotion-group strong {
    color: #eab308;
}
.management-promotion-actions {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 10px;
    margin-top: 12px;
}
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.summary-pill { background: #050505; border: 1px solid #b38f00; color: #eab308; padding: 6px 10px; font-size: 11px; font-weight: 700; }
.total-box { display: inline-flex; flex-direction: column; gap: 4px; min-width: 260px; background: #050505; border: 1px solid #b38f00; color: #d1d5db; padding: 12px 14px; margin-bottom: 12px; font-size: 11px; text-transform: uppercase; }
.total-box strong { color: #eab308; font-size: 24px; line-height: 28px; }
.log-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.log-stat { background: #050505; border: 1px solid #334155; padding: 10px; color: #9ca3af; font-size: 10px; text-transform: uppercase; }
.log-stat strong { display: block; color: #eab308; font-size: 20px; line-height: 24px; margin-top: 4px; }
.defcon-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 2px solid currentColor; border-radius: 6px; color: #22c55e; background: #050505; padding: 18px 20px; margin-bottom: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.defcon-banner.defcon-5 { color: #22c55e; }
.defcon-banner.defcon-4 { color: #3b82f6; }
.defcon-banner.defcon-3 { color: #eab308; }
.defcon-banner.defcon-2 { color: #f97316; }
.defcon-banner.defcon-1 { color: #ef4444; }
.defcon-kicker { color: #d1d5db; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.defcon-title { font-size: 42px; line-height: 46px; font-weight: 900; color: currentColor; text-transform: uppercase; }
.defcon-banner p { margin: 4px 0 0; color: #f8fafc; font-size: 16px; line-height: 24px; font-weight: 700; }
.defcon-select { min-width: 150px; border: 1px solid currentColor; background: #000; color: currentColor; padding: 10px 12px; font-weight: 900; text-transform: uppercase; }
.overview-grid { display: grid; grid-template-columns: 1.05fr 1.05fr .9fr 1.35fr; grid-template-areas: "miranda funk status ranks" "sicher funk bewerbung ranks"; gap: 10px; align-items: start; }
.overview-card { background: #000; border: 2px solid #000; color: #000; }
.overview-card h2 { color: #fff; font-size: 28px; line-height: 34px; text-align: center; padding: 8px 6px 10px; font-weight: 800; letter-spacing: 0; }
.overview-card.small h2 { font-size: 24px; line-height: 30px; }
.overview-cell { background: #6f6f6f; border-top: 2px solid #000; padding: 12px 10px; text-align: center; font-size: 15px; line-height: 20px; font-weight: 800; }
.overview-warning-cell { background: #7f1d1d; color: #fff; border-top-color: #dc2626; box-shadow: inset 4px 0 0 #ef4444; }
.overview-table { width: 100%; border-collapse: collapse; font-size: 12px; font-weight: 800; }
.overview-table td, .overview-table th { border: 1px solid #000; padding: 5px 6px; background: #707070; color: #000; vertical-align: middle; }
.overview-table tr:nth-child(odd) td { background: #9a9a9a; }
.overview-table th { background: #000; color: #fff; font-size: 18px; text-align: center; }
.overview-table .code { width: 72px; white-space: nowrap; font-family: Consolas, monospace; }
.phase-pill { display: block; border-radius: 999px; background: #d8f2c9; color: #087c2d; padding: 2px 8px; text-align: center; }
.phase-pill.closed { background: #ffd2ce; color: #b60000; }
.phase-select { width: 100%; border: 0; border-radius: 999px; padding: 3px 8px; font-weight: 800; text-align: center; color: #087c2d; background: #d8f2c9; }
.phase-select.closed { color: #b60000; background: #ffd2ce; }
.phase-select:disabled { opacity: .72; cursor: not-allowed; }
.auth-box { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.auth-user { font-size: 11px; color: #d1d5db; text-transform: none; }
.login-shell { min-height: calc(100vh - 32px); display: grid; place-items: center; }
.login-panel { width: min(460px, 100%); }
.login-content { padding: 26px; text-align: center; }
.login-logo { width: 82px; height: 82px; object-fit: contain; margin: 0 auto 14px; }
.login-content h1 { margin: 0; color: #eab308; font-size: 24px; line-height: 30px; text-transform: uppercase; }
.login-muted { margin: 8px 0 0; color: #d1d5db; font-size: 13px; line-height: 20px; }
.login-actions { margin-top: 20px; display: flex; justify-content: center; }
.login-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; text-decoration: none; font-size: 12px; }
.login-note { margin: 16px auto 0; max-width: 360px; color: #9ca3af; font-size: 11px; line-height: 17px; }
.login-warning { margin-top: 16px; border: 1px solid #dc2626; background: #2a0909; color: #fecaca; padding: 10px 12px; font-size: 12px; line-height: 18px; text-align: left; }
.login-meta { margin-top: 18px; display: grid; gap: 4px; color: #6b7280; font-size: 10px; line-height: 14px; word-break: break-all; }
.made-by { position: fixed; right: 12px; bottom: 10px; z-index: 40; display: inline-flex; align-items: center; gap: 7px; background: rgba(5, 5, 5, .9); border: 1px solid #b38f00; color: #d1d5db; padding: 7px 9px; font-size: 10px; line-height: 12px; text-decoration: none; text-transform: none; }
.made-by:hover { border-color: #eab308; color: #fff; }
.made-by img { width: 22px; height: 22px; border-radius: 999px; object-fit: cover; }
.made-by strong { color: #eab308; font-size: 11px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.made-by-version { display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 999px; background: rgba(213, 170, 22, .18); border: 1px solid rgba(234, 179, 8, .46); color: #ffe17a; font-weight: 900; letter-spacing: 0; white-space: nowrap; }
.made-by-separator { width: 1px; height: 20px; background: rgba(234, 179, 8, .35); }
.made-by-profile { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.made-by-profile:hover strong { color: #fff2a8; }
.gate-btn { background: #3f0505; border: 1px solid #7f1d1d; color: #fecaca; flex: 1; font-size: 10px; padding: 10px 8px; font-weight: 800; text-transform: uppercase; }
.gate-btn.active { background: #14532d; border-color: #22c55e; color: #bbf7d0; }
.leader-meta { color: #9ca3af; font-size: 10px; }
.leader-board { width: 100%; border-collapse: collapse; font-size: 10px; }
.leader-board th, .leader-board td { border-bottom: 1px solid #333; padding: 6px 4px; text-align: left; }
.leader-board th:nth-child(2), .leader-board th:nth-child(3), .leader-board td:nth-child(2), .leader-board td:nth-child(3) { text-align: right; color: #eab308; }
.gate-history-list { display: grid; gap: 8px; padding: 8px; }
.gate-history-item { border-left: 2px solid #b38f00; background: rgba(4, 8, 6, .58); padding: 8px 9px; }
.gate-history-head { display: flex; justify-content: space-between; gap: 8px; color: #f8fafc; font-size: 10px; line-height: 14px; }
.gate-history-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-history-head span { color: #eab308; font-weight: 800; white-space: nowrap; }
.gate-history-times { display: grid; gap: 2px; margin-top: 5px; color: #9ca3af; font-size: 10px; line-height: 13px; }
.gate-history-empty { padding: 8px; color: #9ca3af; font-size: 10px; }
.law-search-results { margin-top: 6px; border: 1px solid #374151; background: #050505; max-height: 220px; overflow: auto; }
.law-search-result { display: block; width: 100%; border: 0; border-bottom: 1px solid #222; background: transparent; color: #d1d5db; padding: 8px 10px; text-align: left; font-size: 11px; }
.law-search-result:hover, .law-search-result.active { background: #142a14; color: #fff; }
.law-search-title { color: #eab308; font-weight: 700; }
.law-search-meta { color: #9ca3af; margin-top: 2px; }
.law-description { white-space: pre-line; line-height: 18px; }
.law-pending-penalty { margin-top: 8px; border: 1px solid #4b5563; background: #050505; color: #9ca3af; padding: 8px 10px; font-size: 11px; line-height: 15px; }
.editable-cell { outline: 1px solid transparent; }
.editable-cell:focus { outline-color: #eab308; background: #111 !important; }
.copnet-cell { text-align: center; vertical-align: middle !important; }
.copnet-check { width: 18px; height: 18px; accent-color: #22c55e; cursor: pointer; }
.copnet-check:disabled { cursor: not-allowed; opacity: .65; }
.admin-form { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-page-links { display: flex; flex-wrap: wrap; gap: 8px; }
.muted-cell { color: #8ea0a8; font-size: 10px; margin-top: 3px; }
.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid #3b4f40;
    background: #07110c;
    color: #d7e7dc;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.status-open,
.status-pending { border-color: #b38f00; color: #facc15; }
.status-question { border-color: #7c3aed; color: #ddd6fe; }
.status-working { border-color: #2563eb; color: #93c5fd; }
.status-done,
.status-approved { border-color: #16a34a; color: #86efac; }
.status-rejected,
.status-impossible { border-color: #dc2626; color: #fecaca; }
.feedback-row.feedback-status-open td { background: #3a300f !important; }
.feedback-row.feedback-status-question td { background: #271b46 !important; }
.feedback-row.feedback-status-working td { background: #132d46 !important; }
.feedback-row.feedback-status-done td { background: #173925 !important; }
.feedback-row.feedback-status-rejected td { background: #3f1111 !important; }
.feedback-row.feedback-status-impossible td { background: #2f3237 !important; }
.feedback-row:hover td { filter: brightness(1.12); }
.feedback-status-select {
    min-height: 38px;
    width: 100%;
    min-width: 92px;
    border-radius: 4px;
    padding: 8px 9px;
    border: 1px solid #33443a;
    font-weight: 900;
    color: #f8fafc;
    outline: none;
}
.feedback-status-select.feedback-status-open { background: #4a3700; border-color: #b38f00; color: #fde68a; }
.feedback-status-select.feedback-status-question { background: #2e1f57; border-color: #7c3aed; color: #ddd6fe; }
.feedback-status-select.feedback-status-working { background: #0f3a5a; border-color: #2563eb; color: #bfdbfe; }
.feedback-status-select.feedback-status-done { background: #14532d; border-color: #22c55e; color: #bbf7d0; }
.feedback-status-select.feedback-status-rejected { background: #4c0505; border-color: #dc2626; color: #fecaca; }
.feedback-status-select.feedback-status-impossible { background: #2f3237; border-color: #9ca3af; color: #e5e7eb; }
.feedback-status-select:focus {
    box-shadow: 0 0 0 3px rgba(213, 170, 22, .18);
    border-color: var(--gold);
}
.feedback-question-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .72);
}
.feedback-question-dialog {
    width: min(560px, 100%);
    border: 1px solid #7c3aed;
    background: #07110c;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.feedback-question-dialog textarea {
    min-height: 150px;
    resize: vertical;
}
.feedback-question-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}
.ghost-btn {
    border: 1px solid #334155;
    background: #050807;
    color: #d1d5db;
    font-weight: 800;
    text-transform: uppercase;
}
.ghost-btn:hover {
    border-color: #64748b;
    color: #f8fafc;
}
.admin-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.record-section-title { color: #eab308; font-size: 10px; font-weight: 800; margin: 12px 0 6px; text-transform: uppercase; }
.bulk-promotion-group { border: 1px solid #334155; background: #050807; padding: 12px; margin-bottom: 12px; }
.bulk-promotion-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.bulk-promotion-head .record-section-title { margin: 0; }
.bulk-promotion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bulk-promotion-grid textarea { grid-column: 1 / -1; min-height: 86px; resize: vertical; }
.record-text-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.record-text-grid textarea:last-child { grid-column: 1 / -1; }
.record-check-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.record-check-group { background: #050807; border: 1px solid #334155; padding: 10px; }
.record-check-title { color: #9ca3af; font-size: 10px; font-weight: 800; margin-bottom: 8px; text-transform: uppercase; }
.record-check-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.record-check { display: flex; align-items: center; gap: 6px; color: #d1d5db; font-size: 11px; font-weight: 700; }
.record-check-input { width: 16px; height: 16px; accent-color: #22c55e; }
.record-check-single { min-height: 36px; background: #050807; border: 1px solid #334155; padding: 8px 10px; }
.career-builder { display: grid; grid-template-columns: minmax(150px, .85fr) minmax(180px, 1fr) minmax(140px, .7fr) minmax(140px, .7fr) auto; gap: 10px; align-items: end; }
.career-builder .btn-gold { min-height: 38px; white-space: nowrap; }
.career-builder + .admin-actions { margin-top: 18px; }
.field-stack { display: flex; flex-direction: column; gap: 4px; color: #9ca3af; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.field-stack .input-dark { min-height: 36px; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #183724 !important; }
.data-table tbody tr.gate-low,
.data-table tbody tr.gate-low td { background: #4c0505 !important; color: #fecaca !important; }
.data-table tbody tr.gate-mid,
.data-table tbody tr.gate-mid td { background: #4a3700 !important; color: #fde68a !important; }
.data-table tbody tr.gate-high,
.data-table tbody tr.gate-high td { background: #103d24 !important; color: #bbf7d0 !important; }
.soldier-check { min-height: 36px; display: flex; align-items: center; gap: 8px; background: #000; border: 1px solid #333; padding: 5px 8px; color: #9ca3af; font-size: 12px; }
.danger-btn { background: #4c0505; border: 1px solid #dc2626; color: #fecaca; font-size: 10px; padding: 5px 8px; font-weight: 800; }
.rank-general { color: #ff1111 !important; }
.rank-officer { color: #147de0 !important; }
.rank-nco { color: #43a0ff !important; }
.rank-soldier { color: #73d064 !important; }
.rank-recruit { color: #69c95e !important; }
.overview-rank-table { font-size: 11px; table-layout: auto; }
.overview-rank-table th { font-size: 11px; line-height: 14px; padding: 5px 4px; }
.overview-rank-table td { padding: 5px 5px; }
.overview-rank-table .rank-number-cell { width: 28px; text-align: center; font-family: Consolas, monospace; font-weight: 900; }
.overview-rank-table .rank-name-cell { min-width: 96px; }
.overview-rank-table .rank-insignia-cell { min-width: 112px; text-align: left; }
.rank-insignia-wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.rank-insignia {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: #050505;
    font-size: 10px;
    line-height: 12px;
    font-weight: 900;
    color: #d1d5db;
    letter-spacing: 0;
    white-space: nowrap;
    flex: 0 0 auto;
}
.rank-insignia-image {
    display: block;
    max-width: 68px;
    max-height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .75));
    margin-left: auto;
}
.rank-insignia-general { color: #ff1111; background: #1e0505; }
.rank-insignia-officer { color: #147de0; background: #031122; }
.rank-insignia-nco { color: #43a0ff; background: #06182a; }
.rank-insignia-soldier { color: #73d064; background: #071907; }
.rank-insignia-recruit { color: #69c95e; background: #071907; }
.area-miranda { grid-area: miranda; }
.area-sicher { grid-area: sicher; }
.area-funk { grid-area: funk; }
.area-status { grid-area: status; }
.area-bewerbung { grid-area: bewerbung; }
.area-ranks { grid-area: ranks; }
button { cursor: pointer; }
select, button { font: inherit; }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .xl\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .xl\:col-span-2 { grid-column: span 2 / span 2; }
    .xl\:col-span-3 { grid-column: span 3 / span 3; }
}
@media (max-width: 1100px) {
    .overview-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "miranda funk" "sicher funk" "status ranks" "bewerbung ranks"; }
}
@media (max-width: 760px) {
    .overview-grid { grid-template-columns: 1fr; grid-template-areas: "miranda" "sicher" "funk" "status" "bewerbung" "ranks"; }
    .top-nav { margin-left: 0; margin-top: 10px; }
}

/* Modernes Oberflaechen-Polish. Bleibt bewusst CSS-only, damit Logik und Daten unveraendert bleiben. */
:root {
    --bg: #111312;
    --surface: #172019;
    --surface-strong: #0b0f0d;
    --surface-soft: #1d2921;
    --line: #3b4a40;
    --line-strong: #b38f00;
    --gold: #d5aa16;
    --gold-soft: #f6d761;
    --blue: #3b82f6;
    --blue-soft: #93c5fd;
    --text: #f7f7f4;
    --muted: #aeb8b0;
    --danger: #b91c1c;
    --ok: #16a34a;
    --radius: 6px;
}

html { min-height: 100%; background: var(--bg); }
body {
    min-height: 100%;
    background:
        linear-gradient(180deg, #171a18 0%, #111312 45%, #0d0f0e 100%);
    color: var(--text);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
}
body.p-4 { padding: 24px 18px 48px; }
.max-w-7xl { width: min(1280px, calc(100vw - 32px)); }

.panel {
    background: linear-gradient(180deg, rgba(28, 40, 31, .96), rgba(18, 27, 21, .96));
    border: 1px solid rgba(213, 170, 22, .72);
    border-radius: var(--radius);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.panel-header {
    background:
        linear-gradient(90deg, rgba(15, 76, 39, .48), rgba(14, 34, 22, .7)),
        repeating-linear-gradient(45deg, rgba(43, 83, 45, .35), rgba(43, 83, 45, .35) 10px, rgba(16, 38, 23, .35) 10px, rgba(16, 38, 23, .35) 20px);
    border-bottom: 1px solid rgba(213, 170, 22, .8);
    padding: 12px 14px;
    color: #fff;
    font-weight: 800;
}
.panel-header.flex { min-height: 88px; }
.panel-header img.h-16 {
    height: 72px;
    width: 72px;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35));
}
h1.text-xl {
    font-size: 23px;
    line-height: 27px;
    font-weight: 900;
}

.btn-gold,
.nav-btn,
.danger-btn,
button.bg-black {
    border-radius: 4px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-gold {
    background: linear-gradient(180deg, var(--gold), #a98100);
    border: 1px solid rgba(255, 232, 127, .28);
    color: #070807;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .22);
}
.btn-gold:hover,
.nav-btn:hover,
.danger-btn:hover,
button.bg-black:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
}
.btn-gold:active,
.nav-btn:active,
.danger-btn:active,
button.bg-black:active {
    transform: translateY(0);
}
.nav-btn {
    background: rgba(5, 8, 7, .84);
    border: 1px solid rgba(213, 170, 22, .72);
    color: #f8fafc;
    padding: 9px 13px;
}
.nav-btn.active {
    background: linear-gradient(180deg, var(--gold), #a98100);
    color: #050505;
}
.top-nav { gap: 10px; }

.input-dark,
select.input-dark,
input.input-dark,
textarea.input-dark {
    min-height: 38px;
    background: #050807;
    border: 1px solid #33443a;
    border-radius: 4px;
    color: #f8fafc;
    padding: 8px 10px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.input-dark:focus,
select.input-dark:focus,
input.input-dark:focus,
textarea.input-dark:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(213, 170, 22, .16);
    background: #030504;
}
textarea.record-readonly-field,
textarea.record-readonly-field:focus {
    border-color: #26352d;
    background: #07110c;
    color: #aeb8b0;
    cursor: default;
    box-shadow: none;
}
label { color: var(--muted); }

.bg-black {
    background: #050807;
    border-radius: 4px;
}
.border-blue-500 { border-color: rgba(59, 130, 246, .82); }
.text-blue-400 { color: #7db5ff; }
.text-yellow-500 { color: var(--gold-soft); }

.table-wrap {
    background: #080b0a;
    border: 1px solid #29372f;
    border-radius: 4px;
}
.log-table-wrap {
    max-height: 560px;
    overflow: auto;
}
.data-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}
.data-table th {
    background: #070a09;
    color: #f8fafc;
    border-bottom: 1px solid #33443a;
    padding: 9px 10px;
}
.data-table th,
.data-table td {
    border-color: #26322c;
}
.data-table td {
    padding: 9px 10px;
    color: #eef2ee;
}
.data-table tbody tr:nth-child(odd) { background: #25352b; }
.data-table tbody tr:nth-child(even) { background: #1d2b23; }
.data-table tbody tr:hover { background: #304535; }
.editable-cell:focus {
    outline: 2px solid rgba(213, 170, 22, .65);
    outline-offset: -2px;
    background: #0b0f0d !important;
}

.summary-pill,
.total-box,
.log-stat {
    border-radius: 4px;
    background: linear-gradient(180deg, #070a09, #030504);
    border-color: #3b4a40;
}
.summary-pill { color: var(--gold-soft); }
.total-box {
    box-shadow: inset 3px 0 0 var(--gold);
}
.total-box strong,
.log-stat strong {
    color: var(--gold-soft);
}
.log-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.gate-btn {
    border-radius: 4px;
    background: #540a0a;
    border-color: #991b1b;
}
.gate-btn.active {
    background: #14532d;
    border-color: #22c55e;
}
.leader-board th,
.leader-board td {
    padding: 8px 6px;
}

.overview-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #111;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
}
.overview-card h2 {
    background: #050505;
    font-size: 25px;
    line-height: 31px;
}
.overview-cell {
    background: #767b77;
    font-size: 14px;
}
.overview-warning-cell {
    background: #7f1d1d;
    color: #fff;
}
.overview-table th {
    font-size: 15px;
}
.overview-table td,
.overview-table th {
    padding: 6px 8px;
}

.auth-box {
    min-width: 165px;
    padding: 4px 0;
}
.auth-user {
    color: #f8fafc;
    font-weight: 700;
}
.made-by {
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
    backdrop-filter: blur(6px);
}

.law-search-results {
    border-radius: 4px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .32);
}
.law-search-result:hover,
.law-search-result.active {
    background: #183724;
}
.danger-btn {
    background: linear-gradient(180deg, #7f1010, #4c0505);
    border-color: #dc2626;
}
.copnet-check {
    accent-color: var(--ok);
}

.training-public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.training-day-card {
    background: rgba(2, 6, 23, .62);
    border: 1px solid rgba(202, 162, 0, .7);
    border-radius: var(--radius);
    overflow: hidden;
}
.training-day-title {
    padding: 10px 12px;
    background: rgba(0, 0, 0, .65);
    color: var(--gold-strong);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}
.training-entry {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid rgba(148, 163, 184, .18);
}
.training-time {
    color: var(--gold-strong);
    font-weight: 900;
}

@media (max-width: 920px) {
    .grid-cols-3 { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: auto; }
    .panel-header.flex { align-items: flex-start; gap: 14px; }
    .panel-header.flex.justify-between { flex-direction: column; }
    .auth-box { align-items: flex-start; }
}

@media (max-width: 760px) {
    body.p-4 { padding: 12px 10px 58px; }
    .max-w-7xl { width: 100%; }
    .panel-header img.h-16 { height: 58px; width: 58px; }
    h1.text-xl { font-size: 20px; line-height: 24px; }
    .admin-grid { grid-template-columns: 1fr; }
    .bulk-promotion-grid { grid-template-columns: 1fr; }
    .career-builder { grid-template-columns: 1fr; }
    .record-check-layout,
    .record-text-grid { grid-template-columns: 1fr; }
    .record-check-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .log-stats { grid-template-columns: 1fr 1fr; }
    .made-by { right: 8px; bottom: 8px; max-width: calc(100vw - 16px); }
}

/* Lokaler Layout-Entwurf: gleiche Farbwelt, klarere Struktur. */
body.p-4 {
    padding: 0;
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    background:
        linear-gradient(90deg, rgba(4, 8, 6, .94) 0, rgba(4, 8, 6, .94) 272px, transparent 272px),
        linear-gradient(180deg, #171a18 0%, #101411 100%);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 14px;
    border-right: 1px solid rgba(213, 170, 22, .52);
    background:
        linear-gradient(180deg, rgba(12, 33, 19, .98), rgba(5, 8, 7, .98)),
        repeating-linear-gradient(45deg, rgba(43, 83, 45, .18), rgba(43, 83, 45, .18) 10px, rgba(16, 38, 23, .18) 10px, rgba(16, 38, 23, .18) 20px);
    box-shadow: 16px 0 34px rgba(0, 0, 0, .24);
    overflow: hidden;
}

.sidebar-brand {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 8px 16px;
    border-bottom: 1px solid rgba(213, 170, 22, .36);
}

.sidebar-brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .42));
}

.sidebar-brand h1 {
    margin: 0;
    color: #fff;
    font-size: 15px;
    line-height: 18px;
    font-weight: 950;
    text-transform: uppercase;
}

.sidebar-brand p {
    margin: 3px 0 0;
    color: var(--gold-soft);
    font-size: 9px;
    line-height: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.nav-section {
    display: grid;
    gap: 6px;
}

.nav-section-label {
    padding: 0 8px 3px;
    color: #87968b;
    font-size: 10px;
    line-height: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.sidebar-nav .nav-btn {
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 8px 10px;
    border-color: rgba(213, 170, 22, .28);
    background: rgba(5, 8, 7, .64);
    color: #dce7df;
    text-align: left;
    box-shadow: none;
}

.sidebar-nav .nav-btn:hover {
    border-color: rgba(213, 170, 22, .7);
    background: rgba(20, 42, 24, .96);
}

.sidebar-nav .nav-btn.active {
    border-color: rgba(246, 215, 97, .96);
    background: linear-gradient(180deg, #d5aa16, #a98100);
    color: #050807;
    box-shadow: 0 9px 18px rgba(0, 0, 0, .28);
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1;
    font-weight: 950;
}

.app-main {
    min-width: 0;
    padding: 18px 22px 44px;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(213, 170, 22, .62);
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(15, 76, 39, .42), rgba(11, 15, 13, .96)),
        repeating-linear-gradient(45deg, rgba(43, 83, 45, .22), rgba(43, 83, 45, .22) 10px, rgba(16, 38, 23, .22) 10px, rgba(16, 38, 23, .22) 20px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .24);
}

.page-context {
    min-width: 0;
}

.page-kicker {
    color: var(--gold-soft);
    font-size: 10px;
    line-height: 14px;
    font-weight: 900;
    text-transform: uppercase;
}

.page-context h2 {
    margin: 2px 0 0;
    color: #f8fafc;
    font-size: 24px;
    line-height: 30px;
    font-weight: 950;
    text-transform: uppercase;
}

.app-workspace {
    min-width: 0;
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 286px;
    gap: 16px;
    align-items: start;
}

.calculator-primary,
.calculator-side,
.calculator-form,
.calculator-summary {
    min-width: 0;
}

.calculator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 16px;
    align-items: start;
}

.calculator-side {
    display: grid;
    gap: 16px;
}

.admin-page-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
}

.admin-page-links .nav-btn {
    width: 100%;
    min-height: 36px;
    margin: 0;
}

.page-view.hidden,
.hidden {
    display: none !important;
}

@media (max-width: 1180px) {
    .app-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        background:
            linear-gradient(90deg, rgba(4, 8, 6, .94) 0, rgba(4, 8, 6, .94) 230px, transparent 230px),
            linear-gradient(180deg, #171a18 0%, #101411 100%);
    }
    .app-sidebar {
        padding: 14px 10px;
    }
    .sidebar-brand {
        grid-template-columns: 48px minmax(0, 1fr);
    }
    .sidebar-brand img {
        width: 48px;
        height: 48px;
    }
    .calculator-layout,
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

.unit-shell {
    display: grid;
    gap: 24px;
}

.unit-nav-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    border-bottom: 1px solid rgba(213, 170, 22, .26);
    padding-bottom: 14px;
}

.unit-unit-btn,
.unit-category-btn {
    min-height: 44px;
    border: 1px solid rgba(213, 170, 22, .24);
    background: rgba(3, 7, 5, .68);
    color: #dce7df;
    font-size: 11px;
    font-weight: 950;
    text-align: left;
    text-transform: uppercase;
}

.unit-unit-btn {
    padding: 0 14px;
}

.unit-unit-btn.active,
.unit-category-btn.active {
    border-color: rgba(255, 232, 127, .86);
    background: linear-gradient(180deg, var(--gold), #a98100);
    color: #050807;
}

.unit-category-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 8px;
}

.unit-category-btn {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    padding: 9px 11px;
}

.unit-category-btn small {
    color: currentColor;
    font-size: 9px;
    line-height: 12px;
    font-weight: 800;
    opacity: .72;
}

.unit-section {
    display: grid;
    gap: 18px;
}

.unit-entry-form,
.unit-doc-form,
.unit-chat-form {
    display: grid;
    gap: 10px;
}

.unit-doc-form {
    grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.2fr) auto;
}

.unit-chat-form {
    grid-template-columns: minmax(160px, .55fr) minmax(260px, 1fr) auto;
}

.unit-entry-form {
    grid-template-columns: minmax(160px, .8fr) minmax(180px, .8fr) minmax(220px, 1fr) auto;
    align-items: start;
}

.unit-entry-form textarea {
    min-height: 92px;
}

.unit-entry-form .btn-gold {
    min-height: 38px;
}

.unit-entry-list,
.unit-doc-list,
.unit-chat-list {
    display: grid;
    gap: 14px;
}

.unit-entry-card,
.unit-doc-item,
.unit-chat-entry {
    border-left: 3px solid rgba(213, 170, 22, .46);
    background: rgba(4, 8, 6, .34);
}

.unit-entry-card {
    display: grid;
    gap: 10px;
    padding: 13px 15px;
}

.unit-entry-card.checked {
    border-left-color: #22c55e;
    background: rgba(20, 83, 45, .35);
}

.unit-entry-meta,
.unit-doc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 900;
}

.unit-entry-meta span,
.unit-entry-extra {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.unit-entry-card p {
    margin: 0;
    color: #dce7df;
    white-space: pre-wrap;
}

.unit-entry-card img,
.unit-entry-card video {
    max-width: min(720px, 100%);
    max-height: 440px;
    border: 1px solid rgba(213, 170, 22, .2);
    background: #020504;
    object-fit: contain;
}

.unit-check-btn,
.unit-archive-btn {
    border: 1px solid rgba(34, 197, 94, .55);
    background: rgba(20, 83, 45, .5);
    color: #dcfce7;
    font-size: 10px;
    font-weight: 900;
    padding: 6px 10px;
    text-transform: uppercase;
}

.unit-archive-btn {
    border-color: rgba(213, 170, 22, .72);
    background: rgba(213, 170, 22, .16);
    color: #f8e29b;
}

.unit-chat-entry {
    display: grid;
    grid-template-columns: 58px minmax(110px, .32fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.unit-chat-entry time {
    color: var(--gold-soft);
    font-size: 10px;
    font-weight: 900;
}

.unit-chat-entry strong {
    color: #f8fafc;
    font-size: 12px;
}

.unit-chat-entry span {
    color: #dce7df;
}

.unit-doc-item {
    display: grid;
    gap: 12px;
    padding: 13px 15px;
}

.unit-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.unit-card-actions a {
    color: var(--gold-soft);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.unit-doc-link-only {
    border-left: 3px solid rgba(213, 170, 22, .46);
    background: rgba(4, 8, 6, .42);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    padding: 10px 12px;
}

.unit-empty {
    border-left: 3px solid rgba(148, 163, 184, .32);
    background: rgba(4, 8, 6, .26);
    color: var(--muted);
    padding: 13px 15px;
    font-size: 12px;
}

.airforce-duty-sheet {
    gap: 22px;
}

.airforce-duty-section {
    display: grid;
    gap: 10px;
}

.airforce-duty-section .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.airforce-duty-section .panel-header small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: none;
}

.airforce-duty-scroll {
    overflow-x: auto;
    border: 1px solid rgba(213, 170, 22, .2);
    background: rgba(3, 7, 5, .58);
}

.airforce-duty-table {
    width: 100%;
    min-width: 1280px;
    border-collapse: collapse;
    color: #f8fafc;
    font-size: 12px;
}

.airforce-duty-table th,
.airforce-duty-table td {
    border: 1px solid rgba(213, 170, 22, .14);
    padding: 8px 7px;
    vertical-align: middle;
}

.airforce-duty-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #050807;
    color: var(--gold-soft);
    font-size: 10px;
    font-weight: 950;
    text-align: center;
    text-transform: uppercase;
}

.airforce-duty-table tbody tr:nth-child(odd) td {
    background: rgba(14, 30, 20, .72);
}

.airforce-duty-table tbody tr:nth-child(even) td {
    background: rgba(8, 18, 13, .72);
}

.airforce-duty-table .support-row td {
    background: rgba(16, 31, 45, .72);
}

.airforce-duty-table .duty-number {
    width: 64px;
    color: var(--gold-soft);
    font-weight: 950;
    text-align: center;
}

.airforce-duty-table .training-col {
    width: 78px;
    text-align: center;
}

.duty-input {
    min-width: 150px;
    height: 34px;
    font-size: 12px;
}

.duty-check {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(148, 163, 184, .22);
    color: #6b7280;
    font-weight: 950;
}

.duty-check.enabled {
    border-color: rgba(34, 197, 94, .6);
    background: rgba(20, 83, 45, .62);
    color: #dcfce7;
}

@media (max-width: 1180px) {
    .unit-entry-form,
    .unit-doc-form,
    .unit-chat-form {
        grid-template-columns: 1fr;
    }
}

.unit-chat-panel {
    min-height: min(640px, calc(100vh - 260px));
    display: grid;
    grid-template-rows: auto minmax(320px, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(213, 170, 22, .22);
    background:
        linear-gradient(180deg, rgba(5, 10, 8, .52), rgba(3, 6, 5, .82)),
        radial-gradient(circle at 100% 0%, rgba(213, 170, 22, .08), transparent 32%);
}

.unit-chat-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(213, 170, 22, .22);
    background: rgba(3, 6, 5, .58);
}

.unit-chat-header > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.unit-channel-hash {
    color: var(--gold-soft);
    font-size: 22px;
    line-height: 1;
    font-weight: 950;
}

.unit-chat-header strong {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 950;
    text-transform: uppercase;
}

.unit-chat-header small,
.unit-chat-header > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.unit-chat-list {
    display: block;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 10px 18px;
    scroll-behavior: smooth;
}

.unit-chat-message {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 8px;
    border-left: 0;
    background: transparent;
}

.unit-chat-message:hover {
    background: rgba(255, 255, 255, .035);
}

.unit-chat-message.own .unit-chat-avatar {
    background: linear-gradient(180deg, var(--gold-soft), var(--gold));
    color: #050807;
}

.unit-chat-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(213, 170, 22, .32);
    border-radius: 50%;
    background: #112217;
    color: #dce7df;
    font-size: 11px;
    font-weight: 950;
}

.unit-chat-message-body {
    min-width: 0;
}

.unit-chat-meta {
    min-height: 18px;
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.unit-chat-meta strong {
    color: #f8fafc;
    font-size: 12px;
    line-height: 16px;
    font-weight: 950;
}

.unit-chat-meta time,
.unit-chat-own {
    color: #7f9188;
    font-size: 10px;
    font-weight: 800;
}

.unit-chat-own {
    color: var(--gold-soft);
    text-transform: uppercase;
}

.unit-chat-message p {
    margin: 2px 0 0;
    color: #dce7df;
    font-size: 13px;
    line-height: 19px;
    white-space: pre-wrap;
    word-break: break-word;
}

.unit-chat-delete {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #ef9a9a;
    font-size: 10px;
    font-weight: 900;
    opacity: 0;
    text-transform: uppercase;
}

.unit-chat-message:hover .unit-chat-delete {
    opacity: 1;
}

.unit-chat-empty {
    display: grid;
    gap: 4px;
    padding: 34px 12px;
    color: var(--muted);
    text-align: center;
}

.unit-chat-empty strong {
    color: #f8fafc;
    font-size: 16px;
}

.unit-chat-composer {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: end;
    gap: 9px;
    padding: 12px 178px 12px 12px;
    border-top: 1px solid rgba(213, 170, 22, .2);
    background: rgba(3, 6, 5, .66);
}

.unit-composer-plus {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(213, 170, 22, .16);
    color: var(--gold-soft);
    font-size: 18px;
    line-height: 1;
    font-weight: 950;
}

.unit-chat-composer textarea {
    min-height: 42px;
    max-height: 140px;
    resize: vertical;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(20, 31, 25, .94);
    color: #f8fafc;
    padding: 11px 12px;
    outline: none;
}

.unit-chat-composer textarea:focus {
    border-color: rgba(213, 170, 22, .62);
    box-shadow: 0 0 0 3px rgba(213, 170, 22, .12);
}

.unit-send-btn {
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid rgba(255, 232, 127, .38);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--gold), #a98100);
    color: #050807;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
}

body[data-current-page="unit"] .made-by {
    bottom: 72px;
}

@media (max-width: 760px) {
    .unit-chat-panel {
        min-height: 560px;
    }
    .unit-chat-composer {
        grid-template-columns: 32px minmax(0, 1fr);
        padding-right: 12px;
    }
    .unit-send-btn {
        grid-column: 2;
    }
}

.app-topbar .auth-box {
    min-width: 0;
    max-width: min(420px, 48vw);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 7px;
    border: 1px solid rgba(213, 170, 22, .26);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(7, 13, 10, .86), rgba(2, 5, 4, .9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 24px rgba(0, 0, 0, .22);
}

.app-topbar .auth-user {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
}

.auth-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 232, 127, .42);
    border-radius: 50%;
    background: linear-gradient(180deg, var(--gold-soft), var(--gold));
    color: #050807;
    font-size: 12px;
    line-height: 1;
    font-weight: 950;
    box-shadow: 0 7px 14px rgba(0, 0, 0, .24);
}

.auth-avatar-button {
    position: relative;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
}

.auth-avatar img,
.unit-chat-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.auth-avatar-edit {
    position: absolute;
    inset: auto 0 0;
    min-height: 14px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .72);
    color: #f8fafc;
    font-size: 7px;
    line-height: 1;
    font-weight: 950;
    opacity: 0;
    text-transform: uppercase;
    transition: opacity .15s ease;
}

.auth-avatar-button:hover .auth-avatar-edit {
    opacity: 1;
}

.auth-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-name {
    max-width: 230px;
    overflow: hidden;
    color: #f8fafc;
    font-size: 12px;
    line-height: 16px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-role {
    width: fit-content;
    color: var(--gold-soft);
    font-size: 9px;
    line-height: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.auth-logout {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 13px;
    border: 1px solid rgba(213, 170, 22, .55);
    border-radius: 6px;
    background: rgba(213, 170, 22, .12);
    color: var(--gold-soft);
    font-size: 10px;
    line-height: 1;
    font-weight: 950;
    text-transform: uppercase;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.auth-logout:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 232, 127, .9);
    background: linear-gradient(180deg, var(--gold), #a98100);
    color: #050807;
}

@media (max-width: 820px) {
    .app-topbar .auth-box {
        max-width: 100%;
        justify-content: space-between;
    }
    .auth-name {
        max-width: 54vw;
    }
}

@media (max-width: 820px) {
    .app-layout {
        display: block;
        background: linear-gradient(180deg, #171a18 0%, #101411 100%);
    }
    .app-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(213, 170, 22, .52);
    }
    .sidebar-nav {
        max-height: none;
        overflow: visible;
    }
    .nav-section {
        grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    }
    .nav-section-label {
        grid-column: 1 / -1;
    }
    .app-main {
        padding: 14px 12px 34px;
    }
    .app-topbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }
    .auth-box {
        align-items: flex-start;
    }
}

/* Lokaler Flaechen-Entwurf: links Navigation, rechts eine durchgehende Arbeitsseite. */
.app-main {
    padding: 22px 28px 56px;
    background:
        radial-gradient(circle at 18% 0%, rgba(44, 94, 54, .18), transparent 34%),
        linear-gradient(180deg, #111711 0%, #0c100d 100%);
}

.app-topbar {
    position: sticky;
    top: 0;
    min-height: 72px;
    margin: -2px 0 24px;
    padding: 4px 0 16px;
    border: 0;
    border-bottom: 1px solid rgba(213, 170, 22, .34);
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(17, 23, 17, .98), rgba(17, 23, 17, .86));
    box-shadow: 0 18px 26px rgba(12, 16, 13, .72);
    backdrop-filter: blur(8px);
}

.page-kicker {
    color: var(--gold-soft);
}

.page-context h2 {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.05;
}

.app-workspace {
    max-width: 1420px;
    min-height: calc(100vh - 150px);
}

.app-main .panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.app-main .panel-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    min-height: 0;
    margin: 0 0 18px;
    padding: 0 0 10px;
    border: 0;
    border-bottom: 1px solid rgba(213, 170, 22, .28);
    background: transparent;
    color: #f8fafc;
    font-size: 13px;
    line-height: 18px;
}

.app-main .panel-header.page-title .summary-pill {
    margin-left: auto;
}

#page-data > .panel > .panel-header {
    display: none;
}

.app-main .panel-header::before {
    content: "";
    width: 4px;
    height: 18px;
    flex: 0 0 auto;
    background: var(--gold);
    box-shadow: 0 0 14px rgba(213, 170, 22, .28);
}

.app-main .panel-header > span:first-child,
.app-main .panel-header:not(.page-title) {
    color: #f8fafc;
}

.app-main .panel > .p-4,
.app-main .panel > .p-3,
.app-main .panel > .p-2 {
    padding: 0;
}

#page-data > .panel > .p-4 {
    display: grid;
    gap: 28px;
}

#page-data .panel + .panel,
#page-data .space-y-4 > .panel + .panel {
    margin-top: 28px;
    padding-top: 26px;
    border-top: 1px solid rgba(213, 170, 22, .18);
}

.calculator-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
}

.calculator-grid {
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 28px;
}

.calculator-side {
    gap: 30px;
    padding-left: 26px;
    border-left: 1px solid rgba(213, 170, 22, .22);
}

.calculator-side .panel + .panel {
    padding-top: 26px;
    border-top: 1px solid rgba(213, 170, 22, .18);
}

.summary-pill,
.app-main .log-stat,
.app-main .total-box,
.calculator-summary,
.app-main .record-check-group,
.app-main .bulk-promotion-group,
.app-main .training-day-card,
.app-main .law-pending-penalty {
    border-radius: 0;
    box-shadow: none;
}

.summary-pill {
    border: 0;
    border-left: 3px solid var(--gold);
    background: rgba(213, 170, 22, .08);
    color: var(--gold-soft);
}

.calculator-summary {
    padding: 0 0 0 18px !important;
    border: 0 !important;
    border-left: 3px solid rgba(59, 130, 246, .8) !important;
    background: transparent !important;
}

.calculator-summary .border-t {
    border-top-color: rgba(213, 170, 22, .2);
}

#law-preview,
.app-main .law-pending-penalty {
    border: 0 !important;
    border-left: 3px solid rgba(213, 170, 22, .46) !important;
    background: rgba(4, 8, 6, .48) !important;
}

.app-main .table-wrap {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.app-main .data-table {
    border-collapse: collapse;
}

.app-main .data-table th {
    background: rgba(3, 6, 5, .92);
    border-top: 1px solid rgba(213, 170, 22, .2);
    border-bottom: 1px solid rgba(213, 170, 22, .32);
}

.app-main .data-table th,
.app-main .data-table td {
    border-left: 0;
    border-right: 0;
}

.app-main .data-table tbody tr:nth-child(odd) {
    background: rgba(40, 57, 46, .72);
}

.app-main .data-table tbody tr:nth-child(even) {
    background: rgba(28, 43, 35, .72);
}

.app-main .record-check-group,
.app-main .bulk-promotion-group,
.app-main .training-day-card,
.app-main .log-stat,
.app-main .total-box {
    border: 0;
    border-left: 3px solid rgba(213, 170, 22, .52);
    background: rgba(4, 8, 6, .34);
}

.app-main .record-check-single,
.app-main .soldier-check {
    border-color: rgba(213, 170, 22, .16);
    background: rgba(4, 8, 6, .45);
}

.app-main .input-dark,
.app-main select.input-dark,
.app-main input.input-dark,
.app-main textarea.input-dark {
    border-color: rgba(148, 163, 184, .24);
    background: rgba(2, 5, 4, .82);
}

.app-main .input-dark:focus,
.app-main select.input-dark:focus,
.app-main input.input-dark:focus,
.app-main textarea.input-dark:focus {
    border-color: var(--gold);
}

.app-main .admin-grid,
.app-main .record-text-grid,
.app-main .record-check-layout,
.app-main .bulk-promotion-grid,
.app-main .career-builder,
.app-main .log-stats {
    gap: 12px;
}

.app-main .overview-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.app-main .defcon-banner {
    border-width: 1px;
    border-radius: 0;
    background: rgba(4, 8, 6, .45);
    box-shadow: none;
}

.gate-btn {
    border-radius: 0;
}

.unit-sync-info,
.unit-sync-warning {
    margin: 14px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--gold);
    background: rgba(213, 170, 22, .1);
    color: #f7f7f4;
    font-size: 12px;
    font-weight: 800;
}

.unit-sync-warning {
    border-left-color: #dc2626;
    background: rgba(127, 29, 29, .28);
}

.worktime-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.worktime-summary > div {
    border-left: 3px solid rgba(213, 170, 22, .58);
    background: rgba(4, 8, 6, .34);
    padding: 12px 14px;
}

.worktime-summary span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.worktime-summary strong {
    display: block;
    margin-top: 4px;
    color: #f8fafc;
    font-size: 18px;
}

.worktime-position {
    color: var(--muted);
    width: 52px;
}

.worktime-rank-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid currentColor;
    background: color-mix(in srgb, var(--rank-color) 12%, transparent);
    font-weight: 900;
}

.worktime-total {
    color: var(--gold-soft);
    font-weight: 900;
}

.tuning-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 180px));
    gap: 10px;
    margin-bottom: 16px;
}

.tuning-summary > div {
    border: 1px solid rgba(213, 170, 22, .32);
    background: #050807;
    padding: 12px 14px;
}

.tuning-summary span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.tuning-summary strong {
    display: block;
    margin-top: 4px;
    color: var(--gold-soft);
    font-size: 24px;
    line-height: 30px;
    font-weight: 950;
}

.tuning-form {
    display: grid;
    grid-template-columns: minmax(180px, .55fr) minmax(260px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.tuning-invoice-table {
    min-width: 840px;
}

.tuning-invoice-thumb {
    display: block;
    width: 92px;
    height: 58px;
    object-fit: cover;
    border: 1px solid rgba(213, 170, 22, .42);
    background: #050807;
}

.action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dispatch-page {
    display: grid;
    gap: 16px;
}

.dispatch-status {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(360px, .9fr);
    gap: 16px;
    align-items: end;
    border-top: 1px solid rgba(213, 170, 22, .48);
    padding-top: 14px;
}

.dispatch-status h3 {
    margin: 4px 0;
    color: #f8fafc;
    font-size: 24px;
    font-weight: 950;
}

.dispatch-status p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.dispatch-status-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.dispatch-table-panel {
    overflow-x: auto;
    border-top: 1px solid rgba(213, 170, 22, .38);
    padding-top: 12px;
}

.dispatch-table {
    min-width: 940px;
}

.dispatch-table th:nth-child(1) { width: 140px; }
.dispatch-table th:nth-child(2) { width: 190px; }
.dispatch-table th:nth-child(5) { width: 132px; }

.dispatch-row.active td {
    background: rgba(213, 170, 22, .14);
    box-shadow: inset 3px 0 0 var(--gold);
}

.dispatch-category-pill {
    display: inline-flex;
    min-width: 92px;
    justify-content: center;
    border: 1px solid rgba(213, 170, 22, .42);
    background: rgba(213, 170, 22, .10);
    color: var(--gold);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    padding: 5px 8px;
}

.dispatch-slot-name {
    color: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
}

.dispatch-table-list,
.dispatch-table-notes {
    display: grid;
    gap: 6px;
}

.dispatch-table-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
    border-left: 3px solid rgba(213, 170, 22, .44);
    background: rgba(1, 5, 4, .42);
    padding: 7px 8px;
}

.dispatch-table-member strong,
.dispatch-table-member span {
    display: block;
}

.dispatch-table-member strong {
    color: #f8fafc;
}

.dispatch-table-member span,
.dispatch-muted,
.dispatch-free {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.dispatch-free {
    color: #86efac;
}

.dispatch-note-row {
    color: #dbeafe;
    font-size: 11px;
    line-height: 1.4;
}

.dispatch-note-row strong {
    color: var(--gold-soft);
}

.dispatch-assign,
.dispatch-remove {
    white-space: nowrap;
}

.home-info-grid {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(360px, 1.1fr);
    gap: 16px;
}

.home-info-panel {
    border-top: 1px solid rgba(213, 170, 22, .48);
    padding-top: 14px;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}

.equipment-item,
.rank-requirement-card {
    background: rgba(5, 8, 7, .72);
    border: 1px solid rgba(213, 170, 22, .24);
    color: #f8fafc;
    padding: 10px 12px;
}

.equipment-item {
    min-height: 38px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 800;
}

.rank-requirements {
    display: grid;
    gap: 10px;
}

.rank-requirement-title {
    color: var(--gold);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.rank-requirement-card ul {
    margin: 0;
    padding-left: 18px;
    color: #dbeafe;
    font-size: 12px;
    line-height: 1.55;
}

.home-note {
    margin-top: 16px;
    border-left: 3px solid var(--gold);
    background: rgba(5, 8, 7, .62);
    padding: 10px 12px;
    color: #dbeafe;
    font-size: 12px;
}

.home-warning {
    border-left-color: #dc2626;
    color: #fecaca;
}

.home-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.home-history-panel {
    border-top: 1px solid rgba(213, 170, 22, .48);
    padding-top: 14px;
    min-width: 0;
}

.compact-history-table th,
.compact-history-table td {
    font-size: 11px;
}

.compact-history-table strong {
    color: #f8fafc;
}

.archive-layout {
    display: grid;
    grid-template-columns: minmax(360px, 46%) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.archive-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.archive-toolbar span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.archive-table-wrap {
    max-height: 640px;
    overflow: auto;
}

.archive-row {
    cursor: pointer;
}

.archive-row.active td,
.archive-row:hover td {
    background: rgba(213, 170, 22, .12);
}

.archive-detail {
    min-height: 420px;
    border-left: 3px solid rgba(213, 170, 22, .56);
    background: rgba(4, 8, 6, .34);
    padding: 18px;
}

.archive-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(213, 170, 22, .18);
}

.archive-detail-head h3 {
    margin: 4px 0 0;
    color: #f8fafc;
    font-size: 24px;
}

.archive-detail-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: var(--gold-soft);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.archive-detail-grid,
.archive-columns {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.archive-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.archive-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.archive-detail-grid > div,
.archive-block {
    background: rgba(2, 5, 4, .42);
    border-left: 3px solid rgba(213, 170, 22, .35);
    padding: 10px 12px;
}

.archive-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.archive-detail-grid strong {
    display: block;
    margin-top: 3px;
    color: #f8fafc;
}

.archive-block {
    margin-top: 16px;
    color: #dbe7df;
}

.archive-block p {
    margin: 6px 0;
}

.archive-block pre {
    margin: 8px 0 0;
    white-space: pre-wrap;
    color: #dbe7df;
    font: inherit;
}

.archive-empty {
    color: var(--muted);
    font-weight: 800;
}

.leader-board th,
.leader-board td {
    border-bottom-color: rgba(213, 170, 22, .18);
}

.documents-page {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.document-list,
.documents-main,
.document-reader,
.document-link-form,
.document-repository {
    min-width: 0;
}

.document-list-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.document-list-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.document-empty {
    border-left: 3px solid rgba(213, 170, 22, .45);
    background: rgba(2, 7, 5, .38);
    color: var(--muted);
    padding: 12px;
    font-size: 12px;
    font-weight: 800;
}

.document-reader,
.document-link-form,
.document-repository {
    background: rgba(2, 7, 5, .34);
    border: 1px solid rgba(213, 170, 22, .18);
}

.document-reader-empty {
    display: grid;
    min-height: 320px;
    place-content: center;
    text-align: center;
}

.document-reader-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(213, 170, 22, .22);
}

.document-reader-head h3 {
    margin: 3px 0 4px;
    color: #f8fafc;
    font-size: 24px;
}

.document-reader-head p,
.document-kicker {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.document-kicker {
    color: var(--gold);
    text-transform: uppercase;
}

.document-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.document-form-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px);
    gap: 12px;
    padding: 16px 20px 0;
}

.document-form-wide {
    grid-column: 1 / -1;
}

.document-form-grid label > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.document-role-row {
    padding: 14px 20px 0;
}

.document-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
    max-height: 190px;
    overflow: auto;
    padding: 10px;
    background: rgba(0, 0, 0, .25);
    border: 1px solid rgba(213, 170, 22, .18);
}

.document-role-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dbe7df;
    font-size: 12px;
    font-weight: 800;
}

.document-repository {
    margin-top: 18px;
    padding: 18px 20px;
}

.document-category-section {
    margin-top: 16px;
}

.document-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    border-left: 4px solid var(--gold);
    padding-left: 10px;
}

.document-category-head h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 16px;
    font-weight: 950;
    text-transform: uppercase;
}

.document-category-head span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.document-link-table td strong,
.document-link-table td small {
    display: block;
}

.document-link-table td small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.document-status-pill {
    display: inline-flex;
    max-width: 260px;
    border: 1px solid rgba(213, 170, 22, .36);
    background: rgba(213, 170, 22, .1);
    color: var(--gold-soft);
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
}

.document-open-link {
    display: inline-flex;
    border: 1px solid rgba(213, 170, 22, .42);
    background: rgba(2, 7, 5, .75);
    color: #f8fafc;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.document-open-link:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.document-table-actions {
    align-items: center;
    justify-content: flex-start;
}

@media (max-width: 1180px) {
    .app-main {
        padding: 18px 18px 44px;
    }
    .calculator-layout,
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    .calculator-side {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid rgba(213, 170, 22, .22);
        padding-top: 24px;
    }
    .worktime-summary {
        grid-template-columns: 1fr;
    }
    .tuning-summary,
    .tuning-form {
        grid-template-columns: 1fr;
    }
    .dispatch-status,
    .dispatch-status-actions {
        grid-template-columns: 1fr;
    }
    .archive-layout,
    .archive-detail-grid,
    .archive-columns,
    .home-info-grid,
    .home-history-grid,
    .documents-page,
    .document-form-grid {
        grid-template-columns: 1fr;
    }
    .document-reader-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
    
