/* The Incident creation page is the shared visual baseline for every HTML surface. */
@font-face { font-family:Inter; src:url('../fonts/Inter.ttf') format('truetype'); font-weight:100 900; font-display:swap; }
@font-face { font-family:'Noto Sans Arabic'; src:url('../fonts/NotoSansArabic.ttf') format('truetype'); font-weight:100 900; font-display:swap; }
:root { --panel-padding:24px; --panel-gap:24px; }
.workspace-content { max-width:1440px; margin-inline:auto; }
.main-content,.setup-body main { max-width:1504px; }
.workspace-content > .card + .card { margin-block-start:var(--panel-gap); }
.card,.setup-preview .card { padding:var(--panel-padding); min-width:0; overflow:visible; }
.card > .card-heading,.setup-preview .card > .card-heading {
  padding:0 0 16px; margin:0 0 24px; min-height:0; border-block-end:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;
}
.card-heading h2,.setup-preview .card-heading h2 { font-size:19px; line-height:1.5; margin:0; }
.card-heading p,.panel-description,.setup-preview .panel-description { font-size:14px; line-height:1.8; }
.section-heading { display:flex; align-items:center; gap:12px; min-width:0; }
.section-number { display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:8px; background:var(--accent-soft); color:var(--accent); font-size:13px; font-weight:700; }
.panel-content,.incident-workspace-body { padding:0; }
.screen-panels,.dashboard-grid { gap:var(--panel-gap); }
.dashboard-grid { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
.dashboard-grid > .card:last-child { grid-column:auto; }
.page-header { align-items:flex-start; margin-block-end:24px; }
.page-header h1,.auth-heading h1,.setup-preview h1 { font-size:30px; line-height:1.5; overflow-wrap:anywhere; }
.page-header .muted { max-width:72ch; }
.page-meta,.page-meta strong { font-size:14px; }
.workspace-content .form-field label,.setup-preview .form-field label { font-size:14px; }
.workspace-content :is(input,select,textarea),.setup-preview :is(input,select,textarea) { max-width:100%; }
.workspace-content textarea { resize:vertical; }
.workspace-content .form-field textarea { min-height:140px; }
.workspace-content .incident-create textarea { min-height:180px; }
.workspace-content .form-field,.field-grid > * { min-width:0; }
.incident-required { color:var(--danger); }
.has-error :is(input,select,textarea) { border-color:var(--danger); }
.workspace-content :is(form,dl,ol,ul) { min-width:0; }
.workspace-content .notice,.setup-preview .notice { display:block; line-height:1.8; overflow-wrap:anywhere; }
.notice ul { margin-block:8px 0; padding-inline-start:24px; }
.notice p { margin-block:8px 0; }
.workspace-content .notice + :is(.card,.workspace-columns),.workspace-content .card + .notice { margin-block-start:24px; }
.workspace-content .button-wide { width:auto; }
.workspace-content .account-card { max-width:none; }
.workspace-content > .account-card { max-width:760px; }
.workspace-content .card-footer { margin:24px -24px -24px; border-radius:0 0 12px 12px; }
.workspace-content .empty-state { padding:32px 16px; }
.workspace-content :is(.card-caption,.metric-caption,.workspace-notice p,.system-notice p) { font-size:14px; }
.workspace-content .table-preview { border-radius:8px; }
.workspace-table { width:100%; border-collapse:collapse; font-size:14px; }
.workspace-table :is(th,td) { text-align:start; padding:16px; border-block-end:1px solid var(--border); vertical-align:top; overflow-wrap:anywhere; }
.workspace-table th { background:var(--bg); color:var(--muted); font-weight:600; }
.workspace-table tbody tr:last-child td { border-block-end:0; }
.workspace-table td a { display:inline-block; min-height:44px; padding-block:8px; }
.workspace-table caption { text-align:start; padding:0 0 16px; font-weight:600; }
.table-scroll { max-width:100%; border:1px solid var(--border); border-radius:8px; }
.workspace-columns { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:var(--panel-gap); align-items:start; }
.workspace-stack { display:grid; gap:var(--panel-gap); min-width:0; }
.workspace-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
.user-access-card .clearance-field { grid-row:span 2; }
.user-access-card fieldset,.screen-panels > fieldset { border:0; margin:0; padding:0; min-width:0; }
.access-permissions { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:12px; }
.access-permissions label { display:flex; align-items:flex-start; gap:10px; padding:10px; border:1px solid var(--border); border-radius:8px; overflow-wrap:anywhere; }
.access-permissions input[type=checkbox] { width:20px; height:20px; min-height:20px; flex-shrink:0; margin-block-start:3px; }
.detail-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:0; }
.detail-list > div { padding:16px; border:1px solid var(--border); border-radius:8px; background:var(--bg); min-width:0; }
.detail-list dt { color:var(--muted); font-size:14px; margin-block-end:6px; }
.detail-list dd { margin:0; font-size:16px; font-weight:600; overflow-wrap:anywhere; }
.detail-description { white-space:pre-wrap; overflow-wrap:anywhere; margin:0; line-height:1.9; }
.workspace-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-block-start:24px; }
.workspace-actions .button { min-height:44px; }
.workspace-timeline { list-style:none; margin:0; padding:0; display:grid; gap:16px; }
.workspace-timeline li { border-inline-start:3px solid var(--accent); padding:12px 16px; background:var(--bg); border-radius:6px; overflow-wrap:anywhere; }
.workspace-timeline strong { display:block; margin-block-end:6px; }
.workspace-timeline p { margin:0; white-space:pre-wrap; }
.account-card > ul { list-style:none; padding:0; }
.account-card > ul li { padding:16px 0; border-block-end:1px solid var(--border); overflow-wrap:anywhere; }
.auth-main { background:var(--bg); }
.auth-content { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:32px; box-shadow:var(--shadow); }
.auth-heading { border-block-end:1px solid var(--border); padding-block-end:24px; margin-block-end:24px; }
.auth-heading h1 { margin-block:8px; }
.auth-content .form-field label { font-size:14px; }
.auth-content .button-wide { width:100%; }
:is(.workspace-content,.setup-preview,.auth-content) :is(input,select,textarea,button,a,summary):focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.setup-preview .card .panel-content { padding:0; }
.setup-preview .field-grid { gap:0 16px; }
.setup-preview .policy-card { border-radius:12px; }
.setup-preview .panel-action { padding-block-start:16px; border-block-start:1px solid var(--border); }
.setup-preview .checklist-row strong { font-size:15px; }
.setup-preview .step-actions { gap:16px; }
.setup-preview .mfa-modal-close { min-width:44px; min-height:44px; }
/* Administration retains Django's controls and permissions, with the same visual tokens. */
.admin-workspace {
  --primary:#087e81; --secondary:#102b3e; --accent:#e8f5f4; --header-bg:#102b3e;
  --body-bg:#f4f7f9; --body-fg:#172f40; --body-quiet-color:#5d6e7d;
  --darkened-bg:#edf3f5; --selected-bg:#e8f5f4; --link-fg:#087e81; --link-hover-color:#075c5e;
  --button-bg:#087e81; --button-hover-bg:#07696c; --default-button-bg:#087e81; --default-button-hover-bg:#07696c;
  --font-family-primary:Inter,'Noto Sans Arabic',system-ui,sans-serif;
  font-family:var(--font-family-primary); font-size:16px; line-height:1.65; color:var(--body-fg); background:var(--body-bg);
}
.admin-workspace #content { padding:32px; }
.admin-workspace :is(.module,#content-main > form) { background:white; border:1px solid #dce4e9; border-radius:12px; overflow:hidden; }
.admin-workspace .module { margin-block-end:24px; }
.admin-workspace .module :is(h2,caption) { padding:16px 24px; font-size:18px; background:#102b3e; }
.admin-workspace :is(input:not([type=checkbox]):not([type=radio]),select,textarea,.button,input[type=submit]) { min-height:44px; border-radius:7px; font:inherit; box-sizing:border-box; max-width:100%; }
.admin-workspace .form-row { padding:20px 24px; }
.admin-workspace .submit-row { padding:20px 24px; }
.admin-workspace table { font-size:14px; }
.admin-workspace :is(th,td) { padding:12px 16px; }
.admin-workspace[lang=ar] { --font-family-primary:'Noto Sans Arabic',Inter,system-ui,sans-serif; }
.admin-workspace.login #container { width:480px; max-width:calc(100% - 32px); margin:8vh auto; border:1px solid #dce4e9; border-radius:12px; overflow:hidden; box-sizing:border-box; background:white; }
.admin-workspace.login #header { padding:20px 24px; }
.admin-workspace.login #site-name { font-size:20px; }
.admin-workspace.login #content { padding:24px; }
.admin-workspace.login #content-main > form { border:0; border-radius:0; padding:0; overflow:visible; }
.admin-workspace.login .form-row { padding:0; margin-block-end:20px; }
.admin-workspace.login .form-row label { font-size:14px; font-weight:600; margin-block-end:8px; }
.admin-workspace.login .form-row input { width:100%; padding:11px 13px; background:white; border:1px solid #cbd7de; min-height:48px; }
.admin-workspace.login .submit-row { padding:0; margin:0; display:flex; justify-content:flex-end; }
.admin-workspace.login input[type=submit] { padding:12px 20px; background:#087e81; color:white; font-weight:600; }
.admin-workspace :is(input,select,textarea,button,a):focus-visible { outline:3px solid #087e81; outline-offset:3px; }
@media(max-width:1100px) { .workspace-columns,.dashboard-grid { grid-template-columns:1fr; } }
@media(max-width:760px) { .dashboard-grid { grid-template-columns:1fr; } .page-header { flex-direction:column; gap:16px; } .page-meta { max-width:100%; text-align:start; } }
@media(max-width:600px) {
  :root { --panel-padding:18px; --panel-gap:16px; }
  .card,.setup-preview .card { padding:18px; }
  .workspace-form-grid,.detail-list { grid-template-columns:1fr; }
  .user-access-card .clearance-field { grid-row:auto; }
  .card-heading h2,.setup-preview .card-heading h2 { font-size:18px; }
  .page-header h1,.auth-heading h1,.setup-preview h1 { font-size:26px; }
  .workspace-content .card-footer { margin:18px -18px -18px; }
  .auth-content { padding:24px 18px; }
  .workspace-table :is(th,td) { padding:12px; }
  .admin-workspace #content { padding:18px; }
}

/* Shared security step-up on every protected browser form. */
.shared-mfa-dialog { width:min(28rem, calc(100vw - 2rem)); box-sizing:border-box; max-height:calc(100dvh - 2rem); overflow-y:auto; padding:1.5rem; }
.shared-mfa-dialog::backdrop { background:rgb(15 23 42 / 45%); }
.shared-mfa-dialog h2 { margin-block-start:0; }
.shared-mfa-dialog input { box-sizing:border-box; width:100%; }
.shared-mfa-dialog .dialog-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.75rem; margin-block-start:1rem; }
.shared-mfa-dialog [role="alert"] { color:var(--danger, #b42318); }
.shared-mfa-dialog :is(input,button,a):focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.procedure-steps { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; list-style:none; padding:0; margin:24px 0; }
.procedure-steps li { min-width:0; display:flex; flex-direction:column; gap:8px; padding:14px; border:1px solid var(--border); border-radius:8px; background:var(--surface,#fff); overflow-wrap:anywhere; }
.procedure-steps li>span { font-weight:700; color:var(--muted); }
.procedure-steps [aria-current="step"] { border-color:var(--accent); background:var(--accent-soft); }
.procedure-steps .procedure-step-complete { border-color:var(--accent); }
@media(max-width:760px) { .procedure-steps { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } }

/* Keep each user's access action readable on phones. */
.user-access-table td { vertical-align:top; }
@media (max-width:700px) {
 .user-access-table,.user-access-table table,.user-access-table tbody { display:block; width:100%; }
 .user-access-table thead { display:none; }
 .user-access-table tr { display:grid; gap:12px; padding:16px; border-block-end:1px solid var(--border); }
 .user-access-table td { display:grid; grid-template-columns:100px minmax(0,1fr); gap:12px; padding:0; border:0; text-align:start; white-space:normal; }
 .user-access-table td::before { content:attr(data-label); color:var(--muted); font-weight:600; }
 .user-access-table td:first-child { display:block; }
 .user-access-table td:first-child::before { display:none; }
 .user-access-table td > div { min-width:0; overflow-wrap:anywhere; }
 .user-access-table .button { white-space:normal; }
}

/* Reports reuse the workspace cards, with readable record actions on phones. */
.incident-report > .card,.incident-report > .report-metrics { margin-block-end:24px; }
.report-filter-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.report-filter-grid .form-field { margin:0; }
.report-advanced { margin-block:20px; }
.report-advanced summary { cursor:pointer; font-weight:600; padding-block:8px; }
.report-filter-summary { display:flex; flex-wrap:wrap; gap:12px 24px; margin:16px 0; }
.report-filter-summary > div { min-width:0; }
.report-filter-summary dt { color:var(--muted); font-size:12px; }
.report-filter-summary dd { margin:0; overflow-wrap:anywhere; }
.report-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.report-metrics h2 { font-size:14px; line-height:1.6; margin:0 0 8px; }
.report-metrics strong { font-size:30px; }
.report-results { overflow:auto; }
.report-results table { min-width:1050px; }
.report-results td { vertical-align:top; line-height:1.8; }
@media (max-width:700px) {
 .report-filter-grid { grid-template-columns:minmax(0,1fr); }
 .report-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .report-metrics .card { padding:16px; }
 .report-results table,.report-results tbody { display:block; width:100%; min-width:0; }
 .report-results thead { display:none; }
 .report-results tr { display:grid; gap:12px; padding:16px 0; border-block-end:1px solid var(--border); }
 .report-results td { display:grid; grid-template-columns:100px minmax(0,1fr); gap:12px; padding:0; border:0; text-align:start; white-space:normal; }
 .report-results td::before { content:attr(data-label); color:var(--muted); font-weight:600; }
 .report-results td:first-child { display:block; }
 .report-results td:first-child::before { display:none; }
 .report-results td > div { min-width:0; overflow-wrap:anywhere; }
}
@page operational-report { size:A4 landscape; margin:10mm; }
.report-export-actions form { display:flex; flex-wrap:wrap; gap:12px; }
.report-export-actions button { white-space:normal; max-width:100%; overflow-wrap:anywhere; }
@media print {
 body.report-page { page:operational-report; background:#fff; color:#000; }
 .report-page .sidebar,.report-page .topbar,.report-page .workspace-footer,.report-page .breadcrumbs,
 .report-page .report-filter-card,.report-page .skip-link,.report-page .report-export-actions,.report-page [data-print-report],.report-page dialog { display:none!important; }
 .report-page .app-shell { display:block; min-height:0; }
 .report-page .app-body,.report-page .main-content { margin:0!important; padding:0!important; max-width:none; width:100%; }
 .report-page .card { box-shadow:none; padding:12px; break-inside:avoid; }
 .report-page .report-results { overflow:visible; }
 .report-page .report-results table { display:table; width:100%; min-width:0; table-layout:fixed; }
 .report-page .report-results thead { display:table-header-group; }
 .report-page .report-results tbody { display:table-row-group; }
 .report-page .report-results th,.report-page .report-results td,.report-page .report-results td:first-child { display:table-cell; padding:4px; font-size:8pt; overflow-wrap:anywhere; }
 .report-page .report-results td::before { display:none; }
 .report-page .report-results tr { display:table-row; break-inside:avoid; }
 .report-page .report-metrics { gap:8px; }
 .report-page .report-metrics strong { font-size:18pt; }
 .report-page a { color:inherit; text-decoration:none; }
}

/* Keep the operational map first, with its controls alongside on wide screens. */
.live-map-layout { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:20px; align-items:start; }
.live-map-layout > * { min-width:0; }
.live-map-sidebar { display:grid; gap:20px; }
.live-map-layout .card { padding:20px; }
.live-map-layout h2 { margin-block:0 12px; font-size:18px; }
.live-map-panel .incident-map { height:clamp(420px,65vh,760px); }
.live-map-sidebar .workspace-form-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
.live-map-sidebar .form-field { margin:0; }
.live-map-sidebar .form-field label { margin-block-end:4px; }
.live-map-sidebar .form-field :is(input,select) { min-height:44px; padding:9px 12px; }
.live-map-sidebar .workspace-actions { gap:8px; margin-block-start:16px; }
.live-map-sidebar .workspace-actions .button { flex:1 1 130px; text-align:center; }
.live-map-sidebar .detail-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.live-map-sidebar .detail-list > div { padding:10px; }
.live-map-sidebar .detail-list dt { font-size:12px; }
.live-map-sidebar .detail-list dd { font-size:20px; }
.live-map-sidebar .help-text { font-size:12px; overflow-wrap:anywhere; }
@media (max-width:1100px) {
 .live-map-layout { grid-template-columns:minmax(0,1fr); }
 .live-map-sidebar { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
}
@media (max-width:640px) {
 .live-map-sidebar { grid-template-columns:minmax(0,1fr); }
 .live-map-layout .card { padding:16px; }
 .live-map-panel .incident-map { height:380px; }
}
