:root {
  --navy: #163a6b;
  --navy-deep: #0f2c54;
  --blue: #3d6ea8;
  --blue-soft: #dceaf7;
  --blue-softer: #eef5fb;
  --blue-border: #c5d8ee;
  --paper: #f3f7fb;
  --ink: #1a2744;
  --muted: #6b7a90;
  --line: #d7e3f0;
  --card: #ffffff;
  --green-on: #2fbe6a;
  --warn: #fff4d6;
  --danger: #c44545;
  --ok: #1f7a4d;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 4px 16px rgba(22, 58, 107, 0.08);
  --font: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--navy); }
.skip { position: absolute; left: -999px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.brand {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--blue);
  font-weight: 700;
}
.brand-logo-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-logo-wrap img,
.login-brand img,
.page-logo img {
  height: 40px;
  width: auto;
  display: block;
}
.login-brand,
.page-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 22px;
  max-width: 320px;
}
.login-brand img,
.page-logo img { height: 64px; }
.page-logo { margin-bottom: 12px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 64px; }
.wrap-wide {
  width: 95%;
  max-width: 95%;
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.topbar-app {
  background: var(--navy);
  color: #fff;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 16px;
  align-items: center;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 61;
  gap: 14px;
}
.topbar-app a { color: #fff; text-decoration: none; }
.topbar-app .screen-title h1,
.topbar-app .screen-title .subtitle { color: #fff; }
.topbar-app .icon-btn.is-menu {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.topbar-app .icon-btn.is-menu:hover,
.topbar-app .icon-btn.is-menu:active,
body.nav-open .topbar-app .icon-btn.is-menu {
  background: #fff;
  color: var(--navy);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 44, 84, 0.45);
  z-index: 55;
}
body.nav-open .nav-backdrop,
body.sheet-open .nav-backdrop { display: block; }

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: min(280px, 88vw);
  height: 100vh;
  background: var(--navy-deep);
  color: #fff;
  padding: calc(88px + env(safe-area-inset-top, 0px)) 12px 16px;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 8px 0 24px rgba(15, 44, 84, 0.28);
}
body.nav-open .app-sidebar { transform: translateX(0); }
.app-sidebar .sidebar-logo {
  margin: 0 8px 10px;
  align-self: flex-start;
}
.topbar-app .screen-title { min-width: 0; }
.topbar-app .screen-title h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  background: transparent;
  border: 0;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
}
.app-sidebar .nav-item:hover,
.app-sidebar .nav-item:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}
.app-sidebar .nav-item.is-active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 3px 0 0 #fff;
}
.app-sidebar .nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-sidebar .nav-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
}
.app-sidebar .nav-user {
  padding: 8px 12px 12px;
}
.app-sidebar .nav-user-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}
.app-sidebar .nav-user-email {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.75;
  word-break: break-word;
}
.screen-title h1 {
  font-size: 1.35rem;
  margin: 0;
  color: var(--navy);
}
.screen-title .subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar-actions a.is-active { text-decoration: underline; }
.topbar-actions .btn { margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-head {
  background: var(--blue-softer);
  margin: -20px -20px 16px;
  padding: 12px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--blue-border);
  font-weight: 700;
  color: var(--navy);
}
h1 { font-size: 1.5rem; margin: 8px 0 12px; color: var(--navy); }
h2 { font-size: 1.05rem; margin: 0 0 12px; color: var(--navy); }
p.lead { color: var(--muted); margin-top: 0; }
label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px;
}
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--ink);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23163a6b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
input[type="date"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233d6ea8' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue-soft);
  border-color: var(--blue);
}
.form-field label { margin-top: 14px; }
.form-field:first-child label { margin-top: 0; }
.form-field.is-invalid label { color: var(--danger); }
.form-field.is-invalid input,
.form-field.is-invalid select,
.form-field.is-invalid textarea {
  border-color: var(--danger);
  outline-color: rgba(198, 40, 40, 0.25);
}
.hint { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.row { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .row.cols-2 { grid-template-columns: 1fr 1fr; }
  .row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--navy);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.icon-btn:hover, .icon-btn:active {
  background: var(--navy);
  color: #fff;
}
.icon-btn:disabled {
  background: #eceff3;
  color: #9aa6b5;
  cursor: not-allowed;
}
.icon-btn.round { border-radius: 50%; }
.icon-btn.is-danger { background: #f8e3e3; color: var(--danger); }
.icon-btn.is-danger:hover, .icon-btn.is-danger:active {
  background: var(--danger);
  color: #fff;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--blue-soft);
  color: var(--navy) !important;
  border: 0;
  padding: 11px 18px;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 8px;
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn:hover, .btn:active {
  background: var(--navy);
  color: #fff !important;
}
.btn:disabled {
  background: #eceff3;
  color: #9aa6b5 !important;
  cursor: not-allowed;
}
.btn-ghost {
  background: #fff;
  border: 1px solid var(--blue);
  color: var(--navy) !important;
}
.btn-ghost:hover, .btn-ghost:active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff !important;
}
.btn-danger {
  background: #f8e3e3;
  color: var(--danger) !important;
}
.btn-danger:hover { background: var(--danger); color: #fff !important; }
.btn-wide { width: 100%; }
.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  margin-top: 0;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: 14px;
}
.alert.error { background: #fdecea; color: var(--danger); }
.alert.ok { background: #e6f7ee; color: var(--ok); }
.alert.warn { background: var(--warn); color: #6a5300; }

.nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 8px;
}
.footer {
  margin-top: 40px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.code {
  font-family: Consolas, ui-monospace, monospace;
  font-size: 1.45rem;
  letter-spacing: 0.12em;
  background: var(--blue-softer);
  border: 1px solid var(--blue-border);
  color: var(--navy);
  padding: 18px;
  border-radius: var(--radius);
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--blue-softer);
  color: var(--navy);
}
.badge.unresolved { background: #f3d6d6; color: #7a2020; }
.badge.pending { background: #f0e6a0; color: #6a5300; }
.badge.resolved { background: #cde8d8; color: #1f7a4d; }
.badge.low { background: #e8edf3; }
.badge.medium { background: #dceaf7; }
.badge.high { background: #f3d6d6; color: #7a2020; }

.search-row {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.search-row input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.search-row .btn {
  margin: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.attach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fff;
}
.attach-row .clip {
  color: var(--blue);
  display: inline-flex;
}
.attach-row .attach-name { flex: 1; font-weight: 600; color: var(--navy); }
.attach-row .btn { margin: 0; padding: 8px 14px; }

.filter-card {
  margin: 16px 0;
  padding: 0;
  overflow: hidden;
}
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--blue-border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--blue-softer);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.filter-card.is-collapsed .filter-toggle {
  border-bottom: 0;
  border-radius: var(--radius);
}
.filter-toggle:hover,
.filter-toggle:focus-visible {
  background: var(--blue-soft);
}
.filter-toggle-meta {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.filter-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}
.filter-card:not(.is-collapsed) .filter-chevron { transform: rotate(180deg); }
.filter-body { padding: 16px 20px 20px; }
.filter-card.is-collapsed .filter-body { display: none; }
.filter-body .filters > div > label { margin-top: 0; }
.filter-body .preset-row { margin-bottom: 12px; }
.filters {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
}
.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.filter-actions .btn { margin-top: 0; width: auto; }

table.data { width: 100%; border-collapse: collapse; background: #fff; }
table.data th, table.data td {
  padding: 10px 8px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
table.data th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--blue-softer);
}
table.data tbody tr:nth-child(even) { background: var(--blue-softer); }
table.data tbody tr:nth-child(odd) { background: #fff; }
table.data .icon-btn { width: 34px; height: 34px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--navy);
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) { .split { grid-template-columns: 1fr 340px; } }
.internal { background: var(--blue-softer); }
.muted { color: var(--muted); font-size: 13px; }
pre.hist {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  margin: 0;
}
.file-list { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 6px 2px 0;
  padding: 2px 8px;
  background: #f0f2f5;
  border-radius: 6px;
  font-size: 12px;
}
.file-remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  padding: 0 2px;
}
.file-remove:hover { color: var(--danger); }
#anon-delay-warn { margin-top: 10px; }
.hidden { display: none !important; }
body.modal-open { overflow: hidden; }
.center { text-align: center; }
.home-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
@media (min-width: 700px) { .home-grid { grid-template-columns: 1fr 1fr; } }
.home-grid .card { min-height: 180px; }

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  display: inline-block;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  background: #d5dde6;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s;
}
.switch span::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
}
.switch input:checked + span { background: var(--green-on); }
.switch input:checked + span::after { transform: translateX(20px); }

.user-chip { font-size: 13px; opacity: 0.9; }

.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  margin: 8px 0 20px;
}
@media (min-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi-card .kpi-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.kpi-card .kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 4px;
  line-height: 1.2;
}
.kpi-card .kpi-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}
.chart-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .chart-grid { grid-template-columns: 1fr 1fr; }
}
.chart-card canvas { max-height: 280px; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-empty { margin: 24px 8px; text-align: center; }
.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.preset-row .btn { margin-top: 0; }
.preset-row .btn.is-active {
  background: var(--navy);
  color: #fff !important;
}

.tour-root {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}
.tour-catcher {
  position: fixed;
  inset: 0;
  pointer-events: auto;
}
.tour-spotlight {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 9999px rgba(15, 44, 84, 0.58);
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.tour-popover {
  position: fixed;
  width: min(340px, calc(100vw - 28px));
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 16px 44px rgba(15, 44, 84, 0.32);
  z-index: 92;
  pointer-events: auto;
  border: 1px solid var(--blue-border);
  border-left: 4px solid var(--navy);
}
.tour-progress {
  height: 3px;
  background: var(--blue-softer);
  border-radius: 99px;
  margin: 0 0 10px;
  overflow: hidden;
}
.tour-progress span {
  display: block;
  height: 100%;
  background: var(--navy);
  border-radius: 99px;
  width: 0;
  transition: width 0.2s ease;
}
.tour-popover h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.tour-popover p { margin: 0 0 12px; font-size: 14px; color: var(--ink); }
.tour-step {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 6px;
}
.tour-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tour-actions .btn { margin-top: 0; }

.badge.investigating { background: #d6e4f3; color: #1a4a7a; }
.badge.closed { background: #d9d9d9; color: #444; }

.choice-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0 4px;
}
.choice-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.choice-row input[type="radio"],
.choice-row input[type="checkbox"] {
  width: auto;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.tabs .btn { margin-top: 0; }
.tabs .btn.is-active {
  background: var(--navy);
  color: #fff !important;
}
.tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}
.tabs-bar .tabs { margin: 0; flex: 1; }
.tabs-bar .btn-alta { margin-top: 0; margin-left: auto; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 44, 84, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 16px;
}
.modal {
  background: #fff;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 16px 48px rgba(15, 44, 84, 0.28);
}
.modal img, .modal iframe {
  width: 100%;
  max-height: 70vh;
  border: 0;
}
.modal-form { max-width: 520px; padding: 0; }
.modal-case { max-width: 720px; padding: 0; }
.modal-manage { max-width: 560px; padding: 0; }
.modal-manage textarea { min-height: 72px; }
.modal-head-actions { display: flex; align-items: center; gap: 8px; }
.modal-head-actions .btn { margin-top: 0; padding: 8px 14px; }
.case-block { margin: 0 0 16px; }
.case-block h3 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.attach-list,
.history-list { list-style: none; padding: 0; margin: 0; }
.attach-list li,
.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.history-list li { display: block; }
.th-sort {
  white-space: nowrap;
  user-select: none;
}
.th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.th-sort-btn:hover,
.th-sort.is-sorted .th-sort-btn {
  color: var(--navy);
}
.th-sort-mark {
  min-width: 0.75em;
  font-size: 11px;
  line-height: 1;
  color: var(--navy);
}
.modal-confirm { max-width: 440px; padding: 28px 24px 20px; text-align: center; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--blue-softer);
  border-bottom: 1px solid var(--blue-border);
  border-radius: 8px 8px 0 0;
}
.modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-body { padding: 8px 20px 20px; }
.modal-form textarea { min-height: 88px; }
.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}
.modal-actions .btn { margin-top: 0; }
.confirm-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fdecea;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.confirm-text {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 8px;
  line-height: 1.45;
}
.confirm-name {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-weight: 700;
}

.toast-host {
  position: fixed;
  top: calc(84px + env(safe-area-inset-top, 0px));
  right: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.alert.toast {
  pointer-events: auto;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(15, 44, 84, 0.18);
  animation: toast-in 0.22s ease;
}
.alert.toast span { flex: 1; min-width: 0; }
.alert.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.alert.toast.toast-out { animation: toast-out 0.2s ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

.catalog-card { padding: 0; overflow: auto; }
.empty-catalog {
  margin: 0;
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
}
table.data td.col-actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}
.table-actions { display: inline-flex; gap: 6px; }
.field-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 6px;
}
.field-switch > span:first-child {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.field-switch .switch { flex-shrink: 0; }

@media (max-width: 640px) {
  .screen-title h1 { font-size: 1.15rem; }
  table.data { font-size: 13px; }
}

.app-tabbar,
.app-sheet { display: none; }

@media (max-width: 820px) {
  body.is-committee {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  body.is-committee .topbar-app {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 12px;
  }
  body.is-committee .topbar-app .icon-btn.is-menu { display: none; }
  body.is-committee .topbar-app .brand-logo-wrap { padding: 4px 8px; }
  body.is-committee .topbar-app .brand-logo-wrap img { height: 32px; }
  body.is-committee .app-sidebar { display: none; }
  body.is-committee .wrap-wide {
    width: 100%;
    max-width: 100%;
    padding: 14px 12px calc(24px + 64px + env(safe-area-inset-bottom, 0px));
  }
  body.is-committee .filters { grid-template-columns: 1fr; }
  body.is-committee table.data {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 62;
    background: var(--navy);
    color: #fff;
    justify-content: space-around;
    align-items: stretch;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(15, 44, 84, 0.2);
  }
  .app-tabbar .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 10px;
    cursor: pointer;
  }
  .app-tabbar .nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .app-tabbar .nav-item svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .app-tabbar .nav-item.is-active,
  .app-tabbar .nav-item[aria-expanded="true"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
  }

  .app-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: #fff;
    color: var(--ink);
    border-radius: 16px 16px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    transition: transform 0.22s ease;
    max-height: 80vh;
    box-shadow: 0 -12px 40px rgba(15, 44, 84, 0.28);
  }
  body.sheet-open .app-sheet { transform: translateY(0); }
  .app-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--line);
    margin: 6px auto 12px;
  }
  .app-sheet-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .app-sheet .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--navy);
    font-weight: 600;
  }
  .app-sheet .nav-item.is-active { background: var(--blue-softer); }
  .app-sheet .nav-item svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .app-sheet .nav-foot {
    margin-top: 8px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
  .app-sheet .nav-user-name { color: var(--navy); }
  .app-sheet .nav-user-email { opacity: 0.8; color: var(--muted); }
}
