/* Atomo Dash - design system
 * Brand: graphite #3A3A3C (logo) and the orbit blue gradient #3392C8 -> #055599.
 * Bootstrap 5.2 is the base; this file only sets the brand tokens and the app components.
 */

:root {
  --atomo-graphite: #3a3a3c;
  --atomo-graphite-900: #262628;
  --atomo-graphite-800: #2f2f31;
  --atomo-graphite-700: #46464a;
  --atomo-blue-900: #033c6d;
  --atomo-blue-700: #055599;
  --atomo-blue-600: #0a63ad;
  --atomo-blue-500: #1b78bd;
  --atomo-blue-400: #3392c8;
  --atomo-blue-100: #dcecf8;
  --atomo-blue-50: #eef5fb;
  --atomo-gradient: linear-gradient(135deg, var(--atomo-blue-400) 0%, var(--atomo-blue-700) 100%);

  --app-bg: #f4f6f9;
  --app-surface: #ffffff;
  --app-surface-muted: #f8fafc;
  --app-border: #e4e7ec;
  --app-border-strong: #d0d5dd;
  --app-text: #1d2433;
  --app-text-muted: #667085;
  --app-text-subtle: #98a2b3;

  --app-success: #12b76a;
  --app-success-bg: #ecfdf3;
  --app-warning: #f79009;
  --app-warning-bg: #fffaeb;
  --app-danger: #d92d20;
  --app-danger-bg: #fef3f2;

  --app-radius-sm: 8px;
  --app-radius: 12px;
  --app-radius-lg: 16px;
  --app-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --app-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --app-shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, 0.12), 0 4px 8px -4px rgba(16, 24, 40, 0.06);
  --app-focus: 0 0 0 4px rgba(27, 120, 189, 0.18);

  --sidebar-width: 264px;
  --sidebar-collapsed-width: 76px;
  --topbar-height: 64px;

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--app-text);
  --bs-body-bg: var(--app-bg);
  --bs-primary: var(--atomo-blue-600);
  --bs-primary-rgb: 10, 99, 173;
  --bs-link-color: var(--atomo-blue-600);
  --bs-link-hover-color: var(--atomo-blue-700);
  --bs-border-color: var(--app-border);
}

[hidden] { display: none !important; }

body {
  font-family: var(--bs-body-font-family);
  background: var(--app-bg);
  color: var(--app-text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

a { color: var(--atomo-blue-600); text-decoration: none; }
a:hover { color: var(--atomo-blue-700); }

h1, h2, h3, h4, h5, h6 { color: var(--app-text); font-weight: 600; letter-spacing: -0.01em; }

:focus-visible { outline: none; box-shadow: var(--app-focus); }

/* ---------- Bootstrap overrides ---------- */
.btn {
  --bs-btn-font-weight: 500;
  --bs-btn-border-radius: var(--app-radius-sm);
  --bs-btn-padding-y: .5rem;
  --bs-btn-padding-x: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.btn-sm { --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .75rem; }
.btn-primary {
  --bs-btn-bg: var(--atomo-blue-600);
  --bs-btn-border-color: var(--atomo-blue-600);
  --bs-btn-hover-bg: var(--atomo-blue-700);
  --bs-btn-hover-border-color: var(--atomo-blue-700);
  --bs-btn-active-bg: var(--atomo-blue-900);
  --bs-btn-active-border-color: var(--atomo-blue-900);
  --bs-btn-disabled-bg: var(--atomo-blue-500);
  --bs-btn-disabled-border-color: var(--atomo-blue-500);
  --bs-btn-focus-shadow-rgb: 27, 120, 189;
}
.btn-light, .btn-outline-secondary {
  --bs-btn-bg: var(--app-surface);
  --bs-btn-color: var(--app-text);
  --bs-btn-border-color: var(--app-border-strong);
  --bs-btn-hover-bg: var(--app-surface-muted);
  --bs-btn-hover-color: var(--app-text);
  --bs-btn-hover-border-color: var(--app-border-strong);
  --bs-btn-active-bg: var(--app-bg);
  --bs-btn-active-color: var(--app-text);
}
.btn-ghost {
  --bs-btn-color: var(--app-text-muted);
  --bs-btn-hover-bg: var(--app-surface-muted);
  --bs-btn-hover-color: var(--app-text);
  --bs-btn-active-bg: var(--app-bg);
  border: 0;
}

/* loading state for any button: <button class="btn is-loading"> */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-color: rgba(255, 255, 255, .9) rgba(255, 255, 255, .9) rgba(255, 255, 255, .25) rgba(255, 255, 255, .25);
  border-radius: 50%;
  animation: atomo-spin .7s linear infinite;
}
.btn-light.is-loading::after, .btn-outline-secondary.is-loading::after, .btn-ghost.is-loading::after {
  border-color: var(--atomo-blue-600) var(--atomo-blue-600) var(--app-border) var(--app-border);
}

.form-control, .form-select {
  border-color: var(--app-border-strong);
  border-radius: var(--app-radius-sm);
  padding: .6rem .85rem;
  color: var(--app-text);
}
.form-control:focus, .form-select:focus { border-color: var(--atomo-blue-400); box-shadow: var(--app-focus); }
.form-label { font-weight: 500; font-size: .875rem; color: var(--app-text); margin-bottom: .375rem; }
.form-text { color: var(--app-text-muted); }
.form-check-input:checked { background-color: var(--atomo-blue-600); border-color: var(--atomo-blue-600); }
.form-check-input:focus { box-shadow: var(--app-focus); border-color: var(--atomo-blue-400); }

.dropdown-menu {
  --bs-dropdown-border-color: var(--app-border);
  --bs-dropdown-border-radius: var(--app-radius);
  --bs-dropdown-link-active-bg: var(--atomo-blue-50);
  --bs-dropdown-link-active-color: var(--atomo-blue-700);
  --bs-dropdown-padding-y: .375rem;
  box-shadow: var(--app-shadow-lg);
  padding-left: .375rem;
  padding-right: .375rem;
}
.dropdown-item { border-radius: 6px; padding: .5rem .75rem; display: flex; align-items: center; gap: .625rem; font-size: .9rem; }
.dropdown-item i { color: var(--app-text-muted); font-size: 1rem; }
.dropdown-header { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--app-text-subtle); }

.modal-content { border: 0; border-radius: var(--app-radius-lg); box-shadow: var(--app-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--app-border); padding: 1rem 1.25rem; }
.modal-title { font-size: 1.05rem; }
.tooltip { --bs-tooltip-bg: var(--atomo-graphite-900); --bs-tooltip-font-size: .78rem; }

.table { --bs-table-color: var(--app-text); margin-bottom: 0; }
.table > thead th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--app-text-muted);
  background: var(--app-surface-muted);
  border-bottom-color: var(--app-border);
  padding: .75rem 1rem;
}
.table > tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--app-border); }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns .2s ease;
}
.app.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr); }

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--atomo-graphite);
  background: linear-gradient(180deg, var(--atomo-graphite) 0%, var(--atomo-graphite-900) 100%);
  color: #fff;
  z-index: 1030;
  overflow: hidden;
}
.app-sidebar__brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  flex-shrink: 0;
}
.app-sidebar__brand img { height: 30px; width: auto; }
.app-sidebar__brand .brand-mark { display: none; width: 32px; height: 32px; }
.app-sidebar__nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.app-sidebar__section {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .45);
  padding: 1.25rem .75rem .5rem;
  white-space: nowrap;
}
.app-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--app-radius-sm);
  color: rgba(255, 255, 255, .78);
  font-size: .9rem;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.app-nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; flex-shrink: 0; color: rgba(255, 255, 255, .6); }
.app-nav-link span { overflow: hidden; text-overflow: ellipsis; }
.app-nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.app-nav-link.active { background: rgba(51, 146, 200, .16); color: #fff; }
.app-nav-link.active i { color: var(--atomo-blue-400); }
.app-nav-link.active::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--atomo-blue-400);
}
.app-nav-link .nav-count {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8);
  border-radius: 999px;
  padding: .1rem .5rem;
}
.app-sidebar__footer { padding: .75rem; border-top: 1px solid rgba(255, 255, 255, .06); flex-shrink: 0; }

.app.sidebar-collapsed .app-sidebar__brand { justify-content: center; padding: 0; }
.app.sidebar-collapsed .app-sidebar__brand img { display: none; }
.app.sidebar-collapsed .app-sidebar__brand .brand-mark { display: block; }
.app.sidebar-collapsed .app-sidebar__section { visibility: hidden; height: .75rem; padding: 0; }
.app.sidebar-collapsed .app-nav-link { justify-content: center; }
.app.sidebar-collapsed .app-nav-link span, .app.sidebar-collapsed .app-nav-link .nav-count { display: none; }

.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--app-border);
}
.app-topbar__title { min-width: 0; flex: 1; }
.app-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  color: var(--app-text-muted);
  white-space: nowrap;
  overflow: hidden;
}
.app-breadcrumb a { color: var(--app-text-muted); }
.app-breadcrumb a:hover { color: var(--app-text); }
.app-breadcrumb .current { color: var(--app-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.app-breadcrumb i { font-size: .7rem; color: var(--app-text-subtle); }
.app-topbar__actions { display: flex; align-items: center; gap: .5rem; }

.account-switch {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem .6rem .3rem .3rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface);
  color: var(--app-text);
  font-size: .85rem;
  font-weight: 500;
  max-width: 260px;
}
.account-switch:hover { border-color: var(--app-border-strong); color: var(--app-text); }
.account-switch img, .account-switch .account-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--app-surface-muted);
  flex-shrink: 0;
}
.account-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-initials, .user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 600;
  color: var(--atomo-blue-700);
  background: var(--atomo-blue-50);
  border-radius: 50%;
}
.user-avatar { width: 36px; height: 36px; border: 0; color: #fff; background: var(--atomo-gradient); }
.user-menu-toggle { border: 0; background: none; padding: 0; border-radius: 50%; }
.dropdown-menu .account-list { max-height: 320px; overflow-y: auto; }

.app-content { padding: 1.75rem 1.5rem 2.5rem; flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; }
.app-content--flush { max-width: none; padding: 1rem 1.25rem 1.5rem; }
.app-footer { padding: 1rem 1.5rem; font-size: .8rem; color: var(--app-text-subtle); text-align: center; }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .app, .app.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
  .app-sidebar {
    position: fixed;
    left: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .app.sidebar-open .app-sidebar { transform: none; }
  .app.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .45);
    z-index: 1025;
  }
  .app.sidebar-collapsed .app-sidebar__brand img { display: block; }
  .app.sidebar-collapsed .app-sidebar__brand .brand-mark { display: none; }
  .app.sidebar-collapsed .app-nav-link span, .app.sidebar-collapsed .app-nav-link .nav-count { display: initial; }
  .app.sidebar-collapsed .app-nav-link { justify-content: flex-start; }
  .app.sidebar-collapsed .app-sidebar__section { visibility: visible; height: auto; padding: 1.25rem .75rem .5rem; }
  .app-topbar { padding: 0 1rem; }
  .app-content { padding: 1.25rem 1rem 2rem; }
  .account-switch span:not(.account-initials) { display: none; }
  .account-switch { padding-right: .3rem; }
}

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; margin: 0; }
.page-header p { color: var(--app-text-muted); margin: .25rem 0 0; font-size: .925rem; }

.surface {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
}

/* ---------- Search and filters ---------- */
.search-field { position: relative; min-width: 260px; flex: 1; max-width: 420px; }
.search-field i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--app-text-subtle); }
.search-field .form-control { padding-left: 2.4rem; padding-right: 2.6rem; background: var(--app-surface); }
.search-field kbd {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: .7rem;
  color: var(--app-text-muted);
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
  border-radius: 4px;
  padding: .05rem .35rem;
}
.toolbar-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chip-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--app-border-strong);
  background: var(--app-surface);
  color: var(--app-text-muted);
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
}
.chip:hover { color: var(--app-text); border-color: var(--app-text-subtle); }
.chip.active { background: var(--atomo-blue-50); border-color: var(--atomo-blue-400); color: var(--atomo-blue-700); }

/* ---------- Dashboard cards ---------- */
.section-title { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--app-text-muted); margin: 0 0 .85rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.dash-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: 1.1rem 1.1rem 1rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  color: var(--app-text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  min-height: 132px;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--app-shadow-lg); border-color: var(--atomo-blue-100); color: var(--app-text); }
.dash-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--atomo-gradient);
  font-size: 1.15rem;
  flex-shrink: 0;
}
.dash-card__title { font-weight: 600; font-size: .98rem; line-height: 1.35; margin: 0; padding-right: 2rem; }
.dash-card__meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: auto; font-size: .78rem; color: var(--app-text-muted); }
.dash-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--app-text-subtle); }
.badge-new { font-size: .68rem; font-weight: 600; color: var(--atomo-blue-700); background: var(--atomo-blue-50); border-radius: 999px; padding: .15rem .5rem; }
.dash-card__link { color: inherit; }
.dash-card:hover .dash-card__link { color: var(--atomo-blue-700); }
.dash-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.fav-toggle {
  position: relative;
  z-index: 2;
  border: 0;
  background: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--app-text-subtle);
  font-size: 1.05rem;
  transition: color .15s ease, background .15s ease, transform .15s ease;
}
.fav-toggle:hover { background: var(--app-surface-muted); color: var(--app-warning); }
.fav-toggle.is-favorite { color: #f5b301; }
.fav-toggle.is-favorite .bi-star::before { content: "\f586"; } /* bi-star-fill */
.fav-toggle.pop { animation: atomo-pop .3s ease; }
.dash-card .fav-toggle { position: absolute; top: .65rem; right: .65rem; }

.empty-state { text-align: center; padding: 3.5rem 1.5rem; color: var(--app-text-muted); }
.empty-state .empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--atomo-blue-600);
  background: var(--atomo-blue-50);
}
.empty-state h3 { font-size: 1.05rem; margin-bottom: .35rem; }

/* ---------- Report view ---------- */
.report-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}
.report-toolbar__title { min-width: 0; flex: 1; display: flex; align-items: center; gap: .85rem; }
.report-toolbar__title h1 { font-size: 1.15rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-toolbar__title .subtitle { font-size: .8rem; color: var(--app-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-toolbar__actions { display: flex; align-items: center; gap: .25rem; }
.report-toolbar__actions .btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--app-radius-sm); font-size: 1.05rem; }
.toolbar-divider { width: 1px; height: 24px; background: var(--app-border); margin: 0 .35rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  border: 1px solid var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-text-muted);
  white-space: nowrap;
}
.status-pill .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--app-text-subtle); }
.status-pill.is-ok { color: #027a48; background: var(--app-success-bg); border-color: #abefc6; }
.status-pill.is-ok .status-dot { background: var(--app-success); }
.status-pill.is-stale { color: #b54708; background: var(--app-warning-bg); border-color: #fedf89; }
.status-pill.is-stale .status-dot { background: var(--app-warning); }
.status-pill.is-error { color: #b42318; background: var(--app-danger-bg); border-color: #fecdca; }
.status-pill.is-error .status-dot { background: var(--app-danger); }
.status-pill.is-running { color: var(--atomo-blue-700); background: var(--atomo-blue-50); border-color: var(--atomo-blue-100); }
.status-pill.is-running .status-dot { background: var(--atomo-blue-500); animation: atomo-pulse 1.2s ease-in-out infinite; }
button.status-pill:hover { border-color: var(--app-border-strong); }

.viewing-as {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  color: #b54708;
  background: var(--app-warning-bg);
  border: 1px solid #fedf89;
}

.report-frame {
  position: relative;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  padding: .75rem;
  min-height: 420px;
}
#reportContainer { position: relative; min-height: 400px; }
#reportContainer iframe { border: 0 !important; width: 100%; min-height: 400px; display: block; }
.report-frame.is-loading #reportContainer { aspect-ratio: 16 / 9; max-height: calc(100vh - 220px); }
.report-frame.is-loading #reportContainer iframe { visibility: hidden; }
.page-change-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; border-radius: var(--app-radius) var(--app-radius) 0 0; opacity: 0; transition: opacity .2s; }
.page-change-bar.active { opacity: 1; }
.page-change-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--atomo-gradient); animation: atomo-indeterminate 1.1s ease-in-out infinite; }

/* report skeleton: drawn over the container until Power BI renders */
.report-skeleton {
  position: absolute;
  inset: .75rem;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 56px 96px 1fr 1fr;
  gap: .85rem;
  background: var(--app-surface);
  transition: opacity .35s ease;
}
.report-skeleton.is-hidden { opacity: 0; pointer-events: none; }
.report-skeleton .sk { border-radius: 10px; }
.report-skeleton .sk-header { grid-column: 1 / -1; }
.report-skeleton .sk-chart { grid-column: span 2; }
.report-skeleton .sk-wide { grid-column: span 3; }
.report-skeleton__status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, .92);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-lg);
  text-align: center;
  min-width: 260px;
}
.report-skeleton__status .stage { font-weight: 600; font-size: .95rem; }
.report-skeleton__status .hint { font-size: .8rem; color: var(--app-text-muted); }
.stage-steps { display: flex; gap: .35rem; }
.stage-steps span { width: 28px; height: 4px; border-radius: 2px; background: var(--app-border); transition: background .3s ease; }
.stage-steps span.done { background: var(--atomo-blue-500); }

.sk {
  background: linear-gradient(90deg, #eef1f5 0%, #f7f9fb 40%, #eef1f5 80%);
  background-size: 200% 100%;
  animation: atomo-shimmer 1.4s ease-in-out infinite;
}
.sk-line { height: .85rem; border-radius: 6px; }

.report-error {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .75rem;
  padding: 3rem 1.5rem;
}
.report-error .error-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--app-danger);
  background: var(--app-danger-bg);
}
.report-error p { margin: 0; color: var(--app-text-muted); max-width: 440px; }

/* ---------- Atom loader (brand mark) ---------- */
.atom-loader { width: 56px; height: 56px; }
.atom-loader .orbit-electrons { transform-origin: 515px 652px; animation: atomo-spin 1.6s linear infinite; }
.atom-loader .nucleus { transform-origin: 515px 652px; animation: atomo-breathe 1.6s ease-in-out infinite; }
.atom-loader--sm { width: 28px; height: 28px; }

/* ---------- Navigation progress bar ---------- */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 2000;
  background: var(--atomo-gradient);
  box-shadow: 0 0 8px rgba(51, 146, 200, .6);
  opacity: 0;
  transition: width .3s ease, opacity .3s ease;
}
.nav-progress.active { opacity: 1; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2100; display: flex; flex-direction: column; gap: .6rem; max-width: min(420px, calc(100vw - 2.5rem)); }
.app-toast {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--atomo-blue-500);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
  font-size: .9rem;
  animation: atomo-slide-in .25s ease;
}
.app-toast.is-success { border-left-color: var(--app-success); }
.app-toast.is-error { border-left-color: var(--app-danger); }
.app-toast.is-warning { border-left-color: var(--app-warning); }
.app-toast > i { font-size: 1.15rem; line-height: 1.3; }
.app-toast.is-success > i { color: var(--app-success); }
.app-toast.is-error > i { color: var(--app-danger); }
.app-toast.is-warning > i { color: var(--app-warning); }
.app-toast.is-info > i { color: var(--atomo-blue-500); }
.app-toast .toast-body { flex: 1; padding: 0; }
.app-toast .toast-actions { margin-top: .5rem; display: flex; gap: .5rem; }
.app-toast .btn-close { font-size: .7rem; margin-top: .2rem; }
.app-toast.is-leaving { animation: atomo-fade-out .2s ease forwards; }

/* ---------- Auth pages ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--app-surface);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  color: #fff;
  background: radial-gradient(circle at 85% 15%, rgba(51, 146, 200, .45) 0%, rgba(51, 146, 200, 0) 45%),
              radial-gradient(circle at 10% 90%, rgba(5, 85, 153, .55) 0%, rgba(5, 85, 153, 0) 50%),
              linear-gradient(160deg, var(--atomo-graphite) 0%, var(--atomo-graphite-900) 100%);
}
.auth-brand img { height: 40px; width: auto; align-self: flex-start; }
.auth-brand h2 { color: #fff; font-size: 2.1rem; line-height: 1.2; font-weight: 700; max-width: 460px; margin-bottom: 1rem; }
.auth-brand p { color: rgba(255, 255, 255, .72); font-size: 1.02rem; max-width: 440px; }
.auth-brand .brand-art { position: absolute; right: -170px; bottom: -190px; width: 470px; opacity: .1; pointer-events: none; }
.auth-brand .brand-footer { font-size: .8rem; color: rgba(255, 255, 255, .5); }
.auth-features { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .85rem; }
.auth-features li { display: flex; gap: .75rem; align-items: center; color: rgba(255, 255, 255, .85); font-size: .95rem; }
.auth-features i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08);
  color: var(--atomo-blue-400);
}
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .auth-logo-mobile { display: none; height: 34px; margin-bottom: 2rem; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: .4rem; }
.auth-card .lead-text { color: var(--app-text-muted); margin-bottom: 2rem; }
.auth-card .form-control { padding: .7rem .9rem; }
.auth-card .btn-lg { --bs-btn-padding-y: .7rem; font-size: 1rem; width: 100%; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 2.8rem; }
.password-field .toggle-password {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: var(--app-text-muted);
}
.password-field .toggle-password:hover { color: var(--app-text); background: var(--app-surface-muted); }
.auth-alert { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--app-radius-sm); font-size: .875rem; margin-bottom: 1.25rem; }
.auth-alert.is-error { background: var(--app-danger-bg); color: #b42318; border: 1px solid #fecdca; }
.auth-alert.is-success { background: var(--app-success-bg); color: #027a48; border: 1px solid #abefc6; }
.auth-alert ul { margin: 0; padding-left: 1rem; }
.errorlist { list-style: none; padding: 0; margin: .35rem 0 0; color: var(--app-danger); font-size: .82rem; }
.password-rules { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .25rem; font-size: .8rem; color: var(--app-text-muted); }
.password-rules li { display: flex; gap: .4rem; align-items: center; }
.password-rules i { color: var(--app-text-subtle); }
.auth-footer { margin-top: 2.5rem; font-size: .8rem; color: var(--app-text-subtle); text-align: center; }
.auth-illustration { width: 72px; height: 72px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 1.5rem; color: var(--atomo-blue-600); background: var(--atomo-blue-50); }

@media (max-width: 991.98px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-card .auth-logo-mobile { display: block; }
}

/* ---------- Misc ---------- */
.user-row { display: flex; align-items: center; gap: .75rem; }
.user-row .user-avatar { width: 34px; height: 34px; font-size: .75rem; }
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 500; border-radius: 999px; padding: .2rem .6rem; }
.badge-soft.is-success { color: #027a48; background: var(--app-success-bg); }
.badge-soft.is-danger { color: #b42318; background: var(--app-danger-bg); }
.badge-soft.is-running { color: var(--atomo-blue-700); background: var(--atomo-blue-50); }
.badge-soft.is-muted { color: var(--app-text-muted); background: var(--app-surface-muted); border: 1px solid var(--app-border); }
.table-row-link { cursor: pointer; }
.table-row-link:hover td { background: var(--app-surface-muted); }

.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.error-page .code { font-size: 5rem; font-weight: 700; line-height: 1; background: var(--atomo-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Focus mode: in-page full screen (iPhone / installed iOS app) ---------- */
.focus-exit { display: none; }
body.report-focus { overflow: hidden; }
body.report-focus .app-sidebar,
body.report-focus .app-topbar,
body.report-focus .report-toolbar,
body.report-focus .app-footer,
body.report-focus .install-banner { display: none !important; }
body.report-focus .report-frame {
  position: fixed;
  inset: 0;
  min-height: 0;
  z-index: 1050;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #fff;
}
body.report-focus #reportContainer { height: 100%; min-height: 0; display: flex; align-items: center; }
body.report-focus #reportContainer iframe { height: 100%; min-height: 0 !important; }
.rotate-hint {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1060;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
  color: #fff;
  background: rgba(38, 38, 40, .85);
  white-space: nowrap;
}
body.report-focus.show-rotate-hint .rotate-hint { display: inline-flex; animation: atomo-slide-in .3s ease; }
body.report-focus .focus-exit {
  position: fixed;
  top: calc(.75rem + env(safe-area-inset-top));
  right: calc(.75rem + env(safe-area-inset-right));
  z-index: 1060;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border: 0;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  color: #fff;
  background: rgba(38, 38, 40, .78);
  backdrop-filter: blur(6px);
  box-shadow: var(--app-shadow-lg);
  opacity: .55;
  transition: opacity .2s ease;
}
body.report-focus .focus-exit:hover, body.report-focus .focus-exit:focus-visible { opacity: 1; }
@media (pointer: coarse) {
  /* touch screens: icon only, so it hides as little of the report as possible */
  body.report-focus .focus-exit { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 1rem; }
  body.report-focus .focus-exit span { display: none; }
}

/* ---------- Install (PWA) banner ---------- */
.install-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 2050;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-lg);
  animation: atomo-slide-in .3s ease;
}
.install-banner__icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
.install-banner__title { font-weight: 600; margin-bottom: .15rem; }
.install-banner__text { font-size: .875rem; color: var(--app-text-muted); }
.install-banner__text i { color: var(--atomo-blue-600); }
.install-banner__actions { display: flex; gap: .5rem; margin-top: .75rem; }

/* ---------- Activity history ---------- */
.activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--atomo-blue-600);
  background: var(--atomo-blue-50);
}
.activity-login_failed, .activity-data_refresh_failed { color: var(--app-danger); background: var(--app-danger-bg); }
.activity-user_updated, .activity-password_changed, .activity-view_as { color: #b54708; background: var(--app-warning-bg); }
.activity-data_refresh_requested { color: #027a48; background: var(--app-success-bg); }
.activity-logout, .activity-login { color: var(--app-text-muted); background: var(--app-surface-muted); }

/* ---------- 404 ---------- */
.not-found { min-height: calc(100vh - var(--topbar-height) - 8rem); display: flex; align-items: center; justify-content: center; text-align: center; }
.not-found__box { max-width: 460px; }
.not-found__box h1 { font-size: 1.4rem; margin-bottom: .5rem; }
.not-found__box p { color: var(--app-text-muted); margin-bottom: 1.75rem; }
.not-found__art { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; margin-bottom: 1.25rem; }
.not-found__code {
  font-size: 6.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
  background: var(--atomo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* the atom is the "0" of "404": same height as the digits, spinning slowly */
.not-found__atom { display: inline-flex; color: var(--atomo-graphite); transform: translateY(.6rem); }
.not-found__atom .atom-loader { width: 6rem; height: 6rem; }
.not-found__atom .orbit-electrons { animation-duration: 9s; }
.not-found__atom .nucleus { animation-duration: 4.5s; }
.error-page .not-found__box { margin: 0 auto; }

/* ---------- Collapsible account blocks (billing) ---------- */
.account-fold__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 0;
  background: none;
  text-align: left;
  color: var(--app-text);
}
.account-fold__toggle:hover { background: var(--app-surface-muted); }
.account-fold__chevron { color: var(--app-text-subtle); transition: transform .2s ease; flex-shrink: 0; }
.account-fold__toggle[aria-expanded="true"] .account-fold__chevron { transform: rotate(90deg); }
.account-fold__name { flex: 1; min-width: 0; }
.account-fold__stats { display: flex; gap: 1.5rem; text-align: right; }
@media (max-width: 767.98px) {
  .account-fold__toggle { flex-wrap: wrap; }
  .account-fold__stats { width: 100%; justify-content: space-between; gap: .75rem; padding-left: 2rem; }
}

/* ---------- AI insights panel ---------- */
.ai-toggle[aria-expanded="true"] { color: var(--atomo-blue-600); background: var(--atomo-blue-50); }
.ai-backdrop { position: fixed; inset: 0; z-index: 1039; background: rgba(16, 24, 40, .25); }
.ai-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(440px, 100vw);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  background: var(--app-surface);
  border-left: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-lg);
  transform: translateX(100%);
  transition: transform .25s ease;
}
.ai-panel.is-open { transform: none; }
.ai-panel__header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--app-border); }
.ai-panel__icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--atomo-gradient); font-size: 1.1rem; }
.ai-panel__body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.ai-panel__footer { padding: .75rem 1.25rem; border-top: 1px solid var(--app-border); display: flex; gap: .5rem; align-items: center; }
.ai-quota { display: flex; align-items: center; gap: .75rem; font-size: .8rem; color: var(--app-text-muted); }
.ai-quota__bar { flex: 1; height: 6px; border-radius: 3px; background: var(--app-border); overflow: hidden; }
.ai-quota__bar span { display: block; height: 100%; background: var(--atomo-gradient); transition: width .3s ease; }
.ai-actions { display: grid; gap: .5rem; }
.ai-actions .btn { justify-content: flex-start; }
.ai-question__row { display: flex; gap: .5rem; }
.ai-question__row .btn-icon { width: 42px; flex-shrink: 0; padding: 0; }
.ai-status { display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--app-text-muted); }
.ai-error { padding: .75rem .9rem; border-radius: var(--app-radius-sm); font-size: .875rem; background: var(--app-danger-bg); color: #b42318; border: 1px solid #fecdca; }
.ai-paywall { text-align: center; padding: 1.25rem; }
.ai-paywall .empty-icon { width: 44px; height: 44px; margin: 0 auto .75rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--atomo-gradient); }
.ai-results { display: flex; flex-direction: column; gap: 1rem; }
.ai-insight { padding: 1rem; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface-muted); }
.ai-insight__meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--app-text-subtle); margin-bottom: .5rem; }
.ai-insight__question { font-size: .875rem; color: var(--app-text-muted); font-style: italic; margin: 0 0 .5rem; }
.ai-insight__headline { font-size: 1rem; margin: 0 0 .75rem; }
.ai-insight__points { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; font-size: .9rem; }
.ai-insight__points li { display: flex; gap: .6rem; align-items: flex-start; }
.ai-insight__points i { flex-shrink: 0; margin-top: .15rem; }
.ai-insight__points .is-positive i { color: var(--app-success); }
.ai-insight__points .is-negative i { color: var(--app-danger); }
.ai-insight__points .is-alert i { color: var(--app-warning); }
.ai-insight__points .is-info i { color: var(--atomo-blue-500); }
.ai-insight__caveats { margin: .75rem 0 0; padding-left: 1.1rem; font-size: .8rem; color: var(--app-text-muted); }
.ai-insight__meta { align-items: center; }
.ai-insight__time { margin-left: auto; }
.ai-insight__rerun { border: 0; background: none; padding: .1rem .35rem; border-radius: 6px; color: var(--atomo-blue-600); font-size: .72rem; font-weight: 600; letter-spacing: 0; text-transform: none; display: inline-flex; align-items: center; gap: .25rem; }
.ai-insight__rerun:hover { background: var(--atomo-blue-50); }
.ai-insight__rerun:disabled { opacity: .5; }
.ai-insight.is-stale { opacity: .55; }
.ai-insight.is-stale:hover { opacity: 1; }
.ai-insight__stale { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .5rem; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 500; color: #b54708; background: var(--app-warning-bg); border: 1px solid #fedf89; }
.ai-insight__stale::before { content: "\f28a"; font-family: "bootstrap-icons"; }
@media (min-width: 1200px) {
  .ai-backdrop { display: none; }
}

/* ---------- Animations ---------- */
@keyframes atomo-spin { to { transform: rotate(360deg); } }
@keyframes atomo-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(.88); } }
@keyframes atomo-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes atomo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes atomo-indeterminate { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes atomo-pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes atomo-slide-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes atomo-fade-out { to { transform: translateY(4px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .sk { animation: none; }
}


/* =====================================================================
   Console (administration area, templates/console)
   ===================================================================== */
/* backoffice shell: same components as the portal, graphite sidebar with the brand gradient on top */
.console-sidebar { background: var(--atomo-graphite-900); }
.console-sidebar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--atomo-gradient); }
.console-sidebar__tag { display: flex; align-items: center; gap: .5rem; margin: .9rem .75rem 0; padding: .45rem .75rem; border-radius: var(--app-radius-sm); background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.console-sidebar__tag i { color: var(--atomo-blue-400); }
.app.sidebar-collapsed .console-sidebar__tag { justify-content: center; padding: .45rem 0; }
.app.sidebar-collapsed .console-sidebar__tag span { display: none; }
.console-shell .app-topbar { border-bottom: 1px solid var(--app-border); }
.console .page-header h1 { font-size: 1.4rem; }
.console-narrow { max-width: 820px; }
.console-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.console-grid--wide { grid-template-columns: minmax(0, 1fr) 300px; }
.console-aside { position: sticky; top: calc(var(--topbar-height) + 1rem); }
.console-aside__title { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--app-text-muted); margin: 0 0 .75rem; }
@media (max-width: 1100px) {
  .console-grid, .console-grid--wide { grid-template-columns: minmax(0, 1fr); }
  .console-aside { position: static; }
}

.console-section__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1rem; border-bottom: 1px solid var(--app-border); }
.console-section__header h2 { font-size: .95rem; margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.console-section__header h2 i { color: var(--atomo-blue-500); }
.console-section__header h2 a { color: inherit; }
.console-section__footer { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: .75rem 1rem; border-top: 1px solid var(--app-border); background: var(--app-surface-muted); }
.console-panel { scroll-margin-top: calc(var(--topbar-height) + 4rem); }

.console-table > tbody td { padding: .6rem .85rem; }
.console-table > thead th { padding: .6rem .85rem; white-space: nowrap; }
.console-table__check { width: 42px; text-align: center; }
.console-table__check .form-check-input { margin: 0; cursor: pointer; }
.console-table--flags .form-check-input { margin: 0; width: 1.1rem; height: 1.1rem; cursor: pointer; }
.sort-link { color: inherit; display: inline-flex; align-items: center; gap: .15rem; }
.sort-link:hover, .sort-link.active { color: var(--atomo-blue-700); }
.console-toolbar .form-select { font-size: .875rem; min-width: 170px; padding-right: 2.4rem; }

.console-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--app-border); margin-bottom: 1.5rem; overflow-x: auto; position: sticky; top: var(--topbar-height); background: var(--app-bg); z-index: 5; padding-top: .25rem; }
.console-tabs a { padding: .6rem .9rem; color: var(--app-text-muted); font-weight: 500; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; }
.console-tabs a:hover { color: var(--app-text); }
.console-tabs a.active { color: var(--atomo-blue-700); border-bottom-color: var(--atomo-blue-600); }
.console-tabs .nav-count, .console-section__header .nav-count { background: var(--app-surface-muted); color: var(--app-text-muted); border: 1px solid var(--app-border); border-radius: 999px; font-size: .7rem; padding: .05rem .45rem; }

.console-fieldset { padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--app-border); }
.console-fieldset:last-of-type { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.console-fieldset__title { font-size: .95rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.console-fieldset__title i { color: var(--atomo-blue-500); }
.console-switch { padding: .4rem 0 .4rem 2.75rem; }
.console-switch .form-check-input { margin-left: -2.75rem; width: 2.2rem; height: 1.2rem; margin-top: .1rem; cursor: pointer; }
.console-switch .form-check-label { font-weight: 500; }
.console-switch .form-text { margin-top: .1rem; }
.console-details summary { cursor: pointer; font-weight: 500; color: var(--app-text-muted); font-size: .9rem; }
.console-details summary:hover { color: var(--app-text); }
.console-pre { background: var(--app-surface-muted); border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); padding: .75rem; font-size: .78rem; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

.console-avatar { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--atomo-gradient); color: #fff; font-weight: 600; font-size: 1.1rem; flex-shrink: 0; }
.console-avatar.is-staff, .user-avatar.is-staff { background: linear-gradient(135deg, var(--atomo-graphite-700), var(--atomo-graphite-900)); }
.console-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: var(--app-surface); border: 1px solid var(--app-border); }
.console-logo--lg { width: 48px; height: 48px; border-radius: 14px; }

.console-kv { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .875rem; }
.console-kv > span:first-child { color: var(--app-text-muted); }
.console-stack { display: flex; flex-direction: column; gap: .75rem; }
.console-stack--tight { gap: .5rem; }
.console-links { display: flex; flex-direction: column; gap: .15rem; }
.console-links a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--app-radius-sm); color: var(--app-text); font-size: .9rem; }
.console-links a:hover { background: var(--app-surface-muted); color: var(--atomo-blue-700); }
.console-links a i { color: var(--app-text-muted); width: 1.1rem; text-align: center; }
.console-steps { padding-left: 1.2rem; margin: 0; font-size: .875rem; color: var(--app-text-muted); display: flex; flex-direction: column; gap: .5rem; }
.console-user-link { color: inherit; }
.console-user-link:hover { color: var(--atomo-blue-700); }
.console-related { margin: 0; padding-left: 1.2rem; }
.console-inline-form { padding: 1rem; background: var(--app-surface-muted); border-bottom: 1px solid var(--app-border); }
.chip--sm { padding: .15rem .55rem; font-size: .75rem; margin: .1rem .2rem .1rem 0; }

/* permission matrix */
.console-matrix__menu td { background: var(--app-surface-muted); font-weight: 600; font-size: .85rem; color: var(--app-text-muted); }
.console-matrix__menu td i { color: var(--atomo-blue-500); }
.console-matrix__row { cursor: pointer; }
.console-matrix__row .form-control-sm { font-size: .78rem; }
.console-matrix__row:not(.is-granted) td:not(.console-table__check):not(:nth-child(2)) { opacity: .5; }
.console-matrix__row.is-granted td:nth-child(2) .fw-medium { color: var(--atomo-blue-700); }

/* checklist for releasing a dashboard to several users */
.console-checklist__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .4rem; max-height: 280px; overflow-y: auto; padding: .25rem; }
.console-checklist__item { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); background: var(--app-surface); cursor: pointer; margin: 0; }
.console-checklist__item:hover { border-color: var(--atomo-blue-400); }
.console-checklist__item .form-check-input { margin: 0; flex-shrink: 0; }
.console-checklist__item .user-avatar { width: 28px; height: 28px; font-size: .65rem; }
.console-checklist.is-everyone .console-checklist__item { opacity: .5; pointer-events: none; }

/* user picker (autocomplete) */
.user-picker { position: relative; }
.user-picker__chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .35rem; }
.user-picker__chips:empty { display: none; }
.user-picker__chips .chip button { border: 0; background: none; padding: 0; margin-left: .15rem; color: inherit; line-height: 1; }
.user-picker__results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); box-shadow: var(--app-shadow-lg); max-height: 280px; overflow-y: auto; margin-top: .25rem; }
.user-picker__results button { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: none; text-align: left; padding: .5rem .75rem; font-size: .875rem; }
.user-picker__results button:hover, .user-picker__results button:focus { background: var(--app-surface-muted); outline: none; }
.user-picker__results .user-avatar { width: 28px; height: 28px; font-size: .65rem; }
.user-picker__results .empty { padding: .6rem .75rem; color: var(--app-text-muted); font-size: .85rem; }

/* overview */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.stat-card { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: var(--app-shadow-sm); color: var(--app-text); position: relative; transition: border-color .15s ease, box-shadow .15s ease; }
.stat-card:hover { border-color: var(--atomo-blue-400); box-shadow: var(--app-shadow); color: var(--app-text); }
.stat-card__icon { position: absolute; top: .9rem; right: .9rem; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--atomo-blue-50); color: var(--atomo-blue-600); }
.stat-card__value { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.stat-card__label { font-size: .82rem; color: var(--app-text-muted); }
.stat-card__hint { font-size: .75rem; color: var(--app-text-subtle); margin-top: .35rem; }
.stat-card__hint.is-warning { color: #b54708; }

/* bulk actions bar */
.bulk-bar { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 1040; display: flex; align-items: center; gap: 1rem; padding: .6rem .75rem .6rem 1rem; background: var(--atomo-graphite-900); color: #fff; border-radius: 999px; box-shadow: var(--app-shadow-lg); max-width: calc(100vw - 2rem); animation: console-rise .2s ease; }
.bulk-bar__count { font-size: .875rem; white-space: nowrap; }
.bulk-bar__actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.bulk-bar .btn-light { --bs-btn-bg: rgba(255,255,255,.12); --bs-btn-border-color: transparent; --bs-btn-color: #fff; --bs-btn-hover-bg: rgba(255,255,255,.22); --bs-btn-hover-color: #fff; }
.bulk-bar .btn-outline-danger { --bs-btn-color: #fda29b; --bs-btn-border-color: rgba(253,162,155,.5); --bs-btn-hover-bg: #d92d20; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #d92d20; }
.bulk-bar .btn-ghost { color: rgba(255,255,255,.7); }
.bulk-bar .btn-ghost:hover { color: #fff; background: rgba(255,255,255,.12); }
.bulk-bar .form-select { background-color: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.bulk-bar .form-select option { color: var(--app-text); }
/* the group labels (account names) inherit the white text of the bar: force the dropdown colors */
.bulk-bar .form-select optgroup { color: var(--app-text-muted); background: var(--app-surface); font-weight: 600; font-style: normal; }
.bulk-bar .form-select optgroup option { color: var(--app-text); font-weight: 400; }
@keyframes console-rise { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.ai-insight-view ul { padding-left: 1.2rem; }
.ai-insight-view li { margin-bottom: .35rem; }
