:root {
  --bg: #eef4fb;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --line: rgba(22, 50, 79, 0.12);
  --line-strong: rgba(22, 50, 79, 0.2);
  --text: #16324f;
  --muted: rgba(22, 50, 79, 0.7);
  --brand: #1f6eb5;
  --accent: #1ea7a1;
  --ok: #177a52;
  --warn: #8a630f;
  --bad: #a22a45;
  --shadow-soft: 0 12px 26px rgba(17, 36, 61, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  background:
    radial-gradient(circle at top left, rgba(30, 167, 161, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(76, 132, 255, 0.12), transparent 24%),
    var(--bg);
  color: var(--text);
}
body.theme-dark {
  --bg: #0d1724;
  --panel: rgba(18, 30, 46, 0.88);
  --panel-strong: #122131;
  --line: rgba(159, 185, 214, 0.24);
  --line-strong: rgba(159, 185, 214, 0.34);
  --text: #edf4fb;
  --muted: rgba(237, 244, 251, 0.74);
  --brand: #2a79b5;
  --ok: #42c790;
  --warn: #d7a349;
  --bad: #e16886;
  --shadow-soft: 0 16px 34px rgba(0, 0, 0, 0.34);
}
body.theme-dark .sidebar { background: linear-gradient(180deg, #08111d 0%, #102236 100%); }
body.theme-dark .row { background: rgba(245, 250, 255, 0.08); }
body.theme-dark .row:hover { background: rgba(245, 250, 255, 0.12); }
body.theme-dark .row.active { background: rgba(31, 102, 164, 0.26); border-color: #4f93cf; }
body.theme-dark .settings-table-row { background: rgba(245, 250, 255, 0.08); border-color: rgba(159, 185, 214, 0.24); }
body.theme-dark .settings-table-head { color: rgba(237, 244, 251, 0.74); }
body.theme-dark .settings-system-field select {
  background: rgba(245, 250, 255, 0.08);
  border-color: rgba(159, 185, 214, 0.24);
  color: var(--text);
}
body.theme-dark .b-warn { color: #f1c56d; border-color: #a57a2c; background: rgba(165, 122, 44, 0.2); }
body.theme-dark .b-info { color: #74b7ff; border-color: #3f7cb7; background: rgba(63, 124, 183, 0.2); }
body.theme-dark .b-bad { color: #ff9ab1; border-color: #b94b69; background: rgba(185, 75, 105, 0.22); }
body.theme-dark .b-ok { color: #72deb0; border-color: #3d966f; background: rgba(61, 150, 111, 0.2); }
body.theme-dark .icon-button,
body.theme-dark .user-chip,
body.theme-dark .settings-entry,
body.theme-dark .notifications-panel {
  background: rgba(245, 250, 255, 0.08);
  border-color: rgba(159, 185, 214, 0.24);
  color: var(--text);
}
body.theme-dark .settings-entry:hover { background: rgba(245, 250, 255, 0.14); }
body.theme-dark .settings-accordion-panel {
  background: rgba(245, 250, 255, 0.06);
  border-color: rgba(159, 185, 214, 0.24);
}
body.theme-dark .dashboard-inactive-tray,
body.theme-dark .dashboard-inactive-card {
  background: rgba(19, 31, 46, 0.96);
  border-color: rgba(159, 185, 214, 0.22);
  color: var(--text);
}
body.theme-dark .topbar-search {
  background: rgba(245, 250, 255, 0.08);
  border-color: rgba(159, 185, 214, 0.24);
}
body.theme-dark .topbar-search-icon,
body.theme-dark #globalSearch,
body.theme-dark .notif-icon { color: #edf4fb; }
body.theme-dark .crumb-home {
  background: rgba(245, 250, 255, 0.14);
  border-color: rgba(159, 185, 214, 0.3);
  color: #edf4fb;
}
body.theme-dark .breadcrumb strong { color: #edf4fb; }
body.theme-dark .user-panel {
  background: #132233;
  border-color: rgba(159, 185, 214, 0.2);
}
body.theme-dark .user-panel .settings-entry {
  background: rgba(34, 50, 70, 0.98);
  border-color: rgba(159, 185, 214, 0.24);
}
body.theme-dark .user-panel .settings-entry:hover {
  background: rgba(44, 64, 88, 0.98);
}
body.theme-dark .notification-card {
  background: rgba(32, 46, 63, 0.96);
  border-color: rgba(159, 185, 214, 0.18);
  color: #edf4fb;
}
body.theme-dark .notification-card:hover {
  background: rgba(40, 58, 78, 0.98);
  border-color: rgba(159, 185, 214, 0.28);
}
body.theme-dark .notification-card p {
  color: rgba(237, 244, 251, 0.76);
}
body.theme-dark .notification-card.info {
  border-color: rgba(71, 183, 255, 0.24);
}
body.theme-dark .notification-card.warning {
  border-color: rgba(215, 163, 73, 0.26);
}
body.theme-dark .notification-card.critical {
  border-color: rgba(225, 104, 134, 0.28);
  background: rgba(77, 28, 44, 0.88);
}
body.theme-dark .notification-state {
  background: rgba(71, 200, 194, 0.16);
  color: #dcfffb;
}
body.theme-dark .notification-state.is-muted {
  background: rgba(245, 250, 255, 0.08);
  color: rgba(237, 244, 251, 0.76);
}
body.theme-dark .dashboard-mini-action {
  background: rgba(245, 250, 255, 0.08);
  border-color: rgba(159, 185, 214, 0.24);
  color: #edf4fb;
}
body.theme-dark .dashboard-mini-action:hover {
  background: rgba(245, 250, 255, 0.14);
  border-color: rgba(159, 185, 214, 0.32);
}
body.theme-dark .meta,
body.theme-dark .meta.copyable {
  background: rgba(245, 250, 255, 0.08);
  border-color: rgba(159, 185, 214, 0.24);
  color: var(--text);
}
body.theme-dark .meta strong { color: #edf4fb; }
.hidden { display: none !important; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 10px; }
.error { color: var(--bad); min-height: 18px; margin: 0; font-size: 12px; }
input, select, button, textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; min-height: 36px; padding: 0 10px; }
textarea { min-height: 70px; padding: 8px 10px; }
button { cursor: pointer; background: var(--brand); border-color: var(--brand); color: white; font-weight: 600; }
button.ghost { background: var(--panel); color: var(--text); }
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  transition: grid-template-columns .18s ease;
}
.sidebar {
  background: linear-gradient(180deg, #10253b 0%, #17334f 100%);
  color: #eaf4ff;
  border-right: 1px solid rgba(173, 199, 224, 0.22);
  padding: 12px;
  overflow: auto;
  z-index: 20;
  transition: width .18s ease, padding .18s ease, border-right-width .18s ease, opacity .18s ease, transform .15s linear;
  min-width: 0;
}
.app.sidebar-collapsed { grid-template-columns: 0 1fr; }
.app.sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.brand { font-weight: 800; margin-bottom: 12px; }
.group { margin-bottom: 10px; }
.group-head { width: 100%; display: flex; align-items: center; justify-content: space-between; background: transparent; border: 0; color: #e6f0fa; padding: 4px 0; min-height: 28px; }
.group h4 { margin: 0; font-size: 12px; opacity: .8; text-transform: uppercase; }
.group-body { display: none; margin-top: 6px; }
.group.open .group-body { display: block; }
.nav-btn {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  color: #eaf4ff;
  border: 1px solid rgba(173, 199, 224, 0.24);
  margin-bottom: 6px;
}
.nav-btn.active {
  background: linear-gradient(135deg, #245482 0%, #2e669d 100%);
  border-color: rgba(173, 199, 224, 0.42);
  box-shadow: inset 0 0 0 1px rgba(210, 231, 249, 0.46);
}
.nav-empty { display: block; padding: 8px 2px; color: #adc7e0; }
.main { min-width: 0; display: grid; grid-template-rows: auto auto 1fr; }
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--line);
  padding: 12px 12px;
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: 0 6px 20px rgba(11, 34, 56, 0.05);
}
.topbar-left { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h2 { margin: 0; font-size: 1.1rem; letter-spacing: -0.01em; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar-actions { display: inline-flex; align-items: center; gap: 8px; }
.icon-button {
  min-width: 42px;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu-toggle { font-size: 18px; }
.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 10px;
  min-height: 42px;
  background: var(--panel-strong);
  width: min(420px, 38vw);
}
.topbar-search-icon { color: var(--muted); font-size: 16px; }
#globalSearch {
  border: 0;
  background: transparent;
  outline: 0;
  min-height: 38px;
  width: 100%;
  padding: 0;
  color: var(--text);
}
.notif-btn { position: relative; }
.notif-icon { width: 19px; height: 19px; display: inline-flex; color: var(--text); }
.notif-icon svg { width: 100%; height: 100%; }
.notif-count {
  position: absolute;
  top: 4px;
  right: 3px;
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #d85773;
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 0 5px;
  border: 1px solid rgba(255,255,255,.8);
}
.breadcrumb { display: flex; gap: 8px; align-items: center; padding: 8px 10px; color: var(--muted); font-size: 14px; }
.crumb-home { cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: #fff; color: var(--text); font-weight: 700; opacity: 1; }
.breadcrumb strong { color: var(--text); }
.notifications-panel {
  position: fixed;
  top: 92px;
  right: 20px;
  width: min(420px, calc(100vw - 40px));
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 34;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(12,34,58,.24);
  display: grid;
  gap: 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}
.notifications-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 16px; padding: 6px 10px;
  background: #f6fbff; min-height: 42px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #2e6fb5; color: #fff; font-weight: 700; font-size: 12px;
}
.user-meta { display: inline-flex; flex-direction: column; line-height: 1.05; }
.user-meta strong { font-size: 14px; }
.user-meta small { font-size: 12px; color: var(--muted); }
.user-panel {
  position: fixed;
  inset: 18px 18px 18px auto;
  width: min(390px, calc(100vw - 36px));
  height: calc(100vh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 36;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(12,34,58,.24);
  transform: translateX(calc(100% + 24px));
  transition: transform 220ms ease;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.action-required {
  border-color: #e59fb1 !important;
  background: #fceef2 !important;
}
.action-required strong { color: #a22a45; }
.action-required small { color: #7d3c4e; }
.user-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.user-panel::-webkit-scrollbar { width: 10px; }
.user-panel::-webkit-scrollbar-track { background: transparent; }
.user-panel::-webkit-scrollbar-thumb {
  background: rgba(120, 147, 179, 0.4);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.user-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 10px;
}
.user-panel-header h3 { margin: 2px 0 0; }
.settings-entry-list { display: grid; gap: 8px; }
.settings-entry {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 14px 16px;
  display: grid;
  gap: 2px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.settings-entry-copy { display: grid; gap: 2px; min-width: 0; }
.settings-accordion { display: grid; gap: 8px; }
.settings-accordion-item { display: grid; gap: 8px; }
.settings-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.settings-accordion-icon {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.settings-accordion-icon-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.settings-accordion-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: color-mix(in srgb, var(--panel-strong) 92%, white);
}
.settings-entry strong { color: var(--text); font-size: 15px; }
.settings-entry span { color: var(--muted); font-size: 13px; }
.settings-entry:hover { background: #eef5fd; border-color: #9dbde1; transform: translateY(-1px); }
.settings-entry.is-active {
  border-color: #6ea9e6;
  background: #eaf4ff;
  box-shadow: inset 0 0 0 1px rgba(46, 111, 181, 0.28);
}
.view { padding: 12px; min-height: 0; }
.grid { display: grid; gap: 10px; }
.grid.kpi { grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
}
.kpi strong { font-size: 28px; display: block; }
.workspace { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,0.95fr); gap: 14px; align-items: start; }
.list-head { display: grid; grid-template-columns: 1.4fr 1fr 1fr 150px; gap: 8px; font-size: 12px; color: var(--muted); margin: 6px 0; }
.rows { display: grid; gap: 8px; max-height: calc(100vh - 240px); overflow: auto; }
.row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 150px;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.row:hover {
  background: #f4f9ff;
  border-color: rgba(38, 98, 156, 0.3);
  transform: translateY(-1px);
}
.row.active {
  border-color: #2c6eb7;
  background: #e9f3ff;
  box-shadow: 0 0 0 2px rgba(31, 110, 181, 0.2) inset;
}
.row small { color: var(--muted); display: block; }
.progress-inline {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}
.progress-inline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(22, 50, 79, 0.12);
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1ea7a1 0%, #2c6eb7 100%);
}
.badge { display: inline-block; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 700; padding: 5px 11px; text-align: center; }
.b-ok { background: #dff6eb; color: var(--ok); border-color: #9bd3b8; }
.b-warn { background: #faecd0; color: #8c5d09; border-color: #ebc985; }
.b-bad { background: #f9e0e7; color: var(--bad); border-color: #e59fb1; }
.b-info { background: #dceafa; color: #1c5ea1; border-color: #9ec0ea; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-bottom: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meta {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--panel-strong);
  color: var(--text);
  text-align: left;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
}
button.meta,
button.meta.copyable {
  background: var(--panel-strong) !important;
  color: var(--text) !important;
}
.meta small { color: var(--muted); display: block; }
.meta strong {
  display: block;
  color: var(--text);
  line-height: 1.25;
  word-break: break-word;
}
.meta.copyable { cursor: pointer; text-align: left; background: #fff; }
.meta.copyable .copy { float: right; opacity: .6; font-size: 12px; }
.meta.copyable.copied { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31,110,181,.14) inset; }
.meta:active { transform: none; }

/* Keep details readable in dark mode (must come after .meta/.meta.copyable rules). */
body.theme-dark .meta,
body.theme-dark .meta.copyable {
  background: rgba(245, 250, 255, 0.1) !important;
  border-color: rgba(159, 185, 214, 0.32);
  color: #edf4fb !important;
}
body.theme-dark .progress-track {
  background: rgba(245, 250, 255, 0.12);
}
body.theme-dark .meta small {
  color: rgba(237, 244, 251, 0.82);
}
body.theme-dark .meta strong {
  color: #f8fbff !important;
}
.actions { display: grid; gap: 8px; margin-top: 8px; }
.detail-section { margin-top: 8px; }
.detail-section h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.rows.slim { max-height: 240px; }
.status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.reference-progress-summary { margin-bottom: 10px; }
.reference-lines { display: grid; gap: 8px; }
.reference-line-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.reference-line-main,
.reference-line-progress {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.reference-line-main strong { line-height: 1.2; }
.reference-line-main small,
.reference-line-progress small { color: var(--muted); line-height: 1.25; }
.reference-line-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.reference-links {
  display: grid;
  gap: 8px;
}
.reference-link {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
}
.reference-link small {
  display: block;
  color: var(--muted);
}
.reference-link strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
}
.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.media-preview-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  overflow: hidden;
  display: grid;
}
.media-preview-frame {
  background: rgba(15, 35, 56, 0.06);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.media-preview-frame img,
.media-preview-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.media-preview-copy {
  display: grid;
  gap: 4px;
  padding: 10px;
}
.media-preview-copy strong { line-height: 1.2; }
.media-preview-copy small {
  color: var(--muted);
  line-height: 1.35;
}
.media-preview-link {
  display: inline-flex;
  align-items: center;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  margin-top: 2px;
}
.media-preview-link:hover { text-decoration: underline; }
.inline { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.log-list { max-height: 220px; overflow: auto; display: grid; gap: 6px; }
.log-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.muted { color: var(--muted); }
.settings-controls { display: inline-flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.active-tab { border-color: #7ca8d8 !important; background: #eaf4ff !important; color: #1f4f82 !important; }
.settings-panel { border-radius: 16px; }
.settings-panel-core { margin-bottom: 0; }
.settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.settings-panel-head h4 {
  margin: 4px 0;
  font-size: 1.05rem;
}
.settings-account-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: 12px; }
.settings-users-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr); gap: 12px; }
.settings-system-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; align-items: start; }
.settings-system-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 4px;
}
.settings-system-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.settings-system-shortcuts {
  grid-template-columns: 1fr;
}
.settings-system-shortcuts .settings-entry { min-height: 70px; }
.settings-system-detail { display: grid; gap: 8px; }
.settings-system-detail .card { margin: 0; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.settings-table-wrap { display: grid; gap: 8px; }
.settings-table-head {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.settings-table-body { display: grid; gap: 6px; }
.settings-table-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
  align-items: center;
}
.settings-table-row span { min-width: 0; }
.settings-table-row strong { display: block; line-height: 1.2; }
.settings-table-row small { display: block; color: var(--muted); line-height: 1.2; }
.settings-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.tiny-btn {
  min-height: 28px;
  border-radius: 9px;
  font-size: 12px;
  padding: 0 8px;
}
.settings-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.settings-form-span2 { grid-column: span 2; }
.settings-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.settings-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  padding: 4px 10px;
  min-height: 30px;
  font-size: 13px;
}
.settings-chip input { min-height: auto; }
.settings-system-field select {
  background: var(--panel-strong);
  color: var(--text);
}
.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}
.dashboard-config-footer {
  position: fixed;
  left: 72px;
  bottom: 18px;
  z-index: 26;
  display: flex;
  justify-content: flex-start;
}
body.theme-dark .media-preview-card {
  background: rgba(245, 250, 255, 0.06);
  border-color: rgba(159, 185, 214, 0.22);
}
body.theme-dark .media-preview-frame {
  background: rgba(245, 250, 255, 0.08);
}
body.theme-dark .media-preview-link {
  color: #80beff;
}
.dashboard-tiles-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.dashboard-tile { min-height: 130px; }
.dashboard-tile.is-clickable { cursor: pointer; }
.dashboard-tile.is-clickable:hover {
  border-color: rgba(46, 111, 181, 0.46);
  box-shadow: 0 0 0 1px rgba(46, 111, 181, 0.2) inset, var(--shadow-soft);
}
.dashboard-tile.tile-s { grid-column: span 3; }
.dashboard-tile.tile-m { grid-column: span 4; }
.dashboard-tile.tile-l { grid-column: span 6; }
.tile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tile-drag { cursor: grab; background: #f4f8fc; color: var(--muted); border: 1px solid var(--line); min-height: 28px; padding: 0 8px; }
.dashboard-tile.is-dragging { opacity: .6; }
.tile-actions { display: flex; gap: 4px; }
.tile-size-btn { min-height: 28px; padding: 0 8px; }
.tile-size-btn.active { border-color: var(--brand); color: var(--brand); }
.ghost-button {
  background: var(--panel-strong);
  color: var(--text);
  border: 1px solid var(--line);
}
.panel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}
.dashboard-inactive-tray {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 90px;
}
.dashboard-workspace:not(.is-editing) .dashboard-inactive-tray { display: none !important; }
.dashboard-inactive-tray.is-open {
  display: block;
}
body.user-panel-open .dashboard-inactive-tray,
body.user-panel-open .floating-config-btn,
body.user-panel-open .dashboard-config-footer,
body.notifications-open .dashboard-inactive-tray,
body.notifications-open .floating-config-btn,
body.notifications-open .dashboard-config-footer {
  display: none !important;
}
.dashboard-inactive-tray-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.dashboard-inactive-tray-actions { display: inline-flex; align-items: center; gap: 6px; }
.dashboard-inactive-tray-copy { margin: 8px 0; color: var(--muted); font-size: 12px; }
.dashboard-inactive-list { display: grid; gap: 8px; }
.dashboard-inactive-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
}
.dashboard-inactive-card strong,
.dashboard-inactive-card span { display: block; }
.dashboard-inactive-card span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.shortcut-list { display: grid; gap: 6px; margin-top: 6px; }
.shortcut-btn { width: 100%; text-align: left; }
.mini-list { display: grid; gap: 6px; margin-top: 6px; max-height: 220px; overflow: auto; }
.mini-row { border: 1px solid var(--line); border-radius: 9px; padding: 6px; }
.dashboard-mini-action {
  width: 100%;
  text-align: left;
  background: color-mix(in srgb, var(--panel-strong) 88%, white);
  color: var(--text);
}
.dashboard-mini-action:hover {
  border-color: rgba(46, 111, 181, 0.3);
  background: #f5f9ff;
}
.mini-row strong { display: block; font-size: 13px; }
.mini-row small { display: block; color: var(--muted); }
.dashboard-tile-data-list { display: grid; gap: 8px; margin-top: 8px; }
.dashboard-tile-data-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-strong) 90%, white);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.dashboard-tile-data-copy { min-width: 0; display: grid; gap: 2px; }
.dashboard-tile-data-copy strong { font-size: 14px; line-height: 1.2; }
.dashboard-tile-data-copy small { color: var(--muted); font-size: 12px; line-height: 1.2; }
.dashboard-tile-data-value {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
body.theme-dark .dashboard-tile-data-row {
  background: rgba(245, 250, 255, 0.08);
  border-color: rgba(159, 185, 214, 0.24);
}
body.theme-dark .reference-line-card,
body.theme-dark .reference-link {
  background: rgba(245, 250, 255, 0.08);
  border-color: rgba(159, 185, 214, 0.24);
}
body.theme-dark .dashboard-tile-data-value {
  border-color: rgba(159, 185, 214, 0.32);
  background: rgba(245, 250, 255, 0.08);
  color: #edf4fb;
}
.notifications-panel .mini-row {
  background: color-mix(in srgb, var(--panel-strong) 88%, white);
}
.notification-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.notification-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.notification-card:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 111, 181, 0.3);
  background: #f5f9ff;
}
.notification-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.notification-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.notification-card.warning { border-color: rgba(217, 122, 29, 0.26); }
.notification-card.critical { border-color: rgba(189, 54, 54, 0.26); background: rgba(255, 243, 243, 0.96); }
.notification-card.info { border-color: rgba(51, 143, 187, 0.22); }
.notification-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(30, 167, 161, 0.12);
  color: #126761;
  font-size: 11px;
  font-weight: 800;
}
.notification-state.is-muted {
  margin-top: 10px;
  background: rgba(22, 50, 79, 0.08);
  color: var(--muted);
}
.floating-config-btn {
  position: fixed; left: 14px; bottom: 14px; width: 48px; height: 48px;
  border-radius: 14px; z-index: 26; font-size: 20px;
  background: linear-gradient(135deg, #e8f2ff 0%, #cfe3fb 100%);
  color: #14365a;
  border: 1px solid #95b6dd;
  box-shadow: 0 10px 26px rgba(24, 67, 109, 0.2);
}
.floating-config-btn:focus-visible {
  outline: 2px solid #2e6fb5;
  outline-offset: 2px;
}
.dashboard-config-panel {
  position: fixed; right: 12px; top: 72px; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 84px);
  overflow: auto; background: var(--panel-strong); border: 1px solid var(--line); border-radius: 14px; padding: 12px; z-index: 25;
  box-shadow: 0 12px 40px rgba(11,31,52,.2);
}
.config-list { display: grid; gap: 8px; margin: 10px 0; }
.config-row {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 8px;
}
.config-row label { display: flex; gap: 8px; align-items: center; font-weight: 600; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); z-index: 30; transform: translateX(-105%); transition: transform .15s linear; box-shadow: 8px 0 24px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .workspace,
  .dashboard-workspace,
  .settings-account-layout,
  .settings-users-layout,
  .settings-system-layout { grid-template-columns: 1fr; }
  .list-head, .row { grid-template-columns: 1fr; }
  .row { gap: 4px; padding: 7px; }
  .row strong { font-size: 20px; line-height: 1.15; }
  .row small { font-size: 13px; line-height: 1.2; }
  .filters { grid-template-columns: 1fr 1fr; }
  .settings-table-head,
  .settings-table-row { grid-template-columns: 1fr; }
  .settings-inline-actions { justify-content: flex-start; }
  .settings-kpi-grid { grid-template-columns: 1fr 1fr; }
  .settings-form-grid { grid-template-columns: 1fr 1fr; }
  .settings-system-controls { grid-template-columns: 1fr 1fr; }
  .settings-system-shortcuts { grid-template-columns: 1fr; }
  .settings-form-span2 { grid-column: span 2; }
  .dashboard-config-panel { top: 64px; right: 8px; width: calc(100vw - 16px); }
  .notifications-panel { top: 136px; right: 8px; width: calc(100vw - 16px); }
  .user-panel { inset: 136px 8px 8px 8px; width: auto; height: auto; }
  .reference-line-card { grid-template-columns: 1fr; }
  .reference-line-actions { justify-content: flex-start; }
  .media-preview-grid { grid-template-columns: 1fr; }
  .dashboard-tiles-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dashboard-tile.tile-s { grid-column: span 3; }
  .dashboard-tile.tile-m { grid-column: span 3; }
  .dashboard-tile.tile-l { grid-column: span 6; }
}
@media (max-width: 700px) {
  .filters, .detail-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar-left { width: 100%; }
  .topbar-search { width: 100%; order: 3; }
  #globalSearch { width: 100%; min-height: 42px; font-size: 17px; }
  .topbar button, .topbar input, .topbar select { min-height: 42px; }
  .topbar-actions { margin-left: auto; }
  .user-chip { width: auto; justify-content: flex-start; }
  .badge { font-size: 13px; padding: 5px 10px; }
  .status-stack { align-items: stretch; }
  .floating-config-btn { left: 10px; bottom: 10px; }
  .dashboard-config-footer { left: 66px; bottom: 12px; }
  .settings-kpi-grid { grid-template-columns: 1fr; }
  .settings-form-grid { grid-template-columns: 1fr; }
  .settings-system-controls { grid-template-columns: 1fr; }
  .settings-form-span2 { grid-column: span 1; }
  .dashboard-tiles-grid { grid-template-columns: 1fr; }
  .dashboard-tile.tile-s,
  .dashboard-tile.tile-m,
  .dashboard-tile.tile-l { grid-column: span 1; }
  .notification-card-top { align-items: flex-start; flex-direction: column; }
}
