:root {
  color-scheme: light;
  --asmp-navy: #081f38;
  --asmp-navy-soft: #0d2e4e;
  --asmp-blue: #116991;
  --asmp-blue-hover: #0d587b;
  --asmp-blue-light: #eaf4f8;
  --asmp-bg: #f5f7fa;
  --asmp-surface: #ffffff;
  --asmp-surface-soft: #f9fbfc;
  --asmp-text: #17212b;
  --asmp-muted: #667586;
  --asmp-border: #dce4ea;
  --asmp-success: #15803d;
  --asmp-warning: #b45309;
  --asmp-danger: #b91c1c;
  --asmp-info: #116991;
  --asmp-focus: #2d8fb8;
  --sidebar-width: 270px;
  --topbar-height: 76px;
  --shadow-sm: 0 1px 2px rgb(8 31 56 / 6%), 0 4px 16px rgb(8 31 56 / 5%);
  --shadow-lg: 0 24px 70px rgb(8 31 56 / 18%);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

[data-theme="dark"] {
  color-scheme: dark;
  --asmp-bg: #071421;
  --asmp-surface: #0d2235;
  --asmp-surface-soft: #102a40;
  --asmp-text: #ecf4fa;
  --asmp-muted: #9eb0bf;
  --asmp-border: #294156;
  --asmp-blue-light: #12344a;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 18%), 0 8px 20px rgb(0 0 0 / 14%);
  --shadow-lg: 0 24px 70px rgb(0 0 0 / 34%);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--asmp-text);
  background: var(--asmp-bg);
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { font: inherit; }

button,
select { cursor: pointer; }

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--asmp-focus), transparent 35%);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 1rem;
  padding: 0.8rem 1rem;
  color: white;
  border-radius: 0 0 8px 8px;
  background: var(--asmp-blue);
  transform: translateY(-120%);
}

.skip-link:focus { transform: translateY(0); }

.is-hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Login */
.login-shell {
  display: grid;
  grid-template-columns: minmax(500px, 1.15fr) minmax(420px, 0.85fr);
  min-height: 100vh;
  background: var(--asmp-surface);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(2.5rem, 5vw, 5.5rem);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 14% 8%, rgb(17 105 145 / 54%), transparent 26rem),
    radial-gradient(circle at 95% 85%, rgb(17 105 145 / 25%), transparent 28rem),
    linear-gradient(145deg, #06192d, var(--asmp-navy) 56%, #0a2c4a);
}

.login-brand::before,
.login-brand::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.login-brand::before {
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgb(255 255 255 / 9%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 9%) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom right, black, transparent 74%);
}

.login-brand::after {
  right: -8rem;
  bottom: -9rem;
  width: 32rem;
  height: 32rem;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgb(255 255 255 / 2%), 0 0 0 10rem rgb(255 255 255 / 1%);
}

.login-logo {
  position: relative;
  z-index: 1;
  width: min(280px, 62%);
  height: auto;
}

.login-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-block: auto;
  padding-block: 4rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 1rem;
  color: #75c1df;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-brand h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(3.5rem, 7vw, 7.4rem);
  line-height: 0.93;
  letter-spacing: -0.065em;
}

.login-brand-copy > p:last-child {
  max-width: 600px;
  margin: 2rem 0 0;
  color: #c6d6e4;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  line-height: 1.7;
}

.trust-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
  margin: 0;
  padding: 0;
  color: #dce8f2;
  list-style: none;
  font-size: 0.86rem;
}

.trust-list span {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.35rem;
  color: #9fe0b5;
  border: 1px solid rgb(159 224 181 / 42%);
  border-radius: 50%;
}

.login-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(2rem, 6vw, 6rem);
  background: var(--asmp-surface);
}

.login-card {
  width: min(100%, 450px);
  margin: auto;
}

.mobile-login-brand { display: none; }
.section-kicker { color: var(--asmp-blue); }

.login-card h2,
.dialog h2 {
  margin: 0;
  color: var(--asmp-navy);
  font-size: clamp(2.1rem, 3.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

[data-theme="dark"] .login-card h2,
[data-theme="dark"] .dialog h2 { color: var(--asmp-text); }

.supporting-copy {
  margin: 0.8rem 0 2.2rem;
  color: var(--asmp-muted);
}

#login-form { display: grid; gap: 1.15rem; }

.field { display: grid; gap: 0.45rem; }
.field label,
.filter-field label {
  color: var(--asmp-text);
  font-size: 0.84rem;
  font-weight: 750;
}

.field small {
  color: var(--asmp-muted);
  font-size: 0.74rem;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0.74rem 0.85rem;
  color: var(--asmp-text);
  border: 1px solid var(--asmp-border);
  border-radius: var(--radius-sm);
  background: var(--asmp-surface);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:hover,
select:hover { border-color: color-mix(in srgb, var(--asmp-blue), var(--asmp-border) 48%); }

input:focus,
select:focus {
  border-color: var(--asmp-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgb(17 105 145 / 14%);
}

.text-button,
.recovery-link {
  padding: 0;
  color: var(--asmp-blue);
  border: 0;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 750;
}

.recovery-link { justify-self: center; }
.text-button:hover,
.recovery-link:hover { text-decoration: underline; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  color: var(--asmp-text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-weight: 760;
  text-decoration: none;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease;
}

.button:active:not(:disabled) { transform: translateY(1px); }
.button-full { width: 100%; justify-content: space-between; }

.button-primary {
  color: white;
  border-color: var(--asmp-blue);
  background: var(--asmp-blue);
  box-shadow: 0 6px 18px rgb(17 105 145 / 18%);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--asmp-blue-hover);
  background: var(--asmp-blue-hover);
}

.button-ghost {
  border-color: var(--asmp-border);
  background: var(--asmp-surface);
}

.button-ghost:hover:not(:disabled) { background: var(--asmp-blue-light); }
.button-danger { color: white; background: var(--asmp-danger); }
.button-small { min-height: 36px; padding: 0.45rem 0.7rem; font-size: 0.8rem; }

.inline-message {
  padding: 0.85rem 1rem;
  color: var(--asmp-danger);
  border: 1px solid color-mix(in srgb, var(--asmp-danger), transparent 70%);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--asmp-danger), transparent 94%);
  font-size: 0.84rem;
}

.inline-message.success {
  color: var(--asmp-success);
  border-color: color-mix(in srgb, var(--asmp-success), transparent 70%);
  background: color-mix(in srgb, var(--asmp-success), transparent 94%);
}

.login-security,
.login-footer {
  color: var(--asmp-muted);
  font-size: 0.74rem;
  text-align: center;
}

.login-security { margin: 2rem 0 0; }
.login-security span { color: var(--asmp-success); }
.login-footer { margin-top: 2rem; }

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

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  color: #dce8f2;
  background: var(--asmp-navy);
  box-shadow: 8px 0 28px rgb(8 31 56 / 9%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: var(--topbar-height);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.sidebar-brand img {
  width: 92px;
  height: 34px;
  object-fit: contain;
  object-position: left center;
}

.sidebar-brand div { display: grid; }
.sidebar-brand strong { color: white; font-size: 0.9rem; }
.sidebar-brand span { color: #8fa8bd; font-size: 0.68rem; }

.main-navigation {
  flex: 1;
  padding: 1rem 0.8rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-group { margin-bottom: 1.25rem; }
.nav-group > p {
  margin: 0 0 0.4rem;
  padding: 0 0.75rem;
  color: #7892a8;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin: 0.14rem 0;
  padding: 0.58rem 0.7rem;
  color: #bed0df;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  font-size: 0.83rem;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.nav-item:hover {
  color: white;
  background: rgb(255 255 255 / 7%);
}

.nav-item[aria-current="page"] {
  color: white;
  background: var(--asmp-blue);
  box-shadow: 0 8px 20px rgb(0 0 0 / 13%);
}

.nav-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.75rem;
  margin-right: 0.35rem;
  color: #8fc3dc;
  font-size: 1rem;
  font-weight: 800;
}

.nav-item[aria-current="page"] .nav-icon { color: white; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 54px;
  padding: 0.9rem 1.35rem;
  color: #93aabd;
  border-top: 1px solid rgb(255 255 255 / 10%);
  font-size: 0.72rem;
}

.connection-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--asmp-success);
  box-shadow: 0 0 0 4px rgb(21 128 61 / 13%);
}

.connection-dot.warning { background: var(--asmp-warning); box-shadow: 0 0 0 4px rgb(180 83 9 / 13%); }
.connection-dot.danger { background: var(--asmp-danger); box-shadow: 0 0 0 4px rgb(185 28 28 / 13%); }

.sidebar-scrim { display: none; }
.app-column {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 0.75rem clamp(1rem, 2.5vw, 2.25rem);
  border-bottom: 1px solid var(--asmp-border);
  background: color-mix(in srgb, var(--asmp-surface), transparent 5%);
  backdrop-filter: blur(14px);
}

.breadcrumb-wrap { min-width: 0; }
.breadcrumb {
  display: flex;
  gap: 0.45rem;
  margin: 0 0 0.15rem;
  color: var(--asmp-muted);
  font-size: 0.68rem;
}

.breadcrumb strong { color: var(--asmp-blue); }
.breadcrumb-wrap h1 {
  margin: 0;
  overflow: hidden;
  color: var(--asmp-text);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--asmp-text);
  border: 1px solid var(--asmp-border);
  border-radius: 10px;
  background: var(--asmp-surface);
  font-size: 1.05rem;
}

.icon-button:hover { background: var(--asmp-blue-light); }
.mobile-menu-button,
.mobile-filter-button { display: none; }

.sync-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  color: var(--asmp-text);
  border: 1px solid var(--asmp-border);
  border-radius: 10px;
  background: var(--asmp-surface);
  text-align: left;
}

.sync-chip span:last-child { display: grid; }
.sync-chip small { color: var(--asmp-muted); font-size: 0.61rem; }
.sync-chip strong { font-size: 0.72rem; font-weight: 760; }

.profile-menu { position: relative; }
.profile-button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.35rem 0.55rem;
  color: var(--asmp-text);
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.profile-button:hover { background: var(--asmp-blue-light); }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: white;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--asmp-blue), #3d92b5);
  font-size: 0.74rem;
  font-weight: 850;
}

.profile-copy { display: grid; min-width: 100px; }
.profile-copy strong { overflow: hidden; max-width: 160px; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: var(--asmp-muted); font-size: 0.64rem; }

.profile-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 0.45rem);
  right: 0;
  display: grid;
  width: 210px;
  padding: 0.45rem;
  border: 1px solid var(--asmp-border);
  border-radius: 12px;
  background: var(--asmp-surface);
  box-shadow: var(--shadow-lg);
}

.profile-popover button {
  min-height: 40px;
  padding: 0.55rem 0.7rem;
  color: var(--asmp-text);
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.profile-popover button:hover { background: var(--asmp-blue-light); }

.global-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(120px, 0.65fr)) auto auto;
  align-items: end;
  gap: 0.75rem;
  padding: 1rem clamp(1rem, 2.5vw, 2.25rem);
  border-bottom: 1px solid var(--asmp-border);
  background: var(--asmp-surface);
}

.filter-field { display: grid; gap: 0.32rem; min-width: 0; }
.filter-field select { min-height: 40px; padding-block: 0.5rem; }
.filter-apply,
.filter-clear { min-height: 40px; }

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 0;
  padding: 0 clamp(1rem, 2.5vw, 2.25rem);
  background: var(--asmp-bg);
}

.active-filters:not(:empty) { padding-top: 0.7rem; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  color: var(--asmp-blue);
  border: 1px solid color-mix(in srgb, var(--asmp-blue), transparent 70%);
  border-radius: 999px;
  background: var(--asmp-blue-light);
  font-size: 0.68rem;
  font-weight: 700;
}

.page-container {
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2.25rem);
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 2.5vw, 2.25rem);
  color: var(--asmp-muted);
  border-top: 1px solid var(--asmp-border);
  font-size: 0.68rem;
}

/* Reusable content */
.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-intro h2 {
  margin: 0 0 0.35rem;
  color: var(--asmp-text);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.035em;
}

.page-intro p { max-width: 760px; margin: 0; color: var(--asmp-muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.kpi-card,
.surface-card,
.state-card {
  border: 1px solid var(--asmp-border);
  border-radius: var(--radius);
  background: var(--asmp-surface);
  box-shadow: var(--shadow-sm);
}

.kpi-card { min-width: 0; padding: 1.15rem; }
.kpi-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.kpi-label { margin: 0; color: var(--asmp-muted); font-size: 0.75rem; font-weight: 700; }
.kpi-value {
  display: block;
  margin: 0.55rem 0 0.25rem;
  overflow: hidden;
  color: var(--asmp-text);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-meta { color: var(--asmp-muted); font-size: 0.68rem; }
.kpi-accent {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--asmp-blue);
  border-radius: 9px;
  background: var(--asmp-blue-light);
  font-size: 0.9rem;
  font-weight: 850;
}

.value-positive { color: var(--asmp-success) !important; }
.value-negative { color: var(--asmp-danger) !important; }
.value-warning { color: var(--asmp-warning) !important; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 1rem;
}

.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.surface-card { min-width: 0; padding: 1rem; }
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-header h3 { margin: 0; font-size: 0.98rem; }
.card-header p { margin: 0.25rem 0 0; color: var(--asmp-muted); font-size: 0.72rem; }
.card-actions { display: flex; gap: 0.45rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  color: var(--asmp-muted);
  border-radius: 999px;
  background: var(--asmp-bg);
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.success { color: var(--asmp-success); background: color-mix(in srgb, var(--asmp-success), transparent 91%); }
.status-badge.warning { color: var(--asmp-warning); background: color-mix(in srgb, var(--asmp-warning), transparent 91%); }
.status-badge.danger { color: var(--asmp-danger); background: color-mix(in srgb, var(--asmp-danger), transparent 91%); }
.status-badge.info { color: var(--asmp-blue); background: var(--asmp-blue-light); }

.data-table-wrap {
  position: relative;
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--asmp-border);
  border-radius: 10px;
  background: var(--asmp-surface);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.77rem;
}

.data-table th,
.data-table td {
  padding: 0.72rem 0.75rem;
  border-bottom: 1px solid var(--asmp-border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: var(--asmp-muted);
  background: var(--asmp-surface-soft);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--asmp-blue-light), transparent 32%); }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .total-row td { font-weight: 800; background: var(--asmp-surface-soft); }
.data-table .indent-1 { padding-left: 1.75rem; }
.data-table .indent-2 { padding-left: 2.75rem; }

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.table-search { position: relative; width: min(100%, 320px); }
.table-search input { min-height: 40px; padding-left: 2.1rem; }
.table-search::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 0.75rem;
  content: "⌕";
  color: var(--asmp-muted);
  transform: translateY(-50%);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.75rem;
  color: var(--asmp-muted);
  font-size: 0.72rem;
}

.table-pagination button {
  min-width: 36px;
  min-height: 36px;
  color: var(--asmp-text);
  border: 1px solid var(--asmp-border);
  border-radius: 8px;
  background: var(--asmp-surface);
}

.state-card {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.state-content { max-width: 560px; }
.state-icon {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 1rem;
  color: var(--asmp-blue);
  border: 1px solid color-mix(in srgb, var(--asmp-blue), transparent 72%);
  border-radius: 17px;
  background: var(--asmp-blue-light);
  font-size: 1.45rem;
  font-weight: 850;
}

.state-card h2 { margin: 0 0 0.55rem; font-size: 1.45rem; letter-spacing: -0.025em; }
.state-card p { margin: 0; color: var(--asmp-muted); }
.state-card .button { margin-top: 1.25rem; }

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 1rem;
  border-radius: 6px;
  background: var(--asmp-border);
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 45%), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.skeleton-card { min-height: 130px; }
.loading-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@keyframes shimmer { to { transform: translateX(100%); } }

.chart {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  min-height: 230px;
  padding: 1rem 0.5rem 0;
  border-bottom: 1px solid var(--asmp-border);
}

.chart-column {
  display: grid;
  flex: 1;
  grid-template-rows: 1fr auto;
  align-items: end;
  min-width: 20px;
  height: 210px;
}

.chart-bar-wrap { display: flex; align-items: end; justify-content: center; width: 100%; height: 100%; }
.chart-bar {
  width: min(32px, 68%);
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: var(--asmp-blue);
}

.chart-bar.negative { background: repeating-linear-gradient(135deg, var(--asmp-danger), var(--asmp-danger) 4px, transparent 4px, transparent 7px); }
.chart-label { margin-top: 0.45rem; color: var(--asmp-muted); font-size: 0.62rem; text-align: center; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.8rem; color: var(--asmp-muted); font-size: 0.7rem; }
.chart-legend span::before { display: inline-block; width: 0.65rem; height: 0.65rem; margin-right: 0.35rem; content: ""; border-radius: 2px; background: var(--asmp-blue); }
.svg-chart { display: block; width: 100%; min-height: 220px; }
.svg-chart-bar { fill: var(--asmp-blue); }
.svg-chart-bar.negative { fill: var(--asmp-danger); }
.svg-chart-label { fill: var(--asmp-muted); font: 600 12px "Segoe UI", sans-serif; }

.definition-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr);
  gap: 0;
  margin: 0;
}

.definition-list dt,
.definition-list dd {
  margin: 0;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--asmp-border);
}

.definition-list dt { color: var(--asmp-muted); font-size: 0.72rem; }
.definition-list dd { font-size: 0.78rem; font-weight: 700; overflow-wrap: anywhere; }

.warning-banner,
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  color: var(--asmp-warning);
  border: 1px solid color-mix(in srgb, var(--asmp-warning), transparent 70%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--asmp-warning), transparent 94%);
  font-size: 0.76rem;
}

.info-banner {
  color: var(--asmp-blue);
  border-color: color-mix(in srgb, var(--asmp-blue), transparent 70%);
  background: var(--asmp-blue-light);
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--asmp-border);
}

.tab-button {
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  color: var(--asmp-muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-weight: 750;
  white-space: nowrap;
}

.tab-button[aria-selected="true"] { color: var(--asmp-blue); background: var(--asmp-blue-light); }

.query-tenant-selector { max-width: 32rem; margin-bottom: 1rem; }
.query-manager { display: grid; gap: 1rem; }
.query-field { display: grid; gap: 0.4rem; font-weight: 700; color: var(--asmp-text); }
.query-field select,
.sql-query-editor {
  width: 100%;
  border: 1px solid var(--asmp-border);
  border-radius: 0.65rem;
  padding: 0.7rem 0.8rem;
  color: var(--asmp-text);
  background: var(--asmp-surface);
}
.sql-query-editor {
  min-height: 13rem;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
}
.query-enabled { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.query-enabled input { width: 1.1rem; height: 1.1rem; }
.query-version { margin: 0; color: var(--asmp-muted); font-size: 0.85rem; }

.toast-region {
  position: fixed;
  z-index: 200;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.6rem;
  width: min(380px, calc(100vw - 2rem));
}

.toast {
  padding: 0.85rem 1rem;
  color: var(--asmp-text);
  border: 1px solid var(--asmp-border);
  border-left: 4px solid var(--asmp-blue);
  border-radius: 10px;
  background: var(--asmp-surface);
  box-shadow: var(--shadow-lg);
  font-size: 0.78rem;
}

.toast.error { border-left-color: var(--asmp-danger); }
.toast.success { border-left-color: var(--asmp-success); }

.dialog {
  width: min(470px, calc(100vw - 2rem));
  padding: 0;
  color: var(--asmp-text);
  border: 1px solid var(--asmp-border);
  border-radius: var(--radius-lg);
  background: var(--asmp-surface);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop { background: rgb(8 31 56 / 58%); backdrop-filter: blur(4px); }
.dialog form { padding: 1.5rem; text-align: center; }
.dialog h2 { font-size: 1.55rem; }
.dialog p { color: var(--asmp-muted); }
.dialog-icon {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 0.8rem;
  color: var(--asmp-blue);
  border-radius: 14px;
  background: var(--asmp-blue-light);
  font-size: 1.2rem;
  font-weight: 850;
}

.dialog-icon-warning { color: var(--asmp-warning); background: color-mix(in srgb, var(--asmp-warning), transparent 91%); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-top: 1.25rem; }

/* Responsive */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-filter-bar { grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(110px, 0.7fr)) auto auto; }
  .compare-filter { display: none; }
  .sync-chip { display: none; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 280px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-main { min-height: 100vh; padding: 1.5rem; }
  .mobile-login-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2.5rem; }
  .mobile-login-brand img { width: 150px; height: auto; }
  .mobile-login-brand span { padding-left: 0.75rem; color: var(--asmp-muted); border-left: 1px solid var(--asmp-border); font-size: 0.78rem; font-weight: 800; }
  .app-shell { grid-template-columns: 1fr; }
  .app-column { grid-column: 1; }
  .sidebar {
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgb(8 31 56 / 52%);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }
  .sidebar-scrim.is-open { visibility: visible; opacity: 1; }
  .mobile-menu-button { display: inline-grid; }
  .topbar { gap: 0.8rem; }
  .breadcrumb span:first-child,
  .profile-copy { display: none; }
  .profile-button { padding-inline: 0.25rem; }
  .content-grid,
  .content-grid.equal { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { min-height: 66px; padding: 0.65rem 0.8rem; }
  .breadcrumb { display: none; }
  .breadcrumb-wrap h1 { max-width: 52vw; font-size: 1.05rem; }
  #theme-toggle { display: none; }
  .global-filter-bar {
    position: fixed;
    z-index: 34;
    inset: auto 0 0;
    display: none;
    grid-template-columns: 1fr 1fr;
    max-height: 80vh;
    padding: 1rem;
    overflow-y: auto;
    border-top: 1px solid var(--asmp-border);
    box-shadow: 0 -18px 50px rgb(8 31 56 / 18%);
  }
  .global-filter-bar.is-open { display: grid; }
  .company-filter,
  .compare-filter { grid-column: 1 / -1; }
  .compare-filter { display: grid; }
  .filter-apply,
  .filter-clear { width: 100%; }
  .mobile-filter-button { display: inline-grid; }
  .page-container { padding: 1rem 0.8rem; }
  .active-filters { padding-inline: 0.8rem; }
  .kpi-grid,
  .loading-grid { grid-template-columns: 1fr; }
  .page-intro { display: grid; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .surface-card { padding: 0.8rem; }
  .data-table th,
  .data-table td { padding: 0.65rem 0.6rem; }
  .app-footer { display: grid; text-align: center; }
  .table-toolbar { align-items: stretch; }
  .table-search { width: 100%; }
}

@media (max-width: 430px) {
  .login-main { padding: 1rem; }
  .mobile-login-brand img { width: 125px; }
  .login-card h2 { font-size: 1.9rem; }
  .topbar-actions { gap: 0.25rem; }
  .avatar { width: 34px; height: 34px; }
  .global-filter-bar { grid-template-columns: 1fr; }
  .company-filter,
  .compare-filter { grid-column: auto; }
  .dialog-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .global-filter-bar,
  .active-filters,
  .page-actions,
  .app-footer { display: none !important; }
  .app-shell,
  .app-column { display: block; }
  .page-container { max-width: none; padding: 0; }
  .surface-card,
  .kpi-card { break-inside: avoid; box-shadow: none; }
}
