:root {
  --navy: #16223c;
  --navy-2: #1e2d4e;
  --navy-3: #27375e;
  --gold: #d9a431;
  --gold-light: #f3c969;
  --accent: #3b6fe0;
  --accent-dark: #2c59c0;
  --bg: #f3f5f9;
  --card: #ffffff;
  --border: #e2e7f0;
  --text: #1c2434;
  --muted: #69748c;
  --green: #1e8e5a;
  --red: #c93b3b;
  --amber: #b07a18;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 26, 50, .05), 0 4px 16px rgba(16, 26, 50, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 228px; background: linear-gradient(180deg, var(--navy-2) 0%, var(--navy) 100%); color: #c6d0e4; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 22px 20px 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar .brand img { width: 34px; height: 34px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.sidebar .brand .word { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: .2px; line-height: 1.1; }
.sidebar .brand .word span { color: var(--gold-light); }
.sidebar .brand .tag { font-size: 10px; color: #7d8cab; letter-spacing: 1.2px; text-transform: uppercase; margin-top: 2px; }
.sidebar nav { flex: 1; padding: 14px 10px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 2px; color: #c6d0e4; font-weight: 500; border-radius: 8px; transition: background .12s, color .12s; }
.sidebar nav a svg { width: 17px; height: 17px; opacity: .75; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: rgba(243, 201, 105, .12); color: var(--gold-light); }
.sidebar nav a.active svg { opacity: 1; }
.sidebar .userbox { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.sidebar .userbox .avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar .userbox .uname { color: #fff; font-weight: 600; line-height: 1.2; }
.sidebar .userbox .urole { color: #7d8cab; text-transform: capitalize; font-size: 11px; }
.sidebar .userbox button { margin: 0; background: none; border: none; color: #7d8cab; padding: 6px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar .userbox button svg { width: 16px; height: 16px; pointer-events: none; }
.sidebar .userbox button:hover { background: rgba(255,255,255,.08); color: #fff; }
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main { flex: 1; padding: 26px 34px; max-width: 1300px; width: 100%; }

.impersonation-bar { background: linear-gradient(90deg, #2c2050, #432d7a); color: #e6defc; padding: 10px 34px; font-size: 13px; display: flex; align-items: center; gap: 12px; }
.impersonation-bar.warn { background: linear-gradient(90deg, #6e2424, #8a3030); color: #fbe7e7; }
.impersonation-bar a { color: #fff; text-decoration: underline; }
.impersonation-bar button { margin-left: auto; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 5px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.impersonation-bar button:hover { background: rgba(255,255,255,.24); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.plan-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan-card.current { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 164, 49, .15), var(--shadow); }
.plan-name { font-weight: 700; color: var(--navy); font-size: 15px; }
.plan-price { font-size: 30px; font-weight: 700; color: var(--navy); margin: 8px 0 2px; letter-spacing: -1px; }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-blurb { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.plan-feat { list-style: none; margin: 0 0 18px; flex: 1; }
.plan-feat li { padding: 5px 0 5px 24px; position: relative; font-size: 13px; color: var(--text); }
.plan-feat li::before { content: '✓'; position: absolute; left: 2px; color: var(--green); font-weight: 700; }

/* ---------- charts ---------- */
.chart-wrap { position: relative; }
.chart { width: 100%; display: block; }
.chart-bar { fill: var(--accent); opacity: .85; transition: opacity .12s; }
.chart-bar:hover { opacity: 1; }
.chart-labels { display: flex; margin-top: 4px; }
.chart-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.chart-max { position: absolute; top: 0; right: 0; font-size: 11px; color: var(--muted); background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 4px; }

/* ---------- tickets ---------- */
.ticket-thread { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.ticket-msg { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; max-width: 85%; align-self: flex-start; font-size: 13.5px; }
.ticket-msg.platform { background: #eef3ff; border-color: #ccdaf8; align-self: flex-end; }
.ticket-msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

/* ---------- branding ---------- */
.stat.alert::before { background: linear-gradient(90deg, #e06a6a, var(--red)); }
.stat.alert .num { color: var(--red); }
.logo-preview { width: 110px; height: 72px; border: 1.5px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg); flex-shrink: 0; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar .brand img.org-logo { border-radius: 6px; background: #fff; padding: 2px; object-fit: contain; }

/* ---------- template rich text editor ---------- */
.rte-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-bottom: none; border-radius: 0 8px 0 0; }
.rte-toolbar button { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 13px; min-width: 34px; color: var(--text); }
.rte-toolbar button:hover { background: #eef2f9; border-color: var(--accent); }
.rte-toolbar .sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.rte-toolbar select { width: auto; max-width: 190px; padding: 5px 8px; font-size: 13px; font-weight: 600; color: var(--accent-dark); border-color: var(--accent); background: #f3f7ff; }
.rte { border: 1px solid var(--border); border-radius: 0 0 8px 8px; min-height: 340px; max-height: 52vh; overflow-y: auto; padding: 28px 34px; background: #fff; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; line-height: 1.55; }
.rte:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 111, 224, .12); }
.rte h1 { font-size: 19px; } .rte h3 { font-size: 15px; }
.rte-html { min-height: 340px; max-height: 52vh; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; line-height: 1.5; border-radius: 0 0 8px 8px; }
.rte-preview { min-height: 340px; max-height: 52vh; overflow-y: auto; border-radius: 0 0 8px 8px; margin: 0; max-width: none; }
mark.merged { background: #fff3cd; border-radius: 3px; padding: 0 2px; }
.tabs button[data-mode] { font-size: 13px; }

/* ---------- 2FA ---------- */
.tfa-secret { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 18px; letter-spacing: 2px; background: var(--bg); border: 1.5px dashed var(--border); border-radius: 8px; padding: 12px 16px; text-align: center; user-select: all; }
.backup-codes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.backup-codes span { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 15px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 4px; text-align: center; user-select: all; }
@media (max-width: 700px) { .backup-codes { grid-template-columns: repeat(2, 1fr); } }
.sidebar .userbox { gap: 6px; }
.sidebar .userbox .uwrap { flex: 1; min-width: 0; }
.sidebar .userbox .uname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- fine print / version ---------- */
.fineprint { padding: 8px 16px 12px; font-size: 10px; color: #5b6a88; text-align: center; letter-spacing: .3px; user-select: none; }

/* ---------- owner dashboard ---------- */
.mix-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.mix-label { width: 110px; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.mix-bar { flex: 1; height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.mix-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-light), var(--gold)); border-radius: 7px; min-width: 6px; }
.mix-count { width: 34px; text-align: right; font-weight: 700; color: var(--navy); }
ul.roadmap { list-style: none; margin: 0; padding: 0; }
ul.roadmap li { padding: 9px 0 9px 26px; position: relative; border-bottom: 1px solid #edf0f6; font-size: 13.5px; }
ul.roadmap li:last-child { border-bottom: none; }
ul.roadmap li::before { content: ''; position: absolute; left: 4px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
ul.roadmap li:first-child::before { box-shadow: 0 0 0 3px rgba(217, 164, 49, .25); }

/* ---------- danger zone (org delete) ---------- */
.danger-zone { margin: 14px 0; border: 1px solid #ecc8c8; border-radius: 9px; padding: 10px 14px; background: #fffafa; }
.danger-zone summary { color: var(--red); font-weight: 600; font-size: 13px; cursor: pointer; }
.danger-zone[open] summary { margin-bottom: 4px; }

/* ---------- generic ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-head h1 { font-size: 22px; letter-spacing: -.2px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 14px; margin-bottom: 14px; color: var(--navy); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.mt { margin-top: 12px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

.btn { background: var(--accent); color: #fff; border: none; padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: 13px; transition: background .12s, transform .08s, box-shadow .12s; box-shadow: 0 1px 3px rgba(44, 89, 192, .35); }
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #ecc8c8; box-shadow: none; }
.btn.danger:hover { background: #fdf3f3; }
.btn.gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--navy); box-shadow: 0 1px 3px rgba(217, 164, 49, .4); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea { font: inherit; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); width: 100%; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 111, 224, .15); }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 9px 10px; border-bottom: 2px solid var(--border); font-weight: 700; }
td { padding: 10px; border-bottom: 1px solid #edf0f6; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f4f7fd; }

.badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; letter-spacing: .2px; }
.badge.Open { background: #e7eefc; color: var(--accent-dark); }
.badge.s-TitleSearch { background: #fdf3e0; color: var(--amber); }
.badge.s-CommitmentIssued { background: #e9e3f8; color: #6743b8; }
.badge.s-ClearedtoClose { background: #def5ea; color: var(--green); }
.badge.s-Closed { background: #e8ebf1; color: var(--muted); }
.badge.s-Cancelled { background: #fbe7e7; color: var(--red); }
.badge.dep { background: #def5ea; color: var(--green); }
.badge.dis { background: #fbe7e7; color: var(--red); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold-light), var(--gold)); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--navy); letter-spacing: -.5px; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 10px 15px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; font-size: 13px; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--gold); }
.tabs button:hover { color: var(--text); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1100px 600px at 75% -10%, #2e4474 0%, transparent 55%), radial-gradient(900px 500px at -10% 110%, #233458 0%, transparent 50%), linear-gradient(160deg, #1a2845 0%, #101a30 100%); position: relative; overflow: hidden; padding: 20px; }
.login-wrap::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(243, 201, 105, .14) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(180deg, transparent, #000 35%, #000 70%, transparent); }
.login-card { position: relative; background: rgba(255, 255, 255, .98); border-radius: 18px; padding: 42px 40px 36px; width: 400px; box-shadow: 0 24px 70px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255,255,255,.08); }
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
.login-logo img { width: 66px; height: 66px; margin-bottom: 14px; filter: drop-shadow(0 6px 14px rgba(22, 34, 60, .35)); }
.login-logo h1 { font-size: 25px; color: var(--navy); letter-spacing: -.3px; }
.login-logo h1 span { color: var(--gold); }
.login-logo .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.login-card .btn { width: 100%; padding: 12px; font-size: 14px; border-radius: 9px; margin-top: 4px; background: linear-gradient(135deg, #3b6fe0, #2c59c0); }
.login-card .btn:hover { filter: brightness(1.07); }
.login-foot { text-align: center; margin-top: 22px; font-size: 12px; color: #8d97ad; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(13, 20, 38, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; padding: 26px; width: 100%; max-width: 640px; box-shadow: 0 16px 60px rgba(0, 0, 0, .35); animation: pop .15s ease; }
.modal h2 { font-size: 17px; margin-bottom: 18px; color: var(--navy); }
.modal.wide { max-width: 900px; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; } }

/* ---------- tasks / notes ---------- */
.task-row { display: flex; align-items: center; gap: 11px; padding: 8px 4px; border-bottom: 1px solid #edf0f6; }
.task-row input[type=checkbox] { width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--green); }
.task-row .done { text-decoration: line-through; color: var(--muted); }
.task-row .due { font-size: 12px; color: var(--amber); white-space: nowrap; }
.task-row .del { visibility: hidden; }
.task-row:hover .del { visibility: visible; }

.note { border-bottom: 1px solid #edf0f6; padding: 11px 4px; }
.note .meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }

.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; }
.progress > div { height: 100%; background: linear-gradient(90deg, #25a36b, var(--green)); }

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy); color: #fff; padding: 13px 22px; border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); z-index: 200; animation: fadeup .2s ease; font-weight: 500; }
.toast.err { background: var(--red); }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

/* ---------- settlement editor ---------- */
.settle-table input { padding: 5px 8px; font-size: 13px; }
.settle-table td { padding: 4px 6px; }
.settle-section td { background: #eef2f9; font-weight: 700; color: var(--navy); font-size: 13px; }
.settle-totals td { font-weight: 700; border-top: 2px solid var(--navy); }

/* ---------- print ---------- */
@media print {
  .sidebar, .page-head .btn, .no-print, .impersonation-bar { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; }
}
.doc-paper { background: #fff; padding: 48px 56px; max-width: 820px; margin: 0 auto; border: 1px solid var(--border); border-radius: 4px; line-height: 1.55; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; box-shadow: var(--shadow); }
.doc-paper h1 { font-size: 19px; margin-bottom: 10px; }
.doc-paper h3 { margin: 18px 0 8px; font-size: 15px; }
.doc-paper p, .doc-paper ol { margin-bottom: 10px; }
.doc-paper ol { padding-left: 22px; }
.doc-paper hr { border: none; border-top: 1px solid #999; margin: 14px 0; }
@media print { .doc-paper { border: none; padding: 0; max-width: none; box-shadow: none; } }

/* ---------- support: quick-start guides ---------- */
.guide-intro { margin-bottom: 14px; }
.guide-intro h2 { margin-bottom: 4px; }
.guides { display: flex; flex-direction: column; gap: 10px; }
details.guide { background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
details.guide summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--navy); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.guide summary::-webkit-details-marker { display: none; }
details.guide summary::after { content: '+'; color: var(--gold); font-size: 20px; font-weight: 400; line-height: 1; flex-shrink: 0; }
details.guide[open] summary::after { content: '\2013'; }
details.guide[open] summary { border-bottom: 1px solid var(--border); }
details.guide summary:hover { background: rgba(22, 34, 60, .02); }
.guide-body { padding: 14px 18px 18px; color: var(--text); line-height: 1.55; }
.guide-body p { margin: 6px 0; }
.guide-body ol, .guide-body ul { margin: 8px 0 8px 20px; }
.guide-body li { margin: 4px 0; }
.guide-body code, .chips code { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; background: #eef1f7; color: var(--navy); border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- platform: usage section ---------- */
.section-head { margin: 22px 0 10px; font-size: 15px; color: var(--navy); }
.usage-table { margin-top: 6px; }
.usage-table th.right, .usage-table td.right { text-align: right; }
.usage-table td .badge { font-size: 10px; }

/* locked / non-editable form field */
input.locked, input.locked:focus { background: #eef1f7; color: var(--muted); border-style: dashed; cursor: not-allowed; -webkit-text-fill-color: var(--muted); opacity: 1; }

/* support-mode org switcher in the impersonation bar */
.impersonation-bar .imp-switch { display: inline-flex; align-items: center; gap: 6px; margin: 0 auto 0 18px; font-size: 12px; opacity: .95; }
.impersonation-bar .imp-switch select { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 3px 8px; font-size: 12px; max-width: 230px; }
.impersonation-bar .imp-switch select option { color: #1c2434; }

/* message board banners (org-facing) */
#broadcastBar:empty { display: none; }
.broadcast { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 13px; line-height: 1.45; }
.broadcast .bc-text { flex: 1; }
.broadcast .bc-x { background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .5; padding: 0 4px; }
.broadcast .bc-x:hover { opacity: 1; }
.broadcast.bc-info { background: #eaf1fc; color: #1c3a66; }
.broadcast.bc-warn { background: #fdf3e0; color: #7a5410; }
.broadcast.bc-crit { background: #fde8e8; color: #962020; }

/* message board composer (platform) */
.bc-orglist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.bc-orgopt { font-weight: 400; display: flex; align-items: center; gap: 6px; }
.bc-orgopt input { width: 15px; height: 15px; }

/* ---------- mobile / phone layout (off-canvas sidebar) ---------- */
.mobile-topbar { display: none; }
.nav-overlay { display: none; }
@media (max-width: 768px) {
  .mobile-topbar { display: flex; align-items: center; gap: 12px; padding: 11px 16px; background: linear-gradient(180deg, var(--navy-2), var(--navy)); color: #fff; position: sticky; top: 0; z-index: 60; }
  .nav-toggle { background: none; border: none; color: #fff; padding: 4px; display: flex; align-items: center; border-radius: 7px; }
  .nav-toggle:hover { background: rgba(255,255,255,.1); }
  .nav-toggle svg { width: 24px; height: 24px; pointer-events: none; }
  .mtb-title { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
  .mtb-title span { color: var(--gold-light); }

  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; height: 100dvh; z-index: 110; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .layout.nav-open .sidebar { transform: translateX(0); }
  .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(13,20,38,.5); z-index: 105; opacity: 0; pointer-events: none; transition: opacity .22s; }
  .layout.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }

  .main { padding: 16px 14px; }
  .page-head h1 { font-size: 19px; }
  .grid2 { grid-template-columns: 1fr; }
  .card:has(table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .impersonation-bar { padding: 10px 14px; flex-wrap: wrap; }
  .impersonation-bar button { margin-left: 0; }
  .impersonation-bar .imp-switch { margin: 0; }
  .impersonation-bar .imp-switch select { max-width: 160px; }
  .modal-bg { padding: 16px 10px; }
  .modal { padding: 18px; }
  .tfa-secret { font-size: 15px; letter-spacing: 1px; }
}

/* compact display density (per-user, toggled in Settings) */
body.compact { font-size: 13px; }
body.compact .card { padding: 14px; margin-bottom: 12px; }
body.compact table th, body.compact table td { padding: 5px 9px; }
body.compact .stat { padding: 13px; }
body.compact .stat .num { font-size: 22px; }
body.compact .page-head { margin-bottom: 12px; }
body.compact .field { margin-bottom: 8px; }
body.compact .sidebar nav a { padding-top: 8px; padding-bottom: 8px; }
