/**
 * SISCRE — Design system (2026)
 * Minimal premium UI: tokens, light/dark, Bootstrap 5 refinements.
 * No business logic — presentation only.
 */

/* —— Design tokens —— */
:root,
html[data-theme="light"] {
  color-scheme: light;

  --siscre-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --siscre-bg: #f8fafc;
  --siscre-bg-elevated: #ffffff;
  --siscre-surface: #f8fafc;
  --siscre-surface-alt: #f1f5f9;
  --siscre-border: #e2e8f0;
  --siscre-border-subtle: rgba(15, 23, 42, 0.06);

  --siscre-text: #0f172a;
  --siscre-text-secondary: #334155;
  --siscre-text-muted: #64748b;

  --siscre-primary: #4f46e5;
  --siscre-primary-hover: #4338ca;
  --siscre-primary-muted: rgba(79, 70, 229, 0.12);
  --siscre-primary-rgb: 79, 70, 229;

  --siscre-sidebar-bg: #0b0f14;
  --siscre-sidebar-border: rgba(255, 255, 255, 0.06);
  --siscre-sidebar-text: rgba(248, 250, 252, 0.72);
  --siscre-sidebar-text-hover: #f8fafc;
  --siscre-sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  --siscre-sidebar-active-bg: rgba(255, 255, 255, 0.1);
  --siscre-sidebar-active-border: rgba(255, 255, 255, 0.12);
  --siscre-sidebar-accent: #a5b4fc;

  --siscre-radius-sm: 0.5rem;
  --siscre-radius-md: 0.625rem;
  --siscre-radius-lg: 0.875rem;
  --siscre-radius-xl: 1rem;

  --siscre-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --siscre-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --siscre-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --siscre-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 24px -8px rgba(15, 23, 42, 0.08);
  --siscre-shadow-card-hover: 0 4px 12px rgba(15, 23, 42, 0.08), 0 20px 40px -12px rgba(15, 23, 42, 0.12);

  --siscre-focus-ring: rgba(79, 70, 229, 0.22);

  --siscre-chart-tick-color: #64748b;
  --siscre-chart-grid-color: rgba(148, 163, 184, 0.16);
  --siscre-chart-tooltip-bg: rgba(15, 23, 42, 0.92);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --siscre-bg: #09090b;
  --siscre-bg-elevated: #18181b;
  --siscre-surface: #09090b;
  --siscre-surface-alt: #27272a;
  --siscre-border: #27272a;
  --siscre-border-subtle: rgba(255, 255, 255, 0.06);

  --siscre-text: #fafafa;
  --siscre-text-secondary: #e4e4e7;
  --siscre-text-muted: #a1a1aa;

  --siscre-primary: #818cf8;
  --siscre-primary-hover: #a5b4fc;
  --siscre-primary-muted: rgba(129, 140, 248, 0.15);
  --siscre-primary-rgb: 129, 140, 248;

  --siscre-sidebar-bg: #030303;
  --siscre-sidebar-border: rgba(255, 255, 255, 0.05);
  --siscre-sidebar-text: rgba(250, 250, 250, 0.65);
  --siscre-sidebar-text-hover: #fff;
  --siscre-sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --siscre-sidebar-active-bg: rgba(129, 140, 248, 0.14);
  --siscre-sidebar-active-border: rgba(129, 140, 248, 0.28);
  --siscre-sidebar-accent: #c4b5fd;

  --siscre-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --siscre-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --siscre-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --siscre-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -4px rgba(0, 0, 0, 0.55);
  --siscre-shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.45);

  --siscre-focus-ring: rgba(129, 140, 248, 0.35);

  --siscre-chart-tick-color: #a1a1aa;
  --siscre-chart-grid-color: rgba(161, 161, 170, 0.12);
  --siscre-chart-tooltip-bg: rgba(24, 24, 27, 0.95);
}

/* Instituição: acento teal refinado (mantém identidade sem ruído) */
body.siscre-mode-inst {
  --siscre-primary: #0d9488;
  --siscre-primary-hover: #0f766e;
  --siscre-primary-muted: rgba(13, 148, 136, 0.12);
  --siscre-primary-rgb: 13, 148, 136;
  --siscre-focus-ring: rgba(13, 148, 136, 0.22);
}

html[data-theme="dark"] body.siscre-mode-inst {
  --siscre-primary: #2dd4bf;
  --siscre-primary-hover: #5eead4;
  --siscre-primary-muted: rgba(45, 212, 191, 0.14);
  --siscre-primary-rgb: 45, 212, 191;
  --siscre-focus-ring: rgba(45, 212, 191, 0.3);
}

body.siscre-mode-inst .siscre-sidebar .nav .nav-link.active {
  --siscre-sidebar-active-bg: rgba(45, 212, 191, 0.12);
  --siscre-sidebar-active-border: rgba(45, 212, 191, 0.28);
}

body.siscre-mode-saas .siscre-sidebar .nav .nav-link.active {
  --siscre-sidebar-active-bg: rgba(129, 140, 248, 0.16);
  --siscre-sidebar-active-border: rgba(165, 180, 252, 0.32);
}

/* —— Bootstrap bridge (área autenticada) —— */
body.siscre-app.siscre-body {
  --bs-body-font-family: var(--siscre-font-sans);
  --bs-body-bg: var(--siscre-bg);
  --bs-body-color: var(--siscre-text);
  --bs-border-color: var(--siscre-border);
  --bs-secondary-bg: var(--siscre-surface-alt);
  --bs-tertiary-bg: var(--siscre-bg-elevated);
  --bs-primary: var(--siscre-primary);
  --bs-primary-rgb: var(--siscre-primary-rgb);
  --bs-link-color: var(--siscre-primary);
  --bs-link-hover-color: var(--siscre-primary-hover);
}

/* —— Base —— */
body.siscre-app {
  min-height: 100vh;
  font-family: var(--siscre-font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.siscre-body {
  background-color: var(--siscre-bg);
  background-image: none;
}

html[data-theme="light"] body.siscre-body {
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(79, 70, 229, 0.045), transparent 50%),
    radial-gradient(ellipse 80% 50% at 0% 100%, rgba(13, 148, 136, 0.035), transparent 45%);
  background-attachment: fixed;
}

html[data-theme="dark"] body.siscre-body {
  background-image:
    radial-gradient(ellipse 100% 60% at 80% -10%, rgba(129, 140, 248, 0.07), transparent 45%);
  background-attachment: fixed;
}

body.siscre-app main.container-fluid {
  padding-bottom: 2rem;
}

/* —— Shell —— */
.siscre-shell {
  min-height: 100vh;
}

/* Sidebar: estilo Linear (escura, limpa) — partilhada com offcanvas */
.siscre-sidebar {
  background: var(--siscre-sidebar-bg);
  color: var(--siscre-sidebar-text);
  border-right: 1px solid var(--siscre-sidebar-border);
  box-shadow: none;
}

aside.siscre-sidebar {
  position: relative;
  width: 268px;
  flex-shrink: 0;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.siscre-shell.is-collapsed aside.siscre-sidebar {
  width: 72px;
}

/* Remover overlays antigos modo SaaS/inst */
body.siscre-mode-saas aside.siscre-sidebar::before,
body.siscre-mode-inst aside.siscre-sidebar::after,
body.siscre-mode-saas .siscre-shell.is-collapsed aside.siscre-sidebar::before {
  display: none;
}

body.siscre-mode-saas .siscre-sidebar .brand,
body.siscre-mode-saas .siscre-sidebar .p-3,
body.siscre-mode-inst .siscre-sidebar .brand,
body.siscre-mode-inst .siscre-sidebar .p-3 {
  position: relative;
  z-index: auto;
}

.siscre-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.125rem 1rem;
  border-bottom: 1px solid var(--siscre-sidebar-border);
}

.siscre-shell.is-collapsed aside.siscre-sidebar .brand {
  padding-left: 0.875rem;
  padding-right: 0.875rem;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .brand-link {
  width: 100%;
  justify-content: center;
  gap: 0 !important;
}

.siscre-sidebar .brand img {
  height: 36px;
  width: auto;
  border-radius: var(--siscre-radius-sm);
}

.siscre-sidebar .brand .brand-title {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--siscre-sidebar-text-hover);
}

.siscre-sidebar .brand .brand-sub {
  font-size: 0.75rem;
  color: var(--siscre-sidebar-text);
  opacity: 1;
  margin-top: 0.125rem;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .brand .brand-title,
.siscre-shell.is-collapsed aside.siscre-sidebar .brand .brand-sub {
  display: none;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .brand img {
  height: 32px;
}

.siscre-sidebar .brand-link {
  color: inherit !important;
}

.siscre-sidebar .nav {
  gap: 0.25rem;
}

.siscre-sidebar .nav .nav-link {
  color: var(--siscre-sidebar-text);
  border-radius: var(--siscre-radius-md);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .nav .nav-link {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .nav .nav-link span {
  display: none;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .nav .nav-section {
  display: none;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .siscre-sidebar-about {
  display: none;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .sidebar-actions {
  flex-direction: column;
  gap: 0.5rem !important;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .sidebar-actions .btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.siscre-shell.is-collapsed aside.siscre-sidebar .sidebar-actions .btn span {
  display: none;
}

.siscre-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--siscre-sidebar-border);
  background: var(--siscre-sidebar-hover-bg);
  color: var(--siscre-sidebar-text-hover);
  border-radius: var(--siscre-radius-md);
  font-size: 1.05rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.siscre-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

.siscre-sidebar .nav .nav-link:hover {
  color: var(--siscre-sidebar-text-hover);
  background: var(--siscre-sidebar-hover-bg);
}

.siscre-sidebar .nav .nav-link .bi {
  font-size: 1.05rem;
  opacity: 0.85;
  flex-shrink: 0;
  width: 1.35rem;
  text-align: center;
  font-weight: normal;
}

.siscre-sidebar .nav .nav-link.active {
  color: var(--siscre-sidebar-text-hover);
  font-weight: 600;
  background: var(--siscre-sidebar-active-bg);
  border-color: var(--siscre-sidebar-active-border);
  box-shadow: none;
}

.siscre-sidebar .nav .nav-section {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--siscre-sidebar-text);
  opacity: 0.55;
  margin: 1.25rem 0 0.5rem;
  padding: 0 0.75rem;
}

.siscre-sidebar .p-3 {
  padding: 1rem !important;
}

.siscre-sidebar .p-3.pt-2 {
  padding-top: 0.75rem !important;
}

.siscre-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: color-mix(in srgb, var(--siscre-bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--siscre-border);
}

.siscre-topbar .btn-outline-secondary {
  border-radius: var(--siscre-radius-md);
  border-color: var(--siscre-border);
  color: var(--siscre-text-secondary);
}

.siscre-topbar-title {
  color: var(--siscre-text);
  font-size: 0.9375rem;
}

.siscre-content {
  min-width: 0;
}

footer.siscre-app-footer {
  position: static;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: none;
}

.siscre-sidebar-about {
  border-top: 1px solid var(--siscre-sidebar-border);
  padding-top: 1rem !important;
}

.siscre-sidebar-about .text-white-50 {
  color: var(--siscre-sidebar-text) !important;
  opacity: 0.75;
  font-size: 0.6875rem;
  line-height: 1.45;
}

.siscre-sidebar .sidebar-actions .btn-outline-light {
  border-color: var(--siscre-sidebar-border);
  color: var(--siscre-sidebar-text-hover);
  background: transparent;
  border-radius: var(--siscre-radius-md);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.45rem 0.65rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.siscre-sidebar .sidebar-actions .btn-outline-light:hover {
  background: var(--siscre-sidebar-hover-bg);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Offcanvas mobile: header */
.offcanvas.siscre-sidebar .offcanvas-header {
  border-bottom: 1px solid var(--siscre-sidebar-border) !important;
  background: var(--siscre-sidebar-bg);
}

.offcanvas.siscre-sidebar .offcanvas-header .text-white {
  color: var(--siscre-sidebar-text-hover) !important;
}

/* —— Main —— */
body.siscre-app .siscre-main {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
  padding-top: 1.25rem !important;
}

@media (min-width: 992px) {
  body.siscre-app .siscre-main {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    padding-top: 1.75rem !important;
  }
}

/* —— Top bar desktop —— */
.siscre-desktop-bar {
  padding: 0.25rem 0 1rem;
  border-bottom: none;
  margin-bottom: 0.5rem !important;
}

.siscre-env-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--siscre-border);
  background: var(--siscre-bg-elevated);
  color: var(--siscre-text-secondary);
  box-shadow: var(--siscre-shadow-xs);
}

.siscre-env-badge .bi {
  font-size: 0.875rem;
  opacity: 0.85;
}

.siscre-env-badge--saas {
  border-color: rgba(129, 140, 248, 0.25);
  background: var(--siscre-primary-muted);
  color: var(--siscre-primary);
}

.siscre-env-badge--inst {
  border-color: rgba(13, 148, 136, 0.22);
  background: rgba(13, 148, 136, 0.08);
  color: #0f766e;
}

html[data-theme="dark"] .siscre-env-badge--inst {
  color: #5eead4;
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.22);
}

.siscre-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.875rem 0.375rem 0.375rem;
  border-radius: 100px;
  background: var(--siscre-bg-elevated);
  border: 1px solid var(--siscre-border);
  box-shadow: var(--siscre-shadow-xs);
}

.siscre-user-chip__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, var(--siscre-primary) 0%, var(--siscre-primary-hover) 100%);
  flex-shrink: 0;
}

.siscre-user-chip__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  text-align: left;
}

.siscre-user-chip__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--siscre-text);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.siscre-user-chip__role {
  font-size: 0.6875rem;
  color: var(--siscre-text-muted);
}

/* Theme toggle */
.siscre-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: var(--siscre-radius-md);
  border: 1px solid var(--siscre-border);
  background: var(--siscre-bg-elevated);
  color: var(--siscre-text-muted);
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.siscre-theme-toggle:hover {
  color: var(--siscre-text);
  background: var(--siscre-surface-alt);
  border-color: var(--siscre-border);
}

html[data-theme="dark"] .siscre-theme-toggle .siscre-theme-icon-light {
  display: none !important;
}

html[data-theme="dark"] .siscre-theme-toggle .siscre-theme-icon-dark {
  display: inline-block !important;
}

html[data-theme="light"] .siscre-theme-toggle .siscre-theme-icon-dark {
  display: none !important;
}

/* —— Typography / page header —— */
.page-header {
  border-bottom: 1px solid var(--siscre-border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.page-header .h4,
.page-header h1,
.page-header h1.h4 {
  color: var(--siscre-text);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.035em;
}

@media (min-width: 768px) {
  .page-header .h4,
  .page-header h1,
  .page-header h1.h4 {
    font-size: 1.375rem;
  }
}

.siscre-content .text-muted {
  color: var(--siscre-text-muted) !important;
}

/* —— Cards —— */
.siscre-content .card {
  border-radius: var(--siscre-radius-lg);
  border: 1px solid var(--siscre-border);
  background: var(--siscre-bg-elevated);
  box-shadow: var(--siscre-shadow-card);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.siscre-content .card.shadow-sm.border-0 {
  border: 1px solid var(--siscre-border) !important;
  box-shadow: var(--siscre-shadow-card);
}

.siscre-content .card.shadow-sm.border-0:hover {
  box-shadow: var(--siscre-shadow-card-hover);
  border-color: var(--siscre-border) !important;
}

.siscre-content .card.shadow-sm.border-0 .card-header.bg-white {
  background: color-mix(in srgb, var(--siscre-bg-elevated) 96%, var(--siscre-surface-alt)) !important;
  border-bottom: 1px solid var(--siscre-border);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: -0.02em;
  color: var(--siscre-text);
  padding: 0.875rem 1.125rem;
}

.card-metric {
  border: 1px solid var(--siscre-border);
  border-radius: var(--siscre-radius-lg);
  box-shadow: var(--siscre-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background: var(--siscre-bg-elevated);
}

.card-metric:hover {
  transform: translateY(-1px);
  box-shadow: var(--siscre-shadow-card-hover);
  border-color: var(--siscre-border-subtle);
}

.card-metric .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--siscre-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  background: var(--siscre-primary-muted);
  color: var(--siscre-primary);
}

/* —— Buttons —— */
.siscre-content .btn {
  border-radius: var(--siscre-radius-md);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.45rem 0.9rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.siscre-content .btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: var(--siscre-radius-sm);
}

.siscre-content .btn-lg {
  padding: 0.55rem 1.15rem;
  border-radius: var(--siscre-radius-md);
}

.siscre-content .btn-primary {
  background: var(--siscre-primary);
  border-color: var(--siscre-primary);
  box-shadow: none;
}

.siscre-content .btn-primary:hover:not(:disabled) {
  background: var(--siscre-primary-hover);
  border-color: var(--siscre-primary-hover);
  box-shadow: var(--siscre-shadow-xs);
}

.siscre-content .btn-outline-primary {
  color: var(--siscre-primary);
  border-color: color-mix(in srgb, var(--siscre-primary) 35%, var(--siscre-border));
}

.siscre-content .btn-outline-primary:hover:not(:disabled) {
  background: var(--siscre-primary-muted);
  border-color: var(--siscre-primary);
  color: var(--siscre-primary);
}

.siscre-content .btn-outline-secondary {
  border-color: var(--siscre-border);
  color: var(--siscre-text-secondary);
  background: var(--siscre-bg-elevated);
}

.siscre-content .btn-outline-secondary:hover:not(:disabled) {
  background: var(--siscre-surface-alt);
  border-color: var(--siscre-border);
  color: var(--siscre-text);
}

.siscre-content .btn-danger {
  box-shadow: none;
}

.siscre-content .btn:hover:not(:disabled) {
  box-shadow: none;
}

.siscre-content .btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* —— Tables —— */
.siscre-content .table {
  vertical-align: middle;
  color: var(--siscre-text);
  --bs-table-bg: transparent;
  --bs-table-hover-bg: color-mix(in srgb, var(--siscre-primary) 6%, transparent);
}

.siscre-content .table thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--siscre-text-muted);
  border-bottom-color: var(--siscre-border);
  padding: 0.75rem 0.875rem;
  background: transparent;
}

.siscre-content .table td {
  padding: 0.75rem 0.875rem;
  border-color: var(--siscre-border);
}

.siscre-content .table-light {
  --bs-table-bg: color-mix(in srgb, var(--siscre-surface-alt) 85%, transparent);
  color: var(--siscre-text);
}

html[data-theme="dark"] .siscre-content .table-light {
  --bs-table-bg: rgba(255, 255, 255, 0.04);
}

.table-hover tbody tr:hover {
  --bs-table-hover-bg: color-mix(in srgb, var(--siscre-primary) 7%, transparent);
}

/* —— Forms —— */
.siscre-content .form-label,
.siscre-content .col-form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--siscre-text-secondary);
  margin-bottom: 0.375rem;
}

.siscre-content .form-control,
.siscre-content .form-select {
  border-radius: var(--siscre-radius-md);
  border-color: var(--siscre-border);
  background: var(--siscre-bg-elevated);
  color: var(--siscre-text);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.siscre-content .form-control::placeholder {
  color: var(--siscre-text-muted);
  opacity: 0.75;
}

.siscre-content .form-control:focus,
.siscre-content .form-select:focus {
  border-color: var(--siscre-primary);
  box-shadow: 0 0 0 3px var(--siscre-focus-ring);
  background: var(--siscre-bg-elevated);
  color: var(--siscre-text);
}

.siscre-content .input-group-text {
  border-radius: var(--siscre-radius-md);
  border-color: var(--siscre-border);
  background: var(--siscre-surface-alt);
  color: var(--siscre-text-muted);
  font-size: 0.8125rem;
}

.siscre-content .form-text {
  color: var(--siscre-text-muted);
  font-size: 0.75rem;
}

/* —— Permissions matrix (utilizadores) —— */
.siscre-permissions-panel {
  background: color-mix(in srgb, var(--siscre-surface-alt) 50%, var(--siscre-bg-elevated));
  border-color: var(--siscre-border) !important;
}

.siscre-permissions-hint {
  color: var(--siscre-text-secondary);
}

.siscre-permissions-hint strong {
  color: var(--siscre-text);
  font-weight: 600;
}

.siscre-permissions-table-wrap {
  background: var(--siscre-bg-elevated);
  border-color: var(--siscre-border) !important;
}

.siscre-permissions-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--siscre-text);
  --bs-table-border-color: var(--siscre-border);
  color: var(--siscre-text);
}

.siscre-permissions-table thead th {
  background: var(--siscre-surface-alt);
  color: var(--siscre-text-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-color: var(--siscre-border);
}

.siscre-permissions-table tbody td {
  border-color: var(--siscre-border);
  color: var(--siscre-text);
}

.siscre-permissions-table tbody tr:hover {
  background: color-mix(in srgb, var(--siscre-primary) 6%, transparent);
}

.siscre-permissions-table .form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0;
  border: 2px solid var(--siscre-text-muted);
  background-color: var(--siscre-bg);
  cursor: pointer;
}

.siscre-permissions-table .form-check-input:checked {
  background-color: var(--siscre-primary);
  border-color: var(--siscre-primary);
}

.siscre-permissions-table .form-check-input:focus {
  border-color: var(--siscre-primary);
  box-shadow: 0 0 0 3px var(--siscre-focus-ring);
}

html[data-theme="dark"] .siscre-permissions-table .form-check-input {
  border-color: #a1a1aa;
  background-color: #18181b;
}

html[data-theme="dark"] .siscre-permissions-table .form-check-input:checked {
  background-color: var(--siscre-primary);
  border-color: var(--siscre-primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2309090b' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.siscre-content .card-footer {
  background: var(--siscre-bg-elevated);
  border-top: 1px solid var(--siscre-border);
}

.siscre-content .card-footer.bg-white {
  background: var(--siscre-bg-elevated) !important;
}

/* —— Métodos de pagamento (assinatura) —— */
.siscre-pay-method {
  display: block;
  margin: 0;
  cursor: pointer;
}

.siscre-pay-method__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.siscre-pay-method__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 0.75rem;
  border: 2px solid var(--siscre-border);
  border-radius: var(--siscre-radius-md);
  background: var(--siscre-bg-elevated);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 7.5rem;
  justify-content: center;
}

.siscre-pay-method:hover .siscre-pay-method__card {
  border-color: color-mix(in srgb, var(--siscre-primary) 40%, var(--siscre-border));
}

.siscre-pay-method__input:focus-visible + .siscre-pay-method__card {
  outline: 2px solid var(--siscre-primary);
  outline-offset: 2px;
}

.siscre-pay-method__input:checked + .siscre-pay-method__card,
.siscre-pay-method--picked .siscre-pay-method__card {
  border-color: var(--siscre-primary);
  box-shadow: 0 0 0 3px var(--siscre-focus-ring), 0 8px 20px color-mix(in srgb, var(--siscre-primary) 18%, transparent);
  background: color-mix(in srgb, var(--siscre-primary) 10%, var(--siscre-bg-elevated));
  transform: translateY(-2px);
}

.siscre-pay-methods--has-selection .siscre-pay-method:not(.siscre-pay-method--picked) .siscre-pay-method__card {
  opacity: 0.52;
  filter: grayscale(0.15);
}

.siscre-pay-method--picked .siscre-pay-method__name {
  color: var(--siscre-primary);
}

.siscre-pay-method--picked .siscre-pay-method__prefix {
  font-weight: 600;
  color: var(--siscre-primary);
}

.siscre-pay-method-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--siscre-radius-md);
  background: color-mix(in srgb, var(--siscre-primary) 12%, var(--siscre-bg-elevated));
  border: 1px solid color-mix(in srgb, var(--siscre-primary) 28%, transparent);
  color: var(--siscre-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.siscre-pay-method-banner .bi {
  color: var(--siscre-primary);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.siscre-checkout-form .form-label.fw-semibold {
  color: var(--siscre-text);
}

.siscre-pay-method__logo {
  display: block;
  max-width: 100%;
  width: auto;
  height: 3rem;
  object-fit: contain;
  object-position: center;
}

html[data-theme="dark"] .siscre-pay-method__logo {
  filter: none;
}

.siscre-pay-method__meta {
  text-align: center;
  line-height: 1.3;
}

.siscre-pay-method__name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--siscre-text);
}

.siscre-pay-method__prefix {
  display: block;
  font-size: 0.6875rem;
  color: var(--siscre-text-muted);
  letter-spacing: 0.02em;
}

.siscre-pay-method__check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.125rem;
  color: var(--siscre-primary);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.siscre-pay-method__input:checked + .siscre-pay-method__card .siscre-pay-method__check {
  opacity: 1;
  transform: scale(1);
}

/* —— Alerts —— */
.siscre-content .alert {
  border-radius: var(--siscre-radius-md);
  border: 1px solid transparent;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
}

.siscre-content .alert-success {
  background: color-mix(in srgb, #10b981 12%, var(--siscre-bg-elevated));
  color: #047857;
  border-color: color-mix(in srgb, #10b981 22%, transparent);
}

html[data-theme="dark"] .siscre-content .alert-success {
  color: #6ee7b7;
}

.siscre-content .alert-danger {
  background: color-mix(in srgb, #f43f5e 10%, var(--siscre-bg-elevated));
  color: #be123c;
  border-color: color-mix(in srgb, #f43f5e 20%, transparent);
}

html[data-theme="dark"] .siscre-content .alert-danger {
  color: #fda4af;
}

.siscre-content .alert-warning:not(.border-0) {
  background: color-mix(in srgb, #f59e0b 12%, var(--siscre-bg-elevated));
  color: #b45309;
  border-color: color-mix(in srgb, #f59e0b 22%, transparent);
}

html[data-theme="dark"] .siscre-content .alert-warning:not(.border-0) {
  color: #fcd34d;
}

.siscre-content .alert-info {
  background: color-mix(in srgb, var(--siscre-primary) 10%, var(--siscre-bg-elevated));
  color: var(--siscre-text);
  border-color: color-mix(in srgb, var(--siscre-primary) 22%, transparent);
}

.siscre-content .alert.border-0.shadow-sm {
  border: 1px solid var(--siscre-border) !important;
  box-shadow: var(--siscre-shadow-sm) !important;
  background: var(--siscre-bg-elevated);
  color: var(--siscre-text);
}

/* —— Pagination —— */
.siscre-content .pagination .page-link {
  border-radius: var(--siscre-radius-sm);
  border: 1px solid var(--siscre-border);
  color: var(--siscre-text-secondary);
  background: var(--siscre-bg-elevated);
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  margin: 0 0.125rem;
}

.siscre-content .pagination .page-item.disabled .page-link {
  background: var(--siscre-surface-alt);
  color: var(--siscre-text-muted);
  opacity: 1;
}

.siscre-content .pagination .page-link:hover {
  background: var(--siscre-surface-alt);
  border-color: var(--siscre-border);
  color: var(--siscre-primary);
}

/* —— Modals & dropdowns —— */
.siscre-content .modal-content {
  border-radius: var(--siscre-radius-lg);
  border: 1px solid var(--siscre-border);
  background: var(--siscre-bg-elevated);
  box-shadow: var(--siscre-shadow-md);
}

.siscre-content .modal-header {
  border-bottom-color: var(--siscre-border);
  padding: 1rem 1.25rem;
}

.siscre-content .modal-footer {
  border-top-color: var(--siscre-border);
}

.siscre-content .dropdown-menu {
  border-radius: var(--siscre-radius-md);
  border: 1px solid var(--siscre-border);
  box-shadow: var(--siscre-shadow-md);
  background: var(--siscre-bg-elevated);
  padding: 0.35rem;
}

.siscre-content .dropdown-item {
  border-radius: var(--siscre-radius-sm);
  font-size: 0.8125rem;
  padding: 0.4rem 0.65rem;
}

.siscre-content .dropdown-item:hover {
  background: var(--siscre-surface-alt);
  color: var(--siscre-text);
}

/* —— Badges (estados crédito) —— */
.badge-status-solicitada { background-color: #71717a; color: #fff; font-weight: 500; }
.badge-status-em_analise { background-color: #38bdf8; color: #0c4a6e; font-weight: 500; }
.badge-status-analise_concluida { background-color: #8b5cf6; color: #fff; font-weight: 500; }
.badge-status-aprovacao_pendente { background-color: #fb923c; color: #431407; font-weight: 500; }
.badge-status-aprovada { background-color: #22c55e; color: #052e16; font-weight: 500; }
.badge-status-rejeitada { background-color: #f43f5e; color: #fff; font-weight: 500; }
.badge-status-desembolsada { background-color: #3b82f6; color: #fff; font-weight: 500; }
.badge-status-encerrada { background-color: #52525b; color: #fff; font-weight: 500; }

.siscre-content .badge {
  font-weight: 500;
  padding: 0.35em 0.55em;
  border-radius: var(--siscre-radius-sm);
}

/* —— Charts —— */
.siscre-chart-wrap {
  position: relative;
  min-height: 220px;
}

.siscre-chart-wrap--compact {
  min-height: 200px;
}

.siscre-chart-wrap--short {
  min-height: 180px;
}

/* —— Brand / misc —— */
img.siscre-brand-logo {
  height: 48px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  vertical-align: middle;
}

img.siscre-brand-logo--login {
  height: 80px;
  max-width: 200px;
}

img.siscre-brand-logo--landing {
  height: 56px;
  max-width: 170px;
}

img.siscre-brand-logo--footer {
  height: 20px;
  max-width: 140px;
}

.bg-siscre {
  background: linear-gradient(135deg, var(--siscre-primary) 0%, var(--siscre-primary-hover) 100%) !important;
}

/* —— Login —— */
body.siscre-login-page {
  min-height: 100vh;
  font-family: var(--siscre-font-sans);
  color: var(--siscre-text);
  display: flex;
  align-items: center;
  background-color: var(--siscre-bg);
  background-image:
    radial-gradient(ellipse 100% 80% at 100% -20%, rgba(79, 70, 229, 0.08), transparent 50%),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(13, 148, 136, 0.06), transparent 48%);
}

html[data-theme="dark"] body.siscre-login-page {
  background-image:
    radial-gradient(ellipse 100% 70% at 80% -15%, rgba(129, 140, 248, 0.12), transparent 50%);
}

.siscre-login-card {
  border: 1px solid var(--siscre-border) !important;
  border-radius: var(--siscre-radius-xl) !important;
  box-shadow: var(--siscre-shadow-card), 0 24px 64px rgba(15, 23, 42, 0.1) !important;
  overflow: hidden;
  background: var(--siscre-bg-elevated) !important;
}

html[data-theme="dark"] .siscre-login-card {
  box-shadow: var(--siscre-shadow-card), 0 24px 64px rgba(0, 0, 0, 0.5) !important;
}

.siscre-login-card .card-body {
  padding: 2rem !important;
}

.siscre-login-page .siscre-login-card .btn[type="submit"] {
  border-radius: var(--siscre-radius-md);
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-weight: 600;
  background: var(--siscre-primary);
  border-color: var(--siscre-primary);
}

.siscre-login-page .siscre-login-card .btn[type="submit"]:hover {
  background: var(--siscre-primary-hover);
  border-color: var(--siscre-primary-hover);
}

.siscre-login-page .form-control {
  border-radius: var(--siscre-radius-md);
  border-color: var(--siscre-border);
  background: var(--siscre-bg-elevated);
  color: var(--siscre-text);
}

.siscre-login-page .form-control:focus {
  border-color: var(--siscre-primary);
  box-shadow: 0 0 0 3px var(--siscre-focus-ring);
}

/* —— Landing (pública) —— */
.landing-nav {
  background: color-mix(in srgb, var(--siscre-bg-elevated) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--siscre-border);
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 5.5rem;
  background: linear-gradient(155deg, #0f172a 0%, #1e1b4b 42%, #312e81 100%);
  color: #fff;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(129, 140, 248, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(45, 212, 191, 0.12) 0%, transparent 40%);
  pointer-events: none;
}

.landing-hero .landing-hero-inner {
  position: relative;
  z-index: 1;
}

.landing-hero h1 {
  font-weight: 600;
  letter-spacing: -0.03em;
}

.landing-hero .lead {
  opacity: 0.9;
  max-width: 36rem;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.landing-feature-card {
  border: 1px solid var(--siscre-border);
  border-radius: var(--siscre-radius-lg);
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--siscre-shadow-sm);
  background: var(--siscre-bg-elevated);
}

.landing-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--siscre-shadow-card-hover);
  border-color: var(--siscre-border-subtle);
}

.landing-feature-card .icon-round {
  width: 48px;
  height: 48px;
  border-radius: var(--siscre-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--siscre-primary-muted);
  color: var(--siscre-primary);
}

.landing-section-title {
  font-weight: 600;
  color: var(--siscre-text);
  letter-spacing: -0.02em;
}

.landing-muted {
  color: var(--siscre-text-muted);
}

/* Toggle de tema na landing (navbar clara) */
.siscre-landing .siscre-theme-toggle {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .siscre-landing .siscre-theme-toggle {
  border-color: #3f3f46;
  background: #18181b;
  color: #d4d4d8;
}

.landing-cta-bar {
  background: color-mix(in srgb, var(--siscre-primary) 6%, var(--siscre-bg-elevated));
  border-radius: var(--siscre-radius-lg);
  border: 1px solid var(--siscre-border);
}

.landing-hero-visual {
  position: relative;
}

.landing-hero-img {
  width: 100%;
  height: auto;
  border-radius: var(--siscre-radius-xl);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
  display: block;
}

.landing-hero-collage {
  position: relative;
}

.landing-hero-photo-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--siscre-radius-xl);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
  display: block;
}

.landing-hero-photo-inset {
  position: absolute;
  right: 0.25rem;
  bottom: 5.5rem;
  width: 38%;
  max-width: 220px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--siscre-radius-lg);
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
}

.landing-stock-showcase {
  background: linear-gradient(180deg, var(--siscre-bg-elevated) 0%, var(--siscre-bg) 100%);
}

.landing-stock-caption {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--siscre-text-muted);
  font-weight: 600;
}

.landing-stock-frame {
  border-radius: var(--siscre-radius-xl);
  overflow: hidden;
  box-shadow: var(--siscre-shadow-card);
  border: 1px solid var(--siscre-border);
  background: var(--siscre-surface-alt);
}

.landing-stock-photo {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.landing-stock-frame:hover .landing-stock-photo {
  transform: scale(1.03);
}

.landing-stock-wide {
  border-radius: var(--siscre-radius-xl);
  overflow: hidden;
  box-shadow: var(--siscre-shadow-card);
  border: 1px solid var(--siscre-border);
}

.landing-stock-wide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (min-width: 992px) {
  .landing-stock-wide img {
    height: 260px;
  }
}

.landing-suporte-photo {
  max-width: 100%;
  border-radius: var(--siscre-radius-xl);
  box-shadow: var(--siscre-shadow-card);
  border: 1px solid var(--siscre-border);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.landing-hero-card {
  position: relative;
  z-index: 2;
  margin-top: -2.25rem;
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}

@media (min-width: 992px) {
  .landing-hero-card {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
  }
}

.landing-section-figure {
  margin-bottom: 0;
}

.landing-section-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--siscre-radius-xl);
  box-shadow: var(--siscre-shadow-card);
  border: 1px solid var(--siscre-border);
}

.landing-card-illu {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--siscre-radius-lg) var(--siscre-radius-lg) 0 0;
  background: linear-gradient(180deg, var(--siscre-surface-alt) 0%, var(--siscre-bg-elevated) 100%);
}

.landing-feature-card.has-illu .card-body {
  border-radius: 0 0 var(--siscre-radius-lg) var(--siscre-radius-lg);
}

.landing-split-img {
  max-height: 220px;
  width: 100%;
  object-fit: contain;
}

@media (max-width: 767.98px) {
  .landing-hero {
    padding: 3rem 0 3.5rem;
  }

  .landing-hero-card {
    margin-top: -1.5rem;
  }

  .landing-hero-photo-inset {
    width: 34%;
    max-width: 140px;
    bottom: 5rem;
    right: 0.15rem;
    border-width: 3px;
  }
}

/* —— Planos de assinatura —— */
.siscre-plan-card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.siscre-plan-card--selected {
  border: 2px solid var(--siscre-primary) !important;
  box-shadow: 0 0 0 4px var(--siscre-focus-ring);
  transform: translateY(-2px);
}

.siscre-plan-card--current {
  opacity: 0.92;
  background: var(--siscre-surface-alt, rgba(13, 148, 136, 0.04));
}

.siscre-plan-card--current .fs-4 {
  font-size: 1.35rem !important;
}

.siscre-checkout-pricing {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--siscre-radius, 0.5rem);
  background: var(--siscre-bg-subtle, rgba(15, 23, 42, 0.04));
  border: 1px solid var(--siscre-border, rgba(15, 23, 42, 0.08));
}

.siscre-checkout-pricing__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9375rem;
}

.siscre-checkout-pricing__label {
  font-weight: 700;
  color: var(--siscre-text, #0f172a);
}

.siscre-checkout-pricing__value {
  font-weight: 600;
  color: var(--siscre-text, #0f172a);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.siscre-checkout-pricing__value--struck {
  text-decoration: line-through;
  color: var(--siscre-text-muted, #64748b);
  font-weight: 500;
}

.siscre-checkout-pricing__row--discount .siscre-checkout-pricing__value {
  color: var(--bs-success, #15803d);
}

.siscre-checkout-pricing__row--total {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--siscre-border, rgba(15, 23, 42, 0.15));
}

.siscre-checkout-pricing__row--total .siscre-checkout-pricing__label {
  font-size: 1.0625rem;
}

.siscre-checkout-pricing__row--total .siscre-checkout-pricing__value {
  color: var(--siscre-primary, #0d9488);
  font-size: 1.25rem;
  font-weight: 800;
}

/* —— Carregamento global —— */
.siscre-global-loader {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

html.siscre-page-loading .siscre-global-loader,
.siscre-global-loader.siscre-global-loader--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.siscre-global-loader__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  min-width: 11rem;
  padding: 1.35rem 1.75rem;
  border-radius: var(--siscre-radius-lg, 0.75rem);
  background: var(--siscre-bg-elevated, #fff);
  border: 1px solid var(--siscre-border, rgba(15, 23, 42, 0.08));
  box-shadow: var(--siscre-shadow-lg, 0 20px 40px rgba(15, 23, 42, 0.12));
  color: var(--siscre-text, #0f172a);
}

.siscre-global-loader__spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--siscre-border, rgba(15, 23, 42, 0.12));
  border-top-color: var(--siscre-primary, #0d9488);
  border-radius: 50%;
  animation: siscre-loader-spin 0.75s linear infinite;
}

.siscre-global-loader__text {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

@keyframes siscre-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

[data-theme="dark"] .siscre-global-loader {
  background: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .siscre-global-loader__panel {
  background: var(--siscre-bg-elevated, #18181b);
  border-color: var(--siscre-border, rgba(255, 255, 255, 0.1));
  color: var(--siscre-text, #fafafa);
}

/* —— Motion —— */
@media (prefers-reduced-motion: reduce) {
  .siscre-global-loader__spinner {
    animation-duration: 0.01ms !important;
  }

  .card-metric,
  .siscre-content .card.shadow-sm.border-0,
  .siscre-content .btn,
  .landing-feature-card,
  .landing-stock-photo {
    transition-duration: 0.01ms !important;
  }

  .card-metric:hover,
  .landing-feature-card:hover,
  .landing-stock-frame:hover .landing-stock-photo {
    transform: none;
  }

  .siscre-content .btn:active:not(:disabled) {
    transform: none;
  }
}
