:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; background: #eef3f6; color: #162630; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: radial-gradient(circle at top right, #dcecf0, transparent 45%), #eef3f6; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: .7rem 1rem; background: #0c6973; color: white; font-weight: 700; }
button.secondary { background: #dce7e9; color: #1d3e45; }
button.danger { background: #a63d3d; }
button:disabled { cursor: wait; opacity: .55; }
.shell { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px; }
.login { max-width: 460px; margin: 9vh auto; padding: 34px; background: white; border-radius: 22px; box-shadow: 0 18px 60px #13353d18; }
.eyebrow { color: #0c6973; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; }
.muted { color: #61747b; }
.notice { margin: 16px 0; padding: 12px 14px; border-radius: 10px; background: #fff3d6; color: #725413; }
.error { margin: 16px 0; padding: 12px 14px; border-radius: 10px; background: #ffe2e2; color: #7a2424; }
.client-error { max-width: 620px; margin: 10vh auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #0c6973; color: white; font-weight: 900; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { background: #fff; border: 1px solid #d8e3e5; border-radius: 16px; padding: 20px; box-shadow: 0 8px 24px #13353d0d; }
.card h3 { margin-bottom: 8px; }
.metric { font-size: 2rem; font-weight: 850; color: #0c6973; }
.stack { display: grid; gap: 12px; }
.menu-button { display: grid; flex: 0 0 44px; place-items: center; gap: 4px; width: 44px; min-width: 44px; height: 44px; padding: 9px; border: 1px solid #c7d5d8; border-radius: 11px; background: #fff; color: #0c6973; }
.menu-button span { display: block; width: 19px; height: 2px; border-radius: 99px; background: currentColor; }
.notification-button { position: relative; display: grid; flex: 0 0 44px; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; border: 1px solid #c7d5d8; border-radius: 11px; background: #fff; color: #0c6973; font-size: 1.1rem; }
.notification-count { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; background: #a63d3d; color: #fff; font-size: .68rem; font-weight: 850; line-height: 1; }
.notification-panel { position: absolute; z-index: 12; top: 82px; right: 24px; width: min(390px, calc(100vw - 28px)); max-height: min(70vh, 620px); overflow: auto; padding: 14px; border: 1px solid #d8e3e5; border-radius: 16px; background: rgba(255,255,255,.98); box-shadow: 0 20px 60px #13353d2b; }
.notification-panel[hidden] { display: none; }
.notification-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #e1eaeb; }
.notification-header strong { display: block; font-size: 1.05rem; }
.notification-header button { min-height: 38px; padding: .5rem .65rem; font-size: .78rem; }
.notification-list { display: grid; gap: 9px; padding-top: 10px; }
.notification-item { padding: 12px; border: 1px solid #e1eaeb; border-radius: 12px; background: #fbfdfd; }
.notification-item.unread { border-color: #8bc8c2; background: #eef8f6; }
.notification-item strong { overflow-wrap: anywhere; }
.notification-item time { font-size: .72rem; white-space: nowrap; }
.notification-item p { margin: 6px 0; color: #47616a; font-size: .9rem; }
.notification-read { min-height: 36px; margin-top: 9px; padding: .45rem .65rem; font-size: .78rem; }
.notification-empty { margin: 8px 0; }
.menu-panel { position: absolute; z-index: 10; top: 82px; right: 24px; display: grid; min-width: 210px; padding: 8px; border: 1px solid #d8e3e5; border-radius: 14px; background: rgba(255,255,255,.97); box-shadow: 0 18px 50px #13353d22; }
.menu-panel[hidden] { display: none; }
.menu-panel a { display: block; border-radius: 9px; padding: .7rem .8rem; color: #1d3e45; text-decoration: none; font-weight: 750; }
.menu-panel a.active, .menu-panel a:hover, .button-link { background: #0c6973; color: white; }
.button-link { display: inline-block; border-radius: 10px; padding: .65rem .9rem; text-decoration: none; font-weight: 750; }
.quick-links { justify-content: flex-start; margin-top: 16px; }
.secondary-link { background: #dce7e9; color: #1d3e45; }
.metric-card { min-height: 132px; }
.operations-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 20px; padding: 28px; border-radius: 20px; background: linear-gradient(135deg, #0c6973, #164853); color: white; box-shadow: 0 16px 36px #0c69732b; }
.operations-hero .eyebrow, .operations-hero .muted { color: #d8f2f0; }
.operations-hero h1 { max-width: 620px; margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.04em; }
.operations-hero p { max-width: 620px; margin-bottom: 0; }
.operations-hero .button-link { background: white; color: #164853; white-space: nowrap; }
.operations-panels { align-items: stretch; margin-top: 16px; }
.queue-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid #e1eaeb; color: #1d3e45; text-decoration: none; }
.queue-item:first-child { padding-top: 2px; }
.queue-item:last-child { padding-bottom: 2px; border-bottom: 0; }
.queue-item span { display: grid; gap: 4px; }
.queue-item small { color: #61747b; }
.queue-item b { min-width: 34px; color: #0c6973; font-size: 1.35rem; text-align: right; }
.directory-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.directory-summary div { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: #eef6f5; }
.directory-summary strong { color: #0c6973; font-size: 1.5rem; }
.directory-summary span { color: #61747b; font-size: .82rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .85rem; font-weight: 700; color: #47616a; }
input, select, textarea { width: 100%; border: 1px solid #c7d5d8; border-radius: 9px; padding: .68rem .75rem; background: #fbfdfd; color: #162630; }
textarea { min-height: 76px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.pill { display: inline-flex; border-radius: 999px; padding: .25rem .6rem; background: #e5f2ef; color: #146154; font-size: .78rem; font-weight: 800; }
.list { display: grid; gap: 10px; }
.list-item { padding: 14px; border: 1px solid #e1eaeb; border-radius: 12px; background: #fbfdfd; }
.list-item p { margin: 5px 0; }
.table-wrap { overflow-x: auto; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e1eaeb; }
.inline-form input { flex: 1 1 150px; width: auto; }
.inline-form strong { flex: 0 0 auto; color: #47616a; font-size: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #e1eaeb; white-space: nowrap; }
th { color: #47616a; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 680px) { .shell { padding: 14px; } .form-grid { grid-template-columns: 1fr; } .form-grid .wide { grid-column: auto; } .topbar { align-items: flex-start; flex-direction: column; } .topbar > .row { width: 100%; justify-content: flex-start; } .user-name { margin-right: auto; } .menu-panel { top: 126px; right: 14px; left: 14px; } .notification-panel { top: 120px; right: 14px; left: 14px; width: auto; } .operations-hero { align-items: flex-start; flex-direction: column; padding: 22px; } .operations-hero .button-link { width: 100%; text-align: center; } .directory-summary { grid-template-columns: 1fr; } }

/* Adaptive app shell: protect content at narrow widths and make touch actions predictable. */
html { min-width: 0; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
#app, main, .shell, .topbar, .brand, .card, .grid, .form-grid, .row, .list-item, .operations-hero { min-width: 0; max-width: 100%; }
main { width: 100%; }
.brand > div:last-child, .topbar > .row, .user-name { min-width: 0; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button, .button-link, input, select, textarea { min-height: 44px; }
button:focus-visible, .button-link:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #f0a202; outline-offset: 3px; }
button, .button-link, input, select, textarea { max-width: 100%; }
.form-grid .wide > button, .form-grid .wide > .button-link { width: 100%; text-align: center; }
.grid > *, .form-grid > *, .operations-hero > *, .row > * { min-width: 0; }
.operations-hero h1, .operations-hero p, h1, h2, h3, p { overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
table { min-width: max-content; }
.menu-panel a { min-height: 44px; display: flex; align-items: center; }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 0; }
.section-edit-toggle { flex: 0 0 auto; min-width: 74px; }
.section-summary { margin-bottom: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.summary-grid > div { display: grid; gap: 4px; min-width: 0; padding: 12px; border: 1px solid #e1eaeb; border-radius: 10px; background: #fbfdfd; }
.summary-grid strong { overflow-wrap: anywhere; }
.summary-wide { grid-column: 1 / -1; }
.section-kicker { margin-top: 4px; padding-top: 10px; border-top: 1px solid #e1eaeb; color: #0c6973; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invite-note { padding: 10px 12px; border-radius: 10px; background: #eef6f5; color: #47616a; font-size: .9rem; }
.export-filter-note { align-content: center; padding: 10px 12px; border: 1px dashed #b9cccf; border-radius: 10px; background: #fbfdfd; }
.export-filter-note span { color: #146154; font-weight: 800; }
.live-operations-search { margin: 14px 0 18px; }
.live-operations-search summary { width: fit-content; cursor: pointer; color: #0c6973; font-weight: 800; }
.live-operations-search[open] summary { margin-bottom: 12px; }
.operations-filter-form { margin: 14px 0 18px; padding: 14px; border: 1px solid #e1eaeb; border-radius: 12px; background: #f6faf9; }
.filter-actions { display: flex; align-items: end; gap: 8px; }
.filter-actions button { flex: 1 1 auto; }
.audit-event .section-heading { margin-bottom: 4px; }
.audit-event details { margin-top: 10px; }
.audit-event summary { cursor: pointer; color: #0c6973; font-weight: 800; }
.audit-event pre { max-width: 100%; margin: 10px 0 0; padding: 12px; overflow-x: auto; border-radius: 10px; background: #102a2d; color: #e8f5f3; font: .82rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.danger-zone { border-color: #efcaca; background: #fffafa; }
.danger-zone h2 { color: #8b2f2f; }
.role-access-reference summary { cursor: pointer; color: #0c6973; font-weight: 800; }
.role-access-reference[open] summary { margin-bottom: 14px; }
.role-access-reference > .button-link { margin-top: 14px; }
.user-editor .section-heading { margin-bottom: 14px; }
.role-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.role-field legend { padding: 0; color: #47616a; font-size: .85rem; font-weight: 700; }
.role-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.role-choice { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 12px; border: 1px solid #c7d5d8; border-radius: 10px; background: #fbfdfd; color: #1d3e45; cursor: pointer; }
.role-choice:has(input:checked) { border-color: #0c6973; background: #eef8f6; box-shadow: inset 0 0 0 1px #0c6973; }
.role-choice input { width: auto; min-height: auto; }
.user-languages-panel { padding-top: 4px; }
.user-language-list { display: grid; gap: 10px; }
.user-language-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 10px; border: 1px solid #e1eaeb; border-radius: 12px; background: #fbfdfd; }
.user-language-row button { min-height: 44px; }

@media (max-width: 900px) {
  .shell { padding: 18px; }
  .operations-hero { align-items: flex-start; }
  .operations-hero h1 { font-size: clamp(2rem, 6vw, 3rem); }
}

@media (max-width: 680px) {
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px; }
  .shell { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .login { width: 100%; margin: max(24px, 7vh) auto; padding: 24px 18px; border-radius: 18px; }
  h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); line-height: 1.08; }
  h2 { font-size: 1.2rem; line-height: 1.2; }
  .topbar { gap: 12px; margin-bottom: 16px; }
  .topbar > .row { flex-wrap: nowrap; gap: 8px; }
  .topbar > .row .user-name { flex: 1 1 auto; margin-right: 0; }
  .topbar > .row #logout { flex: 0 0 auto; padding-inline: .75rem; }
  .mark { width: 40px; height: 40px; border-radius: 12px; }
  .card { padding: 16px; border-radius: 14px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .operations-hero { gap: 16px; margin-bottom: 14px; padding: 20px; border-radius: 16px; }
  .operations-hero .button-link, .quick-links { width: 100%; }
  .quick-links { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .quick-links > .button-link { width: 100%; text-align: center; }
  .directory-summary { grid-template-columns: 1fr; gap: 8px; margin: 14px 0; }
  .form-grid { gap: 10px; }
  .inline-form { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
  .inline-form input, .inline-form select, .inline-form button { width: 100%; }
  .inline-form .check { justify-content: flex-start; }
  .table-wrap { margin-inline: -4px; padding-inline: 4px; padding-bottom: 4px; }
  th, td { padding: 10px 8px; }
  .menu-panel { top: 120px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-wide { grid-column: auto; }
  .section-heading { align-items: flex-start; }
  .filter-actions { align-items: stretch; }
  .user-language-row { grid-template-columns: 1fr; align-items: stretch; }
}

@media (max-width: 380px) {
  .topbar > .row { flex-wrap: wrap; gap: 6px; }
  .topbar > .row .user-name { max-width: 9ch; }
  .topbar > .row #logout { padding-inline: .6rem; }
  .login { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
