﻿:root {
  --bg: #fff;
  --fg: #0b0b0b;
  --muted: #6b6b6b;
  --line: #e9e9e9;
  --accent: #111;
  --accent-contrast: #fff;
  --radius: 12px;
  --shadow: 0 2px 14px rgba(0,0,0,0.06);
  --font-base: "Noto Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --employee-table-sticky-top: 76px;
  --app-topbar-height: 76px;
  --surface: #fff;
  --surface-hover: #f1f1f1;
  --surface-alt: #fafafa;
  --fg-secondary: #444;
  --line-strong: #b6b6b6;
  --success-bg: #eefaf1;
  --success-fg: #166534;
  --danger-bg: #ffe2e0;
  --danger-fg: #991b1b;
  --warning-bg: #fff7d6;
  --warning-fg: #92400e;
  --info-bg: #eff6ff;
  --info-fg: #1e40af;
  --backdrop: rgba(0,0,0,0.35);
}

[data-theme="dark"] {
  --bg: #0f0f1a;
  --fg: #e4e4e7;
  --muted: #9ca3af;
  --line: #2d2d4a;
  --accent: #e4e4e7;
  --accent-contrast: #0f0f1a;
  --radius: 12px;
  --shadow: 0 2px 14px rgba(0,0,0,0.4);
  --surface: #1a1a2e;
  --surface-hover: #252545;
  --surface-alt: #161628;
  --fg-secondary: #b0b0c0;
  --line-strong: #404060;
  --success-bg: #0f2a1a;
  --success-fg: #6ee7b7;
  --danger-bg: #2a0f0f;
  --danger-fg: #fca5a5;
  --warning-bg: #2a2510;
  --warning-fg: #fcd34d;
  --info-bg: #0f1a2e;
  --info-fg: #93c5fd;
  --backdrop: rgba(0,0,0,0.6);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 var(--font-base);
}

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.auth-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 6px 10px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  min-width: 0;
}
.auth-status-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}
.auth-user-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  font-size: 13px;
  color: var(--fg-secondary);
}
.auth-user-login {
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}
.auth-subscription-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg-secondary);
  white-space: nowrap;
}
.auth-subscription-status-critical {
  border-color: rgba(220, 60, 31, 0.28);
  background: rgba(220, 60, 31, 0.12);
  color: #9f1239;
}
.auth-subscription-status-warning {
  border-color: rgba(180, 114, 4, 0.28);
  background: rgba(250, 204, 21, 0.16);
  color: #8a5500;
}
.auth-subscription-status-healthy {
  border-color: rgba(33, 150, 83, 0.24);
  background: rgba(33, 150, 83, 0.12);
  color: #166534;
}
.auth-renew-btn {
  font-size: 12px;
  padding: 4px 6px;
  white-space: nowrap;
}
.auth-status > .btn {
  flex-shrink: 0;
}
.auth-status #logoutBtn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}
.title { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
#viewTitle { display: none; }

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}

.topbar-brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(31, 94, 255, 0.16);
}

.topbar-brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1f5eff;
}

.container {
  padding: calc(var(--app-topbar-height) + 24px) clamp(16px, 4vw, 40px) 80px;
  width: 100%;
  margin: 0 auto;
  max-width: none;
}
.container[data-app-fatal="1"] > section:not(#appFatalState) {
  display: none !important;
}
.app-fatal {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--app-topbar-height) - 120px);
}
.app-fatal-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  box-shadow: var(--shadow);
}
.app-fatal-card h2,
.app-fatal-card p {
  margin: 0;
}
.app-fatal-actions {
  justify-content: flex-end;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(0,0,0,0.04), transparent 28%),
    linear-gradient(160deg, var(--surface-alt), var(--bg) 40%, var(--surface) 100%);
}
.login-shell {
  width: min(100%, 460px);
}
.login-top-actions {
  position: fixed;
  top: max(18px, calc(env(safe-area-inset-top, 0px) + 12px));
  right: clamp(16px, 4vw, 36px);
  display: flex;
  gap: 12px;
  z-index: 40;
}
.login-demo-link { text-decoration: none; }
.login-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0,0,0,0.08);
  padding: 28px;
  display: grid;
  gap: 18px;
}
.login-card-header {
  display: grid;
  gap: 8px;
}
.login-brand {
  display: grid;
  gap: 10px;
}
.login-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.login-brand-mark {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 14px 28px rgba(31, 94, 255, 0.16);
}
.login-brand-copy {
  display: grid;
  gap: 2px;
}
.login-brand-title {
  font-family: "Manrope", "Noto Sans", system-ui, sans-serif;
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #1f5eff;
}
.login-brand-caption {
  font-size: 13px;
  font-weight: 600;
  color: #617791;
}
.login-brand-note {
  margin: 0;
  color: var(--fg-secondary);
  font-size: 14px;
  line-height: 1.45;
}
.login-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}
.login-subtitle {
  margin: 0;
  color: var(--fg-secondary);
}
.login-alert {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}
.login-alert-error {
  background: var(--danger-bg);
  color: var(--danger-fg);
}
.login-alert-info {
  background: var(--info-bg);
  color: var(--info-fg);
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-legal-intro {
  display: grid;
  gap: 6px;
}
.login-legal-summary,
.login-legal-hint {
  margin: 0;
  font-size: 14px;
  color: var(--fg-secondary);
}
.login-checkbox-control {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d5dde8;
  background: rgba(255, 255, 255, 0.96);
}
.login-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: #0f172a;
}
.login-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  padding: 0;
  border-radius: 5px;
  flex: 0 0 auto;
}
.login-checkbox-row a {
  color: #2454a6;
}
.login-checkbox-row a:hover {
  color: #173d7a;
}
.login-control {
  display: grid;
  gap: 8px;
}
.login-control input,
.login-control select,
.owner-form-grid input:not([type="checkbox"]):not([type="radio"]),
.owner-form-grid select,
.owner-form-grid textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #cfd9e4;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font: inherit;
  line-height: 1.35;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.login-control input::placeholder,
.owner-form-grid input::placeholder,
.owner-form-grid textarea::placeholder {
  color: #8aa0b2;
}
.login-control input:focus,
.login-control select:focus,
.owner-form-grid input:not([type="checkbox"]):not([type="radio"]):focus,
.owner-form-grid select:focus,
.owner-form-grid textarea:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}
.owner-form-grid input[readonly] {
  background: #f3f7fa;
  color: #587183;
}
.owner-form-grid textarea {
  min-height: 96px;
  resize: vertical;
}
.owner-form-grid .control > span,
.login-control > span {
  font-size: 13px;
  font-weight: 600;
  color: #486171;
}
.login-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.login-footer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.login-footer a {
  color: var(--muted);
  text-decoration: none;
}
.login-footer a:hover {
  color: var(--fg);
}

.btn {
  appearance: none; border: 1px solid var(--line);
  background: var(--surface-hover); color: var(--fg);
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
  transition: background .18s ease, transform .06s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent); color: var(--accent-contrast); border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }

.icon-btn {
  border: 0; background: transparent; cursor: pointer; font-size: 18px; line-height: 1;
  width: 34px; height: 34px; border-radius: 8px;
}
.icon-btn:hover { background: var(--surface-hover); }

.cards {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 16px; box-shadow: var(--shadow);
  display: grid; gap: 8px; transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.08); }
.card-title { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.section-inline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}
.section-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.section-inline-title {
  margin: 0 0 6px;
  font-size: 18px;
}
.inline-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.inline-help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #cfdbe5;
  background: #f7fafc;
  color: #29485a;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  user-select: none;
  cursor: help;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.inline-help-bubble {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dbe6ee;
  background: #ffffff;
  color: #29485a;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  line-height: 1.45;
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  pointer-events: none;
  z-index: 40;
}
.inline-help:hover .inline-help-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.inline-help-compact .inline-help-trigger {
  width: 20px;
  height: 20px;
  font-size: 12px;
}
.inline-help-compact .inline-help-bubble {
  width: min(280px, calc(100vw - 40px));
}
.inline-help.is-modal-help .inline-help-bubble {
  top: calc(100% + 8px);
  right: 0;
  width: min(248px, calc(100vw - 72px));
  transform: translateY(-4px);
}
.inline-help.is-modal-help:hover .inline-help-bubble {
  transform: translateY(0);
}
.card-meta { color: var(--muted); font-size: 13px; margin: 0; }
.card-desc { margin: 6px 0 0; color: var(--fg); }

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.company-limit-notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #fbbf24;
  border-radius: 14px;
  background: var(--warning-bg);
  color: var(--warning-fg);
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.company-limit-notice-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  opacity: 0.72;
}

.company-limit-notice-close:hover {
  opacity: 1;
}

.btn.btn-guarded[aria-disabled='true'] {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.btn-guarded[aria-disabled='true']:hover {
  filter: none;
  background: var(--surface-hover);
}

.modal::backdrop { background: rgba(0,0,0,0.35); backdrop-filter: blur(2px); }
.modal {
  border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100% - 24px));
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}
.modal-compact {
  width: min(92vw, 460px);
}
.modal-wide {
  width: min(95vw, 1400px);
  max-height: 90vh;
  overflow-y: auto;
}
#billingRequestDialog {
  width: min(92vw, 560px);
}
#supportCenterDialog {
  width: min(96vw, 1360px);
  max-height: 92vh;
}
#supportCenterDialog .support-center-form {
  width: 100%;
  min-height: min(84vh, 860px);
  display: flex;
  flex-direction: column;
}
#supportCenterDialog .support-center-form .fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
}
#remindersDialog {
  width: min(96vw, 1380px);
  max-height: 92vh;
}
#remindersDialog .form {
  display: flex;
  flex-direction: column;
  max-height: calc(92vh - 8px);
}
#remindersDialog .fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
}
#companyDialog {
  width: min(96vw, 1280px);
  max-height: 92vh;
}
#lnaEditorDialog,
#lnaPresetManagerDialog {
  width: min(96vw, 1700px);
  height: min(86vh, 760px);
  max-height: 94.5vh;
}
#lnaRegistryPickerDialog {
  width: min(92vw, 820px);
  max-height: 88vh;
}
#lnaPresetPickerDialog {
  width: min(92vw, 620px);
  max-height: 80vh;
}
#lnaRegistryPickerDialog .fields,
#lnaPresetPickerDialog .fields {
  overflow: auto;
}
#lnaEditorDialog .fields,
#lnaPresetManagerDialog .fields {
  overflow: hidden;
}
#lnaEditorDialog .form,
#lnaPresetManagerDialog .form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: none;
}
#lnaEditorDialog .fields,
#lnaPresetManagerDialog .fields {
  flex: 1;
  min-height: 0;
}
#lnaEditorDialog .fields {
  display: flex;
  flex-direction: column;
}
#companyDialog .form {
  display: grid;
  gap: 0;
  max-height: 92vh;
}
#companyDialog .fields {
  overflow: auto;
  padding-right: 8px;
}
.form { padding: 14px; }
.modal-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.form-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.form-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #e5e7eb);
  justify-content: flex-end;
  flex-shrink: 0;
}
.form-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 6px 6px 10px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  gap: 10px;
}
.form-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.form-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.form-header-actions .dialog-window-minimize-btn {
  margin-left: 0;
}
.form-header h2 { margin: 0; font-size: 18px; }
.dialog-window-minimize-btn {
  margin-left: auto;
  white-space: nowrap;
}
.dialog-window-dock {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  pointer-events: none;
}
.dialog-window-dock[hidden] {
  display: none;
}
.dialog-window-dock-item {
  pointer-events: auto;
  min-width: 220px;
  max-width: min(340px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 4px;
  text-align: left;
}
.dialog-window-dock-title {
  font-weight: 600;
  color: var(--fg);
}
.dialog-window-dock-status {
  font-size: 12px;
  color: var(--fg-secondary);
  display: block;
}
.form-top-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 6px 0;
}
.fields { display: grid; gap: 14px; padding: 14px 6px 6px; }
.field { display: grid; gap: 8px; }
.field .hint { margin-top: -2px; }
#docsForm label.is-disabled {
  opacity: 0.58;
}
.field-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}
.field-checkbox input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
}
.field-checkbox span {
  margin: 0;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  outline: none; background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }
.hint { color: var(--muted); font-size: 12px; }
.error { color: var(--danger-fg); font-size: 12px; min-height: 16px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 6px 6px; }
.company-delete-btn { margin-right: auto; }

.inputs { display: grid; gap: 8px; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.input-row input { width: 100%; }
.remove-input { border: 0; background: var(--surface-hover); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; }
.remove-input:hover { background: var(--line); }

fieldset.field { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }

/* Programs grid */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.program-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.program-option:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.program-short { font-weight: 600; letter-spacing: 0.01em; }
.checkbox-list { display: grid; gap: 6px; max-height: 220px; min-height: 46px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.checkbox-option { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 6px; border-radius: 8px; transition: background .15s ease; }
.checkbox-option:hover { background: rgba(0,0,0,0.04); }
.checkbox-option input[type='checkbox'] { accent-color: var(--accent); }

.topbar-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; min-width: 0; }
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: #fff5d8;
  border-bottom: 1px solid #eed89c;
  color: #5b4200;
}
.demo-banner__content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 0 8px; height: 22px; border-radius: 999px; background: #ff8f62; color: var(--accent-contrast); font-size: 12px; font-weight: 600; margin-left: 8px; }
.badge[hidden] { display: none; }
.btn-attention { background: #ffe7d4; border-color: #f2a35a; color: #7a3f00; box-shadow: 0 0 0 3px rgba(242, 163, 90, 0.25); }
.btn-attention:hover { background: #ffd8b2; }
.reminder-options { display: grid; gap: 10px; }
.reminder-option { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
.reminder-option:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.reminder-option label { display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer; }
.reminder-option input[type='radio'] { accent-color: var(--accent); }
.reminders-fields { padding-top: 8px; }
.reminders-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.reminders-tab.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.reminders-list { display: grid; gap: 12px; max-height: none; overflow: visible; }
.reminders-list[hidden] { display: none !important; }
.reminder-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; background: var(--surface); }
.reminder-item.due { border-color: #dc3c1f; box-shadow: 0 4px 18px rgba(220, 60, 31, 0.18); }
.reminder-item-mintrud { border-color: var(--line); background: var(--surface-alt); }
.reminder-item-mintrud-success {
  border-color: #98d8aa;
  background: linear-gradient(180deg, #f5fff7 0%, var(--success-bg) 100%);
}
.reminder-item-mintrud-muted {
  opacity: 0.85;
}
.reminder-item-header { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.reminder-item-title { margin: 0; font-weight: 600; }
.reminder-item-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.reminder-item-status-pending {
  background: var(--surface-hover);
  color: var(--fg-secondary);
}
.reminder-item-status-warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
}
.reminder-item-status-info {
  background: var(--info-bg);
  color: var(--info-fg);
}
.reminder-item-status-success {
  background: var(--success-bg);
  color: var(--success-fg);
}
.reminder-item-status-muted {
  background: var(--surface-hover);
  color: var(--muted);
}
.reminder-item-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.reminder-item-actions { display: flex; gap: 8px; justify-content: flex-end; }
.reminder-item-actions-wrap { flex-wrap: wrap; justify-content: flex-start; }
.reminder-empty { text-align: center; color: var(--muted); padding: 24px 0; font-size: 14px; }
.reminder-due-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; background: var(--danger-bg); color: var(--danger-fg); font-size: 12px; font-weight: 600; }
.reminder-item-mintrud-note {
  margin: 0;
  font-size: 13px;
  color: var(--fg-secondary);
}
.reminder-item-mintrud-note-success {
  color: var(--success-fg);
  font-weight: 600;
}

.topbar-left { display: flex; align-items: center; gap: 18px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.tabs { display: inline-flex; gap: 8px; padding: 4px; border-radius: 999px; background: var(--surface-hover); min-width: 0; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--fg-secondary); }
.tab:hover { background: rgba(0,0,0,0.06); }
.tab-active { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 4px 14px rgba(0,0,0,0.12); }
.tab-active:hover { background: var(--accent); }
.container { max-width: none; width: 100%; }
section[data-view] { display: none; }
section[data-view].active-view { display: block; }
.employee-subtabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-hover);
  margin-bottom: 12px;
}
.employee-subtab {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg-secondary);
}
.employee-subtab:hover { background: rgba(0,0,0,0.06); }
.companies-toolbar {
  justify-content: flex-end;
}
.employee-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr)) max-content;
  gap: 16px;
  margin-bottom: 20px;
  align-items: end;
}
.control span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.control select { width: 100%; min-height: 46px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.control-buttons { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
#employeesSection .employee-controls .control:not(.control-buttons) {
  order: 2;
}
#employeesSection .control-buttons {
  order: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: stretch;
}
#employeesSection .control-buttons .btn {
  width: 100%;
  min-height: 40px;
}
.employee-table-settings-anchor {
  order: 2;
  grid-column: 6;
  justify-self: end;
  align-self: end;
  position: relative;
  display: flex;
  justify-content: flex-end;
  min-width: max-content;
}
.btn-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: #fff;
}
.btn-settings:hover {
  background: #1d4ed8;
  filter: none;
}
.siz-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.9fr) minmax(240px, 1fr) minmax(260px, 1.2fr) auto;
  gap: 16px;
  margin-bottom: 16px;
  align-items: end;
}
#sizSection .control input,
#sizSection .control select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.siz-provision-search-control input {
  width: 100%;
}
.siz-controls-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.siz-controls-actions .btn {
  min-height: 40px;
}
.siz-provision-add-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 16px;
  margin-bottom: 16px;
  align-items: end;
}
.siz-provision-add-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.siz-provision-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: visible;
}
.siz-provision-table {
  min-width: 0;
  table-layout: fixed;
}
.siz-provision-table th:nth-child(1),
.siz-provision-table td:nth-child(1) {
  width: 27%;
}
.siz-provision-table th:nth-child(2),
.siz-provision-table td:nth-child(2) {
  width: 27%;
}
.siz-provision-table th:nth-child(3),
.siz-provision-table td:nth-child(3) {
  width: 14%;
}
.siz-provision-table th:nth-child(4),
.siz-provision-table td:nth-child(4) {
  width: 8%;
}
.siz-provision-table th:nth-child(5),
.siz-provision-table td:nth-child(5) {
  width: 12%;
}
.siz-provision-table th:nth-child(6),
.siz-provision-table td:nth-child(6) {
  width: 12%;
}
.siz-provision-row {
  cursor: pointer;
}
.siz-provision-row:hover {
  background: rgba(17, 24, 39, 0.03);
}
.siz-provision-table tr.is-active {
  background: rgba(17, 24, 39, 0.04);
}
.siz-provision-editor-row td {
  padding: 0 16px 18px;
  background: rgba(17, 24, 39, 0.04);
  border-top: 0;
}
.siz-provision-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.siz-provision-status.is-ready {
  background: rgba(20, 130, 62, 0.12);
  color: #166534;
}
.siz-provision-status.is-exempt {
  background: rgba(34, 106, 48, 0.12);
  color: #226a30;
}
.siz-provision-status.is-empty {
  background: rgba(113, 113, 122, 0.12);
  color: #52525b;
}
.siz-provision-actions {
  white-space: nowrap;
}
.siz-provision-actions .btn {
  width: 100%;
}
.siz-provision-actions {
  cursor: default;
}
.siz-provision-editor {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  scroll-margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.siz-provision-editor-row .siz-provision-editor {
  margin-top: 0;
  border-radius: 0 0 14px 14px;
  border-top: 0;
}
.siz-provision-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.siz-provision-editor-meta {
  display: grid;
  gap: 6px;
}
.siz-provision-editor-meta h3 {
  margin: 0;
}
.siz-provision-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.siz-card-resolve-btn {
  min-width: 140px;
}
.siz-card-appendix2-block,
.siz-card-appendix2-list-block {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
}
.siz-card-appendix3-block,
.siz-card-appendix3-list-block {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
}
.siz-card-appendix2-head {
  display: grid;
  gap: 4px;
}
.siz-card-appendix2-head h6 {
  margin: 0;
}
.siz-card-appendix2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.siz-card-appendix2-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.siz-card-appendix2-wrap {
  max-height: none;
}
.siz-card-appendix2-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.siz-card-appendix2-table th:nth-child(1),
.siz-card-appendix2-table td:nth-child(1) {
  width: 22%;
}
.siz-card-appendix2-table th:nth-child(2),
.siz-card-appendix2-table td:nth-child(2) {
  width: 18%;
}
.siz-card-appendix2-table th:nth-child(3),
.siz-card-appendix2-table td:nth-child(3) {
  width: 36%;
}
.siz-card-appendix2-table th:nth-child(4),
.siz-card-appendix2-table td:nth-child(4) {
  width: 12%;
}
.siz-card-appendix2-table th:nth-child(5),
.siz-card-appendix2-table td:nth-child(5) {
  width: 12%;
}
.employee-table-wrapper { border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.employee-table-settings-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 40px));
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}
.employee-table-settings-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.employee-table-settings-header span {
  font-size: 12px;
  color: var(--fg-secondary);
}
.employee-table-settings-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}
.employee-table-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
}
.employee-table-settings-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.employee-table-settings-label input {
  margin-top: 2px;
}
.employee-table-settings-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.employee-table-settings-text strong {
  font-size: 13px;
  color: var(--fg);
}
.employee-table-settings-text span {
  font-size: 11px;
  color: var(--fg-secondary);
}
.employee-table-settings-actions {
  display: flex;
  gap: 8px;
}
.employee-table-settings-move {
  min-height: 32px;
  padding: 0 10px;
}
.pagination-bar { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--line); }
.pagination-bar[hidden] { display: none !important; }
.pagination-counter { font-size: 13px; color: var(--text-muted, #777); }
.pagination-load-more { font-size: 13px; padding: 4px 14px; cursor: pointer; }
.employee-table-scroll { overflow: visible; max-height: none; position: relative; }
.employee-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.employee-table th, .employee-table td { padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12px; word-break: break-word; white-space: normal; }
.employee-table thead th {
  border-top: 2px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  border-right: 2px solid var(--line-strong);
}
.employee-table thead th:first-child {
  border-left: 2px solid var(--line-strong);
}
.employee-table tr > *:first-child { border-left: 1px solid var(--line); }
.employee-table tbody tr:hover { background: var(--surface-alt); }
.employee-table th { position: relative; text-align: left; font-weight: 600; color: var(--fg); background: var(--surface-alt); user-select: none; }
.employee-table thead th {
  position: sticky;
  top: var(--employee-table-sticky-top);
  z-index: 20;
  background: var(--surface-alt);
  box-shadow: 0 1px 0 var(--line);
  background-clip: padding-box;
}
.employee-table th.sort-asc::after { content: '\2191'; margin-left: 6px; font-size: 12px; }
.employee-table th.sort-desc::after { content: '\2193'; margin-left: 6px; font-size: 12px; }
.resize-handle { position: absolute; top: 0; right: 0; width: 6px; height: 100%; cursor: col-resize; }
.resize-handle::after { content: ''; position: absolute; top: 0; bottom: 0; right: -1px; width: 2px; background: var(--line-strong); }
.employee-table th:hover .resize-handle::after { background: #9c9c9c; }
.employee-table td.table-actions {
  display: table-cell;
  min-width: 92px;
  padding: 0;
  position: relative;
  vertical-align: middle;
}
.employee-table td[data-edit-key] { cursor: text; }
.employee-table td.row-number-cell {
  text-align: center;
  user-select: none;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  color: var(--fg-secondary);
  padding: 4px 2px;
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
}
.employee-table th:first-child {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.employee-table th.col-group-start,
.employee-table td.col-group-start {
  border-left: 2px solid #ababab !important;
}
.employee-table th.col-group-end,
.employee-table td.col-group-end {
  border-right: 2px solid #ababab !important;
}
.employee-table th.col-boundary-right,
.employee-table td.col-boundary-right {
  border-right: 2px solid #ababab !important;
}
.employee-table tbody tr.row-selected td {
  box-shadow: inset 0 0 0 9999px rgba(17, 17, 17, 0.06);
}
.employee-table td.is-editing-cell { padding: 2px 4px; }
.employee-table td.cell-selected {
  box-shadow: inset 0 0 0 2px rgba(17, 17, 17, 0.16);
}
.employee-table td.cell-active {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.employee-table td.cell-copied {
  box-shadow: inset 0 0 0 2px #2d7a34;
}
.employee-table td.cell-cut {
  box-shadow: inset 0 0 0 2px #1d6fbe;
  outline: 1px dashed #1d6fbe;
  outline-offset: -3px;
}
.cell-inline-input {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  font-family: inherit;
}

.btn-text { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.btn-text:hover { background: rgba(0,0,0,0.05); }
.employee-table td.table-actions .btn-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  background: inherit;
  white-space: nowrap;
}
.employee-table td.table-actions .btn-text:hover,
.employee-table td.table-actions .btn-text:focus-visible {
  background: inherit;
}
.employee-row-action-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  color: var(--fg-secondary);
}
.employee-row-draft td {
  background: rgba(37, 99, 235, 0.05);
}
.employee-draft-cell {
  vertical-align: top;
}
.employee-draft-name-cell {
  display: grid;
  gap: 8px;
}
.employee-draft-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
}
.employee-draft-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}
.employee-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.employee-draft-hint {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--fg-secondary);
  font-size: 12px;
}
.employee-name-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.employee-name-primary {
  min-width: 0;
}
.employee-suspension-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dff3e3;
  color: #246b3a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.employee-suspension-badge-scheduled {
  background: #eef2f5;
  color: #58636e;
}
.employee-sout-cell {
  line-height: 1.35;
  font-size: 12px;
}
.employee-sout-cell span {
  display: block;
}
.employee-sout-cell-warning {
  background: var(--warning-bg);
  color: var(--warning-fg);
}
.employee-row-new td { background: var(--success-bg); }
.employee-row-role-changed td { background: var(--warning-bg); }
.employee-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.employee-context-menu[hidden] {
  display: none !important;
}
.employee-context-menu-btn {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
}
.employee-context-menu-btn:hover,
.employee-context-menu-btn:focus-visible {
  background: var(--surface-alt);
  outline: none;
}
.employee-suspension-toggle {
  margin: 0;
}
.employee-suspension-fields {
  display: grid;
  gap: 10px;
}
.employee-suspension-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.employee-suspension-fields textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}
.cell-exempt {
  background: var(--success-bg) !important;
  color: var(--success-fg);
  font-weight: 600;
  text-align: center;
}
.cell-exempt-history {
  background: var(--success-bg) !important;
  color: var(--success-fg);
  font-weight: 600;
  text-align: center;
}
.cell-exempt-history-empty {
  background: var(--success-bg) !important;
  color: var(--success-fg);
  font-weight: 600;
  text-align: center;
}

.due-warning { background: var(--warning-bg); }
.due-danger { background: var(--danger-bg); color: var(--danger-fg); font-weight: 600; }
.import-summary {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  display: grid;
  gap: 6px;
}
.import-summary[hidden] {
  display: none !important;
}
.import-summary.import-summary-success {
  border-color: #89c997;
  background: var(--success-bg);
  color: var(--success-fg);
}
.import-summary.import-summary-busy {
  border-color: rgba(47, 109, 220, 0.22);
  background: rgba(47, 109, 220, 0.08);
  color: #1f4aa8;
  position: relative;
  padding-left: 42px;
}
.import-summary.import-summary-busy::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.3;
  animation: repeat-workplace-busy-pulse 1s ease-in-out infinite;
}
@keyframes repeat-workplace-busy-pulse {
  0%, 100% { transform: scale(0.82); opacity: 0.28; }
  50% { transform: scale(1); opacity: 0.72; }
}
.hint-success {
  color: var(--success-fg);
  font-weight: 600;
}
.import-summary p { margin: 0; }
.import-errors {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: var(--danger-fg);
  font-size: 13px;
}
.import-errors:empty { display: none; }
.employee-docs-import-warnings {
  color: var(--warning-fg);
}
#employeeDocsImportDialog {
  width: min(98vw, 1660px);
  max-height: 95vh;
}
#employeeDocsImportDialog .form {
  display: grid;
  gap: 0;
  max-height: 95vh;
}
#employeeDocsImportDialog .fields {
  overflow: auto;
  max-height: calc(95vh - 124px);
  padding-right: 8px;
}
.employee-docs-import-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.employee-docs-import-picker-input {
  display: none;
}
.employee-docs-import-types-field {
  margin: 0;
}
.employee-docs-import-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}
.employee-docs-keywords-field {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-alt);
}
.employee-docs-keywords-field > summary {
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.employee-docs-keywords-field > summary::-webkit-details-marker {
  margin-right: 6px;
}
.employee-docs-keywords-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.employee-docs-keyword-item {
  margin: 0;
}
.employee-docs-keyword-item textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
}
.employee-docs-keywords-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.employee-docs-import-preview-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.employee-docs-import-preview-wrap {
  max-height: min(68vh, 840px);
  overflow: auto;
}
#employeeDocsImportResult[hidden] {
  display: none !important;
}
#employeeDocsImportResult:empty {
  display: none !important;
}
.employee-docs-import-preview-table th:nth-child(1),
.employee-docs-import-preview-table td:nth-child(1) {
  width: 18%;
}
.employee-docs-import-preview-table th:nth-child(2),
.employee-docs-import-preview-table td:nth-child(2) {
  width: 17%;
}
.employee-docs-import-preview-table th:nth-child(3),
.employee-docs-import-preview-table td:nth-child(3) {
  width: 14%;
}
.employee-docs-import-preview-table th:nth-child(4),
.employee-docs-import-preview-table td:nth-child(4),
.employee-docs-import-preview-table th:nth-child(5),
.employee-docs-import-preview-table td:nth-child(5) {
  width: 10%;
}
.employee-docs-import-preview-table th:nth-child(6),
.employee-docs-import-preview-table td:nth-child(6) {
  width: 14%;
}
.employee-docs-import-preview-table th:nth-child(7),
.employee-docs-import-preview-table td:nth-child(7) {
  width: 17%;
}
.employee-docs-import-preview-table td:nth-child(7) {
  white-space: normal;
  word-break: break-word;
}
.employee-docs-import-action-update {
  color: var(--success-fg);
  font-weight: 600;
}
.employee-docs-import-action-skip {
  color: var(--warning-fg);
}
.employee-docs-import-is-applying .form-header .icon-btn,
.employee-docs-import-is-applying #employeeDocsImportCancel,
.employee-docs-import-is-applying #employeeDocsImportScanBtn,
.employee-docs-import-is-applying #employeeDocsImportExportBtn,
.employee-docs-import-is-applying #employeeDocsImportApplyBtn {
  pointer-events: none;
}
#employeeImportDialog {
  width: min(97vw, 1600px);
  max-height: 92vh;
}
#employeeImportDialog .form {
  display: grid;
  gap: 0;
  max-height: 92vh;
}
#employeeImportDialog .fields {
  overflow: auto;
  max-height: calc(92vh - 124px);
  padding-right: 8px;
}
#employeeImportDialog .instruction-rules-table-wrap {
  max-height: min(48vh, 560px);
}
#employeeImportDialog .instruction-rules-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
#employeeImportDialog .instruction-rules-table th:nth-child(1),
#employeeImportDialog .instruction-rules-table td:nth-child(1) {
  width: 10%;
}
#employeeImportDialog .instruction-rules-table th:nth-child(2),
#employeeImportDialog .instruction-rules-table td:nth-child(2) {
  width: 16%;
}
#employeeImportDialog .instruction-rules-table th:nth-child(3),
#employeeImportDialog .instruction-rules-table td:nth-child(3) {
  width: 15%;
}
#employeeImportDialog .instruction-rules-table th:nth-child(4),
#employeeImportDialog .instruction-rules-table td:nth-child(4) {
  width: 14%;
}
#employeeImportDialog .instruction-rules-table th:nth-child(5),
#employeeImportDialog .instruction-rules-table td:nth-child(5) {
  width: 12%;
}
#employeeImportDialog .instruction-rules-table th:nth-child(6),
#employeeImportDialog .instruction-rules-table td:nth-child(6) {
  width: 18%;
}
#employeeImportDialog .instruction-rules-table th:nth-child(7),
#employeeImportDialog .instruction-rules-table td:nth-child(7) {
  width: 15%;
}
#employeeImportDialog .instruction-rules-table td:nth-child(6),
#employeeImportDialog .instruction-rules-table td:nth-child(7) {
  white-space: normal;
  word-break: break-word;
}
#employeeExportDialog {
  width: min(98vw, 1360px);
  max-height: 96vh;
}
#employeeExportDialog .form {
  display: grid;
  gap: 0;
  max-height: 96vh;
}
#employeeExportDialog .fields {
  overflow: visible;
  max-height: none;
  padding-right: 0;
}
.employee-export-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  max-height: none;
}
.employee-export-columns .checkbox-option {
  border: 1px solid var(--line);
  background: var(--surface-alt);
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
}
.employee-export-columns .checkbox-option:hover {
  background: var(--surface-hover);
}
.employee-export-columns .checkbox-option input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}
.employee-export-columns .checkbox-option span {
  line-height: 1.3;
}
section[data-view='employees'].active-view .employee-table-wrapper { display: block; }
section[data-view='employees']:not(.active-view) .employee-table-wrapper { display: none; }
section[data-view='employees'].active-view .employee-table th,
section[data-view='employees'].active-view .employee-table td {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
}
@media (max-width: 1320px) {
  .employee-controls {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .employee-table-settings-anchor {
    grid-column: 3;
  }
}

@media (max-width: 900px) {
  .employee-controls { grid-template-columns: 1fr; }
  .documents-controls-actions { grid-template-columns: 1fr; }
  .documents-controls-filters { grid-template-columns: 1fr; }
  .documents-star-filter-btn { justify-self: start; }
  .siz-controls {
    grid-template-columns: 1fr;
  }
  .siz-provision-add-panel {
    grid-template-columns: 1fr;
  }
  .siz-provision-editor-header {
    flex-direction: column;
    align-items: stretch;
  }
  .siz-provision-editor-toolbar {
    justify-content: flex-start;
  }
  .employee-export-columns {
    grid-template-columns: 1fr;
  }
  .employee-suspension-dates {
    grid-template-columns: 1fr;
  }
  .instruction-rules-filters {
    grid-template-columns: 1fr;
  }
  .instruction-rules-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 1180px) {
  .topbar-brand-name {
    display: none;
  }
}

@media (max-width: 1680px) {
  .title {
    display: none;
  }

  .topbar-left {
    gap: 12px;
  }

  .tabs {
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar-actions > .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .auth-status {
    padding-right: 8px;
  }
}

@media (max-width: 980px) {
  .auth-status,
  .auth-status-main,
  .auth-user-label {
    flex-wrap: wrap;
  }
}

#remindersBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#remindersBtn .badge {
  margin-left: 0;
  position: static;
}












.checkbox-empty { color: var(--muted); font-size: 12px; margin: 0; }





.filter-dropdown {
  position: relative;
}
.filter-toggle {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.filter-toggle span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-panel {
  position: absolute;
  z-index: 25;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 8px;
  display: none;
}
.filter-search {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
}
.filter-dropdown.open .filter-panel {
  display: block;
}
.filter-panel .checkbox-option {
  padding: 6px 8px;
}
.filter-panel .checkbox-option:hover {
  background: rgba(0,0,0,0.04);
}
.filter-panel .checkbox-option input[type='checkbox'] {
  margin-right: 8px;
}
.filter-dropdown .filter-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.filter-summary {
  color: var(--muted);
  font-size: 13px;
}

#employeesSection .filter-panel {
  width: clamp(320px, 28vw, 420px);
  max-height: none;
  overflow: hidden;
}

#employeesSection .filter-panel .checkbox-list {
  flex: 1 1 auto;
  max-height: min(38vh, 320px);
  overflow-x: hidden;
}

#employeesSection .filter-panel .checkbox-option {
  align-items: flex-start;
}

#employeesSection .filter-panel .checkbox-option span {
  white-space: normal;
  overflow-wrap: anywhere;
}

#employeesSection .filter-dropdown.open .filter-panel {
  display: flex;
  flex-direction: column;
}

#employeesSection .filter-panel .filter-actions {
  flex: 0 0 auto;
}

#instructionRulesDialog,
#roleRulesWizardDialog {
  width: min(99vw, 1980px);
}
#instructionRulesDialog {
  max-height: 94vh;
}
#instructionRulesDialog .form {
  display: flex;
  flex-direction: column;
  max-height: calc(94vh - 8px);
}
#instructionRulesDialog .fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
  min-height: clamp(420px, 66vh, 780px);
}
#instructionRulesDialog .instruction-rules-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 8px;
}
#roleRulesWizardDialog {
  max-height: 94vh;
}
#roleRulesWizardDialog .form {
  display: flex;
  flex-direction: column;
  max-height: calc(94vh - 8px);
}
#roleRulesWizardDialog .fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
  min-height: clamp(420px, 66vh, 780px);
}
#roleRulesWizardDialog .instruction-rules-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 8px;
}
#instructionRulesDialog .instruction-rules-table {
  min-width: 100%;
}
#instructionRulesDialog .instruction-rules-table td {
  padding: 8px 8px;
}
#instructionRulesDialog .instruction-rules-table td input[type='checkbox'] {
  width: 20px;
  height: 20px;
  transform: none;
  cursor: pointer;
}
#roleRulesWizardDialog .instruction-rules-table {
  min-width: 100%;
}
#instructionRulesDialog .instruction-rules-table th,
#roleRulesWizardDialog .instruction-rules-table th {
  padding: 8px 8px;
  white-space: normal;
  line-height: 1.25;
}
#instructionRulesDialog .instruction-rules-table th:nth-child(1),
#instructionRulesDialog .instruction-rules-table td:nth-child(1),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(1),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(1) {
  width: 128px;
}
#instructionRulesDialog .instruction-rules-table th:nth-child(2),
#instructionRulesDialog .instruction-rules-table td:nth-child(2),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(2),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(2) {
  width: 168px;
}
#instructionRulesDialog .instruction-rules-table th:nth-child(3),
#instructionRulesDialog .instruction-rules-table td:nth-child(3),
#instructionRulesDialog .instruction-rules-table th:nth-child(4),
#instructionRulesDialog .instruction-rules-table td:nth-child(4),
#instructionRulesDialog .instruction-rules-table th:nth-child(5),
#instructionRulesDialog .instruction-rules-table td:nth-child(5),
#instructionRulesDialog .instruction-rules-table th:nth-child(6),
#instructionRulesDialog .instruction-rules-table td:nth-child(6),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(3),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(3),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(4),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(4),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(5),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(5),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(6),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(6) {
  width: 72px;
  text-align: center;
}
#instructionRulesDialog .instruction-rules-table th:nth-child(7),
#instructionRulesDialog .instruction-rules-table td:nth-child(7),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(7),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(7) {
  width: 118px;
}
#instructionRulesDialog .instruction-rules-table th:nth-child(8),
#instructionRulesDialog .instruction-rules-table td:nth-child(8),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(8),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(8) {
  width: 126px;
}
#instructionRulesDialog .instruction-rules-table th:nth-child(9),
#instructionRulesDialog .instruction-rules-table td:nth-child(9),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(9),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(9) {
  width: 260px;
}
#instructionRulesDialog .instruction-rules-table th:nth-child(10),
#instructionRulesDialog .instruction-rules-table td:nth-child(10),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(10),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(10) {
  width: 360px;
}
#instructionRulesDialog .instruction-rules-table th:nth-child(11),
#instructionRulesDialog .instruction-rules-table td:nth-child(11),
#roleRulesWizardDialog .instruction-rules-table th:nth-child(11),
#roleRulesWizardDialog .instruction-rules-table td:nth-child(11) {
  width: 188px;
}
#roleRulesWizardDialog .instruction-rules-table td {
  padding: 8px 8px;
  vertical-align: top;
}
#roleRulesWizardDialog .instruction-rules-table td input[type='checkbox'] {
  width: 20px;
  height: 20px;
  transform: none;
  cursor: pointer;
}
#roleRulesWizardDialog .instruction-rules-program-option {
  padding: 8px 6px;
}
#repeatWorkplaceDialog {
  width: min(98vw, 1680px);
  max-height: 92vh;
}
#repeatWorkplaceDialog .form {
  display: flex;
  flex-direction: column;
  max-height: calc(92vh - 8px);
}
#repeatWorkplaceDialog .fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
  padding-bottom: 16px;
}
#repeatWorkplaceDialog .instruction-rules-table-wrap {
  max-height: clamp(140px, 24vh, 300px);
}
#repeatWorkplaceDialog .instruction-rules-table {
  min-width: 980px;
}
#repeatWorkplaceDialog .repeat-protocol-programs-inline .instruction-rules-table-wrap {
  max-height: none;
  overflow: visible;
}
#repeatWorkplaceDialog .repeat-protocol-programs-inline .instruction-rules-program-cell {
  min-width: 320px;
}
#repeatWorkplaceDialog .repeat-protocol-programs-inline .instruction-rules-program-menu {
  max-height: none;
  overflow: visible;
}
#repeatWorkplaceDialog .import-errors {
  max-height: 16vh;
  overflow: auto;
}
#repeatAttendanceReviewDialog {
  width: min(99vw, 1880px);
  max-height: 94vh;
}
#repeatAttendanceReviewDialog .form {
  display: flex;
  flex-direction: column;
  max-height: calc(94vh - 8px);
}
#repeatAttendanceReviewDialog .fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
}
#repeatAttendanceReviewDialog .instruction-rules-table-wrap {
  max-height: 58vh;
}
#repeatAttendanceReviewDialog .instruction-rules-table {
  min-width: 1720px;
}
#internshipPackDialog {
  width: min(99vw, 1880px);
  max-height: 92vh;
}
#internshipPackDialog .form {
  display: flex;
  flex-direction: column;
  max-height: calc(92vh - 8px);
}
#internshipPackDialog .fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
}
#mintrudSubmitDialog {
  width: min(98vw, 1700px);
  max-height: 92vh;
}
#mintrudSubmitDialog .form {
  display: flex;
  flex-direction: column;
  max-height: calc(92vh - 8px);
}
#mintrudSubmitDialog .fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
}
.mintrud-submit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  align-items: end;
}
.mintrud-submit-table-wrap {
  max-height: clamp(180px, 46vh, 600px);
}
.mintrud-submit-table {
  min-width: 1320px;
}
.mintrud-submit-table td {
  vertical-align: top;
}
.mintrud-submit-table td input[type="text"],
.mintrud-submit-table td select {
  width: 100%;
  min-width: 140px;
}
.mintrud-submit-table td select {
  max-width: 360px;
}
.mintrud-submit-table td input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.mintrud-submit-wait-field {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--surface-hover) 100%);
}
.mintrud-submit-inline-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: var(--surface);
  cursor: default;
}
.mintrud-submit-inline-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: 0 0 auto;
}
.mintrud-submit-inline-check span {
  line-height: 1.45;
}
.mintrud-submit-fields .import-summary {
  margin-top: 8px;
}
.mintrud-submit-fields .import-errors {
  margin-top: 8px;
}

#employeeMintrudProtocolsDialog {
  width: min(98vw, 1700px);
  max-height: 95vh;
}
#employeeMintrudProtocolsDialog .form {
  display: flex;
  flex-direction: column;
  max-height: calc(95vh - 8px);
}
#employeeMintrudProtocolsDialog .fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
}
.employee-mintrud-import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: end;
}
.employee-mintrud-import-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.employee-mintrud-import-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}
.employee-mintrud-import-compare-meta {
  display: grid;
  gap: 4px;
}
.employee-mintrud-import-compare-meta strong {
  font-size: 13px;
}
.employee-mintrud-import-compare-meta .hint {
  margin: 0;
  max-width: 680px;
}
.employee-mintrud-import-compare-check {
  margin-top: 0;
  min-height: 42px;
}
.employee-mintrud-import-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.employee-mintrud-import-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.employee-mintrud-import-block-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--fg);
  font: inherit;
  font-weight: 600;
}
.employee-mintrud-import-block-toggle:hover,
.employee-mintrud-import-block-toggle:focus-visible {
  color: var(--accent);
  outline: none;
}
.employee-mintrud-import-block-toggle-chevron {
  display: inline-flex;
  transition: transform 0.18s ease;
}
.employee-mintrud-import-block-toggle.is-collapsed .employee-mintrud-import-block-toggle-chevron {
  transform: rotate(-90deg);
}
.employee-mintrud-import-block-head h4 {
  margin: 0;
}
.employee-mintrud-import-review-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.employee-mintrud-import-review-head h4 {
  margin: 0;
}
.employee-mintrud-import-review-head .hint {
  margin: 0;
}
.employee-mintrud-import-card-list {
  display: grid;
  gap: 10px;
}
.employee-mintrud-import-empty {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}
.employee-mintrud-import-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(248, 249, 250, 0.88);
}
.employee-mintrud-import-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.employee-mintrud-import-card-title {
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}
.employee-mintrud-import-card-meta {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}
.employee-mintrud-import-card-meta-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.employee-mintrud-import-reason-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.employee-mintrud-import-excluded-list,
.employee-mintrud-import-review-row-list {
  display: grid;
  gap: 8px;
}
.employee-mintrud-import-excluded-item,
.employee-mintrud-import-review-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.employee-mintrud-import-excluded-item strong {
  display: block;
  margin-bottom: 2px;
}
.employee-mintrud-import-review-row-top {
  display: grid;
  gap: 4px;
}
.employee-mintrud-import-review-row-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(120px, 150px) minmax(220px, 1fr) minmax(180px, 0.9fr) minmax(92px, auto);
  gap: 10px;
  align-items: end;
}
.employee-mintrud-import-review-row-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.employee-mintrud-import-review-row-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.employee-mintrud-import-review-row-field input,
.employee-mintrud-import-review-row-field select {
  width: 100%;
  min-width: 0;
}
.employee-mintrud-import-review-row-field-program-compact {
  max-width: none;
}
.employee-mintrud-import-review-row-field-snils {
  min-width: 150px;
}
.employee-mintrud-import-review-row-chip-wrap {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
}
.employee-mintrud-import-review-row-status {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}
.employee-mintrud-import-review-row-status-error {
  border-color: #d66d66;
  background: #fff5f4;
  color: var(--danger-fg);
}
.employee-mintrud-import-review-row-status-ready {
  border-color: #8dc99c;
  background: var(--success-bg);
  color: var(--success-fg);
}
.employee-mintrud-import-review-row-main {
  font-weight: 600;
  line-height: 1.3;
  font-size: 16px;
}
.employee-mintrud-import-review-row-sub {
  color: var(--muted);
  font-size: 12px;
}
.employee-mintrud-import-review-row-missing-snils {
  border-color: #d66d66;
  box-shadow: inset 3px 0 0 #d66d66;
}
.employee-mintrud-import-review-input-missing {
  border-color: #d66d66 !important;
  background: var(--danger-bg);
  color: var(--danger-fg);
}
.employee-mintrud-import-program-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--fg-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.employee-mintrud-import-review-row-delete-btn {
  min-height: 40px;
  width: 100%;
}
.employee-mintrud-import-snils-tools {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed #9fb3d9;
  border-radius: 10px;
  background: var(--surface-alt);
}
.employee-mintrud-import-snils-tools-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.employee-mintrud-import-disabled-field {
  opacity: 0.65;
}
@media (max-width: 1200px) {
  .employee-mintrud-import-compare-row,
  .employee-mintrud-import-card-head {
    grid-auto-flow: row;
    flex-direction: column;
  }
  .employee-mintrud-import-review-row-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.internship-pack-top-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 10px;
  align-items: end;
}
.internship-pack-types {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 42px;
}
.internship-pack-types > span {
  color: var(--muted);
  font-size: 12px;
}
.internship-pack-types > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.internship-pack-sheet-only-option {
  margin-left: auto;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  font-weight: 600;
}
.internship-pack-protocol-hint {
  margin-top: 6px;
}
.internship-pack-global-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}
.internship-pack-toolbar {
  display: flex;
  justify-content: flex-end;
}
.internship-pack-table-wrap {
  max-height: clamp(180px, 42vh, 560px);
}
.internship-pack-table {
  min-width: 1750px;
}
.internship-pack-table td {
  vertical-align: top;
}
.internship-pack-table td pre.internship-pack-timeline {
  margin: 0;
  white-space: pre-line;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  min-width: 180px;
}
.internship-pack-programs {
  min-width: 180px;
}
.internship-pack-programs > summary {
  cursor: pointer;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  list-style: none;
}
.internship-pack-programs[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.internship-pack-programs-menu {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow: auto;
  padding: 6px 8px;
  background: var(--surface);
  display: grid;
  gap: 4px;
}
.internship-pack-program-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.internship-pack-manual-dates {
  display: grid;
  gap: 6px;
  min-width: 240px;
}
.internship-pack-manual-dates input {
  min-width: 210px;
}

#sizCardDialog {
  width: min(98vw, 1720px);
  max-height: 95vh;
}
#sizCardDialog .form {
  width: 100%;
  display: grid;
  gap: 0;
  max-height: 95vh;
}
#sizCardDialog .fields {
  max-height: calc(95vh - 124px);
  overflow: auto;
  padding-right: 8px;
}
.siz-card-fields {
  display: grid;
  gap: 12px;
}
.siz-card-provision-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.siz-card-provision-target {
  display: grid;
  gap: 6px;
}
.siz-card-provision-exempt {
  margin-left: auto;
  white-space: nowrap;
}
.siz-card-employees-wrap {
  max-height: 28vh;
}
.siz-card-cards-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.siz-card-cards-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.siz-card-cards-head h4 {
  margin: 0;
}
.siz-card-role-cards {
  display: grid;
  gap: 14px;
}
.siz-card-override-block {
  display: grid;
  gap: 10px;
}
.siz-card-override-block > h4 {
  margin: 0;
}
.siz-card-role-card {
  border: 2px solid #5a626f;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(20, 24, 30, 0.1);
}
.siz-card-section {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #cfd7e3;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}
.siz-card-role-card .documents-order-template-controls {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
}
.siz-card-main-block .documents-order-template-controls {
  margin: 0;
}
.siz-card-role-card-head h5 {
  margin: 0;
}
.siz-card-role-card-head {
  border-bottom: 1px solid var(--line);
  background: var(--surface-hover);
}
.siz-card-role-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.siz-card-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.siz-card-card-meta,
.siz-card-card-warning {
  margin: 0;
}
.siz-card-main-block .siz-card-card-meta,
.siz-card-main-block .siz-card-card-warning {
  padding-inline: 2px;
}
.siz-card-card-warning {
  color: var(--warning-fg);
}
.siz-card-alt-block {
  border: 2px solid #b8c7d9;
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}
.siz-card-alt-block h6 {
  margin: 0;
  font-size: 13px;
}
.siz-card-alt-group {
  display: grid;
  gap: 6px;
}
.siz-card-alt-title {
  font-size: 12px;
  color: var(--muted);
}
.siz-card-multiselect {
  position: relative;
  width: 100%;
  min-width: 0;
}
.siz-card-multiselect-field {
  min-width: 0;
  position: relative;
  overflow: visible;
}
.siz-card-multiselect-field-title {
  display: block;
}
.siz-card-multiselect[open] {
  z-index: 80;
}
.siz-card-multiselect > summary {
  list-style: none;
  cursor: pointer;
  width: 100%;
  min-height: 38px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.siz-card-multiselect[open] > summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.siz-card-multiselect > summary::-webkit-details-marker {
  display: none;
}
.siz-card-multiselect > summary::after {
  content: '▾';
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.siz-card-multiselect[open] > summary::after {
  transform: translateY(-50%) rotate(180deg);
}
.siz-card-multiselect.is-disabled > summary {
  color: var(--muted);
  background: var(--bg-soft);
  cursor: not-allowed;
  pointer-events: none;
}
.siz-card-multiselect.is-disabled > summary::after {
  opacity: 0.5;
}
.siz-card-multiselect-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 60;
  max-height: var(--siz-card-menu-max-height, 260px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  display: grid;
  gap: 4px;
}
.siz-card-multiselect-menu .checkbox-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
  row-gap: 0;
  padding: 8px 10px;
  border-radius: 10px;
}
.siz-card-multiselect-menu .checkbox-option input[type='checkbox'] {
  margin: 0;
  align-self: start;
  transform: translateY(2px);
}
.siz-card-multiselect-menu .checkbox-option span {
  display: block;
  min-width: 0;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}
.siz-card-multiselect.dropup {
  display: flex;
  flex-direction: column-reverse;
}
.siz-card-multiselect.dropup .siz-card-multiselect-menu {
  top: auto;
  bottom: calc(100% + 6px);
}
.siz-card-issue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.siz-card-issue-block {
  gap: 12px;
}
.siz-card-issue-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.siz-card-issue-bulk-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.siz-card-issue-bulk-date input {
  width: 140px;
}
.siz-card-issue-head h6 {
  margin: 0;
  font-size: 13px;
}
.siz-card-issue-wrap {
  max-height: 28vh;
  border: 2px solid #c5d2e1;
  border-radius: 10px;
  background: var(--surface);
}
.siz-card-issue-table {
  min-width: 760px;
}
.siz-card-issue-table th:nth-child(1),
.siz-card-issue-table td:nth-child(1) {
  width: 48%;
}
.siz-card-issue-table th:nth-child(2),
.siz-card-issue-table td:nth-child(2) {
  width: 18%;
}
.siz-card-issue-table th:nth-child(3),
.siz-card-issue-table td:nth-child(3) {
  width: 20%;
}
.siz-card-issue-table th:nth-child(4),
.siz-card-issue-table td:nth-child(4) {
  width: 14%;
}
.repeat-doc-types-field {
  margin: 0;
}
.repeat-doc-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.repeat-due-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}
.repeat-due-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.repeat-due-filter-option input[type='checkbox'] {
  margin: 0;
  accent-color: var(--accent);
}
.repeat-due-filter-option span {
  line-height: 1.2;
}
.repeat-due-filter-option.is-disabled {
  cursor: not-allowed;
  background: var(--surface-alt);
  color: var(--muted);
}
.repeat-attendance-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 320px) minmax(260px, 360px);
  align-items: end;
}
.repeat-attendance-protocol-mode {
  margin: 0;
}
.repeat-attendance-protocol-mode-hint {
  margin: 8px 0 0;
  max-width: 760px;
  line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.repeat-attendance-folder {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.repeat-attendance-folder .hint {
  margin: 0;
}
.repeat-workplace-instructor-block {
  display: grid;
  gap: 8px;
}
.repeat-intro-block {
  display: grid;
  gap: 10px;
}
.repeat-intro-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.repeat-intro-toggle:hover,
.repeat-intro-toggle:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.repeat-intro-toggle-chevron {
  transition: transform .16s ease;
}
.repeat-intro-toggle.is-collapsed .repeat-intro-toggle-chevron {
  transform: rotate(-90deg);
}
.repeat-intro-content {
  display: grid;
  gap: 10px;
}
.repeat-intro-content.is-collapsed {
  display: none;
}
.repeat-intro-date-cell {
  display: grid;
  gap: 6px;
}
.repeat-intro-instructor-cell select,
.repeat-intro-date-cell input {
  width: 100%;
}
.repeat-intro-date-input-missing {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}
#repeatWorkplaceDialog .repeat-intro-block .instruction-rules-table-wrap {
  max-height: none;
  overflow: visible;
}
#repeatWorkplaceDialog .repeat-workplace-instructor-block .instruction-rules-table-wrap {
  max-height: none;
  overflow: visible;
}

@media (max-width: 980px) {
  #repeatWorkplaceDialog .fields {
    padding-right: 6px;
  }
  #repeatAttendanceReviewDialog .fields {
    padding-right: 6px;
  }
  #internshipPackDialog .fields {
    padding-right: 6px;
  }
  #sizCardDialog .fields {
    max-height: calc(95vh - 104px);
    padding-right: 6px;
  }
  .siz-card-provision-header {
    display: grid;
    grid-template-columns: 1fr;
  }
  .siz-card-provision-exempt {
    margin-left: 0;
    white-space: normal;
  }
  .siz-card-issue-head-actions {
    width: 100%;
    justify-content: stretch;
  }
  .siz-card-issue-bulk-date {
    flex: 1 1 100%;
  }
  .siz-card-issue-bulk-date input {
    width: 100%;
  }
  .internship-pack-top-grid {
    grid-template-columns: 1fr;
  }
  .repeat-doc-types {
    grid-template-columns: 1fr;
  }
  .repeat-due-filters {
    grid-template-columns: 1fr;
  }
  .repeat-attendance-controls {
    grid-template-columns: 1fr;
  }
}
.repeat-doc-type-option {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.repeat-doc-type-option input[type='checkbox'] {
  margin: 0;
  accent-color: var(--accent);
}
.repeat-doc-type-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-alt);
}
.repeat-doc-type-option.is-disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--surface-alt);
}
.repeat-doc-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.repeat-protocol-commission {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
}
.repeat-protocol-commission-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.repeat-protocol-commission-grid select {
  width: 100%;
}
.repeat-protocol-programs-cell {
  min-width: 280px;
}
.repeat-protocol-programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 10px;
}
.repeat-protocol-program-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.repeat-protocol-programs-inline {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
}
.repeat-protocol-programs-inline .instruction-rules-table-wrap {
  max-height: 30vh;
}
.repeat-attendance-review-table-wrap {
  border-radius: 12px;
}
.repeat-attendance-review-table td {
  vertical-align: top;
}
.repeat-electro-review-table th,
.repeat-electro-review-table td {
  white-space: normal;
}
.repeat-electro-review-table td:nth-child(2),
.repeat-electro-review-table td:nth-child(3),
.repeat-electro-review-table td:nth-child(7) {
  min-width: 120px;
}
.repeat-electro-review-table td:nth-child(4) {
  min-width: 150px;
}
.repeat-electro-review-table td:nth-child(5) {
  min-width: 220px;
}
.repeat-electro-review-date {
  display: block;
  font-weight: 600;
}
.repeat-electro-review-subtitle {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.repeat-attendance-review-table th:last-child,
.repeat-attendance-review-table td:last-child {
  min-width: 150px;
}
.repeat-attendance-employee {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.repeat-attendance-employee-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.repeat-attendance-employee-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.repeat-attendance-employee-badge-maternity {
  background: rgba(180, 83, 9, 0.14);
  color: #b45309;
}
.repeat-attendance-employee span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.repeat-attendance-inline-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.repeat-attendance-inline-field span {
  font-size: 11px;
  color: var(--muted);
}
.repeat-attendance-inline-field input,
.repeat-attendance-inline-field select {
  width: 100%;
}
.repeat-attendance-date-cell {
  min-width: 156px;
}
.repeat-attendance-date-input {
  width: 100%;
  min-height: 38px;
}
.repeat-attendance-commission-editors {
  display: grid;
  gap: 8px;
  min-width: 280px;
}
.repeat-attendance-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.repeat-attendance-status-ready {
  background: rgba(20, 130, 62, 0.12);
  color: #166534;
}
.repeat-attendance-status-bypass {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
}
.repeat-attendance-status-problem {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}
.repeat-attendance-status-skip {
  background: rgba(113, 113, 122, 0.12);
  color: #52525b;
}
.repeat-attendance-issue {
  color: #991b1b;
  line-height: 1.45;
}
.repeat-attendance-issue-ready {
  color: #166534;
  font-weight: 600;
}
.repeat-attendance-issue-bypass {
  color: #b45309;
}
.repeat-attendance-issue-skip {
  color: #52525b;
}
.repeat-attendance-review-row-problem {
  background: rgba(185, 28, 28, 0.04);
}
.repeat-attendance-review-row-skip {
  opacity: 0.7;
}
.repeat-attendance-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.repeat-attendance-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
}
.repeat-attendance-suggested-dates {
  min-width: 170px;
}
.repeat-attendance-suggested-dates select {
  width: 100%;
}
.repeat-attendance-skip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.repeat-attendance-remove-btn {
  width: 100%;
}
.instruction-rules-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.instruction-rules-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  flex: 1 1 620px;
}
.instruction-rules-filter {
  margin: 0;
}
.instruction-rules-filter span {
  font-size: 12px;
  color: var(--muted);
}
.instruction-rules-filter select,
.instruction-rules-filter input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.instruction-rules-search {
  min-width: 220px;
}
.instruction-rules-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.instruction-rules-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 420px;
  overflow: auto;
  background: var(--surface);
}
.instruction-rules-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
.instruction-rules-table th,
.instruction-rules-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: middle;
  font-size: 13px;
}
.instruction-rules-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
  text-align: left;
}
.instruction-rules-table td input[type='text'],
.instruction-rules-table td select {
  width: 100%;
  min-width: 120px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}
.instruction-rules-table td input[type='checkbox'] {
  transform: scale(1.1);
}
.instruction-rules-program-cell {
  min-width: 0;
  width: 260px;
  max-width: 260px;
  cursor: default;
  position: relative;
}

@media (max-width: 900px) {
  .employee-table-settings-anchor {
    grid-column: auto;
    justify-self: stretch;
    min-width: 0;
  }
  .employee-table-settings-anchor .btn-settings {
    width: 100%;
  }
}
.instruction-rules-program-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
}
.instruction-rules-program-toggle {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  position: relative;
  line-height: 1.25;
}
.instruction-rules-program-toggle span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}
.instruction-rules-program-toggle::after {
  content: '▾';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.instruction-rules-program-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  bottom: auto;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: var(--instruction-rules-program-menu-max-height, 180px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  padding: 6px;
}
.instruction-rules-program-cell.open .instruction-rules-program-menu {
  display: block;
}
.instruction-rules-program-cell.dropup .instruction-rules-program-menu {
  top: auto;
  bottom: calc(100% + 4px);
}
.instruction-rules-program-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  min-width: 0;
}
.instruction-rules-program-option span {
  white-space: normal;
  overflow-wrap: anywhere;
}
.instruction-rules-program-option:hover {
  background: rgba(0,0,0,0.04);
}
.instruction-rules-program-option input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  align-self: start;
  transform: none;
}
.instruction-rules-program-cell-active .instruction-rules-program-toggle {
  border-color: var(--accent);
}
.instruction-rules-program-cell-selected .instruction-rules-program-toggle {
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.14);
}
.instruction-rules-program-cell .instruction-rules-program-menu input[type='checkbox'] {
  margin: 0;
}
.instruction-rules-program-cell .instruction-rules-program-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.2);
}
.instruction-rules-program-cell .instruction-rules-program-menu::-webkit-scrollbar {
  width: 8px;
}
.instruction-rules-program-cell .instruction-rules-program-menu::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 999px;
}
.instruction-rules-program-cell .instruction-rules-program-menu::-webkit-scrollbar-track {
  background: #f5f5f5;
}
.instruction-rules-program-cell .instruction-rules-program-toggle,
.instruction-rules-program-cell .instruction-rules-program-menu {
  font-family: inherit;
}
.instruction-rules-program-cell .instruction-rules-program-menu label {
  cursor: pointer;
}
.instruction-rules-program-cell .instruction-rules-program-menu label span {
  min-width: 0;
  line-height: 1.25;
}
.instruction-rules-program-cell .instruction-rules-program-toggle span {
  width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.instruction-rules-program-cell-selected {
  box-shadow: inset 0 0 0 2px rgba(17, 17, 17, 0.14);
}
.instruction-rules-program-cell-active {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.instruction-rules-local-acts-cell {
  min-width: 210px;
}
.instruction-rules-local-acts-btn {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.instruction-rules-local-acts-btn.is-exempt-empty {
  border-color: #8ccf93;
  background: #eef8ef;
  color: #226a30;
}
.instruction-rules-local-acts-btn.is-exempt-empty:hover {
  border-color: #77be7f;
  background: #e4f4e6;
}
.instruction-rules-local-acts-btn.is-exempt-empty .instruction-rules-local-acts-count {
  display: none;
}
.instruction-rules-local-acts-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-alt);
}
.instruction-rules-local-acts-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.2);
}
.instruction-rules-local-acts-btn [data-local-acts-summary] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.instruction-rules-local-acts-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--fg-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.instruction-rules-role-cell {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.instruction-rules-sout-cell {
  min-width: 470px;
}
.instruction-rules-sout-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: start;
}
.lna-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.lna-editor-registry,
.lna-editor-manual {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.lna-editor-manual {
  margin: 0;
  gap: 8px;
}
.lna-editor-preset-strip {
  display: grid;
  gap: 6px;
}
.lna-editor-preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}
.lna-editor-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
}
.lna-editor-preset-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-alt);
}
.lna-editor-preset-btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--fg-secondary);
  font-size: 11px;
  font-weight: 600;
}
.lna-editor-preset-empty {
  margin: 0;
}
.lna-editor-manual textarea,
.lna-preset-manager-main textarea {
  flex: 1;
  min-height: 0;
  height: 100%;
}
.lna-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.lna-picker-list-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-top: 0;
  height: 100%;
  overflow: hidden;
}
.lna-picker-list {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 0;
  height: 100%;
  max-height: none;
  min-height: min(58vh, 560px);
  padding-bottom: 12px;
  scroll-padding-bottom: 12px;
  overflow-y: auto;
}
.lna-picker-list .checkbox-option {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
}
.lna-preset-manager-fields {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.lna-preset-manager-sidebar,
.lna-preset-manager-registry,
.lna-preset-manager-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lna-preset-manager-list {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px;
  height: 100%;
}
.instruction-rules-sout-flags {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(116px, 0.85fr) minmax(160px, 1.2fr);
  gap: 5px;
  width: 100%;
  align-items: center;
}
.instruction-rules-sout-fields {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(116px, 0.85fr) minmax(160px, 1.2fr);
  gap: 5px;
  width: 100%;
  align-items: start;
}
.instruction-rules-sout-fields select,
.instruction-rules-sout-fields input[type='text'] {
  min-width: 0;
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
}
.instruction-rules-sout-fields .instruction-rules-med-multiselect {
  min-width: 0;
}
.instruction-rules-sout-spacer {
  display: block;
  min-height: 1px;
}
.instruction-rules-sout-toggle {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 5px;
  font-size: 11px;
  line-height: 1.25;
  min-width: 0;
  align-items: center;
  white-space: nowrap;
}
.instruction-rules-sout-toggle input[type='checkbox'] {
  margin: 0;
}
.instruction-rules-sout-hint {
  grid-column: 1 / -1;
  margin: 0;
}
.instruction-rules-sout-hint-warning {
  color: var(--warning-fg);
}
.instruction-rules-sout-editor-unknown {
  opacity: 0.92;
}
/* Med exam 29n multiselect */
.instruction-rules-med-multiselect {
  position: relative;
  width: 100%;
}
.instruction-rules-med-multiselect[open] {
  z-index: 20;
}
.instruction-rules-sout-cell:has(.instruction-rules-med-multiselect[open]) {
  position: relative;
  z-index: 10;
}
.instruction-rules-med-multiselect > summary {
  display: block;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  list-style: none;
}
.instruction-rules-med-multiselect > summary::-webkit-details-marker { display: none; }
.instruction-rules-med-multiselect > summary::after {
  content: '▾';
  float: right;
  margin-left: 4px;
  color: var(--muted);
}
.instruction-rules-med-multiselect-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 2px);
  left: 0;
  width: max(100%, 360px);
  max-height: 360px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 6px;
}
.instruction-rules-med-search {
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 4px;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--fg);
}
.instruction-rules-med-items {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.instruction-rules-med-multiselect-menu .checkbox-option {
  padding: 4px 6px;
  font-size: 12px;
}
.instruction-rules-med-multiselect-menu .checkbox-option:hover {
  background: rgba(0,0,0,0.04);
}
.instruction-rules-med-multiselect-menu .custom-entry span {
  font-style: italic;
  color: var(--muted);
}
[data-theme="dark"] .instruction-rules-med-multiselect-menu .checkbox-option:hover {
  background: rgba(255,255,255,0.06);
}
.instruction-rules-remove-btn {
  min-width: 32px;
  padding: 4px 8px;
  font-size: 20px;
  line-height: 1;
  color: var(--danger-fg);
}
.instruction-rules-remove-btn:hover {
  background: rgba(141, 42, 28, 0.08);
}
.instruction-rules-empty {
  color: var(--muted);
  text-align: center;
}

.documents-controls {
  display: grid;
  gap: 16px;
  margin-bottom: 12px;
}
.documents-controls-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.documents-controls-actions .btn {
  width: 100%;
  min-height: 40px;
}
.documents-controls-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.2fr) auto;
  gap: 16px;
  align-items: end;
}
.documents-search-control input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.documents-selection-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.documents-categories {
  display: grid;
  gap: 14px;
}
.documents-category {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: visible;
}
.documents-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  position: sticky;
  top: calc(var(--app-topbar-height) - 1px);
  z-index: 12;
  box-shadow: 0 1px 0 var(--line);
}
.documents-category-header::before {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  top: -10px;
  height: 10px;
  background: var(--surface-alt);
  pointer-events: none;
}
.documents-category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.documents-category-title {
  font-size: 15px;
  font-weight: 600;
}
.documents-category-chevron {
  font-size: 14px;
  line-height: 1;
  transition: transform 0.18s ease;
}
.documents-category.is-collapsed .documents-category-chevron {
  transform: rotate(-90deg);
}
.documents-category-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.documents-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  transition: opacity 0.18s ease;
}
.documents-category.is-collapsed .documents-table {
  opacity: 0;
}
.documents-table th,
.documents-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 13px;
  vertical-align: top;
  word-break: break-word;
}
.documents-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.documents-table th:first-child,
.documents-checkbox-cell {
  width: 40px;
  padding-left: 6px;
  padding-right: 6px;
}
.documents-table th:nth-child(2),
.documents-template-name-cell {
  padding-left: 4px;
}
.documents-table th {
  text-align: left;
  background: var(--surface-alt);
}
.documents-table tr:last-child td {
  border-bottom: 0;
}
.documents-row-disabled {
  opacity: 0.62;
}
.documents-template-main {
  display: block;
}
.documents-template-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}
.documents-template-title-text {
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}
.documents-template-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2454a6;
  border: 1px solid #c8d7f2;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
}
.documents-template-action-btn {
  padding: 0;
  min-height: auto;
  white-space: nowrap;
}
.documents-user-divider-row td {
  background: #f5f7fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.documents-instruction-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #d6dce7;
  border-radius: 999px;
  background: #fff;
  color: #c2a300;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  flex: 0 0 auto;
  margin-left: auto;
}
.documents-instruction-star[data-star-state="off"] {
  color: #c3cad4;
}
.documents-instruction-star[data-star-state="exclude"] {
  color: #8e98a8;
  border-color: #c5cedc;
  background: #f5f7fa;
}
.documents-instruction-star[data-star-state="include"],
.documents-instruction-star[data-star-state="auto"] {
  border-color: #d7bf5c;
  background: #fff8d8;
}
.documents-star-filter-btn.is-active {
  border-color: #d7bf5c;
  background: #fff4c1;
  color: #6a5600;
}
.documents-star-filter-btn {
  min-height: 46px;
  width: 46px;
  padding: 0;
  justify-self: start;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.documents-status {
  font-weight: 600;
}
.documents-status-generated {
  color: var(--success-fg);
}
.documents-status-error {
  color: var(--danger-fg);
}
.documents-note-warning {
  color: var(--warning-fg);
}
.documents-note-error {
  color: var(--danger-fg);
}
.documents-note-cell {
  padding-right: 10px;
}
.documents-note-rail {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.documents-note-text {
  min-width: 0;
  flex: 1 1 auto;
}
.documents-template-actions-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.documents-cell-editable {
  cursor: pointer;
}
.documents-cell-editable:hover {
  background: var(--hover-bg, rgba(0,0,0,0.04));
}
.documents-cell-input {
  width: 100%;
  min-width: 60px;
  padding: 2px 4px;
  border: 1px solid var(--border, #ccc);
  border-radius: 3px;
  font: inherit;
  box-sizing: border-box;
}

#documentsGenerateDialog {
  width: min(96vw, 1280px);
  max-height: 92vh;
}
#documentsGenerateDialog .form {
  display: grid;
  gap: 0;
  max-height: 92vh;
}
#documentsGenerateDialog .fields {
  overflow: auto;
  padding-right: 8px;
}
.documents-generate-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.documents-common-date-apply {
  align-self: end;
}
.documents-generate-table input {
  width: 100%;
  min-width: 140px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.documents-orders-block {
  border: 2px solid #6d7786;
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-alt);
  display: grid;
  gap: 12px;
}

.documents-orders-block[hidden] {
  display: none !important;
}
#documentsOrdersTemplates,
#documentsCustomTemplates {
  display: grid;
  gap: 10px;
}
.documents-orders-directory {
  border: 2px solid #0f172a;
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.documents-orders-directory .hint {
  margin: 0;
}
.documents-orders-directory-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.documents-orders-directory-head h4 {
  margin: 0;
  font-size: 14px;
}
.company-letterhead-field .hint {
  margin: 2px 0 0;
}
.company-letterhead-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.documents-orders-directory-table input {
  width: 100%;
  min-width: 180px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.documents-orders-directory-table .instruction-rules-table-wrap {
  max-height: none;
  overflow: visible;
}
.documents-responsible-main-row > td {
  background: var(--surface-alt);
  border-top: 2px solid #7f8ea3;
  border-bottom: 1px solid #9eb0c7;
}
.documents-responsible-training-row > td {
  background: var(--surface);
  border-left: 4px solid #6f86a6;
  border-right: 1px solid #b8c7da;
  border-bottom: 2px solid #b8c7da;
}
#companyDialog .company-responsible-directory .instruction-rules-table-wrap,
#documentsGenerateDialog .documents-orders-directory .instruction-rules-table-wrap {
  max-height: none;
  overflow: visible;
}
#documentsGenerateDialog .documents-order-assignments .instruction-rules-table-wrap {
  max-height: none;
  overflow: visible;
}
.documents-order-assignments .documents-order-multiselect[open] {
  z-index: 20;
}
.documents-training-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.documents-training-block .hint {
  margin: 0;
}
.documents-training-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.documents-training-row > td {
  background: var(--surface-alt);
}
.documents-training-toggle {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px 8px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
  white-space: normal;
  text-align: left;
}
.documents-training-count {
  color: var(--muted);
  white-space: nowrap;
}
.documents-training-table {
  min-width: 0;
  width: 100%;
}
.documents-training-table td input[type="date"],
.documents-training-table td input[type="text"],
.documents-training-table td select {
  min-width: 100px;
}
.documents-training-due {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.documents-training-table tr.documents-training-row-overdue td {
  background: var(--danger-bg);
}
.documents-training-table tr.documents-training-row-soon td {
  background: var(--warning-bg);
}
.documents-training-table td select.documents-training-program-overdue {
  border-color: #d94b3d !important;
  background: var(--danger-bg) !important;
  box-shadow: inset 0 0 0 1px rgba(217, 75, 61, 0.25);
}
.documents-training-table td select.documents-training-program-soon {
  border-color: #cc8a00 !important;
  background: var(--warning-bg) !important;
  box-shadow: inset 0 0 0 1px rgba(204, 138, 0, 0.2);
}
.documents-training-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 84px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.documents-training-status-ok {
  background: var(--success-bg);
  color: var(--success-fg);
}
.documents-training-status-soon {
  background: var(--warning-bg);
  color: var(--warning-fg);
}
.documents-training-status-overdue {
  background: var(--danger-bg);
  color: var(--danger-fg);
}
.documents-training-status-unknown {
  background: var(--surface-hover);
  color: var(--fg-secondary);
}
.company-responsible-directory {
  margin-top: 6px;
}
.documents-order-template {
  border: 2px solid #7b8798;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 10px;
  background: var(--surface);
}
.documents-order-template-header h4 {
  margin: 0;
  font-size: 14px;
}
.documents-order-template-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: end;
  min-width: 0;
}
.documents-letterhead-toggle {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.documents-letterhead-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.documents-letterhead-toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d7dbe2;
  border: 1px solid #c0c7d2;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}
.documents-letterhead-toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transform: translateX(0);
  transition: transform 0.16s ease;
}
.documents-letterhead-toggle-label {
  font-weight: 600;
}
.documents-letterhead-toggle input:checked + .documents-letterhead-toggle-track {
  background: #1f6feb;
  border-color: #1f6feb;
}
.documents-letterhead-toggle input:checked + .documents-letterhead-toggle-track .documents-letterhead-toggle-knob {
  transform: translateX(20px);
}
.documents-letterhead-toggle:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.25);
  border-color: #1f6feb;
}
.documents-letterhead-toggle:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}
.documents-letterhead-status-field .hint {
  margin: 4px 0 0;
}
.documents-letterhead-upload {
  border: 1px dashed #98a9bc;
  border-radius: 10px;
  background: var(--surface-alt);
  padding: 10px;
  display: grid;
  gap: 8px;
}
.documents-order-template-controls .checkbox-option {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface);
}
.documents-order-subdivisions .checkbox-list {
  max-height: 180px;
}
.documents-order-assignments {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.documents-order-commission {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.documents-order-template .field,
.documents-order-assignments td,
.documents-order-commission td {
  min-width: 0;
}
.documents-order-template select,
.documents-order-template input[type="text"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.documents-order-template select[multiple] {
  min-height: 96px;
  white-space: normal;
  text-overflow: clip;
}
.documents-order-multiselect {
  position: relative;
}
.documents-order-multiselect > summary {
  list-style: none;
  cursor: pointer;
  width: 100%;
  min-height: 34px;
  padding: 7px 28px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}
.documents-order-multiselect > summary::-webkit-details-marker {
  display: none;
}
.documents-order-multiselect > summary::after {
  content: '▾';
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.documents-order-multiselect-menu {
  position: static;
  margin-top: 6px;
  width: 100%;
  z-index: 60;
  max-height: var(--documents-order-menu-max-height, 220px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  display: grid;
  gap: 4px;
}
.documents-order-multiselect.dropup {
  display: flex;
  flex-direction: column-reverse;
}
.documents-order-multiselect.dropup .documents-order-multiselect-menu {
  margin-top: 0;
  margin-bottom: 6px;
}
.documents-order-multiselect-menu .checkbox-option {
  padding: 4px 2px;
}
.documents-order33-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.documents-order33-table th:nth-child(1),
.documents-order33-table td:nth-child(1) {
  width: 22%;
}
.documents-order33-table th:nth-child(2),
.documents-order33-table td:nth-child(2) {
  width: 22%;
}
.documents-order33-table th:nth-child(3),
.documents-order33-table td:nth-child(3) {
  width: 46%;
}
.documents-order33-table th:nth-child(4),
.documents-order33-table td:nth-child(4) {
  width: 10%;
}
.documents-order33-table .documents-order-multiselect {
  min-width: 0;
}
.documents-order33-table .documents-order-multiselect > summary {
  display: block;
  min-width: 0;
  max-width: 100%;
}
.role-rules-wizard-program-cell {
  min-width: 0;
  width: 260px;
  max-width: 260px;
}
.role-rules-wizard-program-cell .instruction-rules-program-toggle {
  min-height: 52px;
  white-space: normal;
  text-overflow: clip;
  overflow: hidden;
  line-height: 1.25;
  padding-right: 30px;
}
.role-rules-wizard-program-cell .instruction-rules-program-toggle span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-rules-wizard-program-cell .instruction-rules-program-option {
  align-items: start;
}
.role-rules-wizard-program-cell .instruction-rules-program-option span {
  white-space: normal;
  overflow-wrap: anywhere;
}
#employeeSoutImportDialog {
  width: min(96vw, 1240px);
  max-height: 94vh;
}
#employeeSoutImportDialog .fields {
  overflow: auto;
  max-height: calc(94vh - 128px);
  padding-right: 8px;
}
.repeat-instruction-kind-block {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.employee-sout-import-preview-wrap {
  max-height: min(48vh, 560px);
}
.employee-sout-import-preview-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.employee-sout-import-preview-table th,
.employee-sout-import-preview-table td {
  vertical-align: top;
}
.employee-sout-import-preview-table th:nth-child(1),
.employee-sout-import-preview-table td:nth-child(1) {
  width: 14%;
}
.employee-sout-import-preview-table th:nth-child(2),
.employee-sout-import-preview-table td:nth-child(2) {
  width: 14%;
}
.employee-sout-import-preview-table th:nth-child(3),
.employee-sout-import-preview-table td:nth-child(3) {
  width: 8%;
}
.employee-sout-import-preview-table th:nth-child(4),
.employee-sout-import-preview-table td:nth-child(4) {
  width: 6%;
}
.employee-sout-import-preview-table th:nth-child(5),
.employee-sout-import-preview-table td:nth-child(5) {
  width: 14%;
}
.employee-sout-import-preview-table th:nth-child(6),
.employee-sout-import-preview-table td:nth-child(6) {
  width: 8%;
}
.employee-sout-import-preview-table th:nth-child(7),
.employee-sout-import-preview-table td:nth-child(7) {
  width: 13%;
}
.employee-sout-import-preview-table th:nth-child(8),
.employee-sout-import-preview-table td:nth-child(8) {
  width: 23%;
}
.employee-sout-import-preview-table td:nth-child(5),
.employee-sout-import-preview-table td:nth-child(8) {
  white-space: normal;
  word-break: break-word;
}
.employee-sout-import-preview-table td:nth-child(7) {
  padding-top: 10px;
}
.employee-sout-preview-action-apply {
  color: var(--success-fg);
  font-weight: 600;
}
.employee-sout-preview-action-select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 6px 28px 6px 10px;
  line-height: 1.2;
}
.employee-sout-preview-action-skip {
  color: var(--muted);
}
.employee-sout-preview-action-conflict {
  color: var(--danger-fg);
  font-weight: 600;
}
.documents-custom-template + .documents-custom-template {
  margin-top: 10px;
}
.documents-order-assignments-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.documents-order-assignments-head p {
  margin: 0;
}
.documents-order7-list {
  display: grid;
  gap: 10px;
}
.documents-order7-card {
  border: 2px solid #4b5563;
  border-radius: 10px;
  background: var(--surface-alt);
  padding: 10px;
  display: grid;
  gap: 10px;
}
.documents-order7-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.documents-order7-card-head h5 {
  margin: 0;
}
.documents-order7-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.documents-order7-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.documents-order7-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 2px;
  margin-top: 2px;
  background: linear-gradient(to top, var(--surface-alt) 65%, transparent);
}
.documents-order7-block {
  display: grid;
  gap: 10px;
}
.documents-order7-add-bar {
  display: grid;
  grid-template-columns: minmax(360px, 620px) auto;
  gap: 10px;
  align-items: end;
  justify-content: end;
}
.documents-order7-add-bar select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 40px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
}
.documents-order7-add-bar .btn {
  min-height: 42px;
  white-space: nowrap;
}
.documents-order7-table .documents-order7-summary-row {
  cursor: pointer;
}
.documents-order7-table .documents-order7-summary-row.is-open {
  background: #f8fafc;
}
.documents-order7-table .documents-order7-summary-row td {
  vertical-align: middle;
}
.documents-order7-table .documents-order7-summary-row input {
  width: 100%;
}
.documents-order7-row-actions {
  white-space: nowrap;
  text-align: right;
}
.documents-order7-inline-row > td {
  padding: 0;
  background: #f8fafc;
}
.documents-order7-inline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 0;
}
.documents-order7-inline-head strong {
  margin: 0;
}
.documents-order7-inline-row .siz-card-alt-block {
  display: none;
}
.documents-order7-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.documents-order7-status-configured {
  background: #e8f7ec;
  color: #166534;
}
.documents-order7-status-exempt {
  background: #ecfdf3;
  color: #15803d;
}
.documents-order7-status-empty {
  background: #f3f4f6;
  color: #475569;
}
.documents-generate-warnings {
  border: 1px solid #e0a000;
  background: var(--warning-bg);
  color: var(--warning-fg);
}

@media (max-width: 980px) {
  .documents-order7-add-bar {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .documents-order7-add-bar .btn {
    width: 100%;
  }
  .documents-selection-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  .documents-category-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Toast notifications ────────────────────────────────────── */
.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 10001;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 420px; pointer-events: none;
  margin: 0; padding: 0; border: 0; background: transparent;
}
.toast-container:popover-open {
  position: fixed;
  inset: auto 16px auto auto;
  top: 16px;
  right: 16px;
  left: auto;
  bottom: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 10px;
  font-size: 14px; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  pointer-events: auto; position: relative; overflow: hidden;
  animation: toast-in .3s ease;
}
.toast--exit { animation: toast-out .3s ease forwards; }
.toast--error   { background: #fef2f2; border: 1px solid #f87171; color: #991b1b; }
.toast--success { background: #f0fdf4; border: 1px solid #4ade80; color: #166534; }
.toast--warning { background: #fffbeb; border: 1px solid #fbbf24; color: #92400e; }
.toast--info    { background: #eff6ff; border: 1px solid #60a5fa; color: #1e40af; }
.toast__icon { flex-shrink: 0; font-size: 16px; line-height: 1.45; }
.toast__body { flex: 1; min-width: 0; }
.toast__message { display: block; word-break: break-word; }
.toast__details { margin-top: 6px; font-size: 13px; }
.toast__details summary { cursor: pointer; opacity: .8; }
.toast__details-list { margin: 4px 0 0; padding-left: 18px; }
.toast__details-list li { margin-bottom: 2px; }
.toast__close {
  flex-shrink: 0; border: 0; background: transparent; cursor: pointer;
  font-size: 18px; line-height: 1; opacity: .5; padding: 0 2px;
  color: inherit;
}
.toast__close:hover { opacity: 1; }
.toast__progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: currentColor; opacity: .25; width: 100%;
  animation: toast-progress linear forwards;
}
@keyframes toast-in   { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }
@keyframes toast-progress { from { width: 100%; } to { width: 0%; } }

/* ── Confirm dialog ─────────────────────────────────────────── */
.modal-confirm { max-width: 420px; }
.confirm-dialog-message { margin: 0; font-size: 15px; line-height: 1.5; color: var(--fg); }
.btn-danger {
  background: #dc2626; color: #fff; border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* ── Dark theme overrides ─────────────────────────────────── */
[data-theme="dark"] .toast--error   { background: var(--danger-bg); border-color: #f87171; color: var(--danger-fg); }
[data-theme="dark"] .toast--success { background: var(--success-bg); border-color: #4ade80; color: var(--success-fg); }
[data-theme="dark"] .toast--warning { background: var(--warning-bg); border-color: #fbbf24; color: var(--warning-fg); }
[data-theme="dark"] .toast--info    { background: var(--info-bg); border-color: #60a5fa; color: var(--info-fg); }

/* Modals / dialogs */
[data-theme="dark"] .modal,
[data-theme="dark"] dialog {
  background: var(--surface);
  color: var(--fg);
}
[data-theme="dark"] .modal::backdrop,
[data-theme="dark"] dialog::backdrop {
  background: var(--backdrop);
}
[data-theme="dark"] .form-header {
  border-bottom-color: var(--line);
}

/* Selects, inputs inside dialogs & filters */
[data-theme="dark"] select,
[data-theme="dark"] input,
[data-theme="dark"] textarea {
  color: var(--fg);
  background: var(--surface-alt);
  border-color: var(--line);
}
[data-theme="dark"] select option {
  background: var(--surface);
  color: var(--fg);
}

/* Filter search */
[data-theme="dark"] .filter-search {
  background: var(--surface-alt);
  color: var(--fg);
}

/* Hover states — use white alpha instead of black alpha */
[data-theme="dark"] .checkbox-option:hover,
[data-theme="dark"] .filter-panel .checkbox-option:hover,
[data-theme="dark"] .employee-subtab:hover {
  background: rgba(255,255,255,0.06);
}

/* Fieldsets & legends */
[data-theme="dark"] fieldset {
  border-color: var(--line);
}
[data-theme="dark"] legend {
  color: var(--fg-secondary);
}

/* Program options in generation dialog */
[data-theme="dark"] .program-option {
  background: var(--surface-alt);
  border-color: var(--line);
}
[data-theme="dark"] .program-option:hover {
  border-color: var(--line-strong);
}

/* Badge for attention button */
[data-theme="dark"] .btn-attention {
  background: #3d2a10;
  border-color: #b8862d;
  color: #fcd34d;
  box-shadow: 0 0 0 3px rgba(184, 134, 45, 0.25);
}

/* Error list in dialogs */
[data-theme="dark"] .error {
  color: var(--danger-fg);
}

/* Dialog minimize dock items */
[data-theme="dark"] .dialog-window-dock-item {
  background: var(--surface);
  border-color: var(--line);
  color: var(--fg);
}

/* ── Theme toggle button ────────────────────────────────────── */
.theme-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 6px; border-radius: 8px; color: var(--fg);
}
.theme-toggle-btn svg { display: block; }

/* ── Inline validation ──────────────────────────────────────── */
.cell-inline-input.input-invalid,
.field-invalid input,
.field-invalid select {
  border-color: var(--danger-fg) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12) !important;
}
.field-invalid-hint {
  color: var(--danger-fg); font-size: 12px; margin-top: 2px;
}

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard-loading {
  text-align: center; padding: 40px 0; color: var(--muted); font-size: 15px;
}
.dashboard-empty {
  text-align: center; padding: 40px 0; color: var(--muted);
}
.dashboard-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.dashboard-stat-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; background: var(--surface); text-align: center;
  box-shadow: var(--shadow);
}
.dashboard-stat-value { font-size: 32px; font-weight: 600; line-height: 1.2; }
.dashboard-stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.dashboard-stat-card.stat-danger { border-color: var(--danger-fg); }
.dashboard-stat-card.stat-danger .dashboard-stat-value { color: var(--danger-fg); }
.dashboard-stat-card.stat-warning { border-color: var(--warning-fg); }
.dashboard-stat-card.stat-warning .dashboard-stat-value { color: var(--warning-fg); }

.dashboard-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.dashboard-company-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; background: var(--surface); box-shadow: var(--shadow);
  display: grid; gap: 8px;
  transition: transform .12s ease, box-shadow .18s ease;
}
.dashboard-company-card:hover {
  transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.08);
}
.dashboard-company-header {
  display: flex; align-items: center; gap: 8px;
}
.dashboard-company-name { font-size: 15px; }
.dashboard-company-meta { font-size: 13px; color: var(--muted); }
.dashboard-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 12px; font-size: 12px; font-weight: 600; line-height: 1;
}
.dashboard-badge-danger { background: var(--danger-bg); color: var(--danger-fg); }
.dashboard-badge-warning { background: var(--warning-bg); color: var(--warning-fg); }
.dashboard-deadlines {
  list-style: none; padding: 0; margin: 4px 0 0;
  font-size: 13px; line-height: 1.6;
}
.dashboard-deadlines li { padding: 2px 0; }
.deadline-overdue { color: var(--danger-fg); font-weight: 600; }
.deadline-soon { color: var(--warning-fg); }

#documentsUploadDialog {
  width: min(96vw, 1240px);
  max-height: 92vh;
}
#documentsUploadDialog .form {
  display: grid;
  gap: 0;
  max-height: 92vh;
}
#documentsUploadDialog .fields {
  overflow: auto;
  padding-right: 8px;
}
.documents-upload-fields {
  display: grid;
  gap: 12px;
}
.documents-upload-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(520px, 1.5fr);
  gap: 14px;
  align-items: start;
}
.documents-upload-workspace {
  display: grid;
  gap: 12px;
}
.documents-upload-table-wrap {
  max-height: calc(92vh - 240px);
}
.documents-upload-instructions p {
  margin: 0 0 8px;
}

.documents-upload-table td {
  vertical-align: top;
}

.documents-upload-file {
  font-weight: 600;
}

.documents-upload-category-select {
  min-width: 170px;
}

.documents-upload-cell-placeholders {
  min-width: 240px;
  max-width: 360px;
  white-space: normal;
  line-height: 1.4;
  word-break: break-word;
}

.documents-upload-placeholders-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.documents-upload-placeholder-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f4f8;
  border: 1px solid #d8e0ea;
  font-size: 12px;
}

.documents-upload-status {
  white-space: normal;
  line-height: 1.4;
}

.documents-upload-status-ready {
  color: #1f7a43;
  font-weight: 600;
}

.documents-upload-status-error {
  color: #a23b32;
  font-weight: 600;
}
.documents-upload-status-warning {
  color: #8a5a00;
  font-weight: 600;
}
.documents-upload-diagnostics {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.documents-upload-diagnostic {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}
.documents-upload-diagnostic-warning {
  border-color: #d1b35d;
  background: #fff9e7;
  color: #7b5a00;
}
.documents-upload-diagnostic-error {
  border-color: #dc8b8b;
  background: #fff4f3;
  color: #9c362f;
}
.documents-upload-diagnostic-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 1100px) {
  .documents-upload-layout {
    grid-template-columns: 1fr;
  }
}

/* ─── Prescriptions Tab ─────────────────────────────────────────────── */

.prescriptions-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.prescriptions-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.prescriptions-toolbar .control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
}

.prescriptions-toolbar .control label {
  font-size: 0.85em;
  color: var(--fg-muted, #666);
  font-weight: 500;
}

.prescriptions-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Pretty inputs/selects inside prescriptions section */
#prescriptionsSection .control-select,
#prescriptionsSection .control-input,
#prescriptionsSection .prescription-deadline-input {
  padding: 9px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  font-size: 0.93em;
  background: var(--surface, #fff);
  color: var(--fg, #222);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
#prescriptionsSection .control-select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
#prescriptionsSection .control-select:focus,
#prescriptionsSection .control-input:focus,
#prescriptionsSection .prescription-deadline-input:focus {
  border-color: var(--accent, #333);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.07);
}
#prescriptionsSection .control-input::placeholder {
  color: var(--fg-muted, #aaa);
}
#prescriptionsSection .prescription-comment-control {
  min-width: 200px;
  flex: 1;
  max-width: 400px;
}

.prescriptions-columns {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.prescriptions-columns-label {
  font-size: 0.9em;
  font-weight: 600;
}

.prescriptions-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
  cursor: pointer;
}

.prescriptions-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
}

.prescriptions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.prescriptions-table th,
.prescriptions-table td {
  padding: 10px 12px;
  border: 1px solid var(--border, #e0e0e0);
  text-align: left;
  vertical-align: top;
}

.prescriptions-table th {
  background: var(--surface-hover, #f5f5f5);
  font-weight: 600;
  white-space: nowrap;
}

.prescriptions-col-num {
  width: 40px;
  text-align: center;
}

.prescriptions-col-photo {
  width: 320px;
  min-width: 260px;
}

.prescriptions-col-violation {
  min-width: 250px;
}

.prescriptions-col-deadline {
  width: 160px;
}

.prescriptions-col-actions {
  width: 40px;
  text-align: center;
}

.prescription-remove-row-btn {
  font-size: 1.3em;
  line-height: 1;
  color: var(--danger, #c00);
  padding: 2px 6px;
}

/* Column hiding via CSS */
.prescriptions-table.hide-photo .prescriptions-col-photo { display: none; }
.prescriptions-table.hide-violation .prescriptions-col-violation { display: none; }
.prescriptions-table.hide-deadline .prescriptions-col-deadline { display: none; }

/* ── Prescriptions Workspace (two-column layout) ── */

.prescriptions-workspace {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.prescriptions-main {
  flex: 1;
  min-width: 0;
}

.prescription-photo-pool-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--app-topbar-height, 60px) + 12px);
  max-height: calc(100vh - var(--app-topbar-height, 60px) - 24px);
  overflow-y: auto;
}

/* ── Photo Pool (bulk upload area) ── */

.prescription-photo-pool {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface, #fff);
}

.prescription-photo-pool-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.prescription-photo-pool-title {
  font-weight: 600;
  font-size: 0.93em;
  flex: 1;
}

.prescription-photo-pool-dropzone {
  border: 2px dashed var(--border, #ccc);
  border-radius: 8px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.prescription-photo-pool-dropzone-text {
  color: var(--fg-muted, #999);
  font-size: 0.85em;
}

.prescription-photo-pool-dropzone:hover,
.prescription-photo-pool-dropzone.dragover {
  border-color: var(--accent, #111);
  background: var(--surface-hover, #f5f5f5);
}

.prescription-photo-pool-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.photo-pool-item {
  position: relative;
  width: 260px;
  height: 195px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border, #ddd);
  cursor: grab;
  transition: box-shadow 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.photo-pool-item:hover {
  border-color: var(--accent, #333);
  box-shadow: 0 2px 10px rgba(0,0,0,0.13);
}

.photo-pool-item.dragging {
  opacity: 0.45;
  border-color: var(--accent, #111);
}

.photo-pool-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-pool-item-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-pool-item-del:hover { background: rgba(200,0,0,0.8); }

/* ── Photo cell in table ── */

.prescription-photo-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prescription-photo-thumb {
  position: relative;
  display: inline-block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e0e0e0);
}

.prescription-photo-thumb img {
  display: block;
  width: 100%;
  max-width: 300px;
  max-height: 220px;
  object-fit: contain;
  border-radius: 7px;
  background: var(--surface-hover, #f8f8f8);
}

.prescription-photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prescription-photo-del:hover { background: rgba(200,0,0,0.8); }

.prescription-photo-dropzone {
  border: 2px dashed var(--border, #ccc);
  border-radius: 8px;
  padding: 16px 10px;
  text-align: center;
  color: var(--fg-muted, #999);
  font-size: 0.85em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.prescription-photo-dropzone:hover,
.prescription-photo-dropzone.dragover {
  border-color: var(--accent, #111);
  background: var(--accent-faint, rgba(0,0,0,0.04));
  color: var(--fg, #333);
}

/* Violation (NPA) cell */
.prescription-violation-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prescription-npa-display {
  font-size: 0.9em;
  line-height: 1.4;
}

.prescription-npa-fulltext {
  color: var(--fg-muted, #666);
  font-size: 0.85em;
  margin-top: 4px;
  line-height: 1.3;
}

/* Multiple NPA entries */
.prescription-npa-point-line {
  font-size: 0.9em;
  line-height: 1.4;
  color: var(--fg, #222);
  word-break: break-word;
}
.prescription-npa-doc-name {
  font-size: 0.8em;
  color: var(--fg-muted, #777);
  margin-top: 2px;
  line-height: 1.3;
  word-break: break-word;
  font-style: italic;
}
.prescription-npa-group-name {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--fg, #333);
  margin-bottom: 4px;
  line-height: 1.3;
  word-break: break-word;
}
.prescription-npa-entry {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--surface-hover, #fafafa);
  padding: 3px 0;
  font-size: 0.85em;
  line-height: 1.35;
}
.prescription-npa-entry + .prescription-npa-entry {
  margin-top: 4px;
}
.prescription-npa-entry-text {
  flex: 1;
  word-break: break-word;
}
.prescription-npa-editable {
  outline: none;
  border-radius: 3px;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background 0.15s;
  cursor: text;
}
.prescription-npa-editable:hover {
  background: var(--surface-hover, #f0f0f0);
}
.prescription-npa-editable:focus {
  background: var(--surface-hover, #e8e8e8);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}
.prescription-npa-entry-del {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--danger, #c00);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.prescription-npa-entry-del:hover {
  opacity: 1;
  background: rgba(200, 0, 0, 0.1);
}
.prescription-npa-add-btn {
  font-size: 0.85em !important;
  margin-top: 4px;
  padding: 5px 10px !important;
  border: 1px dashed var(--border, #ccc) !important;
  border-radius: 6px !important;
  color: var(--fg-muted, #666) !important;
  transition: border-color 0.2s, color 0.2s !important;
}
.prescription-npa-add-btn:hover {
  border-color: var(--accent, #333) !important;
  color: var(--fg, #222) !important;
}

.prescription-npa-btns-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.prescription-npa-templates-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.prescription-npa-template-btn {
  font-size: 0.8em !important;
  padding: 3px 10px !important;
  border-radius: 12px !important;
  background: var(--accent, #333) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer;
  transition: opacity 0.15s;
}
.prescription-npa-template-btn:hover {
  opacity: 0.8;
}

/* ── NPA Templates Dialog ── */

#npaTemplatesDialog {
  width: min(96vw, 1300px);
}

.npa-templates-content {
  padding: 16px 20px 20px;
}

.npa-templates-empty {
  text-align: center;
  color: var(--fg-muted, #999);
  padding: 24px 0;
  font-size: 0.9em;
}

.npa-template-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  margin-bottom: 8px;
}

.npa-template-item-info {
  flex: 1;
  min-width: 0;
}

.npa-template-item-name {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 4px;
}

.npa-template-item-detail {
  font-size: 0.85em;
  color: var(--fg-muted, #666);
  word-break: break-word;
}

.npa-template-item-npa {
  font-size: 0.8em;
  color: var(--fg-muted, #888);
  font-style: italic;
  margin-top: 2px;
}

.npa-template-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.npa-template-editor {
  padding: 8px 0;
}

.npa-template-editor-back {
  margin-bottom: 12px;
}

.npa-template-editor .field {
  margin-bottom: 12px;
}

.npa-template-editor .field label {
  display: block;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--fg-muted, #666);
  margin-bottom: 4px;
}

.npa-template-editor-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.npa-template-editor-side {
  width: 500px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.npa-template-editor-textarea {
  width: 100%;
  min-height: 50vh;
  height: 100%;
  resize: vertical;
  box-sizing: border-box;
  font-size: 1em;
  line-height: 1.6;
}

.npa-template-editor-npaname-textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  box-sizing: border-box;
  font-size: 0.93em;
  line-height: 1.4;
}

.npa-template-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Deadline input */
.prescription-deadline-input {
  width: 100%;
  max-width: 160px;
}

/* Footer */
.prescriptions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.prescriptions-footer-actions {
  display: flex;
  gap: 8px;
}

/* ─── NPA Search Dialog ─────────────────────────────────────────────── */

#npaSearchDialog {
  max-width: 1200px;
  width: 92vw;
  max-height: 85vh;
}

.npa-search-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 70vh;
  padding: 0 20px 20px;
}

.npa-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.npa-search-bar input {
  flex: 1;
}

.npa-search-level {
  overflow-y: auto;
  max-height: 60vh;
}

.npa-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.npa-search-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #eee);
  cursor: pointer;
  font-size: 0.9em;
  line-height: 1.45;
  transition: background 0.15s;
}
.npa-search-item:hover {
  background: var(--surface-hover, #f5f5f5);
}

.npa-clause-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.npa-clause-num {
  font-weight: 600;
  white-space: nowrap;
  min-width: 60px;
  color: var(--accent, #111);
}

.npa-clause-text {
  font-size: 0.85em;
  color: var(--fg-muted, #555);
  line-height: 1.35;
}

.npa-search-loading,
.npa-search-empty,
.npa-search-error {
  padding: 16px 12px;
  text-align: center;
  color: var(--fg-muted, #999);
  font-size: 0.9em;
}

.npa-search-error {
  color: var(--danger, #c00);
}

.npa-search-back {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.npa-search-selected-name {
  font-size: 0.88em;
  color: var(--fg-muted, #555);
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  background: var(--surface-hover, #f5f5f5);
  border-radius: 6px;
}

#npaSearchManual {
  padding-bottom: 20px;
}

#npaSearchManual .field {
  margin-bottom: 16px;
}

#npaSearchManual .field label {
  display: block;
  font-size: 0.85em;
  margin-bottom: 6px;
  color: var(--fg-muted, #666);
  font-weight: 500;
}

/* NPA dialog inputs styling */
#npaSearchDialog .control-input {
  padding: 10px 14px;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  font-size: 0.95em;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: var(--surface, #fff);
  color: var(--fg, #222);
}
#npaSearchDialog .control-input:focus {
  border-color: var(--accent, #333);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}
#npaSearchDialog .control-input::placeholder {
  color: var(--fg-muted, #aaa);
}
#npaSearchDialog #npaClauseSearchInput {
  margin-top: 8px;
  margin-bottom: 8px;
}

/* ─── Photo Lightbox ────────────────────────────────────────────────── */

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}
.photo-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
  transform-origin: center center;
  transition: transform 0.15s ease-out;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-lightbox-img--dragging {
  transition: none;
}
.photo-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.photo-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.photo-pool-item img,
.prescription-photo-thumb img {
  cursor: pointer;
}

/* ─── Prescriptions responsive ──────────────────────────────────────── */

@media (max-width: 768px) {
  .prescriptions-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .prescriptions-toolbar-actions {
    margin-left: 0;
  }
  .prescriptions-col-photo { min-width: 120px; }
}

/* ─── Risk Cards Tab ───────────────────────────────────────────────── */

.risk-cards-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.risk-cards-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.risk-cards-toolbar .control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 220px;
  min-width: 220px;
}
.risk-cards-toolbar .control:first-child {
  flex: 1 1 320px;
  min-width: 320px;
}
.risk-cards-toolbar .control:nth-child(2) {
  flex: 1 1 280px;
  min-width: 280px;
}
.risk-cards-toolbar .control:nth-child(3) {
  flex: 2 1 420px;
  min-width: 420px;
}

.risk-cards-toolbar .control label {
  font-size: 0.85em;
  color: var(--fg-muted, #666);
  font-weight: 500;
}

.risk-cards-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

#riskCardsSection .control-select,
#riskCardsSection .control-input {
  padding: 9px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  font-size: 0.93em;
  background: var(--surface, #fff);
  color: var(--fg, #222);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
#riskCardsSection .control-select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
#riskCardsSection .control-select:focus,
#riskCardsSection .control-input:focus {
  border-color: var(--primary, #4f8cff);
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.15);
}

.risk-cards-brief-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}

.risk-cards-brief-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.9em;
}

.risk-cards-brief-table th,
.risk-cards-brief-table td {
  border: 1px solid var(--border, #ddd);
  padding: 4px 5px;
  text-align: left;
  white-space: nowrap;
}

.risk-cards-brief-table th {
  background: var(--surface-raised, #f5f5f5);
  font-weight: 600;
  font-size: 0.85em;
  position: sticky;
  top: 0;
  z-index: 1;
  vertical-align: middle;
  position: sticky;
}


.risk-cards-brief-table .rc-th-check,
.risk-cards-brief-table .rc-select-cell {
  text-align: center;
  padding: 3px;
  width: 32px;
}

.risk-cards-brief-table .rc-th-check input[type="checkbox"],
.risk-cards-brief-table .rc-select-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.risk-cards-brief-table .rc-work-check-cell {
  text-align: center;
  padding: 2px 0;
}

.risk-cards-brief-table .rc-work-check-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.risk-cards-brief-table .rc-th-no,
.risk-cards-brief-table .rc-input-no {
  width: 44px;
  min-width: 44px;
}

.risk-cards-brief-table .rc-input-no,
.risk-cards-brief-table .rc-input-dept,
.risk-cards-brief-table .rc-input-pos,
.risk-cards-brief-table .rc-input-resp,
.risk-cards-brief-table .rc-input-date {
  padding: 3px 5px;
  font-size: 0.84em;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.risk-cards-brief-table .rc-th-no {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.risk-cards-brief-table .rc-input-no {
  text-align: center;
}
.risk-cards-brief-table .rc-th-dept { min-width: 58px; }
.risk-cards-brief-table .rc-th-pos { min-width: 60px; }
.risk-cards-brief-table .rc-th-leader,
.risk-cards-brief-table .rc-th-coord { min-width: 96px; }
.risk-cards-brief-table .rc-th-date { min-width: 58px; }

.risk-cards-brief-table .rc-th-leader,
.risk-cards-brief-table .rc-th-coord,
.risk-cards-brief-table .rc-th-date {
  vertical-align: middle;
}

.rc-th-bulk {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  justify-content: center;
  min-height: 100%;
}

.rc-th-bulk-label {
  display: block;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.rc-th-bulk-input {
  width: 100%;
  min-width: 0;
}

.rc-header-copy-all-btn {
  align-self: center;
  white-space: nowrap;
}

.rc-field-with-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rc-field-with-btn input {
  flex: 1;
  min-width: 0;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 0.72em;
  white-space: nowrap;
  border-radius: 4px;
}

.rc-copy-all-btn {
  opacity: 0.6;
  flex-shrink: 0;
}
.rc-copy-all-btn:hover { opacity: 1; }

.risk-cards-brief-table th.rc-work-col {
  writing-mode: vertical-lr;
  text-orientation: mixed;
  font-size: 12px !important;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  padding: 6px 2px !important;
  text-align: center;
  cursor: grab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  user-select: none;
}

.risk-cards-brief-table th .resize-handle {
  z-index: 3;
}

.risk-cards-brief-table th .resize-handle::after {
  background: #b8b8b8;
}

.risk-cards-brief-table th:hover .resize-handle::after {
  background: #6f6f6f;
}

.risk-cards-brief-table th.rc-work-col.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.risk-cards-brief-table th.rc-work-col.is-drop-target {
  background: #e6eefc;
  box-shadow: inset 0 0 0 2px rgba(79, 140, 255, 0.35);
}

/* Separator between toolbar groups */
.rc-separator {
  display: inline-block;
  width: 1px;
  background: var(--border, #ddd);
  align-self: stretch;
  margin: 0 4px;
}

.risk-cards-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.risk-cards-footer-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

[data-theme="dark"] .auth-subscription-status {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .auth-subscription-status-critical {
  background: rgba(220, 60, 31, 0.18);
  border-color: rgba(248, 113, 113, 0.36);
  color: #fecaca;
}

[data-theme="dark"] .auth-subscription-status-warning {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.3);
  color: #fde68a;
}

[data-theme="dark"] .auth-subscription-status-healthy {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(74, 222, 128, 0.28);
  color: #bbf7d0;
}

[data-theme="dark"] .app-fatal-card {
  background: linear-gradient(180deg, rgba(26, 26, 46, 0.98), rgba(22, 22, 40, 0.98));
}

[data-theme="dark"] .risk-cards-brief-table-wrap {
  border: 1px solid rgba(95, 103, 141, 0.32);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 24, 41, 0.98), rgba(18, 20, 34, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .risk-cards-brief-table {
  background: transparent;
}

[data-theme="dark"] .risk-cards-brief-table th,
[data-theme="dark"] .risk-cards-brief-table td {
  border-color: rgba(79, 84, 119, 0.42);
  background: rgba(22, 24, 41, 0.94);
  color: var(--fg);
}

[data-theme="dark"] .risk-cards-brief-table th {
  background: rgba(31, 34, 57, 0.98);
  color: rgba(228, 228, 231, 0.92);
}

[data-theme="dark"] .risk-cards-brief-table th.rc-work-col {
  color: rgba(228, 228, 231, 0.76);
}

[data-theme="dark"] .risk-cards-brief-table th .resize-handle::after {
  background: rgba(148, 163, 184, 0.62);
}

[data-theme="dark"] .risk-cards-brief-table th:hover .resize-handle::after {
  background: rgba(191, 219, 254, 0.92);
}

[data-theme="dark"] .risk-cards-brief-table th.rc-work-col.is-drop-target {
  background: rgba(44, 67, 129, 0.92);
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.45);
}

[data-theme="dark"] .risk-cards-brief-table .rc-th-check input[type="checkbox"],
[data-theme="dark"] .risk-cards-brief-table .rc-select-cell input[type="checkbox"],
[data-theme="dark"] .risk-cards-brief-table .rc-work-check-cell input[type="checkbox"] {
  accent-color: #7aa2ff;
}

[data-theme="dark"] .risk-cards-brief-table input,
[data-theme="dark"] .risk-cards-brief-table select,
[data-theme="dark"] .risk-cards-brief-table textarea {
  background: rgba(12, 14, 25, 0.82);
  color: var(--fg);
  border-color: rgba(95, 103, 141, 0.42);
}

[data-theme="dark"] .rc-separator {
  background: rgba(95, 103, 141, 0.42);
}

/* ─── Risk Base Editor ─────────────────────────────────────────────── */

#riskCardBaseEditorDialog {
  width: min(98vw, 1680px);
}

.risk-base-editor-close {
  margin-left: 8px;
  font-size: 24px;
  font-weight: 500;
  color: #334155;
}

.risk-base-measures-section,
.risk-base-group-section {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.risk-base-measures-section {
  border: 1px solid #d7def0;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 10px 24px rgba(18, 38, 63, 0.05);
  margin-bottom: 18px;
}

.risk-base-measures-section h3 {
  margin: 0 0 12px;
  font-size: 1.05em;
}

.risk-base-measures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.risk-base-measure-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #e1e7f5;
  border-radius: 12px;
  background: #fff;
}

.risk-base-measure-label,
.risk-base-row-measure-label {
  font-weight: 700;
  font-size: 0.9rem;
}

.risk-base-measure-textarea {
  min-height: 88px;
  font-size: 0.92rem;
  line-height: 1.45;
  resize: vertical;
}

.risk-base-group-section {
  border: 1px solid #d5deef;
  border-radius: 18px;
  margin-bottom: 14px;
  padding: 14px 16px 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.risk-base-group-section summary {
  cursor: pointer;
  padding: 10px 12px;
  margin: -4px -4px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4f7ff 0%, #eef3ff 100%);
  border: 1px solid #d8e2f8;
  font-size: 0.95rem;
}

.risk-base-group-section[open] {
  border-color: #b7c7ea;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.12);
}

.risk-base-group-section[open] summary {
  background: linear-gradient(135deg, #e8f0ff 0%, #dfeaff 100%);
  border-color: #c7d7fb;
}

.risk-base-group-summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.risk-base-group-summary-short {
  font-size: 0.98rem;
}

.risk-base-group-summary-full {
  font-size: 0.94rem;
}

.risk-base-group-summary-sep {
  color: #6b7280;
}

.risk-base-group-section .badge {
  font-size: 0.78em;
  color: #4c5a74;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #d7deef;
  border-radius: 999px;
  padding: 2px 8px;
}

.risk-base-group-meta {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(420px, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.risk-base-group-meta-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.risk-base-group-meta-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.risk-base-group-meta-input,
.risk-base-group-meta-textarea {
  font-size: 0.94rem;
  line-height: 1.4;
}

.risk-base-group-meta-textarea {
  min-height: 74px;
  resize: vertical;
}

.risk-base-group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
  margin: 12px 0;
  table-layout: fixed;
}

.risk-base-group-table th,
.risk-base-group-table td {
  border: 1px solid #dde5f2;
  padding: 8px 10px;
  vertical-align: top;
}

.risk-base-group-table th {
  background: #f5f8ff;
  font-size: 0.86rem;
  color: #24324b;
}

.risk-base-group-table th:nth-child(1),
.risk-base-group-table td:nth-child(1) {
  width: 32%;
}

.risk-base-group-table th:nth-child(2),
.risk-base-group-table td:nth-child(2) {
  width: 24%;
}

.risk-base-input,
.risk-base-input-textarea {
  width: 100%;
  min-width: 100px;
  font-size: 0.93rem;
  line-height: 1.45;
}

.risk-base-input-textarea {
  min-height: 84px;
  resize: vertical;
}

.risk-base-input-sm {
  width: 64px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
}

.risk-base-row-actions {
  width: 156px;
  text-align: center;
  white-space: nowrap;
}

.risk-base-row-action-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.risk-base-group-section-hidden > summary {
  background: #fff7f7;
  border-color: #f0caca;
}

.risk-base-group-summary-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.risk-base-group-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.risk-base-group-summary-actions .btn {
  pointer-events: auto;
}

.risk-base-row-hidden td {
  background: #fff7f7;
}

.risk-base-row-hidden .risk-base-input-textarea,
.risk-base-row-hidden .risk-base-input-sm,
.risk-base-row-hidden .risk-base-kr,
.risk-base-row-hidden .risk-base-level {
  opacity: 0.62;
}

.risk-base-measures-host-hidden td {
  background: #fcf7f7;
}

.risk-base-row-actions-placeholder {
  color: var(--fg-muted, #888);
}

.risk-base-measures-host td {
  background: #f8fbff;
}

.risk-base-row-measures {
  border: 1px solid #d6e2fb;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 6px 0;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.risk-base-row-measures summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.91rem;
  color: #1f3a68;
}

.risk-base-row-measures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.risk-base-row-measure-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid #e0e8f8;
  border-radius: 12px;
  background: #fff;
}

.risk-base-row-measure-textarea {
  min-height: 92px;
  font-size: 0.92rem;
  line-height: 1.45;
  resize: vertical;
}

.risk-base-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.risk-base-kr,
.risk-base-level {
  text-align: center;
  font-weight: bold;
  min-width: 44px;
  font-size: 0.92rem;
}

.risk-base-level {
  color: #0f172a;
}

.risk-base-add-group-panel {
  margin-top: 4px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #d8e3f8;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.risk-base-add-group-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.risk-base-add-group-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(420px, 1fr);
  gap: 12px;
}

.risk-base-add-group-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.risk-base-add-group-field .control-input {
  font-size: 0.94rem;
  line-height: 1.4;
}

.risk-base-add-group-field textarea.control-input {
  min-height: 76px;
  resize: vertical;
}

.risk-base-add-group-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 1180px) {
  .risk-base-group-meta {
    grid-template-columns: 1fr;
  }

  .risk-base-add-group-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Risk Card Preview ────────────────────────────────────────────── */

.risk-preview-header {
  margin-bottom: 12px;
}

.risk-preview-header p {
  margin: 2px 0;
  font-size: 0.9em;
}

.risk-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}

.risk-preview-table th,
.risk-preview-table td {
  border: 1px solid var(--border, #ddd);
  padding: 6px 8px;
  vertical-align: top;
}

.risk-preview-table th {
  background: var(--surface-raised, #f5f5f5);
  font-weight: 600;
}

/* ── Site footer ── */
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 18px 16px;
  margin-top: 32px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.site-footer-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  transition: color .15s;
}
.site-footer a:hover {
  color: var(--fg);
  text-decoration: underline;
}
.site-footer-btn:hover {
  color: var(--fg);
  text-decoration: underline;
}
.site-footer-sep {
  user-select: none;
}

/* ── Owner Panel ── */
.owner-page,
.owner-login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(14, 116, 144, 0.10), transparent 26%),
    linear-gradient(165deg, #f4f7fb 0%, #eef4f7 48%, #f8fbfc 100%);
}

.owner-login-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 32px 20px;
}

.owner-login-card {
  border: 1px solid #d7e2ea;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.10);
  padding: 30px;
  display: grid;
  gap: 18px;
}

.owner-login-header {
  display: grid;
  gap: 8px;
}

.owner-login-eyebrow,
.owner-topbar-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0f766e;
}

.owner-login-title,
.owner-topbar-title {
  margin: 0;
  letter-spacing: -0.02em;
}

.owner-login-subtitle {
  margin: 0;
  color: #486171;
}

.owner-login-footer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}

.owner-login-footer a {
  color: #486171;
  text-decoration: none;
}

.owner-login-footer a:hover {
  color: #0f172a;
}

.owner-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 28px 28px 18px;
}

.owner-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.owner-current-label {
  font-size: 14px;
  color: #486171;
}

.owner-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.95fr);
  gap: 22px;
  padding: 0 28px 32px;
  align-items: start;
}

.owner-main-column,
.owner-side-column {
  display: grid;
  gap: 18px;
  align-content: start;
  align-items: start;
}

.owner-main-column > .owner-section,
.owner-side-column > .owner-section {
  width: 100%;
  align-self: start;
}

.owner-section {
  border: 1px solid #d7e2ea;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
  padding: 20px;
}

.owner-section-header {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.owner-section-header h2,
.owner-section h2,
.owner-section h3 {
  margin: 0;
}

.owner-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
}

.owner-summary-card,
.owner-analytics-card {
  border: 1px solid #dbe6ee;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fafc 100%);
  padding: 14px 16px;
}

.owner-summary-card {
  display: grid;
  gap: 6px;
}

.owner-summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #587183;
}

.owner-summary-value {
  font-size: 28px;
  line-height: 1;
  color: #0f172a;
}

.owner-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.owner-mini-list,
.owner-audit-feed {
  list-style: none;
  padding: 0;
  margin: 0;
}

.owner-mini-list {
  display: grid;
  gap: 8px;
}

.owner-mini-list li,
.owner-audit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7fafc;
  border: 1px solid #e3edf3;
}

.owner-form-grid {
  display: grid;
  gap: 14px;
}

.owner-form-grid .control {
  display: grid;
  gap: 8px;
}

.owner-memberships-block {
  display: grid;
  gap: 10px;
}

.owner-checkbox-list {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #dbe6ee;
  border-radius: 14px;
  background: #f9fcfd;
}

.owner-checkbox-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: start;
  font-size: 14px;
}

.owner-checkbox-option input {
  margin-top: 2px;
}

.owner-checkbox-option small {
  grid-column: 2;
  color: #587183;
}

.owner-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.owner-users-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.owner-users-search {
  min-width: 0;
}

.owner-users-toolbar input:not([type="checkbox"]):not([type="radio"]),
.owner-users-toolbar select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #cfd9e4;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.owner-users-toolbar input:not([type="checkbox"]):not([type="radio"]):focus,
.owner-users-toolbar select:focus {
  border-color: #2454a6;
  box-shadow: 0 0 0 4px rgba(36, 84, 166, 0.12);
}

.owner-users-toolbar-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.owner-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.owner-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d7e2ea;
  border-radius: 999px;
  background: #f7fafc;
  color: #29485a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.owner-chip.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.owner-queue-list {
  display: grid;
  gap: 12px;
}

.owner-queue-item {
  border: 1px solid #dbe6ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.owner-queue-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.owner-queue-user {
  display: grid;
  gap: 4px;
}

.owner-queue-user small,
.owner-queue-meta span {
  color: #587183;
  font-size: 13px;
}

.owner-queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.owner-preview-shell {
  border: 1px solid #dbe6ee;
  border-radius: 16px;
  background: #f8fbfc;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.owner-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.owner-preview-card {
  border: 1px solid #dbe6ee;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.owner-preview-card span {
  color: #587183;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.owner-preview-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.owner-preview-list li {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e3edf3;
  background: #ffffff;
  color: #29485a;
  font-size: 13px;
}

.owner-preview-list-danger li {
  border-color: #f2c9c9;
  background: #fff5f5;
  color: #a61b1b;
}

.owner-preview-list-warning li {
  border-color: #f4d38b;
  background: #fff9e7;
  color: #8a5a00;
}

.owner-temp-code {
  margin-top: 14px;
  border: 1px solid #cfe3d4;
  border-radius: 16px;
  background: #f3fcf5;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.owner-temp-code code {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #14532d;
}

.owner-table-wrap {
  overflow: auto;
}

.owner-table {
  width: 100%;
  border-collapse: collapse;
}

.owner-table th,
.owner-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e4edf3;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.owner-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #587183;
}

.owner-row-selected {
  background: #f2f8fb;
}

.owner-row-open-btn {
  white-space: nowrap;
}

.owner-audit-feed {
  display: grid;
  gap: 10px;
}

#ownerAuditFeed,
#ownerSelectedUserAudit,
#ownerUserActivity .owner-audit-feed {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

#ownerUserActivity .owner-audit-feed {
  max-height: 280px;
}

#ownerAuditFeed .owner-audit-item,
#ownerSelectedUserAudit .owner-audit-item,
#ownerUserActivity .owner-audit-item {
  padding: 8px 10px;
}

.owner-audit-item {
  flex-direction: column;
  align-items: stretch;
}

.owner-audit-main,
.owner-audit-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.owner-audit-meta {
  color: #587183;
  font-size: 13px;
}

.owner-flash {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.owner-flash-info {
  background: #eef6fb;
  color: #0f4c6e;
}

.owner-flash-success {
  background: #eefbf1;
  color: #166534;
}

.owner-flash-error {
  background: #fff1f1;
  color: #b42318;
}

.owner-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.owner-alert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.owner-alert-card {
  border: 1px solid #dbe6ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.owner-alert-card .owner-mini-list li {
  align-items: flex-start;
}

.owner-alert-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.owner-alert-header h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.owner-alert-header strong {
  font-size: 24px;
  line-height: 1;
  color: #0f172a;
}

.owner-alert-card p {
  margin: 0;
  color: #486171;
  font-size: 13px;
}

.owner-alert-card-danger {
  border-color: #f2c9c9;
  background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
}

.owner-alert-card-warning {
  border-color: #f4d38b;
  background: linear-gradient(180deg, #fffdf4 0%, #fff9e7 100%);
}

.owner-alert-card-info {
  border-color: #cfe3ee;
  background: linear-gradient(180deg, #f8fcfe 0%, #eef7fb 100%);
}

.owner-block-card {
  border: 1px solid #dbe6ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.owner-block-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.owner-block-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.owner-block-card strong {
  font-size: 28px;
  line-height: 1;
  color: #0f172a;
}

.owner-block-card p {
  margin: 0;
  color: #486171;
  font-size: 13px;
}

.owner-block-card-warning {
  border-color: #f4d38b;
  background: linear-gradient(180deg, #fffdf4 0%, #fff9e7 100%);
}

.owner-block-card-danger {
  border-color: #f2c9c9;
  background: linear-gradient(180deg, #fff8f8 0%, #fff1f1 100%);
}

.owner-block-card-info {
  border-color: #cfe3ee;
  background: linear-gradient(180deg, #f8fcfe 0%, #eef7fb 100%);
}

.owner-analytics-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.owner-analytics-grid-tight {
  margin-top: 16px;
}

.owner-empty-state,
.owner-empty-inline {
  color: #587183;
  font-size: 13px;
}

.owner-empty-inline {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.owner-user-cell {
  display: grid;
  gap: 2px;
}

.owner-user-cell span {
  color: #587183;
  font-size: 13px;
}

.owner-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-tag-list-spacious {
  margin-top: 12px;
}

.owner-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef6fb;
  border: 1px solid #d6e5ef;
  color: #0f4c6e;
  font-size: 12px;
  font-weight: 600;
}

.owner-overview-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.owner-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.owner-detail-card {
  border: 1px solid #dbe6ee;
  border-radius: 16px;
  background: #f8fbfc;
  padding: 14px;
  display: grid;
  gap: 6px;
}

.owner-detail-card strong {
  font-size: 20px;
  line-height: 1.1;
}

.owner-detail-card small {
  color: #587183;
}

.owner-detail-label {
  color: #587183;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.owner-code-dialog {
  border: 0;
  padding: 0;
  border-radius: 22px;
}

.owner-code-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(3px);
}

.owner-code-shell {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.owner-code-header h2 {
  margin: 0;
}

.owner-code-body {
  display: grid;
  gap: 12px;
}

.owner-code-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.owner-code-value {
  flex: 1 1 220px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 14px;
  background: #0f172a;
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.owner-code-footer {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .owner-layout {
    grid-template-columns: 1fr;
  }

  .owner-users-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .owner-users-toolbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .owner-topbar,
  .owner-layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .owner-topbar {
    flex-direction: column;
  }

  .owner-users-toolbar {
    grid-template-columns: 1fr;
  }

  .owner-topbar-actions,
  .owner-form-actions {
    width: 100%;
  }

  .owner-form-actions .btn,
.owner-topbar-actions .btn {
  width: 100%;
}

}

/* Support center */
#supportBtn {
  position: relative;
}

.support-welcome-modal {
  width: 100%;
  max-width: none;
}

.support-welcome-fields {
  display: grid;
  gap: 14px;
  overflow-x: hidden;
}

.support-welcome-fields p {
  margin: 0;
}

.support-welcome-actions {
  justify-content: flex-end;
}

#supportWelcomeDialog {
  width: min(92vw, 640px);
  overflow-x: hidden;
}

#supportCenterDialog .support-center-form {
  width: min(1320px, calc(100vw - 16px));
}

.support-center-form .form-header {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.support-center-form .form-header h2 {
  margin-right: auto;
}

.support-center-form .dialog-window-minimize-btn {
  margin-left: auto;
}

.support-center-form .form-header .icon-btn {
  margin-left: 0;
}

.support-center-form .fields {
  display: grid;
  gap: 18px;
}

.support-center-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  flex-wrap: wrap;
  width: max-content;
  max-width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
}

.support-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 156px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.support-center-status {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--surface-alt);
}

.support-center-status-success {
  border-color: rgba(33, 150, 83, 0.28);
  background: rgba(33, 150, 83, 0.08);
  color: #1b6e40;
}

.support-center-status-error {
  border-color: rgba(220, 60, 31, 0.25);
  background: rgba(220, 60, 31, 0.08);
  color: #8f2b18;
}

.support-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.support-panel-note {
  border: 1px solid rgba(55, 107, 255, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(55, 107, 255, 0.08), rgba(55, 107, 255, 0.03));
}

.support-panel-note p {
  margin: 0;
}

.support-compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.support-compose-grid .control,
.support-reply-form .control,
.owner-support-form-card .control {
  display: grid;
  gap: 8px;
  width: 100%;
}

.support-compose-grid .control > span,
.support-reply-form .control > span,
.owner-support-form-card .control > span {
  font-size: 13px;
  font-weight: 600;
  color: #486171;
}

.support-compose-grid .control:nth-child(3),
.support-compose-grid .control:nth-child(4),
.support-compose-grid .support-file-list,
.support-compose-grid .error,
.support-compose-grid .actions {
  grid-column: 1 / -1;
}

.support-compose-grid .control:nth-child(1),
.support-compose-grid .control:nth-child(2) {
  grid-column: 1 / -1;
}

.support-compose-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.support-compose-grid select,
.support-compose-grid textarea,
.support-reply-form textarea,
.owner-support-form-card input:not([type="checkbox"]):not([type="radio"]),
.owner-support-form-card select,
.owner-support-form-card textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #cfd9e4;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  font: inherit;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.support-compose-grid input::placeholder,
.support-compose-grid textarea::placeholder,
.support-reply-form textarea::placeholder,
.owner-support-form-card input::placeholder,
.owner-support-form-card textarea::placeholder {
  color: #8aa0b2;
}

.support-compose-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.support-compose-grid select:focus,
.support-compose-grid textarea:focus,
.support-reply-form textarea:focus,
.owner-support-form-card input:not([type="checkbox"]):not([type="radio"]):focus,
.owner-support-form-card select:focus,
.owner-support-form-card textarea:focus {
  border-color: #2454a6;
  box-shadow: 0 0 0 4px rgba(36, 84, 166, 0.12);
}

.support-compose-grid textarea,
.support-reply-form textarea,
.owner-support-form-card textarea {
  min-height: 132px;
  resize: vertical;
}

#supportComposeKind,
#supportComposeTitle,
#supportComposeDescription {
  display: block;
  width: 100%;
  max-width: 100%;
}

.support-compose-grid input[type="file"] {
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px dashed #b6c8dc;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fcff 0%, #f2f7fc 100%);
  color: #486171;
}

.support-compose-grid input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 1px solid #cfd9e4;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.support-compose-grid .actions {
  justify-content: flex-end;
}

.support-file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.support-file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--surface-alt);
}

.support-ticket-shell {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.support-ticket-list-column,
.support-ticket-thread-column {
  display: grid;
  gap: 12px;
}

.support-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.support-ticket-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.support-ticket-list-item {
  display: grid;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px 14px;
}

.support-ticket-list-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(55, 107, 255, 0.14);
}

.support-ticket-list-item.is-unread {
  background: rgba(55, 107, 255, 0.06);
}

.support-ticket-list-top,
.support-ticket-list-meta,
.support-thread-message header,
.owner-support-ticket-top,
.owner-support-ticket-meta,
.owner-support-message header,
.owner-support-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.support-ticket-thread,
.owner-support-detail {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 22px;
  min-height: 360px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.owner-support-detail-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}

.owner-support-detail-empty strong {
  font-size: 18px;
  color: #0f172a;
}

.owner-support-detail-empty p {
  margin: 0;
  max-width: 320px;
  color: #587183;
}

.support-thread-messages,
.owner-support-thread {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.support-thread-message,
.owner-support-message {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-alt);
}

.support-thread-message-owner,
.owner-support-message-owner {
  background: rgba(55, 107, 255, 0.08);
}

.support-thread-attachments,
.owner-support-attachments {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.support-reply-form,
.owner-support-reply-form,
.owner-support-bonus-form {
  margin-top: 16px;
}

.support-empty-state {
  color: var(--muted);
  margin: 0;
}

.support-thread-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}

.support-thread-empty strong {
  font-size: 18px;
}

.support-thread-header h3 {
  margin: 0;
}

.support-thread-meta {
  margin: 6px 0 0;
  color: var(--muted);
}

.support-thread-tags {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.support-pill,
.support-ticket-bonus {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.support-pill {
  background: rgba(55, 107, 255, 0.1);
  color: var(--accent);
}

.support-ticket-bonus {
  background: rgba(255, 193, 7, 0.16);
  color: #7a5a00;
}

.owner-support-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.owner-support-layout.is-collapsed {
  grid-template-columns: minmax(320px, 380px);
}

.owner-support-list-column,
.owner-support-detail-column {
  display: grid;
  gap: 12px;
}

.owner-support-list {
  display: grid;
  gap: 10px;
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}

.owner-support-ticket {
  display: grid;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid #d7e3ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 16px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.owner-support-ticket:hover {
  border-color: #b8cae0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.owner-support-ticket.is-active {
  border-color: #2454a6;
  box-shadow: 0 14px 32px rgba(36, 84, 166, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
}

.owner-support-ticket.is-unread {
  background: linear-gradient(180deg, #fafdff 0%, #eef5ff 100%);
}

.owner-support-actions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.owner-support-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.owner-support-header {
  align-items: start;
}

.owner-support-header-side {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.owner-support-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.owner-support-ticket-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.owner-support-heading {
  display: grid;
  gap: 6px;
}

.owner-support-heading h3,
.owner-support-card-head h4 {
  margin: 0;
}

.owner-support-card-head {
  display: grid;
  gap: 4px;
}

.owner-support-card-head p {
  margin: 0;
  color: #587183;
  font-size: 13px;
}

.owner-support-admin-grid,
.owner-support-reply-form,
.owner-support-bonus-form {
  margin-top: 18px;
}

.owner-support-form-card {
  border: 1px solid #dbe6ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.owner-support-message p {
  margin: 0;
}

.owner-tag-soft {
  border: 1px solid transparent;
  background: #eef3f8;
  color: #375162;
}

.owner-tag-muted {
  background: #eef2f5;
  color: #587183;
}

.owner-tag-attention {
  background: rgba(36, 84, 166, 0.1);
  color: #2454a6;
}

.owner-tag-bonus {
  background: rgba(255, 193, 7, 0.18);
  color: #7a5a00;
}

.owner-tag-status {
  border: 1px solid transparent;
}

.owner-tag-status-new {
  background: #eef5ff;
  color: #2454a6;
}

.owner-tag-status-info {
  background: #ecf7ff;
  color: #0f4c6e;
}

.owner-tag-status-warning {
  background: #fff6df;
  color: #8a5a00;
}

.owner-tag-status-success {
  background: #eefbf1;
  color: #166534;
}

.owner-tag-status-muted {
  background: #f2f4f7;
  color: #667085;
}

.kind-bug {
  background: rgba(220, 60, 31, 0.1);
  color: #b42318;
}

.kind-question {
  background: rgba(87, 113, 131, 0.12);
  color: #486171;
}

.kind-suggestion {
  background: rgba(22, 101, 52, 0.1);
  color: #166534;
}

@media (max-width: 980px) {
  .support-center-toolbar {
    width: 100%;
  }

  .support-center-toolbar .support-tab {
    flex: 1 1 0;
  }

  .support-compose-grid,
  .owner-support-actions-grid {
    grid-template-columns: 1fr;
  }

  .support-ticket-shell,
  .owner-support-layout {
    grid-template-columns: 1fr;
  }

  .owner-support-layout.is-collapsed {
    grid-template-columns: 1fr;
  }

  .owner-support-header-side {
    justify-items: start;
  }

  .owner-support-inline-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .owner-code-row {
    flex-direction: column;
    align-items: stretch;
  }

  .owner-code-value {
    width: 100%;
    justify-content: center;
  }
}

.tab.tab-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dashboard-expired {
  display: grid;
  gap: 18px;
}

.dashboard-overlimit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
  border-radius: 20px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: linear-gradient(135deg, rgba(255, 244, 228, 0.96), rgba(255, 235, 221, 0.92));
  box-shadow: 0 18px 36px rgba(176, 86, 28, 0.08);
}

.dashboard-overlimit strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.dashboard-overlimit p {
  margin: 0;
  color: rgba(26, 33, 54, 0.78);
  line-height: 1.65;
}

.dashboard-expired-banner {
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(222, 182, 31, 0.35);
  background: linear-gradient(135deg, rgba(255, 244, 184, 0.98), rgba(255, 236, 128, 0.92));
  box-shadow: 0 24px 48px rgba(171, 131, 0, 0.12);
}

.dashboard-expired-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(148, 110, 0, 0.12);
  color: #6b5200;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-expired-banner h2 {
  margin: 14px 0 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.dashboard-expired-banner p {
  margin: 0;
  max-width: 760px;
  color: rgba(26, 33, 54, 0.84);
  font-size: 16px;
  line-height: 1.7;
}

.dashboard-expired-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-plan-card {
  min-height: 180px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(175, 195, 234, 0.72);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(24, 54, 117, 0.08);
}

.dashboard-plan-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
}

.dashboard-plan-card p {
  margin: 0;
  color: rgba(26, 33, 54, 0.76);
  line-height: 1.7;
}

.dashboard-expired-note {
  margin: 0;
  color: rgba(26, 33, 54, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

.dashboard-contact-modal {
  max-width: 480px;
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: none;
  border-radius: 24px;
  box-shadow: 0 36px 72px rgba(15, 32, 79, 0.28);
}

.dashboard-contact-modal::backdrop {
  background: rgba(10, 18, 42, 0.48);
}

.dashboard-contact-modal-inner {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.dashboard-contact-modal-inner h3 {
  margin: 0;
  font-size: 24px;
}

.dashboard-contact-modal-inner p {
  margin: 0;
  color: rgba(26, 33, 54, 0.78);
  line-height: 1.7;
}

.dashboard-contact-modal-actions {
  display: flex;
  justify-content: flex-end;
}

.owner-inline-toggle {
  align-content: start;
}

.owner-checkbox-inline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.owner-checkbox-inline input {
  margin-top: 3px;
}

.owner-tariff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.owner-tariff-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(175, 195, 234, 0.68);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(24, 54, 117, 0.08);
}

.owner-tariff-card.is-featured {
  border-color: rgba(55, 107, 255, 0.4);
  box-shadow: 0 20px 40px rgba(55, 107, 255, 0.16);
}

.owner-tariff-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.owner-tariff-head h3 {
  margin: 0 0 6px;
}

.owner-tariff-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.owner-tariff-form {
  display: grid;
  gap: 14px;
}

.owner-tariff-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.owner-tariff-form .control {
  display: grid;
  gap: 8px;
}

.owner-tariff-form .control > span {
  font-size: 13px;
  font-weight: 600;
  color: #486171;
}

.owner-tariff-form input:not([type="checkbox"]):not([type="radio"]),
.owner-tariff-form select,
.owner-tariff-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid #cfd9e4;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  font: inherit;
  line-height: 1.4;
}

.owner-tariff-form textarea {
  min-height: 94px;
  resize: vertical;
}

.owner-tariff-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.owner-tariff-note {
  font-size: 13px;
  color: var(--muted);
}

.owner-support-plan-request {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(55, 107, 255, 0.18);
  background: rgba(55, 107, 255, 0.05);
}

.owner-support-plan-request strong,
.owner-support-plan-request p {
  margin: 0;
}

.owner-support-plan-request p {
  margin-top: 6px;
  color: var(--muted);
}

.owner-tag-soft.kind-plan {
  background: rgba(55, 107, 255, 0.12);
  color: #2454a6;
}

.tariff-center-form {
  width: 100%;
  max-width: none;
}

#tariffCenterDialog {
  overflow-x: hidden;
}

.tariff-center-fields {
  gap: 20px;
  overflow-x: hidden;
}

.tariff-period-row {
  display: flex;
  justify-content: center;
}

.tariff-period-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

.tariff-period-btn {
  min-width: 112px;
}

.tariff-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.tariff-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(175, 195, 234, 0.68);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(24, 54, 117, 0.08);
  min-width: 0;
  min-height: 100%;
}

.tariff-card-featured {
  border-color: rgba(55, 107, 255, 0.34);
  box-shadow: 0 20px 40px rgba(55, 107, 255, 0.16);
}

.tariff-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.tariff-card-head h3,
.tariff-card-price strong {
  margin: 0;
}

.tariff-card-head p,
.tariff-card-price span,
.tariff-card-current {
  color: var(--muted);
}

.tariff-card-head p {
  margin: 6px 0 0;
}

.tariff-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(55, 107, 255, 0.1);
  color: #2454a6;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tariff-card-price {
  display: grid;
  gap: 6px;
}

.tariff-card-price strong {
  font-size: 32px;
  line-height: 1;
}

.tariff-card-custom .tariff-card-price strong {
  font-size: clamp(22px, 1.8vw, 24px);
  line-height: 1.08;
  color: var(--accent);
  letter-spacing: -0.03em;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.tariff-card-limits,
.tariff-card-bullets {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.tariff-card-bullets {
  flex: 1 1 auto;
}

.tariff-card-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}

.tariff-card-current {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(55, 107, 255, 0.16);
  background: rgba(55, 107, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  color: #2454a6;
}

.billing-request-form {
  max-width: 560px;
  width: min(560px, calc(100vw - 24px));
}

.billing-request-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.billing-request-summary-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.billing-request-summary-item > span {
  color: var(--muted);
  font-size: 13px;
}

.billing-request-summary-item > strong {
  font-size: 15px;
}

.billing-request-grid {
  display: grid;
  gap: 14px;
}

.billing-request-grid .control {
  display: grid;
  gap: 8px;
}

.billing-request-grid .control > span {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.billing-request-grid .control > span small {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(55, 107, 255, 0.16);
  background: rgba(55, 107, 255, 0.08);
  color: #2454a6;
  font-size: 11px;
  font-weight: 700;
}

.billing-request-grid input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.billing-request-grid input::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
}

.billing-request-grid input:hover {
  border-color: color-mix(in srgb, var(--line-strong) 78%, transparent);
}

.billing-request-grid input:focus {
  outline: none;
  border-color: rgba(55, 107, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(55, 107, 255, 0.12);
}

.billing-request-grid .actions {
  justify-content: flex-end;
  margin-top: 4px;
}

[data-theme="dark"] .billing-request-grid .control > span small {
  border-color: rgba(112, 156, 255, 0.22);
  background: rgba(55, 107, 255, 0.16);
  color: #b7cbff;
}

[data-theme="dark"] .billing-request-grid input {
  background: rgba(19, 24, 40, 0.92);
  border-color: rgba(123, 142, 255, 0.18);
  color: #eef2ff;
}

[data-theme="dark"] .billing-request-grid input::placeholder {
  color: rgba(190, 198, 223, 0.62);
}

[data-theme="dark"] .billing-request-grid input:hover {
  border-color: rgba(123, 142, 255, 0.34);
}

[data-theme="dark"] .billing-request-grid input:focus {
  border-color: rgba(123, 142, 255, 0.62);
  box-shadow: 0 0 0 4px rgba(70, 110, 255, 0.18);
}

.billing-request-status {
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 600;
}

.billing-request-status-info {
  background: rgba(55, 107, 255, 0.1);
  color: #2454a6;
}

.billing-request-status-success {
  background: rgba(30, 159, 106, 0.12);
  color: #196b47;
}

.billing-request-status-error {
  background: rgba(215, 72, 72, 0.12);
  color: #9d3333;
}

@media (max-width: 900px) {
  .dashboard-overlimit {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-expired-grid {
    grid-template-columns: 1fr;
  }

  .owner-tariff-form-grid {
    grid-template-columns: 1fr;
  }

  .billing-request-summary {
    grid-template-columns: 1fr;
  }

  .tariff-period-row {
    justify-content: stretch;
  }

  .tariff-period-switch {
    width: 100%;
  }
}
