:root {
  --ink: #172630;
  --ink-soft: #5f707a;
  --ink-faint: #87959d;
  --paper: #ffffff;
  --canvas: #f4f7f8;
  --muted: #edf2f3;
  --muted-2: #f8fafb;
  --line: #dce5e8;
  --line-strong: #cdd9dd;
  --brand: #0f786f;
  --brand-dark: #0c5f59;
  --brand-deep: #102f3a;
  --brand-soft: #e6f4f2;
  --brand-glow: #64d2c6;
  --sky: #2f729f;
  --amber: #b96c10;
  --red: #c13742;
  --violet: #7558ae;
  --green: #277a57;
  --shadow-xs: 0 1px 2px rgba(18, 47, 58, .045);
  --shadow-sm: 0 8px 24px rgba(18, 47, 58, .07);
  --shadow-md: 0 20px 50px rgba(18, 47, 58, .13);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar-width: 272px;
  --topbar-height: 70px;
  color-scheme: light;
  font-family: Tahoma, Arial, "Segoe UI", sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
svg { flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
table { border-collapse: collapse; border-spacing: 0; }
::selection { color: #092f35; background: #a9ddd7; }

:focus-visible {
  outline: 3px solid rgba(100, 210, 198, .42);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  padding: 9px 14px;
  border-radius: 9px;
  color: #fff;
  background: var(--brand-deep);
  transform: translateY(-150%);
  transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); }

.noscript {
  position: fixed;
  z-index: 3000;
  inset: 16px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid #f2c6c8;
  border-radius: var(--radius);
  color: #8d2730;
  background: #fff3f4;
}

.boot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--ink-soft);
}
.boot-screen strong { display: block; color: var(--ink); font-size: 15px; }
.boot-screen p { margin-top: 3px; font-size: 12px; }
.boot-mark, .brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #092c34;
  background: var(--brand-glow);
  box-shadow: 0 10px 30px rgba(100, 210, 198, .22);
  font-weight: 900;
  letter-spacing: -.04em;
}
.boot-mark { width: 48px; height: 48px; border-radius: 15px; font-size: 22px; }

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255,255,255,.38);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
.spinner-dark { color: var(--brand); border-color: var(--line); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Login */
.auth-page {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(360px, .86fr) minmax(520px, 1.14fr);
  overflow: hidden;
  background: var(--paper);
}
.auth-panel {
  position: relative;
  display: grid;
  align-items: center;
  padding: clamp(30px, 6vw, 84px);
  background: var(--paper);
}
.auth-form-wrap { width: min(100%, 420px); margin-inline: auto; }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: clamp(48px, 8vh, 78px); }
.auth-brand .brand-mark { width: 47px; height: 47px; border-radius: 14px; font-size: 21px; }
.auth-brand strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.auth-brand small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.auth-copy { margin-bottom: 29px; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 11px; color: var(--brand); font-size: 11px; font-weight: 800; }
.auth-eyebrow::before { width: 24px; height: 1px; content: ""; background: currentColor; }
.auth-copy h1 { color: #112932; font-size: clamp(27px, 4vw, 35px); line-height: 1.25; letter-spacing: -.045em; }
.auth-copy p { max-width: 380px; margin-top: 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.85; }
.auth-form { display: grid; gap: 18px; }
.auth-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 3px; }
.auth-footnote { margin-top: 33px; color: var(--ink-faint); font-size: 11px; }
.auth-art {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(42px, 7vw, 92px);
  color: #fff;
  background: #0d2c37;
}
.auth-art::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 18% 20%, rgba(100,210,198,.24), transparent 25%),
    radial-gradient(circle at 82% 78%, rgba(47,114,159,.22), transparent 29%),
    linear-gradient(140deg, #102f3a, #0b2833 65%, #123d48);
}
.auth-art::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: .13;
  background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 80%, transparent);
}
.auth-showcase { width: min(100%, 630px); }
.auth-showcase > span { display: inline-flex; align-items: center; gap: 8px; color: #93e4dc; font-size: 11px; font-weight: 800; }
.auth-showcase > span::before { width: 7px; height: 7px; border-radius: 50%; content: ""; background: var(--brand-glow); box-shadow: 0 0 0 6px rgba(100,210,198,.11); }
.auth-showcase h2 { max-width: 570px; margin-top: 20px; font-size: clamp(32px, 4.5vw, 57px); line-height: 1.28; letter-spacing: -.055em; }
.auth-showcase > p { max-width: 510px; margin-top: 18px; color: rgba(255,255,255,.62); font-size: 14px; line-height: 2; }
.auth-preview {
  position: relative;
  margin-top: clamp(38px, 7vh, 68px);
  padding: 19px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 21px;
  background: rgba(255,255,255,.075);
  box-shadow: 0 30px 80px rgba(0,0,0,.2);
  backdrop-filter: blur(16px);
}
.auth-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 2px 14px; color: rgba(255,255,255,.7); font-size: 11px; }
.auth-preview-bar span { display: flex; align-items: center; gap: 7px; }
.auth-preview-bar span::before { width: 7px; height: 7px; border-radius: 50%; content: ""; background: #72ddad; }
.auth-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.auth-mini-card { min-width: 0; padding: 15px; border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.94); }
.auth-mini-card small { display: block; color: var(--ink-soft); font-size: 9px; }
.auth-mini-card strong { display: block; margin-top: 7px; font-size: 22px; direction: ltr; text-align: right; }
.auth-mini-card i { display: block; width: 45%; height: 3px; margin-top: 11px; border-radius: 9px; background: var(--brand-glow); }

/* Shared controls */
.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .field-label { color: #263b44; font-size: 12px; font-weight: 800; }
.field-help { color: var(--ink-faint); font-size: 10px; line-height: 1.65; }
.input, .select, .textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.input::placeholder, .textarea::placeholder { color: #9aa7ad; }
.input:hover, .select:hover, .textarea:hover { border-color: #b7c8cd; }
.input:focus, .select:focus, .textarea:focus { border-color: #5ab8ae; box-shadow: 0 0 0 3px rgba(100,210,198,.17); }
.input:disabled, .select:disabled, .textarea:disabled { cursor: not-allowed; opacity: .62; background: #f4f6f7; }
.textarea { min-height: 92px; resize: vertical; line-height: 1.7; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline: 41px; }
.input-icon { position: absolute; inset-inline-start: 12px; inset-block-start: 50%; width: 18px; height: 18px; color: #84949b; transform: translateY(-50%); pointer-events: none; }
.input-action { position: absolute; inset-inline-end: 5px; inset-block-start: 50%; transform: translateY(-50%); }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-soft); }
.danger-text { color: var(--red); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.btn {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: .56; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 7px 18px rgba(15,120,111,.16); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 9px 22px rgba(15,120,111,.22); }
.btn-secondary { color: var(--brand-dark); background: var(--brand-soft); border-color: #c8e5e1; }
.btn-secondary:hover:not(:disabled) { background: #d9eeeb; }
.btn-outline { color: #29414b; background: #fff; border-color: var(--line-strong); }
.btn-outline:hover:not(:disabled) { color: var(--brand-dark); border-color: #9dcfc9; background: #fbfdfd; }
.btn-ghost { color: var(--ink-soft); background: transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--muted); }
.btn-danger { color: #fff; background: var(--red); }
.btn-block { width: 100%; }
.btn-lg { min-height: 47px; padding-inline: 20px; font-size: 13px; border-radius: 12px; }
.btn-sm { min-height: 33px; padding: 6px 10px; font-size: 11px; border-radius: 9px; }
.btn-icon { width: 39px; min-width: 39px; padding: 0; }
.btn-icon.btn-sm { width: 33px; min-width: 33px; }
.link-button { padding: 0; border: 0; cursor: pointer; color: var(--brand); background: none; font-size: 11px; font-weight: 800; }
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.checkbox-row { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 11px; cursor: pointer; }
.checkbox-row input { accent-color: var(--brand); }

/* Application shell */
.app-shell { min-height: 100svh; }
.sidebar {
  position: fixed;
  z-index: 110;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: #dcebed;
  background: #102f3a;
  box-shadow: -12px 0 40px rgba(16,47,58,.06);
}
.sidebar::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .25;
  background: radial-gradient(circle at 0 10%, rgba(100,210,198,.28), transparent 24%);
}
.sidebar-head { position: relative; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 15px 17px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 20px; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; color: #fff; font-size: 14px; line-height: 1.35; }
.brand-copy small { display: block; overflow: hidden; margin-top: 3px; color: rgba(220,235,237,.54); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-close { display: none; margin-inline-start: auto; }
.sidebar-nav { position: relative; flex: 1; overflow: auto; padding: 17px 11px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.nav-label { padding: 0 12px 8px; color: rgba(220,235,237,.43); font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.nav-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-link {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  color: rgba(231,243,244,.72);
  font-size: 12px;
  font-weight: 700;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.nav-link svg { width: 18px; height: 18px; opacity: .88; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(-1px); }
.nav-link.active { color: #092b34; background: var(--brand-glow); box-shadow: 0 9px 24px rgba(100,210,198,.18); }
.nav-link.active svg { opacity: 1; }
.nav-badge { margin-inline-start: auto; min-width: 20px; padding: 2px 5px; border-radius: 99px; color: #fff; background: var(--red); font-size: 9px; line-height: 1.45; text-align: center; }
.sidebar-foot { position: relative; padding: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: rgba(255,255,255,.045); }
.user-avatar { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #bdebe7; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 900; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { color: #fff; font-size: 11px; }
.user-copy small { margin-top: 2px; color: rgba(220,235,237,.45); font-size: 9px; }
.logout-btn { color: rgba(255,255,255,.58); }
.logout-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

.app-main { min-height: 100svh; margin-inline-start: var(--sidebar-width); }
.topbar {
  position: sticky;
  z-index: 80;
  inset-block-start: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-inline: clamp(18px, 3vw, 34px);
  border-bottom: 1px solid rgba(205,217,221,.82);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
}
.topbar-start, .topbar-actions { display: flex; align-items: center; gap: 11px; min-width: 0; }
.menu-trigger { display: none; }
.topbar-separator { width: 1px; height: 25px; background: var(--line); }
.page-identity { min-width: 0; }
.page-identity h1 { overflow: hidden; color: #16303a; font-size: 15px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.page-identity p { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.notification-button { position: relative; }
.notification-dot { position: absolute; inset-block-start: 5px; inset-inline-start: 5px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #e08b25; }
.connection-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: #fff; font-size: 10px; font-weight: 700; }
.connection-chip i { width: 7px; height: 7px; border-radius: 50%; background: #a9b4b9; }
.connection-chip.online i { background: #3da874; box-shadow: 0 0 0 4px rgba(61,168,116,.12); }

.content-canvas {
  min-height: calc(100svh - var(--topbar-height));
  padding: clamp(18px, 3vw, 34px);
  background-color: var(--canvas);
  background-image: linear-gradient(to left, rgba(15,120,111,.025) 1px, transparent 1px), linear-gradient(to bottom, rgba(15,120,111,.025) 1px, transparent 1px);
  background-size: 30px 30px;
}
.page { width: min(100%, 1500px); margin-inline: auto; animation: page-in .24s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.sidebar-overlay { display: none; }

/* Page composition */
.page-stack { display: grid; gap: 20px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading-copy { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: var(--brand); font-size: 10px; font-weight: 800; }
.eyebrow::before { width: 22px; height: 1px; content: ""; background: currentColor; }
.page-heading h2 { color: #132e38; font-size: clamp(23px, 3vw, 30px); line-height: 1.35; letter-spacing: -.035em; }
.page-heading p { max-width: 760px; margin-top: 6px; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-xs); }
.card-header { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-heading { min-width: 0; }
.card-heading h3 { color: #1e333c; font-size: 13px; }
.card-heading p { margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.card-body { padding: 18px; }
.card-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.toolbar-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.toolbar-search { width: min(100%, 330px); }
.toolbar-search .input { min-height: 38px; font-size: 11px; background: #fff; }
.toolbar-meta { color: var(--ink-faint); font-size: 10px; white-space: nowrap; }

.notice { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border: 1px solid #bee1dc; border-radius: 12px; color: #315f5a; background: #eef9f7; font-size: 11px; line-height: 1.75; }
.notice svg { width: 17px; height: 17px; margin-top: 2px; color: var(--brand); }
.notice-amber { color: #77511c; border-color: #eed7ad; background: #fff8e9; }
.notice-amber svg { color: var(--amber); }
.notice-red { color: #81343a; border-color: #edc7ca; background: #fff3f4; }
.notice-red svg { color: var(--red); }
.notice-sky { color: #315c78; border-color: #c8ddeb; background: #f0f7fc; }
.notice-sky svg { color: var(--sky); }
.notice-green { color: #27634c; border-color: #c6e3d5; background: #eef9f3; }
.notice-green svg { color: var(--green); }

.hero-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid #1c4752;
  border-radius: var(--radius-lg);
  color: #fff;
  background: #102f3a;
  box-shadow: var(--shadow-sm);
}
.hero-panel::before { position: absolute; z-index: -2; inset: 0; content: ""; background: radial-gradient(circle at 5% 50%, rgba(100,210,198,.25), transparent 27%), radial-gradient(circle at 90% 15%, rgba(47,114,159,.18), transparent 28%); }
.hero-panel::after { position: absolute; z-index: -1; inset-block: 0; inset-inline-end: 0; width: 40%; content: ""; opacity: .12; background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to left, transparent, #000); }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.hero-copy { max-width: 710px; }
.hero-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; color: #8ee3da; font-size: 10px; font-weight: 800; }
.hero-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-glow); box-shadow: 0 0 0 6px rgba(100,210,198,.1); }
.hero-copy h2 { font-size: clamp(22px, 3vw, 32px); line-height: 1.45; letter-spacing: -.04em; }
.hero-copy p { max-width: 650px; margin-top: 7px; color: rgba(255,255,255,.64); font-size: 12px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions .btn-primary { color: #092b33; background: var(--brand-glow); }
.hero-actions .btn-outline { color: #fff; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.05); }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.metric-card { position: relative; overflow: hidden; min-height: 145px; display: flex; flex-direction: column; justify-content: space-between; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-xs); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.metric-card:hover { transform: translateY(-2px); border-color: #bedbd8; box-shadow: var(--shadow-sm); }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; }
.metric-icon svg { width: 18px; height: 18px; }
.tone-teal { color: var(--brand); background: #e8f7f4; }
.tone-sky { color: #33739c; background: #edf6fb; }
.tone-violet { color: var(--violet); background: #f2eefb; }
.tone-amber { color: #a96715; background: #fff6e7; }
.tone-red { color: var(--red); background: #fff0f1; }
.tone-green { color: var(--green); background: #eaf7f0; }
.metric-arrow { color: #a1adb2; }
.metric-arrow svg { width: 15px; height: 15px; }
.metric-value { margin-top: 16px; color: #17323c; font-size: 26px; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.metric-label { margin-top: 7px; font-size: 11px; font-weight: 800; }
.metric-helper { margin-top: 2px; color: var(--ink-faint); font-size: 9px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .72fr); gap: 16px; }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-item { display: flex; align-items: flex-start; gap: 11px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--amber); background: #fff7e9; }
.activity-icon svg { width: 16px; height: 16px; }
.activity-copy { min-width: 0; flex: 1; }
.activity-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy p { margin-top: 3px; overflow: hidden; color: var(--ink-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { color: var(--ink-faint); font-size: 9px; white-space: nowrap; }
.workflow-list { display: grid; gap: 3px; padding: 10px; }
.workflow-step { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 11px; }
.workflow-step:hover { background: var(--muted-2); }
.workflow-index { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: var(--brand); background: #fff; font-size: 10px; font-weight: 900; }
.workflow-copy strong { display: block; font-size: 10px; }
.workflow-copy small { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 9px; }

/* Tables */
.table-shell { overflow: hidden; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 720px; }
.data-table th { height: 43px; padding: 10px 14px; color: #667982; background: #f7f9fa; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 800; text-align: right; white-space: nowrap; }
.data-table td { height: 55px; padding: 11px 14px; border-bottom: 1px solid #e9eef0; color: #334750; font-size: 10.5px; vertical-align: middle; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfd; }
.data-table .primary-cell { max-width: 270px; color: #1d333c; font-weight: 800; }
.cell-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-subtitle { display: block; overflow: hidden; margin-top: 3px; color: var(--ink-faint); font-size: 9px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.cell-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.row-clickable { cursor: pointer; }
.row-clickable:focus-within { background: #f5fbfa; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink-faint); background: #fbfcfc; font-size: 9px; }

.badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 24px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; color: #647780; background: #f7f9fa; font-size: 9px; font-weight: 800; white-space: nowrap; }
.badge::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; content: ""; background: currentColor; opacity: .65; }
.badge-green { color: #277253; border-color: #c6e3d5; background: #eef9f3; }
.badge-amber { color: #93611d; border-color: #edd7b2; background: #fff8eb; }
.badge-red { color: #a33c44; border-color: #ecc7ca; background: #fff2f3; }
.badge-sky { color: #386c8c; border-color: #c8dce8; background: #f0f7fb; }
.badge-violet { color: #6d54a0; border-color: #d9d0eb; background: #f6f3fb; }
.badge-gray { color: #687880; border-color: #d8e0e3; background: #f5f7f8; }

.empty-state { min-height: 260px; display: grid; place-items: center; padding: 38px 20px; text-align: center; }
.empty-inner { max-width: 410px; }
.empty-icon { width: 49px; height: 49px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 15px; color: var(--brand); background: var(--brand-soft); }
.empty-icon svg { width: 21px; height: 21px; }
.empty-state h3 { font-size: 13px; }
.empty-state p { margin-top: 6px; color: var(--ink-soft); font-size: 10px; line-height: 1.75; }
.empty-state .btn { margin-top: 15px; }
.error-state .empty-icon { color: var(--red); background: #fff0f1; }

.skeleton { position: relative; overflow: hidden; border-radius: 7px; background: #edf1f2; }
.skeleton::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); transform: translateX(100%); animation: shimmer 1.35s infinite; }
@keyframes shimmer { to { transform: translateX(-100%); } }
.table-skeleton { display: grid; gap: 11px; padding: 18px; }
.table-skeleton-row { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 12px; }
.table-skeleton-row span { height: 27px; }

/* Tabs and segmented filters */
.tabs { display: flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; overflow-x: auto; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-height: 35px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 0; border-radius: 9px; cursor: pointer; color: var(--ink-soft); background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--ink); background: var(--muted-2); }
.tab.active { color: var(--brand-dark); background: var(--brand-soft); box-shadow: inset 0 0 0 1px #d2e9e6; }

/* Import and detail workspaces */
.drop-zone { position: relative; display: grid; place-items: center; min-height: 175px; padding: 24px; border: 1.5px dashed #a9c9c6; border-radius: 14px; text-align: center; background: #f7fcfb; transition: border-color .16s ease, background .16s ease; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--brand); background: #eff9f7; }
.drop-zone input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.drop-icon { width: 45px; height: 45px; display: grid; place-items: center; margin-bottom: 11px; border-radius: 13px; color: var(--brand); background: #fff; box-shadow: var(--shadow-sm); }
.drop-icon svg { width: 21px; height: 21px; }
.drop-zone strong { display: block; font-size: 12px; }
.drop-zone p { margin-top: 5px; color: var(--ink-soft); font-size: 10px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.file-chip svg { width: 20px; height: 20px; color: var(--brand); }
.file-chip-copy { min-width: 0; flex: 1; }
.file-chip-copy strong, .file-chip-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-copy strong { font-size: 10px; }
.file-chip-copy small { margin-top: 2px; color: var(--ink-faint); font-size: 9px; }
.columns-guide { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; }
.column-pill { padding: 9px 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; font-size: 9px; font-weight: 700; text-align: center; }
.column-pill.required { color: var(--brand-dark); border-color: #a9d9d3; background: var(--brand-soft); }

.split-workspace { display: grid; grid-template-columns: minmax(310px, .63fr) minmax(0, 1.37fr); gap: 16px; align-items: start; }
.list-panel { overflow: hidden; }
.compact-list { max-height: calc(100svh - 250px); overflow: auto; padding: 7px; }
.compact-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 12px; border: 0; border-radius: 11px; cursor: pointer; color: inherit; background: transparent; text-align: right; }
.compact-item + .compact-item { margin-top: 2px; }
.compact-item:hover { background: var(--muted-2); }
.compact-item.active { background: var(--brand-soft); box-shadow: inset 0 0 0 1px #cce6e2; }
.compact-symbol { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--brand); background: #edf7f5; }
.compact-symbol svg { width: 17px; height: 17px; }
.compact-copy { min-width: 0; flex: 1; }
.compact-copy strong, .compact-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-copy strong { font-size: 10.5px; }
.compact-copy small { margin-top: 3px; color: var(--ink-faint); font-size: 9px; }
.detail-panel { min-width: 0; overflow: hidden; }
.detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg,#fff,#f5fbfa); }
.detail-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.detail-title .compact-symbol { width: 42px; height: 42px; }
.detail-title h3 { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.detail-title p { margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.detail-stat { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.detail-stat span { display: block; color: var(--ink-faint); font-size: 9px; }
.detail-stat strong { display: block; margin-top: 5px; font-size: 14px; }
.period-imports-wrap { padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.import-batches { display: grid; gap: 8px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.section-heading strong, .section-heading small { display: block; }
.section-heading strong { font-size: 10.5px; }
.section-heading small { margin-top: 2px; color: var(--ink-soft); font-size: 9px; }
.import-batch { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.import-batch-copy { min-width: 0; flex: 1; }
.import-batch-copy strong, .import-batch-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-batch-copy strong { font-size: 10px; }
.import-batch-copy small { margin-top: 3px; color: var(--ink-soft); font-size: 8.5px; }

.inventory-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.summary-card { display: flex; align-items: center; gap: 12px; padding: 15px; }
.summary-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; }
.summary-icon svg { width: 18px; height: 18px; }
.summary-copy span { display: block; color: var(--ink-soft); font-size: 9px; }
.summary-copy strong { display: block; margin-top: 4px; font-size: 18px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(255px, .6fr); gap: 16px; align-items: start; }
.settings-form { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.card-icon-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.card-icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.card-icon svg { width: 18px; height: 18px; }
.security-card { padding: 17px; border-color: #bcded9; color: #315d58; background: #eef9f7; box-shadow: none; }
.security-card svg { width: 20px; height: 20px; margin-bottom: 10px; color: var(--brand); }
.security-card strong { display: block; color: #1e4c47; font-size: 11px; }
.security-card p { margin-top: 5px; font-size: 10px; line-height: 1.75; }
.facts-list { padding: 4px 16px; }
.fact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 9.5px; }
.fact-row:last-child { border-bottom: 0; }
.fact-row span { color: var(--ink-soft); }
.fact-row strong { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.environment-options { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.environment-option { position: relative; cursor: pointer; }
.environment-option input { position: absolute; opacity: 0; pointer-events: none; }
.environment-box { display: flex; align-items: center; gap: 10px; min-height: 59px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.environment-option input:checked + .environment-box { border-color: #79beb6; background: #f1faf8; box-shadow: inset 0 0 0 1px #bce1dc; }
.environment-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.environment-icon svg { width: 16px; height: 16px; }
.environment-box strong { display: block; font-size: 10px; }
.environment-box small { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 8px; }
.connection-result { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border: 1px solid #c6e3d5; border-radius: 10px; color: #2d6e53; background: #eff9f3; font-size: 10px; }
.connection-result.failed { color: #9a3840; border-color: #ecc7ca; background: #fff2f3; }
.connection-result svg { width: 16px; height: 16px; margin-top: 1px; }

/* Audit / notification timeline */
.notification-card { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border-bottom: 1px solid var(--line); }
.notification-card:last-child { border-bottom: 0; }
.notification-card.unread { background: #fbfefd; }
.notification-card.unread::before { align-self: stretch; width: 3px; border-radius: 3px; content: ""; background: var(--brand-glow); }
.notification-body { min-width: 0; flex: 1; }
.notification-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.notification-title-row strong { font-size: 11px; }
.notification-body p { margin-top: 5px; color: var(--ink-soft); font-size: 10px; line-height: 1.75; }
.notification-meta { display: flex; align-items: center; gap: 11px; margin-top: 8px; color: var(--ink-faint); font-size: 9px; }

/* Modal */
.modal-layer { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; border: 0; cursor: default; background: rgba(8,28,35,.58); backdrop-filter: blur(4px); animation: fade-in .16s ease both; }
@keyframes fade-in { from { opacity: 0; } }
.modal-dialog { position: relative; z-index: 1; width: min(100%, 600px); max-height: calc(100svh - 36px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 18px; background: #fff; box-shadow: var(--shadow-md); animation: modal-in .2s ease both; }
.modal-dialog.modal-lg { width: min(100%, 920px); }
.modal-dialog.modal-xl { width: min(100%, 1160px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-heading { min-width: 0; }
.modal-heading h2 { font-size: 15px; }
.modal-heading p { max-width: 680px; margin-top: 5px; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.modal-close { margin: -5px -5px 0 0; }
.modal-body { min-height: 0; overflow: auto; padding: 20px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: #fbfcfc; }
.invoice-row-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.invoice-row-actions .btn:disabled { opacity: .62; cursor: not-allowed; }
.invoice-pdf-loading { display: grid; gap: 12px; min-height: 58vh; place-content: center; color: var(--ink-soft); text-align: center; }
.invoice-pdf-shell { height: min(72vh, 860px); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #eef2f3; }
.invoice-pdf-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.invoice-pdf-size { margin-inline-start: auto; color: var(--ink-faint); font-size: 10px; }
.form-section { display: grid; gap: 14px; }
.form-section + .form-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Inbound invoice integrity and outgoing billing components */
.badge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cell-block { display: block; margin-top: 5px; }
.wrap-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.preserve-lines { white-space: pre-wrap; }
.field-hint { display: block; margin-top: 6px; color: var(--ink-faint); font-size: 9px; line-height: 1.55; }
.supplier-note-clamp { display: -webkit-box; max-width: 310px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
.supplier-invoice-table { min-width: 1180px; }

.source-integrity-card,
.integrity-panel,
.source-attestation,
.billing-rule-card,
.billing-component-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--muted-2);
}
.source-integrity-card { border-color: #bfdde6; background: linear-gradient(135deg,#f3fafc,#f9fcfd); }
.source-integrity-heading,
.integrity-panel-heading,
.billing-rule-heading,
.billing-component-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.source-integrity-heading > div:first-child,
.integrity-panel-heading > div:first-child,
.billing-rule-heading > div:first-child { display: grid; gap: 3px; }
.source-integrity-heading span,
.integrity-panel-heading span,
.billing-rule-heading span,
.source-attestation > div:first-child > span { color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.source-integrity-heading strong,
.integrity-panel-heading strong,
.billing-rule-heading strong,
.source-attestation > div:first-child > strong { color: var(--ink); font-size: 12px; }
.source-meta-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 0; }
.source-meta-grid > div { min-width: 0; padding: 10px 11px; border: 1px solid #dfeaec; border-radius: 10px; background: rgba(255,255,255,.78); }
.source-meta-grid > .full { grid-column: 1 / -1; }
.source-meta-grid dt { margin: 0 0 4px; color: var(--ink-faint); font-size: 9px; font-weight: 800; }
.source-meta-grid dd { margin: 0; color: #263b44; font-size: 10.5px; }
.integrity-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.integrity-columns > div { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.integrity-columns h4 { margin: 0 0 8px; color: var(--ink); font-size: 10px; }
.integrity-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.integrity-list li { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; color: var(--ink-soft); font-size: 10px; }
.integrity-list li::before { width: 6px; height: 6px; margin-top: 6px; flex: 0 0 auto; border-radius: 50%; content: ""; background: var(--amber); }
.integrity-list .mono { padding: 1px 5px; border-radius: 5px; color: #6d4b1c; background: #fff4de; font-size: 8.5px; }
.integrity-empty { color: var(--ink-faint); font-size: 10px; }
.duplicate-review-list { display: grid; gap: 9px; }
.duplicate-review-item { display: grid; grid-template-columns: minmax(180px,1fr) auto; gap: 10px 16px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.duplicate-review-item p { margin-top: 4px; color: var(--ink-soft); font-size: 9.5px; overflow-wrap: anywhere; }
.duplicate-review-controls { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(180px,.55fr) minmax(260px,1fr) auto; align-items: end; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.source-attestation { border-color: #ead3a9; background: #fffaf0; }

.switch-row { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 11px; font-weight: 800; cursor: pointer; }
.switch-row input { width: 17px; height: 17px; accent-color: var(--brand); }
.billing-rule-card { border-color: #d6cceb; background: #faf8fd; }
.billing-rule-card.is-disabled [data-billing-rule-fields] { opacity: .55; }
.billing-component-editor { margin-top: 12px; border-color: #c8ddeb; background: #f4f9fc; }
.billing-component-editor:not(.is-enabled) [data-billing-fields] { opacity: .5; }
.billing-component-editor.is-invalid { border-color: #e4aeb2; background: #fff5f6; }
.billing-component-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.billing-component-totals { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.billing-component-totals span { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-faint); background: var(--paper); font-size: 9px; }
.billing-component-totals strong { color: var(--ink); font-size: 11px; }
.billing-legal-note { padding-inline-start: 10px; border-inline-start: 3px solid #c7b9df; color: var(--ink-soft); font-size: 10px; }
.section-label { color: var(--brand-dark); font-size: 10px; font-weight: 900; }

/* GİB identity inquiry */
.customer-identity-field { position: relative; }
.identity-query-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.btn-gib-query { min-width: 112px; justify-content: center; color: #fff; border-color: #376fe8; background: #376fe8; }
.btn-gib-query:hover { border-color: #285dcc; background: #285dcc; }
.btn-gib-query:disabled { color: #fff; background: #799be4; }
.identity-query-status { display: block; min-height: 16px; margin-top: 6px; color: var(--ink-faint); font-size: 9px; line-height: 1.55; }
.identity-query-status.is-loading { color: var(--sky); }
.identity-query-status.is-success { color: var(--green); font-weight: 700; }
.identity-query-status.is-error { color: var(--red); font-weight: 700; }
.dialog-confirm-overlay { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8,28,35,.68); backdrop-filter: blur(3px); }
.dialog-confirm-card { width: min(100%, 560px); padding: 24px; border: 1px solid rgba(255,255,255,.7); border-radius: 16px; background: #fff; box-shadow: var(--shadow-md); text-align: center; }
.dialog-confirm-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 12px; color: #376fe8; border-radius: 13px; background: #eaf1ff; }
.dialog-confirm-icon svg { width: 22px; height: 22px; }
.dialog-confirm-card h3 { font-size: 15px; }
.dialog-confirm-card p { margin-top: 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.8; }
.dialog-confirm-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* Toasts */
.toast-region { position: fixed; z-index: 2000; inset-block-start: 18px; inset-inline-end: 18px; width: min(calc(100vw - 36px), 370px); display: grid; gap: 9px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.97); box-shadow: var(--shadow-md); pointer-events: auto; animation: toast-in .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-14px); } }
.toast.leaving { animation: toast-out .2s ease both; }
@keyframes toast-out { to { opacity: 0; transform: translateX(-14px); } }
.toast-icon { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; }
.toast-icon svg { width: 15px; height: 15px; }
.toast-success .toast-icon { color: var(--green); background: #eaf7f0; }
.toast-error .toast-icon { color: var(--red); background: #fff0f1; }
.toast-info .toast-icon { color: var(--sky); background: #edf6fb; }
.toast-warning .toast-icon { color: var(--amber); background: #fff6e7; }
.toast-copy { min-width: 0; flex: 1; }
.toast-copy strong { display: block; font-size: 10.5px; }
.toast-copy p { margin-top: 2px; color: var(--ink-soft); font-size: 9px; line-height: 1.55; }
.toast-close { min-height: auto; padding: 2px; color: var(--ink-faint); }

/* Responsive */
@media (max-width: 1280px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .inventory-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 1020px) {
  :root { --sidebar-width: 256px; }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: minmax(350px, .9fr) minmax(420px, 1.1fr); }
  .auth-preview-grid { grid-template-columns: 1fr; }
  .auth-mini-card:nth-child(n+3) { display: none; }
  .split-workspace { grid-template-columns: minmax(270px,.7fr) minmax(0,1.3fr); }
}

@media (max-width: 820px) {
  .auth-page { display: block; background: linear-gradient(180deg,#0e2e39 0 210px,#fff 210px); }
  .auth-panel { min-height: 100svh; padding: 30px 20px; background: transparent; }
  .auth-form-wrap { padding: 23px; border-radius: 20px; background: #fff; box-shadow: 0 25px 60px rgba(8,28,35,.18); }
  .auth-brand { margin-bottom: 37px; }
  .auth-art { display: none; }
  .sidebar { transform: translateX(110%); transition: transform .22s ease; box-shadow: -25px 0 65px rgba(7,28,34,.26); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close, .menu-trigger { display: inline-flex; }
  .app-main { margin-inline-start: 0; }
  .sidebar-overlay { position: fixed; z-index: 100; inset: 0; display: block; visibility: hidden; border: 0; opacity: 0; background: rgba(8,27,34,.44); transition: opacity .2s ease, visibility .2s ease; }
  .app-shell.sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .connection-chip { display: none; }
  .page-identity p { display: none; }
  .split-workspace { grid-template-columns: 1fr; }
  .compact-list { max-height: 330px; }
}

@media (max-width: 680px) {
  :root { --topbar-height: 62px; }
  .topbar { padding-inline: 14px; }
  .topbar-separator { display: none; }
  .topbar-actions .btn-outline:not(.notification-button) { display: none; }
  .content-canvas { padding: 15px 12px 26px; }
  .page-stack { gap: 15px; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 13px; }
  .page-heading h2 { font-size: 22px; }
  .page-heading p { font-size: 11px; }
  .page-actions { justify-content: flex-start; }
  .hero-inner { align-items: flex-start; flex-direction: column; }
  .hero-panel { border-radius: 16px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .metric-card { min-height: 132px; padding: 13px; }
  .metric-value { font-size: 23px; }
  .card-header, .card-toolbar { align-items: flex-start; flex-direction: column; }
  .card-toolbar { padding: 12px; }
  .toolbar-group { width: 100%; flex-wrap: wrap; }
  .toolbar-search { width: 100%; }
  .inventory-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-card { padding: 12px; }
  .summary-copy strong { font-size: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .source-meta-grid, .integrity-columns, .billing-component-grid { grid-template-columns: 1fr; }
  .source-meta-grid > .full, .billing-component-totals { grid-column: auto; }
  .billing-component-totals { grid-template-columns: 1fr 1fr; }
  .source-integrity-heading, .integrity-panel-heading, .billing-rule-heading, .billing-component-heading { flex-direction: column; }
  .duplicate-review-controls { grid-template-columns: 1fr; }
  .detail-hero { align-items: flex-start; flex-direction: column; }
  .detail-stats { grid-template-columns: 1fr; }
  .import-batch { align-items: flex-start; flex-wrap: wrap; }
  .import-batch-copy { min-width: 180px; }
  .columns-guide { grid-template-columns: repeat(2,1fr); }
  .modal-layer { align-items: end; padding: 0; }
  .modal-dialog, .modal-dialog.modal-lg, .modal-dialog.modal-xl { width: 100%; max-height: 94svh; border-radius: 20px 20px 0 0; }
  .modal-header, .modal-body { padding-inline: 16px; }
  .modal-footer { padding-inline: 16px; }
  .invoice-pdf-shell { height: 67svh; }
  .invoice-pdf-size { width: 100%; margin-inline-start: 0; }
  .toast-region { inset-block-start: auto; inset-block-end: 14px; inset-inline: 14px; width: auto; }
}

@media (max-width: 430px) {
  .auth-panel { padding: 18px 12px; }
  .auth-form-wrap { padding: 20px 17px; }
  .auth-brand { margin-bottom: 31px; }
  .auth-actions { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 127px; }
  .metric-helper { display: none; }
  .inventory-summary { grid-template-columns: 1fr; }
  .environment-options { grid-template-columns: 1fr; }
  .page-actions .btn { flex: 1; }
  .identity-query-row { grid-template-columns: 1fr; }
  .btn-gib-query { width: 100%; }
}
