/* Meta - JATS · Metabiblioteca Official Brand Design System
 * Exact Brand Swatches from Metabiblioteca Logo:
 *   - Brand Blue:  #6888C4 (Deep: #273A63, Action: #4B6BA8, Soft: #EEF3FB)
 *   - Brand Teal:  #50C4CC (Action: #2E9FA8, Soft: #E7F8F9)
 */
:root {
  --mb-blue: #6888c4;
  --mb-blue-action: #4b6ba8;
  --mb-blue-deep: #273a63;
  --mb-blue-soft: #eef3fb;
  --mb-teal: #50c4cc;
  --mb-teal-dark: #2d9ea7;
  --mb-teal-soft: #e6f8f9;
  --mb-grad: linear-gradient(135deg, #4b6ba8 0%, #6888c4 52%, #50c4cc 100%);
  --mb-grad-subtle: linear-gradient(135deg, #eef3fb 0%, #e6f8f9 100%);

  --bg: #f4f7fb;
  --surface: #ffffff;
  --primary: #4b6ba8;
  --primary-dark: #3a568e;
  --primary-soft: #eef3fb;
  --success: #0d9488;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --text: #18253d;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(39, 58, 99, 0.06), 0 1px 2px rgba(39, 58, 99, 0.04);
  --shadow-md: 0 8px 24px rgba(39, 58, 99, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Login Screen ---- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--mb-blue-deep);
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: 16px;
  padding: 32px 30px 26px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
}

.login-brand-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}

.login-logo {
  max-width: 215px;
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.product-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--mb-blue-soft);
  color: var(--mb-blue-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--mb-teal);
  box-shadow: 0 0 0 3px rgba(80, 196, 204, 0.28);
  display: inline-block;
  flex-shrink: 0;
}

.login-subtitle {
  margin: 7px 0 0;
  font-size: 12.2px;
  color: var(--muted);
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  margin-bottom: 16px;
}

.login-tab {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.login-tab.active {
  background: #ffffff;
  color: var(--mb-blue-deep);
  box-shadow: 0 1px 4px rgba(39, 58, 99, 0.12);
}

.login-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.login-foot a { color: var(--mb-blue-action); text-decoration: none; font-weight: 600; }
.login-foot a:hover { text-decoration: underline; }

/* ---- App Shell & Refined Light Metabiblioteca Sidebar ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 266px;
  background: #ffffff;
  border-right: 1px solid #e2e8f2;
  color: var(--text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 2px 0 12px rgba(39, 58, 99, 0.03);
  z-index: 30;
}

.sidebar-brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf1f7;
  background: #ffffff;
}

.sidebar-logo-link {
  display: block;
  text-decoration: none;
  margin-bottom: 12px;
}

.sidebar-logo {
  max-width: 174px;
  width: 100%;
  height: auto;
  display: block;
}

.sidebar-product-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--mb-blue-soft);
}

.sidebar-product-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--mb-blue-deep);
  letter-spacing: -0.01em;
}

.sidebar-version {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--mb-teal-dark);
  background: #ffffff;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(80, 196, 204, 0.35);
}

.sidebar-nav {
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 12px 10px 4px;
}

.nav-group-label:first-child {
  padding-top: 2px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #475569;
  text-decoration: none;
  font-size: 13.2px;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease, transform 0.12s ease;
}

.nav-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #7c93b8;
  transition: color 0.14s ease;
}

.nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.nav-item:hover {
  background: #f4f8fc;
  color: var(--mb-blue-deep);
}

.nav-item:hover .nav-svg {
  color: var(--mb-blue-action);
}

.nav-item.active {
  background: var(--mb-blue-soft);
  color: var(--mb-blue-deep);
  font-weight: 700;
}

.nav-item.active .nav-svg {
  color: var(--mb-blue-action);
}

.nav-item.active .nav-count {
  background: var(--mb-blue-action);
  color: #ffffff;
}

.nav-item-subtle {
  color: #64748b;
  font-size: 12.5px;
}

.sidebar-footer {
  padding: 10px 12px 14px;
  border-top: 1px solid #edf1f7;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafcfe;
}

.actor-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f2;
  border-radius: 10px;
}

.actor-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.actor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--mb-blue-action);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.actor-meta {
  min-width: 0;
}

.actor-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mb-blue-deep);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actor-role {
  font-size: 10.8px;
  color: var(--muted);
}

.btn-icon-logout {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.btn-icon-logout:hover {
  background: var(--danger-soft);
  border-color: #fca5a5;
  color: var(--danger);
}

/* ---- Main Topbar & Content ---- */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f2;
  padding: 13px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-crumb {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.topbar-crumb span { margin: 0 4px; color: #cbd5e1; }
.topbar-crumb strong { color: var(--mb-teal-dark); font-weight: 700; }

.topbar h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--mb-blue-deep);
  letter-spacing: -0.015em;
}

.topbar-sub { font-size: 12.2px; color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.content {
  padding: 22px 28px 44px;
  max-width: 1400px;
  width: 100%;
}

/* ---- Cards, Grids & KPIs ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid #e2e8f2;
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 25px;
  font-weight: 800;
  color: var(--mb-blue-deep);
  margin-top: 6px;
  line-height: 1.15;
}

.kpi-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.card {
  background: var(--surface);
  border: 1px solid #e2e8f2;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--mb-blue-deep);
}

/* ---- Buttons & Forms ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #cfd9e8;
  background: #ffffff;
  color: var(--mb-blue-deep);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s ease;
}

.btn:hover { background: #f4f8fc; border-color: var(--mb-blue); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 10px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--mb-blue-action);
  border-color: var(--mb-blue-action);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
}

.btn-success {
  background: var(--mb-teal-dark);
  border-color: var(--mb-teal-dark);
  color: #ffffff;
}
.btn-success:hover { background: #248890; border-color: #248890; }

.btn-danger { background: #fff; border-color: #fca5a5; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #f87171; }

.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: var(--text);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--mb-blue);
  box-shadow: 0 0 0 3px rgba(80, 196, 204, 0.22);
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.filter-bar input, .filter-bar select {
  padding: 7px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  color: var(--text);
}

.filter-bar input:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--mb-blue);
  box-shadow: 0 0 0 3px rgba(80, 196, 204, 0.22);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 260px;
  flex: 1 1 260px;
  max-width: 380px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: #94a3b8;
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding-left: 32px;
  padding-right: 30px;
}

.search-clear-btn {
  position: absolute;
  right: 7px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: #eef2f6;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.search-clear-btn:hover {
  background: #e2e8f0;
  color: var(--mb-blue-deep);
}

.search-clear-btn.visible {
  display: inline-flex;
}

.filter-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---- Searchable Select (Combobox) ---- */
.ss-wrap {
  position: relative;
  min-width: 260px;
  flex: 0 1 300px;
}

.ss-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.ss-trigger:hover {
  border-color: var(--mb-blue);
}

.ss-wrap.open .ss-trigger {
  border-color: var(--mb-blue);
  box-shadow: 0 0 0 3px rgba(80, 196, 204, 0.22);
}

.ss-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.ss-trigger-text.is-placeholder {
  color: var(--muted);
}

.ss-trigger-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ss-clear {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #eef2f6;
  color: #64748b;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ss-clear:hover {
  background: #e2e8f0;
  color: var(--mb-blue-deep);
}

.ss-chevron {
  width: 14px;
  height: 14px;
  color: #64748b;
  transition: transform 0.15s ease;
}

.ss-wrap.open .ss-chevron {
  transform: rotate(180deg);
}

.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 260px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(24, 37, 61, 0.14);
  z-index: 60;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ss-wrap.open .ss-dropdown {
  display: flex;
}

.ss-search-box {
  padding: 8px;
  border-bottom: 1px solid #edf1f7;
  background: #f8fafd;
}

.ss-search-input {
  width: 100%;
  padding: 6px 10px !important;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 12.5px !important;
  background: #ffffff;
}

.ss-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}

.ss-option {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: inherit;
  color: var(--text);
}

.ss-option:hover,
.ss-option.highlighted {
  background: #f1f6fc;
}

.ss-option.selected {
  background: var(--mb-blue-soft);
  color: var(--mb-blue-deep);
  font-weight: 700;
}

.ss-option-main {
  font-size: 12.8px;
  line-height: 1.3;
}

.ss-option-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.ss-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ---- Tables & Badges ---- */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.8px;
}

.table th, .table td {
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid #edf1f7;
  vertical-align: middle;
}

.table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafd;
}

.table tbody tr:hover { background: #f6faff; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-ok { background: var(--mb-teal-soft); color: #166c73; border: 1px solid rgba(80, 196, 204, 0.35); }
.badge-warn { background: var(--warn-soft); color: #92400e; }
.badge-err { background: var(--danger-soft); color: #991b1b; }
.badge-info { background: var(--mb-blue-soft); color: #36528a; border: 1px solid rgba(104, 136, 196, 0.28); }
.badge-muted { background: #eef2f6; color: #475569; }

.alert { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin: 10px 0; }
.alert-error { background: var(--danger-soft); border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: var(--mb-teal-soft); border: 1px solid var(--mb-teal); color: #166c73; }
.alert-warn { background: var(--warn-soft); border: 1px solid #fcd34d; color: #92400e; }

.code-box {
  background: #1b2844;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.2px;
  overflow-x: auto;
  word-break: break-all;
}

.xml-editor {
  width: 100%;
  min-height: 340px;
  background: #162238;
  color: #e2e8f0;
  border: 1px solid #2d3f63;
  border-radius: 9px;
  padding: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

/* ---- Capabilities & Charts ---- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.cap-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid #e6edf6;
  background: #fbfdff;
  border-radius: 9px;
  font-size: 12.3px;
  font-weight: 500;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12.5px;
}

.bar-label { width: 140px; color: #334155; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 10px; background: #eaf0f8; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--mb-blue); border-radius: 999px; }
.bar-val { width: 38px; text-align: right; font-weight: 700; color: var(--mb-blue-deep); }

.swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  vertical-align: middle;
}

.logo-thumb {
  max-height: 32px;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

/* ---- Modal & Toasts ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 37, 61, 0.62);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 740px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 28px 65px rgba(15, 23, 42, 0.36);
}

.modal-card.wide { max-width: 980px; }

.modal-head {
  padding: 15px 22px;
  background: var(--mb-blue-deep);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.modal-close {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  color: #ffffff;
  font-size: 20px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.25); }

.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 13px 22px;
  border-top: 1px solid #edf1f7;
  background: #f8fafd;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--mb-blue-deep);
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(24, 37, 61, 0.28);
  max-width: 380px;
}

.toast.ok { border-left: 4px solid var(--mb-teal); }
.toast.err { border-left: 4px solid #f87171; }

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .cap-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 8px 10px; }
  .nav-group-label { display: none; }
  .nav-item.active::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
}
