/* JOBS Smart Pass — shared design system
   Navy + white with green accents. Logical properties keep layouts correct in RTL (Arabic). */
:root {
  --navy-900: #071a33;
  --navy-800: #0b2545;
  --navy-700: #13315c;
  --navy-600: #1d4477;
  --navy-100: #e6edf7;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-100: #dcfce7;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-100: #fee2e2;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: var(--gray-900);
  --muted: var(--gray-500);
  --border: var(--gray-200);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.18);
  --sidebar-w: 248px;
  --font: "Segoe UI", Tahoma, Arial, sans-serif; /* same as the Tiekklesia app */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--navy-800); line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(29, 68, 119, 0.45); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
/* Digits/codes use a monospace font; Arabic letters (not in those fonts) fall back to the normal UI font. */
.mono { font-family: Consolas, 'SFMono-Regular', Menlo, 'Segoe UI', Tahoma, 'Noto Sans Arabic', Arial, monospace; letter-spacing: 0.02em; }
.mono:lang(ar), [dir="rtl"] .mono:not([dir="ltr"]) { letter-spacing: 0; }
.nowrap { white-space: nowrap; }
.text-end { text-align: end; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.stack > * + * { margin-top: 12px; }

/* ---------- App shell ---------- */
body.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: minmax(0, 1fr); grid-template-areas: 'side main'; height: 100vh; overflow: hidden; }
.sidebar { grid-area: side; background: #00131c; color: #cfdcf0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; z-index: 30; }
.sidebar::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; height: 84px; padding: 0 14px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.brand:hover { text-decoration: none; color: #fff; }
.brand-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--green-600); color: #fff; flex: none; }
.brand-icon svg { width: 20px; height: 20px; fill: currentColor; }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-logo img { display: block; height: 52px; width: 52px; }
.brand-logo img.wordmark { height: 46px; width: auto; }
.brand-text { font-size: 22px; font-weight: 800; letter-spacing: 1px; color: #fff; white-space: nowrap; }
.brand-text .accent { color: #35c4cf; }
.brand small { display: block; font-weight: 400; font-size: 11px; color: #9fb3d1; letter-spacing: 0.04em; }
/* Links stretch to share the free height evenly (each up to 52px tall), so the spacing stays balanced */
.nav { flex: 1 0 auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav a { flex: 1 0 auto; max-height: 52px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #cfdcf0; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(22, 163, 74, 0.16); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.nav-section { margin: 14px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #7f95b8; }
.sidebar-foot { margin-top: auto; padding: 12px 14px; font-size: 12px; color: #8ea3c4; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 10px; }
/* Username button: opens the user menu (Change password / Sign out) right above it */
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px; background: rgba(255, 255, 255, 0.06); color: #fff; text-align: start; cursor: pointer; }
.sidebar-user:hover, .sidebar-user[aria-expanded='true'] { background: rgba(255, 255, 255, 0.14); }
.sidebar-user-avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.12); }
.sidebar-user-avatar svg { width: 17px; height: 17px; }
.sidebar-user-name { flex: 1; min-width: 0; color: #fff; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user > svg { width: 18px; height: 18px; flex: none; transform: rotate(180deg); transition: transform 0.15s ease; }
.sidebar-user[aria-expanded='true'] > svg { transform: none; }
.sidebar-user-menu { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); }
.sidebar-user-menu[hidden] { display: none !important; }
.sidebar-user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; color: var(--gray-700); font-size: 14px; text-align: start; cursor: pointer; }
.sidebar-user-menu button:hover { background: var(--gray-100); }
.sidebar-user-menu button.danger { color: #dc2626; }
.sidebar-user-menu svg { width: 18px; height: 18px; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green-600); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
/* Person icon next to a name (all tables): grey circle with a user figure. Use App.person(html). */
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-icon { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--gray-100); color: var(--gray-500); }
.person-icon svg { width: 18px; height: 18px; }
.btn.menu-btn { display: none; }
.mobile-bar { display: none; }
/* Standalone pages (scanner): no sidebar, slim top bar */
.mini-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); background: linear-gradient(90deg, var(--navy-800), var(--navy-900)); color: #fff; }
.mini-bar .brand-icon { width: 30px; height: 30px; }
.mini-bar .brand-icon svg { width: 18px; height: 18px; }
.mini-bar .brand-logo { background: #fff; padding: 3px; border-radius: 8px; }
.mini-bar .brand-logo img { height: 30px; }
.mini-bar-title { font-weight: 700; font-size: 17px; }
.mini-bar .spacer { flex: 1; }
.mini-bar-user { font-size: 13px; color: #cfdcf0; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bar .btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); color: #fff; }
.mini-bar .btn:hover { background: rgba(255, 255, 255, 0.16); }
.mini-bar .btn svg { width: 16px; height: 16px; }
@media (max-width: 480px) { .mini-bar-user { display: none; } }
/* main is the only scroll container, so the scrollbar sits on the content area instead of next to the sidebar (also in RTL) */
main#content { grid-area: main; min-height: 0; overflow-y: auto; padding: 22px; width: 100%; }
body.app main#content { padding-inline-end: max(22px, calc(100% - 1400px + 22px)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
/* Phones: header buttons stay on the same row as the page title (compact buttons, title text wraps) */
@media (max-width: 700px) {
  .page-head { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
  .page-head > :first-child { flex: 1 1 auto; min-width: 0; }
  .page-head > :last-child:not(:first-child) { flex: 0 1 auto; min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .page-head h1 { font-size: 19px; }
  .page-head p { font-size: 12.5px; }
  .page-head .btn { min-height: 34px; padding: 0 10px; font-size: 13px; }
}

@media (max-width: 960px) {
  body.app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: 'bar' 'main'; }
  /* Phone navbar: menu button + logo + page title, same colour as the sidebar */
  .mobile-bar { grid-area: bar; display: flex; align-items: center; gap: 10px; z-index: 20; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: #fff; border-radius: 0 0 16px 16px; color: var(--gray-800, #1f2937); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
  .mobile-brand { display: inline-flex; align-items: center; gap: 8px; flex: none; text-decoration: none !important; }
  .mobile-bar .brand-logo img { height: 46px; width: 46px; }
  .mobile-bar .brand-logo img.wordmark { height: 40px; width: auto; }
  @media (max-width: 380px) { .mobile-bar .brand-logo img { height: 40px; width: 40px; } .mobile-bar .brand-logo img.wordmark { height: 34px; } }
  .mobile-user { position: relative; margin-inline-start: auto; min-width: 0; }
  /* User name + role (like the Tiekklesia app's phone top bar): tap opens Change password; the logout icon sits beside it */
  .mobile-user-btn { display: inline-flex; align-items: center; max-width: 100%; padding: 4px 8px; border: 0; border-radius: 10px; background: none; color: #1a202c; font: inherit; text-align: start; cursor: pointer; transition: background 0.15s; }
  .mobile-user-btn:hover, .mobile-user-btn[aria-expanded='true'] { background: #f3f4f6; }
  .mobile-user-who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
  .mobile-user-name { max-width: 100px; font-size: 0.88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-user-role { max-width: 100px; color: #6b7280; font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-logout { display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 8px; border: 1px solid #00131c; border-radius: 8px; background: #fff; color: #00131c; cursor: pointer; }
  .mobile-logout:hover { background: #00131c; color: #fff; }
  .mobile-logout svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-user-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; min-width: 190px; padding: 6px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 40; }
  .mobile-user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 7px; background: none; color: var(--gray-700); font-size: 14px; text-align: start; cursor: pointer; }
  .mobile-user-menu button:hover { background: var(--gray-100); }
  .mobile-user-menu button.danger { color: #dc2626; }
  .mobile-user-menu svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
  /* Phones: the sidebar opens under the navbar (no logo — the navbar already shows it) */
  .sidebar { position: fixed; top: var(--mbar-h, 62px); bottom: 0; inset-inline-start: 0; height: auto; width: var(--sidebar-w); transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar > .brand { display: none; }
  [dir='rtl'] .sidebar { transform: translateX(100%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  /* Phones/tablets: bigger, easier-to-tap sidebar links */
  .sidebar { width: min(290px, 85vw); }
  .nav { padding: 8px; gap: 2px; }
  .nav a { font-size: 15px; padding: 9px 12px; gap: 12px; border-radius: 9px; }
  .nav svg { width: 20px; height: 20px; }
  .nav-section { font-size: 12px; margin: 10px 12px 4px; }
  .sidebar-user-name { font-size: 15px; }
  /* Phones: white sidebar to match the white navbar */
  .sidebar { background: #fff; color: #374151; }
  .nav a { color: #374151; }
  .nav a:hover { background: rgba(0, 0, 0, 0.05); color: #111827; }
  .nav a.active { background: rgba(22, 163, 74, 0.12); color: #15803d; }
  .nav-section { color: #6b7280; }
  .sidebar-foot { color: #6b7280; border-top-color: rgba(0, 0, 0, 0.08); }
  .sidebar-user { border-color: rgba(0, 0, 0, 0.12); background: rgba(0, 0, 0, 0.03); color: #1f2937; }
  .sidebar-user:hover, .sidebar-user[aria-expanded='true'] { background: rgba(0, 0, 0, 0.07); }
  .sidebar-user-avatar { background: rgba(0, 0, 0, 0.07); }
  .sidebar-user-name { color: #1f2937; }  .sidebar-user-menu { border: 1px solid rgba(0, 0, 0, 0.08); }
  body.nav-open::after { content: ''; position: fixed; inset: 0; top: var(--mbar-h, 62px); background: rgba(7, 26, 51, 0.4); z-index: 25; }
  .btn.menu-btn { display: inline-flex; flex: none; width: 40px; height: 40px; padding: 0; background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.12); color: var(--gray-800, #1f2937); }
  .btn.menu-btn:hover { background: rgba(0, 0, 0, 0.07); }
  .btn.menu-btn svg { width: 20px; height: 20px; }
  main#content { padding: 14px; }
  body.app main#content { padding: 14px; }
  .hide-sm { display: none !important; }
}

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.stat .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-700); flex: none; }
.stat .icon.green { background: var(--green-100); color: var(--green-700); }
.stat .icon.red { background: var(--red-100); color: var(--red-700); }
.stat .icon.amber { background: var(--amber-100); color: var(--amber-600); }
.stat .icon svg { width: 20px; height: 20px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 700; color: var(--navy-800); margin-top: 2px; }
.stat .sub { font-size: 12px; color: var(--muted); }
/* Phones: stat cards 3 per row, compact (icon on top, smaller text) */
@media (max-width: 700px) {
  .grid:has(> .stat) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grid > .stat { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 6px; min-width: 0; }
  .grid > .stat > div:last-child { min-width: 0; width: 100%; }
  .grid > .stat .icon { width: 38px; height: 38px; border-radius: 10px; }
  .grid > .stat .icon svg { width: 20px; height: 20px; }
  .grid > .stat .label { font-size: 12.5px; line-height: 1.3; }
  .grid > .stat .value { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
  .grid > .stat .sub { font-size: 11.5px; line-height: 1.3; }
}

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid #00131c; background: #00131c; color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: #0e2a37; border-color: #0e2a37; color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: #00131c; border-color: #00131c; color: #fff; } /* buttons share the sidebar colour */
.btn-primary:hover { background: #0e2a37; border-color: #0e2a37; }
.btn-success { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn-success:hover { background: var(--green-700); border-color: var(--green-700); }
.btn-danger { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn-danger:hover { background: var(--red-700); border-color: var(--red-700); }
.btn-ghost { background: transparent; border-color: transparent; color: #00131c; }
.btn-ghost:hover { background: var(--gray-100); border-color: transparent; color: #00131c; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 0 20px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn-ghost.loading::after { border-color: #00131c #00131c transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .label { font-weight: 600; font-size: 13px; color: var(--gray-700); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--red-700); min-height: 0; }
.input, select.input, textarea.input { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--gray-300); border-radius: 8px; background: #fff; font: inherit; color: inherit; }
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--navy-600); outline: none; box-shadow: 0 0 0 3px rgba(29, 68, 119, 0.15); }
.input[aria-invalid='true'] { border-color: var(--red-600); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--navy-700); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }
.filters .field.search { flex: 0 1 320px; }
.card-head > .filters { flex: 1 1 auto; }
/* Keep every field on one row (search shrinks instead of wrapping) */
.filters.one-row { flex-wrap: nowrap; }
.filters.one-row .field.search { min-width: 0; }
/* Phones: every filter bar becomes 2 inputs per row (pages can make the search span the full row) */
@media (max-width: 700px) {
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; align-items: end; }
  .filters .field, .filters .input { min-width: 0; max-width: none; }
  .filters > *:only-child { grid-column: 1 / -1; }
  /* Odd number of fields: search takes its own full row so the rest pair up evenly */
  .filters:has(> :last-child:nth-child(odd)) > .field.search { grid-column: 1 / -1; }
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: start; font-weight: 600; color: var(--gray-500); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 14px; background: var(--gray-50); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.table th button:focus-visible { outline: 2px solid var(--navy-600); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tbody tr:hover { background: #fafcff; }
.table tr.clickable { cursor: pointer; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
/* m-only: extra details shown only on phones, inside the visible cells (label above, value below) */
.m-only { display: none; }
/* Phones: columns marked hide-phone are dropped and the rest are tightened to fit the screen */
@media (max-width: 700px) {
  .m-only { display: block; }
  .m-actions { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
  .m-actions .btn { width: 100%; }
  .m-extra { text-align: start; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--gray-200); }
  .m-extra > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .m-extra > div > span { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.02em; }
  .m-extra > div > b { font-size: 14px; font-weight: 600; color: var(--gray-700); overflow-wrap: anywhere; }
  .table td { vertical-align: top; }
  /* Rows with phone extras: clear separation between records */
  .table tbody tr:has(.m-extra) td { padding-top: 14px; padding-bottom: 14px; border-bottom: 6px solid var(--gray-100); }
  .table tbody tr:has(.m-extra):nth-child(even) td { background: #f8fafc; }
  .table tbody tr:has(.m-extra):last-child td { border-bottom: 0; }
  .table .hide-phone { display: none; }
  .table th, .table td { padding: 9px 8px; }
  .table th { font-size: 12.5px; letter-spacing: 0.02em; }
  .table td { font-size: 15px; }
  .table td.mono, .table td .mono { font-size: 14.5px; }
  .table .person-icon { display: none; }
}
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.pager .row { gap: 6px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: 0.5; display: block; margin: 0 auto 8px; }
.skeleton { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--gray-100), var(--gray-200), var(--gray-100)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-100); color: var(--green-700); }
.badge.red { background: var(--red-100); color: var(--red-700); }
.badge.amber { background: var(--amber-100); color: #92400e; }
.badge.blue { background: var(--blue-100); color: #1e40af; }
.badge.gray { background: var(--gray-100); color: var(--gray-700); }
.badge.navy { background: var(--navy-100); color: var(--navy-700); }

/* ---------- Dialogs & toasts ---------- */
dialog.modal { border: none; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); color: inherit; }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(7, 26, 51, 0.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; max-height: calc(100vh - 200px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--gray-50); border-radius: 0 0 14px 14px; }
.toasts { position: fixed; inset-block-end: 18px; inset-inline-end: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--navy-800); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; animation: toastIn 0.18s ease-out; border-inline-start: 4px solid var(--green-600); }
.toast.error { border-inline-start-color: var(--red-600); }
.toast.warn { border-inline-start-color: var(--amber-600); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.alert { padding: 12px 14px; border-radius: 8px; border: 1px solid; font-weight: 500; }
.alert.info { background: var(--blue-100); border-color: #bfdbfe; color: #1e3a8a; }
.alert.warn { background: var(--amber-100); border-color: #fde68a; color: #78350f; }
.alert.error { background: var(--red-100); border-color: #fecaca; color: #7f1d1d; }
.alert.success { background: var(--green-100); border-color: #bbf7d0; color: #14532d; }

/* ---------- Misc ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tabs button { all: unset; cursor: pointer; padding: 12px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected='true'] { color: var(--navy-700); border-bottom-color: var(--green-600); }
.tabs button:focus-visible { outline: 2px solid var(--navy-600); }
.photo { width: 120px; height: 150px; border-radius: 10px; object-fit: cover; background: var(--gray-100); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); font-size: 12px; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.chart-box { position: relative; height: 260px; }
.lang-btn { font-weight: 700; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 18px; border-bottom: 1px solid var(--gray-100); display: flex; justify-content: space-between; gap: 10px; }
.list-plain li:last-child { border-bottom: none; }

@media print {
  body.app { display: block; background: #fff; height: auto; overflow: visible; }
  .sidebar, .menu-btn, .mobile-bar, .no-print, .toasts { display: none !important; }
  main#content { padding: 0; overflow: visible; }
  .card { box-shadow: none; border: none; }
}
