/* ==========================================================================
   OPTICORE UI 1.0 (OUS)
   Theme: Minimalistický, medicínsky/optický, dátovo orientovaný
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) DESIGN TOKENS (CSS Variables)
   -------------------------------------------------------------------------- */
:root {
  /* Brand (OUS-like) */
  --c-primary: #0279be;         /* hlavná modrá */
  --c-primary-dark: #223561;   /* hover/darker */
  --c-secondary: #a8c2ff;       /* akcent (cyan/sky) */
  --c-accent: #f2ffc0;
  --c-accent-var: #e5cbcb;          
  --c-danger: #c43737;

  /* Neutral UI */
  --c-bg: #f4f6f8;
  --c-surface: #ffffff;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e0;

  --c-text: #1a202c;
  --c-text-muted: #718096;
  --c-text-invert: #ffffff;
  --c-muted: var(--c-text-muted);

  /* Status */
  --c-success: #38a169;
  --c-warning: #d69e2e;

  /* Radii + shadows */
  --radius-sm: 4px;
  --radius-md: 10px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 20px rgba(0,0,0,0.10);

  /* Typography */
  --f-main: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --sidebar-w: 270px;
  --header-h: 62px;
}

/* --------------------------------------------------------------------------
   2) GLOBAL RESET + TYPOGRAPHY
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--c-secondary);
  text-decoration: none;
}
a:hover { color: var(--c-primary-dark); text-decoration: underline; }

h1, h2, h3 {
  margin: 0 0 12px 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-primary);
}
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 18px 0;
}

/* --------------------------------------------------------------------------
   3) LAYOUT: SIDEBAR + HEADER + MAIN
   -------------------------------------------------------------------------- */
#wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
#sidebar-wrapper {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.10), transparent 34%),
    linear-gradient(180deg, #223561 0%, #1d4e8a 42%, #0279be 100%);
  color: var(--c-text-invert);
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 30px rgba(0,0,0,0.10);
}

.sidebar-heading {
  min-height: 78px;
  display: flex;
  align-items: center;
  padding: 16px 18px;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.16);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-title .app { font-weight: 800; font-size: 14px; color: #fff; }
.brand-title .org { font-weight: 600; font-size: 12px; color: rgba(255,255,255,0.75); }

/* Sidebar nav */
.sidebar-nav {
  padding: 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.sidebar-group {
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
}

.sidebar-group--superuser {
  background: linear-gradient(180deg, rgba(12, 20, 36, 0.26) 0%, rgba(12, 20, 36, 0.16) 100%);
  border-color: rgba(255,255,255,0.14);
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 10px;
}

.nav-section-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.96);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

.nav-section-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.03) 100%);
}

.nav-item {
  position: relative;
  min-height: 48px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.94);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  background: rgba(255,255,255,0.11);
  color: rgba(255,255,255,0.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.nav-item-icon i {
  font-size: 15px;
  line-height: 1;
}

.nav-item-label {
  display: block;
  min-width: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.nav-item:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.12);
  transform: translateX(2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.10);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(255,255,255,0.18);
  border-color: rgba(242,255,192,0.38);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.nav-item.active .nav-item-icon {
  background: rgba(242,255,192,0.22);
  color: var(--c-accent);
}

/* Page content */
#page-content-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.page-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--c-primary);
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  font-size: 12px;
  color: var(--c-text-muted);
  background: #edf2f7;
  border: 1px solid var(--c-border);
  padding: 6px 10px;
  border-radius: 999px;
}

.app-main {
  padding: 18px;
}

/* Container cards */
.card-core {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   4) BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.99); }

.btn-primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--c-accent-var); border-color: var(--c-accent-var); }

.btn-secondary {
  background: #fff;
  border-color: var(--c-border);
  color: var(--c-text);
}
.btn-secondary:hover { background: #f7fafc; border-color: var(--c-border-strong); }

.btn-danger {
  background: #fff;
  border-color: var(--c-danger);
  color: var(--c-danger);
}
.btn-danger:hover { background: var(--c-danger); color: #fff; }

.btn-warning {
  background: #fff;
  border-color: var(--c-warning);
  color: var(--c-warning);
}
.btn-warning:hover {
  background: var(--c-warning);
  color: #111;
}

.btn-success {
  background: var(--c-success);
  border-color: var(--c-success);
  color: #fff;
}
.btn-success:hover { background: #2f855a; border-color: #2f855a; }

.btn-outline-primary {
  background: #fff;
  border-color: rgba(2,121,190,0.28);
  color: var(--c-primary);
}
.btn-outline-primary:hover {
  background: rgba(2,121,190,0.08);
  border-color: rgba(2,121,190,0.36);
  color: var(--c-primary-dark);
}

.btn-outline-secondary {
  background: #fff;
  border-color: var(--c-border-strong);
  color: #475569;
}
.btn-outline-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-outline-danger {
  background: #fff;
  border-color: rgba(196,55,55,0.34);
  color: var(--c-danger);
}
.btn-outline-danger:hover {
  background: rgba(196,55,55,0.08);
  border-color: rgba(196,55,55,0.45);
  color: #991b1b;
}

.btn-sm {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 10px;
}

/* --------------------------------------------------------------------------
   5) FORMS
   -------------------------------------------------------------------------- */
.form-row { margin-bottom: 12px; }

.form-label {
  display: block;
  margin: 0 0 6px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-muted);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text);
  font-family: var(--f-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:hover { border-color: var(--c-border-strong); }
.form-control:focus {
  border-color: var(--c-secondary);
  box-shadow: 0 0 0 3px rgba(0,156,223,0.16);
}

.help-text {
  margin-top: 6px;
  font-size: 12px;
  color: var(--c-text-muted);
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  color: var(--c-danger);
  font-weight: 700;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   6) TABLES (Data tables)
   -------------------------------------------------------------------------- */
.table-container {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-core {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-core thead th {
  background: #f8fafc;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 800;
  padding: 12px 14px;
  border-bottom: 2px solid var(--c-border);
  white-space: nowrap;
}

.table-core tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
}

.table-core tbody tr:nth-child(even) { background: #fcfdff; }
.table-core tbody tr:hover { background: #f7fafc; }

/* Clickable rows (napr. members list) */
.table-core tbody tr.row-link {
  cursor: pointer;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.table-core tbody tr.row-link:hover { background: #f1f5f9; }
.table-core tbody tr.row-link:active { background: #e2e8f0; }
.table-core tbody tr.row-link:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(59,130,246,0.35); }

/* Status / login kruhové ikony */
.table-core .status-dot {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex: 0 0 20px;
  overflow: hidden;
  line-height: 0;
}
.table-core .status-dot .status-dot__icon,
.table-core .status-dot svg {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px;
  max-height: 12px;
  display: block;
  pointer-events: none;
}

.table-core .status-dot--ok { background: #16a34a; color: #ffffff; }
.table-core .status-dot--bad { background: #dc2626; color: #ffffff; }
.table-core .status-dot--warn { background: #f59e0b; color: #111827; }

.login-email { margin-left: 8px; }

/* Počet chýb pri červenom statuse (X) */
.table-core .status-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  height: 18px;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.td-actions { text-align: right; white-space: nowrap; }

.font-mono { font-family: var(--f-mono); }

/* --------------------------------------------------------------------------
   6b) PILLS / BADGES + KEY-VALUE LISTS
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text);
}

.pill-success {
  background: rgba(56,161,105,0.12);
  border-color: rgba(56,161,105,0.35);
  color: var(--c-success);
}

.pill-warning {
  background: rgba(214,158,46,0.12);
  border-color: rgba(214,158,46,0.35);
  color: var(--c-warning);
}

.pill-danger {
  background: rgba(227,6,19,0.08);
  border-color: rgba(227,6,19,0.30);
  color: #c53030;
}

.pill-muted {
  background: #edf2f7;
  border-color: var(--c-border);
  color: var(--c-text-muted);
}


.pill-teal {
  background: rgba(15,118,110,0.12);
  border-color: rgba(15,118,110,0.35);
  color: #0f766e;
}

.pill-blue {
  background: rgba(29,78,216,0.12);
  border-color: rgba(29,78,216,0.35);
  color: #1d4ed8;
}

.pill-purple {
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.35);
  color: #7c3aed;
}

.pill-owner {
  background: rgba(236,72,153,0.12);
  border-color: rgba(236,72,153,0.35);
  color: #be185d;
}
.kv {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kv-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  align-items: start;
}

.kv-row .k {
  color: var(--c-text-muted);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kv-row .v {
  color: var(--c-text);
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   7) ALERTS / NOTIFICATIONS
   -------------------------------------------------------------------------- */
.alert {
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  padding: 12px 14px;
  margin: 0 0 12px 0;
  background: #fff;
}

.alert-success { border-color: rgba(56,161,105,0.35); background: rgba(56,161,105,0.10); }
.alert-warning { border-color: rgba(214,158,46,0.35); background: rgba(214,158,46,0.10); }
.alert-danger  { border-color: rgba(227,6,19,0.30);  background: rgba(227,6,19,0.08); }

.alert-title { font-weight: 800; margin-bottom: 4px; }

/* --------------------------------------------------------------------------
   8) LOGIN PAGE
   -------------------------------------------------------------------------- */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f6f8fb 0%, #d9e6f2 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.login-card__top {
  background: var(--c-primary);
  color: #fff;
  padding: 18px 18px;
}

.login-card__top .title {
  font-size: 18px;
  font-weight: 900;
  margin: 0;
}
.login-card__top .subtitle {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
}

.login-card__body {
  padding: 18px;
}

.login-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.login-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--c-text-muted);
}

/* --------------------------------------------------------------------------
   9) RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  #wrapper { flex-direction: column; }
  #sidebar-wrapper {
    width: 100%;
    min-width: 100%;
  }
  .sidebar-heading { min-height: auto; padding: 14px 18px; }
  .sidebar-nav {
    gap: 10px;
    padding: 12px;
  }
  .sidebar-group {
    border-radius: 16px;
  }
  .app-header { position: sticky; top: 0; z-index: 50; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .table-container { overflow-x: auto; }
  .table-core { min-width: 720px; }
}


.modal-core {
  position: fixed;
  inset: 0;
  z-index: 1050;
}

.modal-core__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
}

.modal-core__dialog {
  position: relative;
  margin: 8vh auto 0;
  width: calc(100% - 32px);
  max-height: 84vh;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15,23,42,0.22);
}

tr.row-link:hover { background: rgba(0,0,0,0.03); }
#member-search-results tr:hover { background: rgba(0,0,0,0.03); }

/* Sidebar nav podmenu */
.admin-menu-wrapper {
  margin-top: 6px;
}

.nav-sub-container {
  display: none;
  margin: 8px 0 2px 0;
  padding: 8px;
  border-radius: 14px;
  background: rgba(8, 13, 24, 0.16);
  border: 1px solid rgba(255,255,255,0.08);
}

.nav-sub-container.is-open {
  display: block;
}

.nav-sub-item {
  min-height: 42px;
  padding: 8px 10px 8px 12px !important;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82) !important;
  border-radius: 12px;
}

.nav-sub-item .nav-item-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
}

.nav-sub-item .nav-item-label {
  font-size: 13px;
  font-weight: 600;
}

.nav-sub-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  border-color: rgba(242,255,192,0.25);
}

.nav-sub-item:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff !important;
  text-decoration: none;
  transform: translateX(2px);
}

/* Šípka pre Nastavenia */
.nav-item-toggle {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
}

.nav-item-toggle::after {
  content: '›';
  font-size: 18px;
  transition: transform 0.2s;
  line-height: 0;
  margin-left: auto;
  color: rgba(255,255,255,0.82);
}

.nav-sub-container.is-open ~ .nav-item-toggle::after,
.is-open-active::after {
  transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   Member detail (members/detail.html)
   -------------------------------------------------------------------------- */

.member-detail-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.member-detail-ident {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.member-detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 72px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: var(--shadow-sm);
}

.member-detail-avatar i {
  font-size: 32px;
  line-height: 1;
}

.member-detail-headtext {
  min-width: 0;
}

.member-detail-subline {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.member-detail-separator {
  margin: 0 8px;
  color: var(--c-text-muted);
}

.member-detail-nav-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.member-detail-nav-pair {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-detail-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.member-detail-nav-btn:hover {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.2);
  color: #0f172a;
  transform: translateY(-1px);
}

.member-detail-nav-btn.is-disabled,
.member-detail-nav-btn[aria-disabled="true"] {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: none;
  pointer-events: none;
  cursor: default;
  transform: none;
}

.member-detail-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.member-detail-action-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .member-detail-ident {
    align-items: flex-start;
  }

  .member-detail-avatar {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  .member-detail-avatar i {
    font-size: 28px;
  }

  .member-detail-actions {
    width: 100%;
    align-items: stretch;
  }

  .member-detail-nav-wrap,
  .member-detail-nav-pair,
  .member-detail-action-buttons {
    justify-content: flex-start;
  }
}

/* --------------------------------------------------------------------------
   Member notes (members/detail.html)
   -------------------------------------------------------------------------- */

#member-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-note-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.member-note-row:hover {
  background: rgba(0,0,0,0.02);
  box-shadow: var(--shadow-sm);
}

.member-note-row:active {
  transform: translateY(1px);
}

.member-note-status {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 34px;
  margin-top: 2px;
}

.member-note-status i {
  font-size: 18px;
  line-height: 1;
}

.member-note-status--exclamation { background: var(--c-danger); }
.member-note-status--question { background: var(--c-primary); }
.member-note-status--star { background: #7c3aed; }  /* fialová */
.member-note-status--check { background: var(--c-success); }
.member-note-status--document-missing { background: #dc2626; }
.member-note-status--document-pending { background: #f97316; }

.member-note-content {
  min-width: 0;
  flex: 1;
}

.member-note-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.member-note-subject {
  font-weight: 700;
}

.member-note-date {
  white-space: nowrap;
}

.member-note-snippet {
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.member-note-meta {
  margin-top: 4px;
}


.member-note-completed-divider {
  height: 1px;
  background: var(--c-border);
  margin: 14px 0 10px;
}

.member-note-completed-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-note-chip {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: none;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.05s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.member-note-chip i {
  font-size: 18px;
  line-height: 1;
}

.member-note-chip:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}

.member-note-chip:active {
  transform: translateY(1px);
}

.member-note-chip:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.member-note-chip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 30;
}

.member-note-chip::after {
  content: attr(data-note-title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  background: #0f172a;
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  line-height: 1.35;
  width: max-content;
  max-width: 220px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}

.member-note-chip:hover::before,
.member-note-chip:hover::after,
.member-note-chip:focus-visible::before,
.member-note-chip:focus-visible::after {
  opacity: 1;
}

.member-note-chip:hover::after,
.member-note-chip:focus-visible::after {
  transform: translate(-50%, 0);
}

/* Detail modal */
.member-note-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

@media (max-width: 980px) {
  .member-note-detail-grid {
    grid-template-columns: 1fr;
  }
}

.member-note-body-view {
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.02);
}

.member-note-status-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #fff;
}

.member-note-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-note-log-item {
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
}


.member-list-pagination {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.member-list-pagination__item {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #b7c2cf;
  background: #ffffff;
  color: #7c8b9b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: none;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.member-list-pagination__item:hover {
  text-decoration: none;
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.member-list-pagination__item:active {
  transform: scale(0.98);
}

.member-list-pagination__item.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #ffffff;
}

.member-list-pagination__item.is-disabled {
  background: #eef2f6;
  border-color: #c9d2dc;
  color: #a0acb8;
  pointer-events: none;
}

.member-list-pagination__item--arrow i {
  font-size: 15px;
  line-height: 1;
}

.member-list-pagination__item--ellipsis {
  font-size: 18px;
  letter-spacing: 1px;
}

.filters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end; /* Toto zarovná spodky inputov a tlačidiel */
}

.filter-item {
  flex: 1 1 auto; /* Umožní filtrom rásť a vyplniť riadok */
  min-width: 160px; /* Minimálna šírka, aby sa to na mobile pekne zalomilo */
}

.filter-item--search {
  flex: 2 1 240px; /* Vyhľadávanie bude prirodzene širšie */
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0; /* Tlačidlá sa nebudú zmenšovať */
}

/* Oprava výšky Reset tlačidla, aby sedelo k btn-primary */
.btn-reset {
  height: 38px; /* Výška form-control v OUS */
  display: inline-flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   16) OVERVIEW / HUB REFACTOR (phase 1)
   -------------------------------------------------------------------------- */
.overview-shell {
  display: grid;
  gap: 18px;
}

.overview-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(2,121,190,0.14);
  border-radius: 28px;
  padding: 24px 24px 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 54%, rgba(237,245,255,0.98) 100%);
  box-shadow: 0 20px 48px rgba(15,23,42,0.08);
}

.overview-hero::before,
.overview-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.overview-hero::before {
  width: 290px;
  height: 290px;
  right: -110px;
  top: -120px;
  background: radial-gradient(circle, rgba(2,121,190,0.14) 0%, rgba(2,121,190,0.00) 72%);
}

.overview-hero::after {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(168,194,255,0.24) 0%, rgba(168,194,255,0.00) 74%);
}

.overview-hero-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.overview-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(2,121,190,0.12);
  color: var(--c-primary-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.overview-title {
  margin: 14px 0 8px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.04;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.overview-lead {
  max-width: 860px;
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--c-text-muted);
}

.overview-actions,
.overview-pill-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.overview-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.78);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(15,23,42,0.04);
}

.overview-stat-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.overview-stat-card {
  border: 1px solid rgba(219,227,239,0.92);
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(15,23,42,0.06);
}

.overview-stat-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.overview-stat-value {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.overview-stat-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-text-muted);
}

.overview-section {
  display: grid;
  gap: 14px;
}

.overview-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.overview-section-head h2,
.overview-section-head h3 {
  margin: 0;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.overview-section-head p {
  margin: 0;
  color: var(--c-text-muted);
  max-width: 880px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.overview-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
  min-height: 176px;
  border-radius: 22px;
  border: 1px solid var(--c-border);
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(251,252,253,1) 100%);
  box-shadow: 0 16px 34px rgba(15,23,42,0.06);
  overflow: hidden;
}

.overview-card::after {
  content: "";
  position: absolute;
  inset: auto -28px -46px auto;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(2,121,190,0.10) 0%, rgba(2,121,190,0.00) 72%);
  pointer-events: none;
}

.overview-card--compact {
  min-height: 150px;
}

.overview-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.overview-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,121,190,0.10);
  color: var(--c-primary);
  box-shadow: inset 0 0 0 1px rgba(2,121,190,0.06);
  font-size: 20px;
}

.overview-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.05);
  color: var(--c-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.overview-card h3,
.overview-card h4 {
  margin: 0;
  color: #0f172a;
}

.overview-card p {
  margin: 0;
  color: var(--c-text-muted);
  line-height: 1.6;
}

.overview-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.overview-note {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(15,23,42,0.12);
  background: rgba(248,250,252,0.92);
  color: var(--c-text-muted);
  line-height: 1.6;
}

.overview-note--warning {
  border-style: solid;
  border-color: rgba(214,158,46,0.30);
  background: linear-gradient(180deg, rgba(255,249,219,1) 0%, rgba(255,252,238,1) 100%);
  color: #8a5a00;
}

.overview-note--danger {
  border-style: solid;
  border-color: rgba(196,55,55,0.24);
  background: linear-gradient(180deg, rgba(254,242,242,1) 0%, rgba(255,247,247,1) 100%);
  color: #a02d2d;
}

.overview-note--success {
  border-style: solid;
  border-color: rgba(56,161,105,0.24);
  background: linear-gradient(180deg, rgba(236,253,243,1) 0%, rgba(247,255,251,1) 100%);
  color: #166534;
}

.overview-filter-card,
.overview-table-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 22px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.05);
  overflow: hidden;
}

.overview-filter-card {
  padding: 18px;
}

.overview-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
}

.overview-filter-actions,
.overview-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.overview-filter-actions {
  margin-top: 10px;
}

.overview-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 20px 0;
}

.overview-table-head p {
  margin: 6px 0 0;
  color: var(--c-text-muted);
}

.overview-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 240px;
  padding: 24px;
  text-align: center;
}

.overview-empty__icon {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(56,161,105,0.12);
  color: #15803d;
  font-size: 34px;
}

.overview-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.overview-mini-card {
  display: block;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--c-border);
  background: #fff;
  color: inherit;
  text-decoration: none !important;
  box-shadow: 0 10px 22px rgba(15,23,42,0.04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.overview-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15,23,42,0.08);
  border-color: rgba(2,121,190,0.18);
}

.overview-mini-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.overview-mini-card__value {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.04em;
}

.overview-mini-card__label {
  color: var(--c-text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.overview-inline-separator {
  display: inline-block;
  margin: 0 8px;
  color: var(--c-text-muted);
}

.hub-shell { display: grid; gap: 16px; }
.hub-switcher {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,250,252,.98) 100%);
  box-shadow: 0 12px 26px rgba(15,23,42,.05);
}
.hub-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none !important;
  color: var(--c-text);
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.hub-switch:hover {
  transform: translateY(-1px);
  border-color: rgba(2,121,190,.20);
  background: rgba(255,255,255,.95);
  box-shadow: 0 10px 20px rgba(15,23,42,.05);
}
.hub-switch.active {
  background: linear-gradient(180deg, rgba(2,121,190,.12) 0%, rgba(2,121,190,.08) 100%);
  border-color: rgba(2,121,190,.26);
  color: var(--c-primary-dark);
  box-shadow: 0 12px 24px rgba(2,121,190,.10);
}
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
@media (max-width: 960px) {
  .hub-grid { grid-template-columns: 1fr; }
}

.dashboard-shell { display:grid; gap:18px; }
.dashboard-hero-card {
  position:relative;
  overflow:hidden;
  border:1px solid rgba(2,121,190,0.12);
  border-radius:28px;
  padding:24px;
  background:linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(248,251,255,0.98) 54%, rgba(237,245,255,0.98) 100%);
  box-shadow:0 20px 48px rgba(15,23,42,0.08);
}
.dashboard-hero-card::after {
  content:"";
  position:absolute;
  right:-100px;
  top:-110px;
  width:280px;
  height:280px;
  border-radius:50%;
  background: radial-gradient(circle, rgba(2,121,190,0.14) 0%, rgba(2,121,190,0) 72%);
  pointer-events:none;
}
.dashboard-shortcuts {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap:12px;
  margin-top:18px;
}
.dashboard-shortcut {
  position:relative;
  z-index:1;
  display:grid;
  gap:8px;
  padding:16px 18px;
  border-radius:20px;
  border:1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.86);
  color:inherit;
  text-decoration:none !important;
  box-shadow:0 12px 24px rgba(15,23,42,0.05);
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.dashboard-shortcut:hover {
  transform:translateY(-2px);
  box-shadow:0 18px 30px rgba(15,23,42,0.09);
  border-color:rgba(2,121,190,0.18);
}
.dashboard-shortcut__top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.dashboard-shortcut__icon {
  width:44px; height:44px; border-radius:14px;
  display:inline-flex; align-items:center; justify-content:center;
  background:rgba(2,121,190,0.10); color:var(--c-primary); font-size:18px;
}
.dashboard-shortcut__title { margin:0; color:#0f172a; font-size:17px; }
.dashboard-shortcut__meta { color:var(--c-text-muted); font-size:13px; line-height:1.55; }

@media (max-width: 800px) {
  .overview-hero, .dashboard-hero-card { padding: 20px; border-radius: 22px; }
}


/* --------------------------------------------------------------------------
   17) WORKLIST / TABLE REFACTOR (phase 2)
   -------------------------------------------------------------------------- */
.workbench-shell {
  display: grid;
  gap: 18px;
}

.workbench-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(2,121,190,0.14);
  border-radius: 28px;
  padding: 24px 24px 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 54%, rgba(237,245,255,0.98) 100%);
  box-shadow: 0 20px 48px rgba(15,23,42,0.08);
}

.workbench-hero::before,
.workbench-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.workbench-hero::before {
  width: 300px;
  height: 300px;
  right: -120px;
  top: -120px;
  background: radial-gradient(circle, rgba(2,121,190,0.14) 0%, rgba(2,121,190,0.00) 72%);
}

.workbench-hero::after {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(168,194,255,0.22) 0%, rgba(168,194,255,0.00) 74%);
}

.workbench-head,
.workbench-toolbar,
.workbench-pill-row,
.workbench-action-row,
.workbench-selection-bar,
.workbench-table-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.workbench-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.workbench-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(2,121,190,0.12);
  color: var(--c-primary-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.workbench-title {
  margin: 14px 0 8px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.workbench-lead {
  max-width: 900px;
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--c-text-muted);
}

.workbench-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.78);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(15,23,42,0.04);
}

.workbench-stat-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.workbench-stat-card {
  border: 1px solid rgba(219,227,239,0.92);
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(15,23,42,0.06);
}

.workbench-stat-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.workbench-stat-value {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.workbench-stat-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-text-muted);
}

.workbench-panel,
.workbench-filter-card,
.workbench-table-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.05);
}

.workbench-panel,
.workbench-filter-card {
  padding: 18px;
}

.workbench-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
}

.workbench-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.workbench-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--c-border);
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(250,252,255,1) 100%);
}

.workbench-check input {
  margin-top: 3px;
}

.workbench-check strong {
  display: block;
  color: #0f172a;
}

.workbench-check span {
  display: block;
  color: var(--c-text-muted);
  line-height: 1.45;
}

.workbench-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 20px 0;
}

.workbench-table-head h2,
.workbench-table-head h3 {
  margin: 0;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.workbench-table-head p {
  margin: 6px 0 0;
  color: var(--c-text-muted);
  max-width: 900px;
}

.workbench-table-wrap {
  margin-top: 14px;
  overflow: auto;
  border-top: 1px solid rgba(226,232,240,0.9);
}

.workbench-table-card .table-core {
  min-width: 960px;
}

.workbench-table-card .table-core thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.workbench-selection-bar {
  justify-content: space-between;
  margin-top: 14px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(226,232,240,0.9);
}

.workbench-selection-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.workbench-selection-count {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(2,121,190,0.14);
  background: rgba(248,251,255,0.95);
  color: var(--c-primary-dark);
  font-weight: 800;
}

.workbench-note {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(15,23,42,0.12);
  background: rgba(248,250,252,0.92);
  color: var(--c-text-muted);
  line-height: 1.6;
}

.workbench-note--warning {
  border-style: solid;
  border-color: rgba(214,158,46,0.30);
  background: linear-gradient(180deg, rgba(255,249,219,1) 0%, rgba(255,252,238,1) 100%);
  color: #8a5a00;
}

.workbench-link {
  color: #0f172a;
  font-weight: 700;
  text-decoration: none !important;
}

.workbench-link:hover {
  color: var(--c-primary);
}

.workbench-subline,
.workbench-substack,
.workbench-meta {
  color: var(--c-text-muted);
  font-size: 12px;
}

.workbench-substack {
  display: grid;
  gap: 4px;
}

.workbench-row-title {
  font-weight: 700;
  color: #0f172a;
}

.workbench-table-card .table-core tbody tr:hover {
  background: linear-gradient(180deg, rgba(248,251,255,0.96) 0%, rgba(243,247,252,0.96) 100%);
}

.workbench-table-card .table-core a:hover {
  text-decoration: none;
}

.workbench-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 24px;
  text-align: center;
}

.workbench-empty__icon {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,121,190,0.12);
  color: var(--c-primary);
  font-size: 30px;
}

.workbench-table-actions {
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .workbench-hero,
  .workbench-panel,
  .workbench-filter-card {
    padding: 18px;
    border-radius: 22px;
  }

  .workbench-title {
    font-size: 28px;
  }

  .workbench-table-head {
    padding: 16px 16px 0;
  }

  .workbench-selection-bar {
    align-items: flex-start;
  }
}


/* --------------------------------------------------------------------------
   18) DETAIL PAGES REFACTOR (phase 3)
   -------------------------------------------------------------------------- */
.detail-shell {
  display: grid;
  gap: 18px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(2,121,190,0.14);
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.99) 0%, rgba(248,251,255,0.98) 54%, rgba(237,245,255,0.98) 100%);
  box-shadow: 0 20px 48px rgba(15,23,42,0.08);
}

.detail-hero::before,
.detail-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.detail-hero::before {
  width: 300px;
  height: 300px;
  right: -120px;
  top: -120px;
  background: radial-gradient(circle, rgba(2,121,190,0.14) 0%, rgba(2,121,190,0.00) 72%);
}

.detail-hero::after {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(168,194,255,0.22) 0%, rgba(168,194,255,0.00) 74%);
}

.detail-hero-head,
.detail-actions,
.detail-pill-row,
.detail-stat-grid {
  position: relative;
  z-index: 1;
}

.detail-hero-head,
.detail-actions,
.detail-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.detail-hero-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.detail-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(2,121,190,0.12);
  color: var(--c-primary-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.detail-title {
  margin: 14px 0 8px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.detail-lead {
  max-width: 980px;
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--c-text-muted);
}

.detail-actions {
  justify-content: flex-end;
}

.detail-pill-row {
  margin-top: 14px;
}

.detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.detail-stat-card {
  border: 1px solid rgba(219,227,239,0.92);
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(15,23,42,0.06);
}

.detail-stat-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.detail-stat-value {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.detail-stat-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-text-muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.detail-grid--balanced {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid--member {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
}

.detail-main,
.detail-sidebar {
  display: grid;
  gap: 16px;
}

.detail-shell .card-core,
.detail-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.05);
}

.detail-shell .card-core {
  padding: 18px;
}

.detail-shell .table-container {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(226,232,240,0.92);
}

.detail-shell .table-core thead th {
  background: linear-gradient(180deg, rgba(248,251,255,0.98) 0%, rgba(243,247,252,0.98) 100%);
}

.detail-shell .table-core tbody tr:hover {
  background: linear-gradient(180deg, rgba(248,251,255,0.96) 0%, rgba(243,247,252,0.96) 100%);
}

.detail-note {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(15,23,42,0.12);
  background: rgba(248,250,252,0.92);
  color: var(--c-text-muted);
  line-height: 1.6;
}

.detail-note--warning {
  border-style: solid;
  border-color: rgba(214,158,46,0.30);
  background: linear-gradient(180deg, rgba(255,249,219,1) 0%, rgba(255,252,238,1) 100%);
  color: #8a5a00;
}

.detail-note--danger {
  border-style: solid;
  border-color: rgba(196,55,55,0.24);
  background: linear-gradient(180deg, rgba(254,242,242,1) 0%, rgba(255,247,247,1) 100%);
  color: #a02d2d;
}

.detail-note--info {
  border-style: solid;
  border-color: rgba(2,121,190,0.22);
  background: linear-gradient(180deg, rgba(239,248,255,1) 0%, rgba(247,251,255,1) 100%);
  color: #0c4a6e;
}

.detail-note--success {
  border-style: solid;
  border-color: rgba(56,161,105,0.24);
  background: linear-gradient(180deg, rgba(236,253,243,1) 0%, rgba(247,255,251,1) 100%);
  color: #166534;
}

.detail-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.detail-section-title,
.detail-shell .card-core > h3,
.detail-shell .card-core > h2 {
  margin: 0;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.detail-inline-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--c-text-muted);
  font-size: 13px;
}

.detail-inline-meta strong {
  color: #0f172a;
}

.detail-shell .member-detail-header {
  position: relative;
  z-index: 1;
}

.detail-shell .member-detail-avatar {
  width: 82px;
  height: 82px;
  flex-basis: 82px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(232,241,250,0.98) 100%);
  border: 1px solid rgba(2,121,190,0.12);
  box-shadow: 0 12px 24px rgba(15,23,42,0.08);
}

.detail-shell .member-detail-avatar i {
  font-size: 34px;
}

@media (max-width: 1100px) {
  .detail-grid,
  .detail-grid--balanced,
  .detail-grid--member {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .detail-hero,
  .detail-shell .card-core {
    padding: 18px;
    border-radius: 22px;
  }

  .detail-title {
    font-size: 30px;
  }
}


.detail-shell--member .detail-kicker {
  margin-bottom: 12px;
}

.detail-shell--member .detail-stat-grid {
  margin-top: 0;
}

.detail-shell--member .detail-grid {
  margin-top: 8px;
}

@media (max-width: 980px) {
  .detail-shell--member .detail-kicker {
    margin-bottom: 10px;
  }

  .detail-shell--member .detail-grid {
    margin-top: 6px;
  }
}


/* --------------------------------------------------------------------------
   19) FORM PAGES REFACTOR (phase 4)
   -------------------------------------------------------------------------- */
.form-shell {
  display: grid;
  gap: 16px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 24px;
  border: 1px solid rgba(2,121,190,0.14);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.99) 0%, rgba(248,251,255,0.98) 54%, rgba(237,245,255,0.98) 100%);
  box-shadow: 0 20px 48px rgba(15,23,42,0.08);
}

.form-hero::before,
.form-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.form-hero::before {
  width: 280px;
  height: 280px;
  right: -110px;
  top: -120px;
  background: radial-gradient(circle, rgba(2,121,190,0.14) 0%, rgba(2,121,190,0.00) 72%);
}

.form-hero::after {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: -130px;
  background: radial-gradient(circle, rgba(168,194,255,0.24) 0%, rgba(168,194,255,0.00) 74%);
}

.form-hero > * {
  position: relative;
  z-index: 1;
}

.form-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(2,121,190,0.12);
  color: var(--c-primary-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.form-title {
  margin: 14px 0 8px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.04;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.form-lead {
  max-width: 920px;
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--c-text-muted);
}

.form-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.form-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.form-layout--member {
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.5fr);
}

.form-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.05);
  padding: 20px;
}

.form-card--soft {
  background: linear-gradient(180deg, rgba(248,251,255,0.98) 0%, rgba(243,247,252,0.98) 100%);
  border-color: rgba(2,121,190,0.10);
}

.form-card--sticky {
  position: sticky;
  top: 82px;
}

.form-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.form-card__title,
.form-card h2,
.form-card h3 {
  margin: 0;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.form-card__meta {
  color: var(--c-text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.form-card__meta strong {
  color: #0f172a;
}

.form-summary-list {
  display: grid;
  gap: 12px;
}

.form-summary-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(226,232,240,0.92);
  border-radius: 18px;
  background: rgba(248,251,255,0.88);
}

.form-summary-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.form-summary-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
}

.form-summary-value--mono {
  font-family: var(--f-mono);
  letter-spacing: -0.02em;
}

.form-subgrid {
  display: grid;
  gap: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.form-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,0.92);
  background: rgba(248,251,255,0.88);
}

.form-check-row label,
.form-check-row .form-check-label {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
}

.form-check-row input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

.form-divider {
  height: 1px;
  background: var(--c-border);
  margin: 2px 0;
}

.form-inline-note {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(2,121,190,0.12);
  background: linear-gradient(180deg, rgba(239,248,255,1) 0%, rgba(247,251,255,1) 100%);
  color: #0c4a6e;
  font-size: 13px;
  line-height: 1.6;
}

.form-field-errors {
  margin-top: 6px;
  color: var(--c-danger);
  font-size: 12px;
  font-weight: 700;
}

.form-field-errors .errorlist {
  margin-top: 0;
}

.form-shell .table-container {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(226,232,240,0.92);
}

.form-shell .table-core thead th {
  background: linear-gradient(180deg, rgba(248,251,255,0.98) 0%, rgba(243,247,252,0.98) 100%);
}

.form-shell .table-core tbody tr:hover {
  background: linear-gradient(180deg, rgba(248,251,255,0.96) 0%, rgba(243,247,252,0.96) 100%);
}

.form-shell--member .form-layout {
  align-items: start;
}

.form-shell--member .form-actions {
  margin-top: 2px;
}

.form-shell--compact .form-card {
  max-width: 980px;
}

.form-shell--compact .form-actions {
  padding-left: 2px;
}

.public-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px !important;
  padding: 26px !important;
  border-color: rgba(2,121,190,0.14) !important;
  background: linear-gradient(135deg, rgba(255,255,255,0.99) 0%, rgba(248,251,255,0.98) 54%, rgba(237,245,255,0.98) 100%) !important;
  box-shadow: 0 20px 48px rgba(15,23,42,0.08) !important;
}

.public-hero::before,
.public-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.public-hero::before {
  width: 280px;
  height: 280px;
  right: -120px;
  top: -120px;
  background: radial-gradient(circle, rgba(2,121,190,0.14) 0%, rgba(2,121,190,0.00) 72%);
}

.public-hero::after {
  width: 210px;
  height: 210px;
  left: -70px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(168,194,255,0.22) 0%, rgba(168,194,255,0.00) 74%);
}

.public-hero > * {
  position: relative;
  z-index: 1;
}

.public-page-title {
  margin: 10px 0 8px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.public-page-lead {
  max-width: 920px;
  margin: 0;
  color: var(--c-text-muted);
  font-size: 15px;
  line-height: 1.7;
}

.public-note--stack {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-note--stack i {
  font-size: 18px;
}

.public-card {
  border-radius: 24px !important;
  box-shadow: 0 14px 30px rgba(15,23,42,0.05) !important;
}

.public-repeat-card {
  border-radius: 18px !important;
  padding: 16px !important;
  background: linear-gradient(180deg, rgba(251,253,255,1) 0%, rgba(247,250,252,1) 100%) !important;
}

.public-actions {
  margin-top: 22px !important;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(226,232,240,0.92);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 24px rgba(15,23,42,0.05);
}

@media (max-width: 1100px) {
  .form-layout--member {
    grid-template-columns: 1fr;
  }

  .form-card--sticky {
    position: static;
  }
}

@media (max-width: 980px) {
  .form-hero,
  .form-card,
  .public-hero,
  .public-card {
    padding: 18px !important;
    border-radius: 22px !important;
  }

  .form-title,
  .public-page-title {
    font-size: 30px;
  }
}


/* --------------------------------------------------------------------------
   17) PHASE 5: MODALS / ALERTS / BADGES / FILTERS / EMPTY STATES
   -------------------------------------------------------------------------- */
.app-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.app-message {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  border-radius: 18px;
  border: 1px solid var(--c-border);
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.96) 100%);
  box-shadow: 0 12px 26px rgba(15,23,42,0.06);
}

.app-message__icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.app-message__body {
  min-width: 0;
}

.app-message__title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.app-message__text {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.app-message--success {
  border-color: rgba(56,161,105,0.28);
  background: linear-gradient(135deg, rgba(240,253,244,0.96) 0%, rgba(255,255,255,0.98) 100%);
}
.app-message--success .app-message__icon {
  background: rgba(56,161,105,0.12);
  color: var(--c-success);
}

.app-message--warning {
  border-color: rgba(214,158,46,0.3);
  background: linear-gradient(135deg, rgba(255,251,235,0.96) 0%, rgba(255,255,255,0.98) 100%);
}
.app-message--warning .app-message__icon {
  background: rgba(214,158,46,0.14);
  color: #b45309;
}

.app-message--danger {
  border-color: rgba(196,55,55,0.24);
  background: linear-gradient(135deg, rgba(254,242,242,0.96) 0%, rgba(255,255,255,0.98) 100%);
}
.app-message--danger .app-message__icon {
  background: rgba(196,55,55,0.12);
  color: var(--c-danger);
}

.app-message--info {
  border-color: rgba(2,121,190,0.18);
  background: linear-gradient(135deg, rgba(239,248,255,0.96) 0%, rgba(255,255,255,0.98) 100%);
}
.app-message--info .app-message__icon {
  background: rgba(2,121,190,0.12);
  color: var(--c-primary);
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ui-badge--info {
  background: rgba(2,121,190,0.10);
  border-color: rgba(2,121,190,0.20);
  color: var(--c-primary);
}

.ui-badge--success {
  background: rgba(56,161,105,0.10);
  border-color: rgba(56,161,105,0.20);
  color: var(--c-success);
}

.ui-badge--warning {
  background: rgba(214,158,46,0.12);
  border-color: rgba(214,158,46,0.24);
  color: #b45309;
}

.ui-badge--danger {
  background: rgba(196,55,55,0.10);
  border-color: rgba(196,55,55,0.20);
  color: var(--c-danger);
}

.ui-badge--muted {
  background: rgba(148,163,184,0.12);
  border-color: rgba(148,163,184,0.24);
  color: #64748b;
}

.ui-filter-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid #dbe3ef;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 56%, #eef5ff 100%);
  box-shadow: 0 18px 42px rgba(15,23,42,0.08);
}

.ui-filter-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  inset: auto -80px -90px auto;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(2,121,190,0.10) 0%, rgba(2,121,190,0) 70%);
  pointer-events: none;
}

.ui-filter-card__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ui-filter-card__title {
  margin: 0;
  font-size: 22px;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.ui-filter-card__meta {
  margin-top: 8px;
  max-width: 820px;
  color: #64748b;
  font-size: 14px;
}

.ui-filter-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px;
  align-items: end;
}

.ui-filter-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ui-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ui-filter-selection {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148,163,184,0.18);
}

.ui-empty {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
  border-radius: 20px;
  border: 1px dashed #cbd5e1;
  background: linear-gradient(135deg, rgba(248,250,252,0.98) 0%, rgba(255,255,255,0.98) 100%);
}

.ui-empty--compact {
  padding: 18px;
  gap: 14px;
}

.ui-empty__icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,121,190,0.10);
  color: var(--c-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.ui-empty__icon i {
  font-size: 22px;
  line-height: 1;
}

.ui-empty__body {
  min-width: 0;
}

.ui-empty__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.ui-empty__text {
  margin-top: 6px;
  color: #64748b;
  line-height: 1.55;
}

.ui-empty__actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ui-table-empty-cell {
  padding: 18px !important;
  background: rgba(248,250,252,0.7);
}

.ui-modal-panel .modal-core__backdrop {
  background: rgba(15,23,42,0.46);
  backdrop-filter: blur(6px);
}

.ui-modal-panel .modal-core__dialog {
  border-radius: 22px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15,23,42,0.28);
}

.ui-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(248,251,255,1) 100%);
}

.ui-modal__title-wrap h2 {
  margin: 0;
  color: #0f172a;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.ui-modal__meta {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.ui-modal__body {
  padding: 18px 20px;
}

.ui-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.ui-modal__close {
  box-shadow: none;
}

.ui-soft-note {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.22);
  background: rgba(248,250,252,0.92);
  color: #475569;
}

.ui-soft-note strong {
  color: #0f172a;
}

@media (max-width: 900px) {
  .ui-empty {
    padding: 18px;
  }

  .ui-filter-card {
    padding: 16px;
    border-radius: 18px;
  }

  .ui-modal__header,
  .ui-modal__body,
  .ui-modal__footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}


/* --------------------------------------------------------------------------
   21) UX FIXES – spacing + no horizontal scroll
   -------------------------------------------------------------------------- */
.detail-grid--member {
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 1fr);
}

.detail-shell--member .detail-stat-grid {
  margin-top: 16px;
}

.detail-shell--member .detail-grid {
  margin-top: 24px;
}

.overview-actions {
  margin-top: 14px;
}

.overview-mini-grid {
  margin-top: 18px;
}

.workbench-table-wrap--no-scroll {
  overflow: visible;
}

.invoice-compact-table {
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
}

.invoice-compact-table thead th {
  padding: 10px 10px;
  font-size: 10px;
}

.invoice-compact-table tbody td {
  padding: 12px 10px;
  vertical-align: top;
  word-break: break-word;
}

.invoice-compact-table .col-select { width: 44px; }
.invoice-compact-table .col-doc { width: 18%; }
.invoice-compact-table .col-payer { width: 24%; }
.invoice-compact-table .col-dates { width: 13%; }
.invoice-compact-table .col-state { width: 13%; }
.invoice-compact-table .col-payment { width: 14%; }
.invoice-compact-table .col-sum { width: 8%; }
.invoice-compact-table .col-actions { width: 10%; }

.invoice-cell-stack {
  display: grid;
  gap: 4px;
}

.invoice-cell-title {
  font-weight: 700;
  color: #0f172a;
}

.invoice-cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.invoice-compact-table .help-text {
  font-size: 12px;
  line-height: 1.4;
}

.invoice-compact-table .btn.btn-sm {
  padding: 6px 10px;
}

.pw-table-compact {
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.pw-table-compact thead th {
  background: transparent;
  border-bottom: 0;
  padding: 0 12px 4px;
}

.pw-table-compact tbody td {
  vertical-align: top;
  padding: 14px 12px;
  background: #ffffff;
  border-top: 1px solid #dbe3ef;
  border-bottom: 1px solid #dbe3ef;
  word-break: break-word;
}

.pw-table-compact tbody td:first-child {
  border-left: 1px solid #dbe3ef;
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.pw-table-compact tbody td:last-child {
  border-right: 1px solid #dbe3ef;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.pw-table-compact tbody tr:hover td {
  background: linear-gradient(180deg, rgba(248,251,255,0.98) 0%, rgba(243,247,252,0.98) 100%);
}

.pw-table-compact .col-select { width: 52px; }
.pw-table-compact .col-member { width: 22%; }
.pw-table-compact .col-login { width: 16%; }
.pw-table-compact .col-status { width: 22%; }
.pw-table-compact .col-reason { width: 24%; }
.pw-table-compact .col-action { width: 16%; }

.pw-cell-stack {
  display: grid;
  gap: 5px;
}

.pw-cell-title {
  font-weight: 700;
  color: #0f172a;
}

.pw-help-tight {
  font-size: 12px;
  color: var(--c-text-muted);
  line-height: 1.4;
}

@media (max-width: 1280px) {
  .detail-grid--member {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.95fr);
  }

  .invoice-compact-table,
  .pw-table-compact {
    table-layout: auto;
  }
}
