/* MedNet – Arida Medical Services. Colours, type and spacing match the MedNet design canvas. */
:root {
  --bg: #0B1220;
  --panel: #111A2E;
  --panel-2: #16213A;
  --panel-3: #0F182A;
  --line: #22304D;
  --line-2: #2F3F60;
  --text: #E6E8EC;
  --text-2: #D5D8DE;
  --text-3: #C9CDD5;
  --muted: #9AA1AD;
  --white: #FFFFFF;
  --red: #D23A45;
  --red-dark: #B23A3A;
  --link: #FF7A84;
  --link-hover: #FFB8BE;
  --green: #2E8B57;
  --green-dot: #3FC27A;
  --sel-bg: #2B1520;
  --display: 'Barlow Condensed', sans-serif;
  --body: Inter, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* `hidden` always hides, even on elements styled display: flex or grid (search filters rely on it) */
[hidden] { display: none !important; }
html { background: var(--bg); }
/* A column, so the footer sits at the bottom of short pages */
body { display: flex; flex-direction: column; margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.6; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--link-hover); outline-offset: 2px; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wrap { max-width: 1640px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }

/* ----- Header ----- */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); }
.brand:hover { text-decoration: none; color: var(--white); }
.brand img { width: 34px; height: 40px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: .5px; }
.brand-sub { font-size: 11px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.main-nav { display: flex; flex-wrap: nowrap; gap: 4px 22px; font-weight: 500; font-size: 14px; white-space: nowrap; }
.main-nav a { color: var(--text-3); }
.main-nav a[aria-current="page"] { color: var(--white); }
.main-nav { align-items: center; }
.nav-group { position: relative; }
.nav-group > summary { list-style: none; cursor: pointer; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.nav-group[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.nav-group > summary:hover, .nav-group[open] > summary, .nav-group.here > summary { color: var(--white); }
.nav-menu { position: absolute; top: calc(100% + 10px); left: -12px; z-index: 50; min-width: 220px; display: flex; flex-direction: column; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.nav-menu a { padding: 9px 12px; border-radius: 6px; color: var(--text-3); white-space: nowrap; }
.nav-menu a:hover { background: #16213A; color: var(--white); text-decoration: none; }
.nav-menu a[aria-current="page"] { color: var(--white); background: #16213A; }
.site-header { position: relative; z-index: 40; }
.mobile-nav { display: none; }
@media (max-width: 1200px) {
  .main-nav { display: none; }
  .mobile-nav { display: block; order: 2; }
  .site-header .brand { order: 1; }
  .header-tools { order: 3; }
  .mobile-nav > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--white); font-weight: 600; }
  .mobile-nav > summary::-webkit-details-marker { display: none; }
  .mobile-nav[open] > summary { background: #16213A; }
  .burger { display: inline-flex; flex-direction: column; gap: 3px; }
  .burger span { width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .15s, opacity .15s; }
  .mobile-nav[open] .burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .mobile-nav[open] .burger span:nth-child(2) { opacity: 0; }
  .mobile-nav[open] .burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  .mobile-menu { position: absolute; left: 12px; right: 12px; margin-top: 8px; z-index: 60; max-height: calc(100vh - 120px); overflow-y: auto; display: flex; flex-direction: column; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.55); }
  .mobile-menu a { padding: 11px 12px; border-radius: 8px; color: var(--text-3); font-size: 16px; }
  .mobile-menu a:hover, .mobile-menu a[aria-current="page"] { background: #16213A; color: var(--white); text-decoration: none; }
  .mobile-group { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; display: flex; flex-direction: column; }
  .mobile-head { padding: 6px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
}
@media (max-width: 760px) {
  .mobile-nav { margin-left: auto; }
  .header-tools { flex-basis: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .header-tools > .user-menu { display: none; }
  .mobile-logout { display: block; border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 4px 2px; }
}
.mobile-logout { display: none; }
/* Your name next to the avatar only where there's room */
@media (max-width: 1440px) { .user-chip > span:last-child { display: none; } }
.header-tools { flex: 1 1 220px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.btn-clock { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 8px; background: var(--green); color: var(--white); font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn-clock:hover { color: var(--white); text-decoration: none; filter: brightness(1.08); }
.btn-clock .dot { width: 8px; height: 8px; border-radius: 50%; background: #B8F5D0; }
.btn-clock.on { background: #123322; color: #7FE0A8; border: 1px solid #1F5A3A; }
.site-search { width: 100%; max-width: 300px; height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--text-3); }
.bell:hover { color: var(--white); text-decoration: none; border-color: #3B4F7A; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: var(--white); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-sizing: border-box; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #5865F2; display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: 600; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu a { font-size: 13px; }
.dev-banner { background: #3A2E12; color: #F5D27A; font-size: 13px; text-align: center; padding: 6px 16px; border-bottom: 1px solid #5A4A1A; }

/* ----- Page banners ----- */
.hero-home { position: relative; height: 320px; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg); }
.hero-home img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero-home::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: linear-gradient(180deg, rgba(11,18,32,0) 0%, rgba(11,18,32,.85) 100%); }
.hero { position: relative; height: 150px; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg); }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,18,32,.94) 0%, rgba(11,18,32,.7) 50%, rgba(11,18,32,.25) 100%); }
.hero .wrap { position: relative; z-index: 1; height: 100%; display: flex; align-items: center; gap: 16px; }
.hero .patch { width: 56px; height: 66px; object-fit: contain; flex: none; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--link-hover); }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1.05; color: var(--white); }

body > * { flex-shrink: 0; }
main.page { width: 100%; max-width: 1640px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 64px; }
main.page.home { padding-top: 24px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.subline { font-size: 14px; color: var(--muted); margin-top: 4px; }
.lead { margin: 0 0 16px; font-size: 16px; color: var(--text-2); }
.prose { color: var(--text-2); }
.prose strong { color: var(--white); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ----- Type ----- */
.h-display { font-family: var(--display); font-weight: 700; color: var(--white); line-height: 1.1; }
h2.section { margin: 0 0 14px; font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--white); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
h2.block { margin: 0 0 4px; font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--white); }
h2.block + p, .block-note { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
h3.card-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--white); }

/* ----- Surfaces ----- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.card.pad { padding: 18px 20px; }
.card-head { padding: 14px 18px; background: var(--panel-2); font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--white); }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1.1; color: var(--white); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.lift { transition: border-color .15s ease, transform .15s ease; }
.lift:hover { border-color: #3B4F7A !important; transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .lift { transition: none; } .lift:hover { transform: none; } }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.grow { flex: 999 1 520px; min-width: 0; }
.side { flex: 1 1 340px; min-width: 0; }
.stack-v { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 32px; }
.mb { margin-bottom: 32px; }

/* ----- Pills and chips ----- */
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-sample { padding: 1px 8px; border-radius: 999px; background: #26324F; color: var(--text-3); font-size: 12px; font-weight: 600; }
.pill-amber { background: #3A2E12; color: #F5D27A; }
.pill-green { background: #123322; color: #7FE0A8; }
.pill-red { background: #3A1A1A; color: #FF9A9A; }
.pill-blue { background: #13283A; color: #9CC8FF; }
.pill-grey { background: #26324F; color: var(--text-3); }
.away { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #3A2E12; color: #F5D27A; font-size: 11px; font-weight: 600; letter-spacing: .3px; vertical-align: middle; white-space: nowrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-size: 14px; }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.on { border-color: var(--red); background: var(--sel-bg); }
.chip.sm { min-height: 34px; padding: 0 10px; font-size: 13px; }
.chip-round { border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.seg a, .seg button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 600; background: transparent; color: var(--text-3); text-decoration: none; }
.seg a:hover { text-decoration: none; color: var(--white); }
.seg .on, .seg [aria-selected="true"], .seg [aria-current="page"] { background: var(--red); color: var(--white); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 0; font-weight: 600; font-size: 15px; background: var(--red); color: var(--white); text-decoration: none; }
.btn:hover { color: var(--white); text-decoration: none; filter: brightness(1.08); }
.btn:disabled, .btn[aria-disabled="true"] { background: #34425F; color: var(--muted); cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text); font-weight: 500; }
.btn-outline { background: transparent; border: 1px solid var(--red); color: var(--red); }
.btn-outline.on { background: var(--red); color: var(--white); }
.btn-green { background: var(--green); }
.btn-out { background: var(--red-dark); }
.btn-danger-ghost { background: transparent; border: 1px solid #5A2A2A; color: #FF9A9A; font-weight: 500; }
.btn-big { min-width: 240px; min-height: 56px; border-radius: 12px; font-size: 18px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-ok { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid #1F5A3A; background: #123322; color: #BFF0D4; font-size: 13px; font-weight: 600; }
.btn-esc { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid #5A2222; background: transparent; color: #FF9A9A; font-size: 13px; font-weight: 600; }

/* ----- Forms ----- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field > .label { font-size: 13px; color: var(--muted); }
.input, .textarea, .select { min-height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; width: 100%; }
.textarea { padding: 10px 12px; resize: vertical; min-height: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.alert-ok { background: #123322; border: 1px solid #1F5A3A; color: #BFF2D6; }
.alert-bad { background: #3A1A1A; border: 1px solid #6A2A2A; color: #FFD0D0; }
.alert-info { background: #13283A; border: 1px solid #23435E; color: #CFE4FF; }
.alert-warn { background: #3A2E12; border: 1px solid #5A4A1A; color: #F5D27A; }
.error-text { font-size: 13px; color: #FF9A9A; }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead tr { background: var(--panel-2); text-align: left; }
table.data th { padding: 10px 14px; color: var(--white); font-weight: 600; }
table.data td { padding: 9px 14px; color: var(--text-3); vertical-align: middle; }
table.data tbody tr { border-top: 1px solid var(--line); }
table.data .strong { color: var(--white); font-weight: 600; }
table.data .num { font-variant-numeric: tabular-nums; }
table.data .cs { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .insig { display: block; height: 24px; width: auto; max-width: 56px; object-fit: contain; }
table.data th.group { padding: 8px 14px; text-align: left; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
@media (max-width: 640px) {
  table.stack { min-width: 0 !important; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td, table.stack th { display: block; width: auto !important; }
  table.stack tr { padding: 6px 0; }
  table.stack td { display: flex !important; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 6px 14px !important; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  table.stack td[data-label=""]::before { display: none; }
}

/* ----- Bars ----- */
.bar { position: relative; height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--red); }
.bar.thin { height: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; }

/* ----- Footer ----- */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--panel); padding: 28px 0; }
.site-footer .inner { max-width: 1640px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer .who { display: flex; align-items: center; gap: 12px; }
.site-footer .who img { width: 36px; height: 42px; object-fit: contain; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }

/* ----- Home ----- */
.home-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.home-title h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 46px; line-height: 1.05; color: var(--white); }
.sync-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.sync-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-dot); }
.sync-line .dot.warn { background: #E8B64A; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 36px; max-width: 340px; }
.toc ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.tier { background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tier-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.tier-head img { width: 52px; height: 60px; object-fit: contain; flex: none; }
.tier-label { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.tier-arrow { display: flex; flex-direction: column; align-items: center; height: 36px; }
.tier-arrow span { width: 2px; flex: 1; background: var(--line-2); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.person { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.person-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 26px; margin-bottom: 10px; }
.person-top img { display: block; height: 24px; width: auto; max-width: 96px; object-fit: contain; }
.person .title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.person .name { font-weight: 600; font-size: 16px; }
.vacant { color: var(--muted); font-style: italic; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid-cards.wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.div-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.div-card .head { padding: 12px 16px; background: var(--panel-2); }
.div-card .dept { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.div-card .dept img { width: 44px; height: 52px; object-fit: contain; flex: none; }
.mem-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: var(--panel-2); }
.mem-head img { width: 30px; height: 36px; object-fit: contain; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.step .n { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--red); }
.sidebar-col { flex: 1 1 300px; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.onduty-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; background: #12261B; }
.onduty-row { padding: 9px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.onduty-row.lead { background: #1A1810; }
.onduty-row img { width: 22px; height: 22px; object-fit: contain; }
.region-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.region-mini span { padding: 3px 8px; border-radius: 8px; background: var(--panel-2); color: var(--text-3); }
.region-mini span.gap { background: #2A1414; border: 1px solid #5A2222; color: #FFB0B0; }
.infobox dl { margin: 0; font-size: 14px; }
.infobox dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--line); }
.infobox dt { color: var(--muted); }
.infobox dd { margin: 0; }
.infobox-head { padding: 12px 16px; background: linear-gradient(135deg, #9E1B2C, #1E2F5E); color: var(--white); font-family: var(--display); font-weight: 700; font-size: 22px; text-align: center; }
.btn-apply { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; background: linear-gradient(135deg, #1E2F5E, #9E1B2C); color: var(--white); font-weight: 600; }
.btn-apply:hover { color: var(--white); text-decoration: none; filter: brightness(1.1); }

/* ----- Duty clock ----- */
.clock-id { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.clock-id .insig { width: 52px; height: 52px; object-fit: contain; }
.clock-id .patch { width: 44px; height: 52px; object-fit: contain; }
.clock-state { padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.clock-big { font-family: var(--display); font-weight: 700; font-size: 64px; line-height: 1; color: var(--white); font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.region-btn { min-height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14px; text-align: left; border: 2px solid var(--line-2); background: var(--panel-2); color: var(--white); }
.region-btn[aria-checked="true"] { border-color: var(--red); background: var(--sel-bg); }
label.region-btn, label.type-btn, label.chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
label.type-btn { display: block; }
label.region-btn:has(input:checked), label.type-btn:has(input:checked), label.chip:has(input:checked) { border-color: var(--red); background: var(--sel-bg); }
label.region-btn:has(input:focus-visible), label.type-btn:has(input:focus-visible), label.chip:has(input:focus-visible) { outline: 2px solid var(--link-hover); outline-offset: 2px; }
label.region-btn input, label.type-btn input, label.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* Every pickable chip shows a tick box, so "selected" never relies on colour alone */
label.region-btn::before, label.chip::before { content: ''; flex: none; width: 16px; height: 16px; box-sizing: border-box; border: 1.5px solid var(--muted); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; line-height: 1; color: #FFFFFF; }
label.region-btn:has(input[type="radio"])::before, label.chip:has(input[type="radio"])::before { border-radius: 50%; }
label.region-btn:has(input:checked)::before, label.chip:has(input:checked)::before { content: '✓'; border-color: var(--red); background: var(--red); }
label.region-btn:has(input:disabled), label.chip:has(input:disabled) { cursor: default; opacity: .75; }
label.type-btn { position: relative; padding-right: 34px; }
label.type-btn::before { content: ''; position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; box-sizing: border-box; border: 1.5px solid var(--muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; line-height: 1; color: #FFFFFF; }
label.type-btn:has(input[type="checkbox"])::before { border-radius: 4px; }
label.type-btn:has(input:checked)::before { content: '✓'; border-color: var(--red); background: var(--red); }
.chip[aria-pressed="true"]::before, .chip[aria-checked="true"]::before, .chip.on::before { content: '✓ '; font-weight: 800; color: var(--red); }
.flash { margin-bottom: 18px; }
.region-btn .hint { font-size: 12px; color: var(--muted); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.type-btn { min-height: 56px; padding: 10px 14px; text-align: left; border-radius: 10px; border: 2px solid var(--line-2); background: var(--panel-2); color: var(--white); }
.type-btn[aria-pressed="true"] { border-color: var(--red); background: var(--sel-bg); }
.type-btn .hint { font-size: 12px; color: var(--muted); }
/* Units & Map drag and drop */
[data-drag] { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
body.dragging, body.dragging * { cursor: grabbing !important; }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -130%); padding: 3px 10px; border-radius: 999px; background: #0B1220; border: 2px solid #E8B64A; color: #FFFFFF; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 14px #0009; }
.drop-ok { outline: 3px dashed #E8B64A !important; outline-offset: 2px; border-radius: 8px; }
.coverage { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cov { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.cov.gap { border-color: #5A2222; }
.cov .n { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; color: var(--white); }
.cov.gap .n { color: #FF9A9A; }
.list-row { padding: 10px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }

/* ----- Leaderboard ----- */
.winner { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; margin-bottom: 32px; padding: 24px; border-radius: 16px; background: #1A1610; border: 1px solid #4A3A1A; }
.winner .medal { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; border-radius: 50%; background: #2A2212; border: 3px solid #E8B64A; flex: none; }
.winner .medal img { width: 64px; height: 64px; object-fit: contain; }
.winner .stat { min-width: 110px; padding: 12px 16px; border-radius: 12px; background: #221C10; }
.winner .stat .k { font-size: 12px; color: #C9B48A; }
.winner .stat .v { font-family: var(--display); font-weight: 700; font-size: 32px; color: var(--white); line-height: 1.1; }
.top-row { display: grid; grid-template-columns: 28px minmax(120px, 190px) minmax(0, 1fr) 64px; align-items: center; gap: 10px; }
.top-row .pos { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.top-row .bar { height: 14px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----- Codes ----- */
.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.code-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.code-card .code { flex: none; min-width: 64px; padding: 4px 8px; border-radius: 8px; background: var(--panel-2); color: var(--link-hover); font-family: var(--display); font-weight: 700; font-size: 22px; text-align: center; line-height: 1.2; }
.code-card.urgent { border-color: #5A2222; }
.code-card.urgent .code { background: #3A1A1A; color: #FF9A9A; }
.region-dot { width: 28px; height: 28px; border-radius: 50%; color: var(--white); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.search-big { flex: 1 1 320px; min-height: 48px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 16px; }

/* ----- Training ----- */
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.day-col { min-width: 0; background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; }
.day-col.today { border-color: var(--red); }
.day-col .head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); }
.sess { border-radius: 10px; background: var(--panel-2); border-top: 3px solid var(--red); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.sess .btn-sign { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); background: transparent; color: var(--text); }
.sess .btn-sign[aria-pressed="true"] { background: #123322; color: #7FE0A8; border-color: #1F5A3A; }
.post-session .invite-box { display: none; }
.post-session:has(input[name="visibility"][value="private"]:checked) .invite-box { display: block; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ----- Command / reports ----- */
.review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.review-row:first-child { border-top: 0; }
.review-row.done { background: #0F1729; }
.region-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.region-tile { padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.region-tile.gap { border-color: #5A2222; }
.region-tile .n { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; color: var(--white); }
.region-tile.gap .n { color: #FF9A9A; }
.lead-card { flex: 1 1 280px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; }
.lead-card.on { border-color: #8A6A1F; }
.lead-tag { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .5px; background: #3A2E12; color: #F5D27A; }
.debrief-row > button { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 14px; font: inherit; text-align: left; border: 0; background: transparent; color: var(--text); }
.debrief-row { border-top: 1px solid var(--line); background: var(--panel); }
.debrief-row:first-child { border-top: 0; }
.debrief-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--text-2); }
.cmd-group { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cmd-group .row-cmd { padding: 9px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.cmd-group code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--link-hover); }
.check-btn { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: 8px; text-align: left; border: 1px solid var(--line); background: transparent; color: var(--text); width: 100%; }
.check-btn .box-mark { flex: none; width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--line-2); color: var(--bg); }
.check-btn[aria-pressed="true"] { border-color: #1F5A3A; }
.check-btn[aria-pressed="true"] .box-mark { background: var(--green-dot); }
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 14px; }
.rule .mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--bg); }
.tri { min-width: 54px; text-align: center; padding: 4px 8px; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tri-1 { background: #2A1414; color: #FFB0B0; }
.tri-2 { background: #2A2410; color: #F5D27A; }
.tri-3 { background: #122A1A; color: #7FE0A8; }
.tri-b { background: #141C2C; color: var(--text-3); }

/* ----- Handbook and documents ----- */
.doc-nav { flex: 1 1 260px; max-width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: 14px; }
/* Only keep the contents in view when it sits in its own column beside the documents. On narrower
   screens it stacks above them and must scroll away, or it covers the section you jumped to. */
@media (min-width: 900px) {
  .doc-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
}
@media (max-width: 899px) {
  .doc-nav { max-width: none; }
}
.doc-nav ol, .doc-nav ul { margin: 0 0 14px; padding-left: 20px; line-height: 1.9; color: var(--muted); }
details.doc { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
details.doc > summary { display: flex; align-items: center; gap: 12px; padding: 16px 0; cursor: pointer; list-style: none; }
details.doc > summary::-webkit-details-marker { display: none; }
details.doc > summary .chev { color: var(--link); font-size: 18px; transition: transform .15s; }
details.doc[open] > summary .chev { transform: rotate(90deg); }
details.doc > summary img { width: 40px; height: 48px; object-fit: contain; flex: none; }
.doc-title { display: block; font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--white); line-height: 1.15; }
.doc-body { padding: 0 0 20px; color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 12px; }
.doc-body h2, .doc-body h3, .doc-body h4 { margin: 8px 0 0; color: var(--white); }
.doc-body h2 { font-family: var(--display); font-size: 24px; }
.doc-body h3 { font-size: 16px; }
.doc-body p { margin: 0; }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-body .table-wrap { border-radius: 10px; }
.doc-body th { background: var(--panel-2); color: var(--white); text-align: left; padding: 9px 12px; }
.doc-body td { padding: 8px 12px; border-top: 1px solid var(--line); }
.design-doc details > summary { cursor: pointer; list-style: none; }
.design-doc details > summary::-webkit-details-marker { display: none; }
.design-doc details[open] > summary .chev { transform: rotate(90deg); }
details.doc-section { border-top: 1px solid var(--line); }
details.doc-section > summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; font-family: var(--display); font-weight: 700; font-size: 21px; color: var(--white); }
details.doc-section > summary::-webkit-details-marker, details.debrief-row > summary::-webkit-details-marker, details.note-form > summary::-webkit-details-marker { display: none; }
details.doc-section > summary .chev { color: var(--link); font-size: 16px; transition: transform .15s; }
details.doc-section[open] > summary .chev { transform: rotate(90deg); }
.doc-section-body { padding: 0 0 16px 26px; display: flex; flex-direction: column; gap: 10px; }
.doc-body ul, .doc-body ol { margin: 0; padding-left: 22px; }
.doc-body li { margin: 2px 0; }
.doc-body .doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-body .doc-table td, .doc-body .doc-table th { vertical-align: top; border-top: 1px solid var(--line); }
.doc-body .doc-table tr:first-child td, .doc-body .doc-table tr:first-child th { border-top: 0; }
.doc-img { display: block; max-width: 100%; height: auto; border-radius: 8px; margin: 4px 0; }
.db-name { color: var(--white); font-weight: 600; border-bottom: 1px dotted var(--muted); }
.doc-locked { display: flex; align-items: center; gap: 12px; padding: 16px 22px; background: #0F1729; border: 1px dashed var(--line-2); border-radius: 14px; }
.doc-locked img { width: 40px; height: 48px; object-fit: contain; flex: none; opacity: .45; }
.notice { padding: 10px 14px; border-radius: 10px; background: #2A1414; border: 1px solid #5A2222; color: #FFD0D0; }
.notice strong { color: var(--white); }
.notice-info { background: #13283A; border-color: #23435E; color: #CFE4FF; }
.command-strip { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 14px; border-radius: 10px; background: var(--panel-2); font-size: 13px; color: var(--text-3); }
.command-strip strong { color: var(--white); }
.dashed { padding: 14px 18px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 14px; }

/* ----- Departments ----- */
.dept-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.dept-card .head { display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: var(--panel-2); }
.dept-card .head img { width: 56px; height: 66px; object-fit: contain; }
.dept-card .body { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.dept-card .foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.dept-card ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }

/* ----- Login ----- */
.login-card { max-width: 520px; margin: 40px auto; }
.btn-discord { background: #5865F2; }

/* ----- HR & Training ----- */
.pipe { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: pipe; }
.pipe li { counter-increment: pipe; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-3); font-size: 13px; }
.pipe li::before { content: counter(pipe); font-weight: 700; }
.pipe li.done { border-color: #2E5A3E; color: #7FE0A8; }
.pipe li.done::before { content: '✓'; }
.pipe li.now { border-color: var(--red); background: var(--sel-bg); color: var(--white); }
.qa { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 16px; margin: 12px 0 0; font-size: 14px; }
.qa dt { color: var(--muted); }
.qa dd { margin: 0; color: var(--text); }
@media (max-width: 600px) { .qa { grid-template-columns: 1fr; } .qa dd { margin-bottom: 6px; } }
/* Application answers: each question above its answer, full width. */
.qa.answers { grid-template-columns: 1fr; gap: 4px; }
.qa.answers dt { color: var(--muted); font-weight: 600; }
.qa.answers dd { margin: 0 0 12px; padding-left: 12px; border-left: 2px solid #22304D; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { padding: 10px 0 10px 14px; border-left: 2px solid var(--line-2); margin-left: 4px; }
.timeline li.pub { border-left-color: #2F5D8A; }
.stage-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.stage { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stage.done strong { color: #7FE0A8 !important; }
.answers { display: flex; flex-direction: column; gap: 6px; }
.answer-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; color: var(--text); }
.answer-opt:has(input:checked) { border-color: var(--red); background: var(--sel-bg); }
.answer-opt input { margin-top: 3px; accent-color: var(--red); }
.answer { white-space: pre-wrap; margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: #0F1A2E; color: var(--text); font-size: 14px; }
.exam-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 10px; background: #16213A; border: 1px solid var(--line-2); color: var(--white); }
.exam-bar.low { border-color: var(--red); background: #3A1A1A; }
main.design-doc { width: 100%; }

/* ----- Ask MedNet: the help chat ----- */
.ask { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.ask-fab { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px; border: 1px solid #3B4F7A; background: #1B2B4A; color: var(--white); font: 600 15px var(--body); cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.ask-fab:hover { background: #22365C; }
.ask.open .ask-fab { background: var(--red); border-color: var(--red); }
.ask-panel { order: -1; width: min(420px, calc(100vw - 32px)); height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 48px rgba(0,0,0,.6); overflow: hidden; }
.ask-panel[hidden] { display: none; }
.ask-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.ask-title { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--white); line-height: 1.1; }
.ask-sub { font-size: 12px; color: var(--muted); }
.ask-close { border: 0; background: none; color: var(--text-3); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.ask-close:hover { color: var(--white); }
.ask-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ask-msg { max-width: 92%; font-size: 14px; }
.ask-msg p { margin: 0 0 8px; }
.ask-me { align-self: flex-end; background: #1B2B4A; border: 1px solid #2F4570; color: var(--white); padding: 8px 12px; border-radius: 12px 12px 2px 12px; }
.ask-bot { align-self: flex-start; color: var(--text-2); }
.ask-wait { color: var(--muted); font-style: italic; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-chips .chip { min-height: 32px; font-size: 13px; cursor: pointer; }
.ask-card { background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.ask-src { display: block; font-size: 12px; font-weight: 600; color: var(--link-hover); margin-bottom: 4px; }
.ask-text { color: #E6E8EC; white-space: pre-line; }
.ask-text mark { background: #3A2E12; color: #FFE3A3; border-radius: 3px; padding: 0 2px; }
.ask-more { font-size: 12px; }
.ask-foot, .ask-lead { font-size: 12px; color: var(--muted); }
.ask-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel-2); }
.ask-form .input { min-height: 40px; }
@media (max-width: 760px) {
  .ask { right: 12px; bottom: 12px; }
  .ask-fab span { display: none; }
  .ask-fab { width: 48px; padding: 0; justify-content: center; }
  .ask.open { left: 12px; top: 12px; }
  .ask-panel { width: 100%; height: auto; flex: 1; }
}
@media print { .ask { display: none; } }
