:root {
  --base-bg: #eff3f6;
  --card-bg: #ffffff;
  --text-900: #162634;
  --text-700: #4d5f6f;
  --line: #d3dfe8;
  --brand-700: #163f5f;
  --brand-600: #1a547f;
  --danger: #b5473d;
  --shadow-xl: 0 18px 42px rgba(13, 34, 51, 0.1);
  --radius-lg: 16px;
  --radius-md: 10px;
  --font-body: 'IBM Plex Sans', 'Avenir Next', 'Segoe UI', sans-serif;
  --font-heading: 'Space Grotesk', 'Avenir Next Condensed', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-900);
  font-family: var(--font-body);
  background: #eef2f5;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: 0.01em;
}

p {
  margin: 0;
  line-height: 1.55;
  color: var(--text-700);
}

.login-body {
  position: relative;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #f6f8fa 0%, #eef2f5 100%);
}

.login-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(22, 38, 52, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 38, 52, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.2;
  pointer-events: none;
}

.ambient-shape {
  position: absolute;
  border-radius: 999px;
  filter: blur(0);
  opacity: 0.08;
}

.ambient-shape--left {
  width: 320px;
  height: 320px;
  top: -130px;
  left: -110px;
  background: #aeb8c2;
}

.ambient-shape--right {
  width: 400px;
  height: 400px;
  bottom: -180px;
  right: -100px;
  background: #a7b2bf;
}

.layout {
  width: min(1220px, 100%);
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(470px, 1.08fr);
  gap: 24px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.hero-card,
.auth-card,
.dashboard-card,
.dashboard-header {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.hero-card {
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  justify-content: flex-start;
  min-height: 560px;
  transition: transform 0.62s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.62s ease,
    filter 0.62s ease;
}

.hero-card h1 {
  font-size: clamp(1.7rem, 2.7vw, 2.05rem);
  line-height: 1.14;
  max-width: 17ch;
}

.hero-card > p {
  font-size: 0.97rem;
  color: #5b6f80;
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  width: fit-content;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e5edf4;
  color: #204864;
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
}

.info-tip {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #c7d5df;
  background: #f4f8fc;
  display: grid;
  place-items: center;
  color: #2f536b;
  cursor: help;
}

.info-tip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(30, 92, 136, 0.2);
}

.info-tip-icon {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.info-tip-text {
  position: absolute;
  left: 46px;
  bottom: 2px;
  width: min(370px, 56vw);
  border-radius: 10px;
  border: 1px solid #c8d8e3;
  background: #ffffff;
  box-shadow: 0 14px 26px rgba(18, 45, 66, 0.14);
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #38546a;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.info-tip:hover .info-tip-text,
.info-tip:focus-visible .info-tip-text {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.auth-card {
  padding: 38px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 560px;
  align-self: stretch;
  transition: transform 0.62s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.62s ease,
    filter 0.62s ease;
}

.auth-card h2 {
  font-size: 2.2rem;
  line-height: 1.12;
}

.auth-subtitle {
  font-size: 0.92rem;
}

.auth-note {
  font-size: 0.9rem;
  color: #607283;
}

.feedback {
  min-height: 22px;
  font-size: 0.9rem;
  color: var(--danger);
  font-weight: 600;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.field-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #355064;
}

.field-input {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  border-radius: var(--radius-md);
  border: 1px solid #b8c8d4;
  font-size: 0.96rem;
  color: var(--text-900);
  background: #fcfdff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus {
  border-color: #1d6b99;
  outline: none;
  box-shadow: 0 0 0 4px rgba(20, 91, 136, 0.15);
}

.password-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.toggle-password,
.submit-btn,
.outline-btn {
  min-height: 50px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle-password {
  position: relative;
  width: 94px;
  flex: 0 0 94px;
  overflow: hidden;
  border: 1px solid #c5d3dd;
  color: #2f5066;
  background: rgba(245, 248, 251, 0.82);
  padding: 0;
  isolation: isolate;
  transition: border-color 0.28s ease, background-color 0.28s ease, box-shadow 0.28s ease,
    backdrop-filter 0.28s ease, -webkit-backdrop-filter 0.28s ease;
}

.toggle-password:focus-visible {
  outline: none;
}

.toggle-password:hover,
.toggle-password:focus-visible {
  border-color: #9bb0c1;
  background: rgba(236, 243, 248, 0.72);
  box-shadow: 0 6px 18px rgba(34, 63, 84, 0.14);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.toggle-visual,
.toggle-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.24s ease, transform 0.24s ease, filter 0.24s ease;
}

.toggle-label {
  opacity: 0;
  transform: translateY(3px);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.toggle-password:hover .toggle-visual,
.toggle-password:focus-visible .toggle-visual {
  opacity: 0;
  filter: blur(4px);
  transform: scale(0.96);
}

.toggle-password:hover .toggle-label,
.toggle-password:focus-visible .toggle-label {
  opacity: 1;
  transform: translateY(0);
}

.eye-icon {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.eye-icon path,
.eye-icon circle {
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eye-icon--closed {
  opacity: 1;
  transform: scale(1);
}

.eye-icon--open {
  opacity: 0;
  transform: scale(0.9);
}

.toggle-password.is-visible .eye-icon--closed {
  opacity: 0;
  transform: scale(0.9);
}

.toggle-password.is-visible .eye-icon--open {
  opacity: 1;
  transform: scale(1);
}

.submit-btn {
  margin-top: 8px;
  border: 0;
  color: #f8fcff;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  box-shadow: 0 8px 20px rgba(22, 63, 95, 0.25);
}

.submit-btn:hover {
  transform: translateY(-1px);
}

.powered-by {
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.75rem;
  text-align: right;
  color: #6e8292;
  letter-spacing: 0.01em;
}

.powered-by span {
  color: #2a4860;
  font-weight: 600;
}

.login-transition {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.48s ease;
}

.login-transition-surface {
  width: min(630px, 88vw);
  min-height: min(560px, 72vh);
  border-radius: 20px;
  border: 1px solid #cfdae4;
  background: linear-gradient(165deg, #edf3f8 0%, #e6edf3 100%);
  box-shadow: 0 18px 46px rgba(19, 42, 61, 0.17);
  display: grid;
  place-items: center;
  transform: scale(0.9);
  filter: blur(8px);
  transition: transform 0.62s cubic-bezier(0.2, 0.9, 0.25, 1), filter 0.62s ease,
    border-radius 0.62s ease;
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2a5374;
  animation: loadingPulse 0.9s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.login-body.is-auth-loading .layout {
  pointer-events: none;
}

.login-body.is-auth-loading .hero-card {
  transform: translateX(54%) scale(0.93);
  opacity: 0;
  filter: blur(12px);
}

.login-body.is-auth-loading .auth-card {
  transform: translateX(-42%) scale(0.93);
  opacity: 0;
  filter: blur(12px);
}

.login-body.is-auth-loading .login-transition {
  opacity: 1;
}

.login-body.is-auth-loading .login-transition-surface {
  transform: scale(1);
  filter: blur(0);
  border-radius: 14px;
}

.login-body.is-auth-loading .ambient-shape {
  opacity: 0;
}

.submit-btn:disabled,
.toggle-password:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0) scale(0.82);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card,
  .auth-card,
  .login-transition,
  .login-transition-surface,
  .loading-dots span {
    animation: none !important;
    transition: none !important;
  }
}

.dashboard-body {
  padding: 24px 16px;
  background: #edf1f5;
}

.admin-shell {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.admin-topbar {
  background: #ffffff;
  border: 1px solid #d2dce5;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(17, 41, 61, 0.08);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand-stack h1 {
  margin-top: 8px;
  font-size: clamp(1.45rem, 2.1vw, 1.85rem);
}

.topbar-subtitle {
  margin-top: 6px;
  font-size: 0.87rem;
  color: #5f7283;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-box {
  min-width: 190px;
  border: 1px solid #d7e1e8;
  border-radius: 12px;
  background: #f8fbff;
  padding: 9px 11px;
  display: grid;
  gap: 2px;
}

.meta-box span {
  font-size: 0.73rem;
  color: #637687;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meta-box strong {
  font-size: 0.88rem;
  color: #1a3448;
}

.admin-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-sidebar {
  background: #ffffff;
  border: 1px solid #d2dce5;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(17, 41, 61, 0.08);
  padding: 16px 14px;
  position: sticky;
  top: 12px;
}

.sidebar-title {
  margin-bottom: 10px;
  font-size: 0.76rem;
  color: #516779;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-link {
  display: block;
  padding: 10px 11px;
  border-radius: 10px;
  color: #2d485e;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.sidebar-link:hover {
  background: #f4f8fc;
  border-color: #d4e1ec;
}

.sidebar-link.is-active {
  background: #e9f2fb;
  border-color: #c6d9eb;
}

.sidebar-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e9ef;
  font-size: 0.79rem;
  color: #5b6f7f;
}

.admin-main {
  display: grid;
  gap: 14px;
}

.panel-section {
  background: #ffffff;
  border: 1px solid #d2dce5;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(17, 41, 61, 0.08);
  padding: 18px;
  display: grid;
  gap: 14px;
  scroll-margin-top: 14px;
}

.section-header h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.section-header p {
  font-size: 0.9rem;
  color: #5e7283;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.metric-card {
  border: 1px solid #d8e3ec;
  border-radius: 12px;
  background: #f7fbff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.metric-card span {
  font-size: 0.79rem;
  color: #5c7081;
}

.metric-card strong {
  font-size: 1.1rem;
  color: #162d42;
}

.split-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 12px;
}

.info-card {
  border: 1px solid #dbe5ed;
  border-radius: 12px;
  background: #fbfdff;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.info-card h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.08rem;
}

.table-wrap {
  border: 1px solid #d7e1ea;
  border-radius: 10px;
  overflow: auto;
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid #e3ebf1;
  font-size: 0.86rem;
  color: #2a4458;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f8fc;
  font-size: 0.78rem;
  color: #4f667a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table a {
  color: #1f5b88;
  font-weight: 600;
  text-decoration: none;
}

.data-table a:hover {
  text-decoration: underline;
}

.ordered-list,
.summary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #3d5568;
  font-size: 0.9rem;
}

.quick-actions {
  display: grid;
  gap: 8px;
}

.quick-actions.inline {
  grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
}

.flat-btn {
  border: 1px solid #c6d5e1;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f5f9fd;
  color: #21455f;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.flat-btn:hover {
  background: #ecf4fb;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid #cddbe7;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.8rem;
  background: #f5f9fc;
  color: #355167;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-badge.ok {
  background: #e8f5ed;
  color: #246644;
}

.status-badge.muted {
  background: #edf2f6;
  color: #56697a;
}

.roadmap-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: #364d60;
  font-size: 0.9rem;
}

.logout-form {
  margin: 0;
}

.outline-btn {
  border: 1px solid #b9c9d5;
  background: #f7fbff;
  color: var(--text-900);
  padding: 0 16px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    max-width: 760px;
  }

  .hero-card {
    padding: 26px;
    min-height: 0;
  }

  .auth-card {
    padding: 26px;
    min-height: 0;
    align-self: auto;
  }

  .auth-card h2 {
    font-size: 1.95rem;
  }

  .login-transition-surface {
    min-height: min(480px, 70vh);
  }

  .login-body.is-auth-loading .hero-card,
  .login-body.is-auth-loading .auth-card {
    transform: scale(0.94);
  }

  .dashboard-body {
    padding: 14px;
  }

  .admin-topbar {
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .login-body,
  .dashboard-body {
    padding: 18px 12px;
  }

  .hero-card,
  .auth-card,
  .dashboard-card,
  .dashboard-header {
    border-radius: 14px;
  }

  .password-wrap {
    grid-template-columns: 1fr;
  }

  .toggle-password {
    width: 100%;
    flex-basis: auto;
  }

  .auth-card h2 {
    font-size: 1.7rem;
  }

  .info-tip-text {
    left: 0;
    right: auto;
    bottom: 42px;
    width: min(88vw, 320px);
  }

  .login-transition-surface {
    width: min(94vw, 430px);
    min-height: min(420px, 66vh);
    border-radius: 16px;
  }

  .admin-topbar,
  .panel-section {
    border-radius: 12px;
    padding: 14px;
  }

  .meta-box {
    min-width: 0;
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard v4: lewy, zwijany pasek nawigacji jak w referencji */
.dashboard-body {
  margin: 0;
  min-height: 100vh;
  padding: 6px;
  background: #eaedf1;
  overflow: hidden;
}

.dash-shell {
  width: 100%;
  height: calc(100vh - 12px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.dash-sidebar {
  width: 250px;
  min-height: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #1d2128 0%, #171b21 100%);
  border: 1px solid #272c34;
  box-shadow: 0 10px 30px rgba(9, 14, 22, 0.3);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: width 0.25s ease;
}

.dash-sidebar.is-collapsed {
  width: 76px;
}

.dash-sidebar-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 42px;
}

.dash-nav-toggle {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #c8d4e1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 0;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.dash-nav-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-nav-toggle:hover {
  background: #252c36;
  border-color: #323a45;
  color: #e2ebf5;
}

.dash-profile-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dash-profile-text strong {
  font-size: 0.82rem;
  color: #f2f6fb;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-profile-text span {
  font-size: 0.72rem;
  color: #9dafc3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-sidebar.is-collapsed .dash-sidebar-head {
  grid-template-columns: 1fr;
}

.dash-sidebar.is-collapsed .dash-profile-text {
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  width: 0;
  overflow: hidden;
}

.dash-nav {
  display: grid;
  gap: 6px;
}

.dash-nav-item,
.dash-logout-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #c8d4e1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.dash-nav-item:hover,
.dash-logout-btn:hover {
  background: #252c36;
  border-color: #323a45;
  color: #e2ebf5;
}

.dash-nav-item.is-active {
  background: #dce5f0;
  border-color: #dce5f0;
  color: #12263a;
}

.dash-nav-item:focus-visible,
.dash-logout-btn:focus-visible,
.dash-nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(150, 179, 210, 0.35);
}

.dash-nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
}

.dash-nav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-nav-label {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.2s ease, width 0.2s ease, transform 0.2s ease;
}

.dash-sidebar.is-collapsed .dash-nav-item,
.dash-sidebar.is-collapsed .dash-logout-btn {
  justify-content: center;
  gap: 0;
  padding-inline: 10px;
}

.dash-sidebar.is-collapsed .dash-nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  transform: translateX(-6px);
  pointer-events: none;
}

.dash-sidebar.is-collapsed .dash-nav-icon {
  margin: 0 auto;
}

.dash-side-logout-form {
  position: relative;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #2b313b;
}

.dash-logout-popover {
  position: absolute;
  left: calc(100% + 10px);
  bottom: 0;
  width: 230px;
  border: 1px solid #cc3a3a;
  border-radius: 11px;
  background: #fff7f7;
  box-shadow: 0 12px 26px rgba(159, 36, 36, 0.18);
  padding: 10px;
  z-index: 40;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.17s ease, transform 0.17s ease;
}

.dash-logout-popover::before {
  content: '';
  position: absolute;
  left: -6px;
  bottom: 15px;
  width: 11px;
  height: 11px;
  background: #fff7f7;
  border-left: 1px solid #cc3a3a;
  border-bottom: 1px solid #cc3a3a;
  transform: rotate(45deg);
}

.dash-logout-popover.is-open {
  opacity: 1;
  transform: translateY(0);
}

.dash-logout-popover p {
  margin: 0;
  font-size: 0.82rem;
  color: #6d2323;
}

.dash-logout-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dash-logout-cancel,
.dash-logout-confirm {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.dash-logout-cancel {
  border: 1px solid #d4b7b7;
  background: #fff;
  color: #663737;
}

.dash-logout-confirm {
  border: 1px solid #bb2d2d;
  background: #c83838;
  color: #fff;
}

.dash-logout-cancel:hover {
  background: #f9f2f2;
}

.dash-logout-confirm:hover {
  background: #b52f2f;
}

.dash-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.dash-topbar,
.dash-stage {
  background: #ffffff;
  border: 1px solid #d7dee6;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.dash-topbar {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dash-brand {
  display: grid;
  gap: 6px;
}

.dash-brand h1 {
  font-size: clamp(1.38rem, 2vw, 1.75rem);
  line-height: 1.1;
}

.dash-brand > p {
  font-size: 0.9rem;
  color: #5d6f80;
  max-width: 72ch;
}

.dash-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dash-meta-card {
  min-width: 184px;
  border: 1px solid #dce3ea;
  border-radius: 9px;
  background: #fafbfc;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
}

.dash-meta-card span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6f7f8f;
}

.dash-meta-card strong {
  font-size: 0.86rem;
  color: #2a3c4f;
}

.dash-stage {
  min-height: 0;
  overflow: hidden;
}

.dash-panel {
  height: 100%;
  overflow: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.dash-panel[hidden] {
  display: none !important;
}

.dash-panel-head {
  display: grid;
  gap: 4px;
}

.dash-panel-head h2 {
  font-size: 1.33rem;
  line-height: 1.1;
}

.dash-panel-head p {
  font-size: 0.88rem;
  color: #617283;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 8px;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
}

.system-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 8px;
}

.system-status-card {
  position: relative;
  min-height: 118px;
  border: 1px solid #dce3ea;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.system-status-card > span:first-child {
  color: #607282;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.system-status-card strong {
  color: #223547;
  font-size: 1rem;
}

.system-status-card small {
  color: #66798b;
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.system-status-card .status-badge {
  width: max-content;
  margin-top: 2px;
}

.api-box,
.collection-item {
  border: 1px solid #dce3ea;
  border-radius: 9px;
  background: #f8fafc;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
}

.api-box span,
.collection-item span {
  color: #607282;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.api-box code,
.collection-item code {
  color: #223547;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.collection-list {
  display: grid;
  gap: 8px;
}

.dash-kpi-card {
  border: 1px solid #dce3ea;
  border-radius: 9px;
  background: #fafbfd;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.dash-kpi-card span {
  font-size: 0.78rem;
  color: #607282;
}

.dash-kpi-card strong {
  font-size: 1.1rem;
  color: #223547;
}

.dash-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px;
}

.dash-columns.single {
  grid-template-columns: 1fr;
}

.dash-card {
  border: 1px solid #dde4eb;
  border-radius: 9px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.dash-card h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1rem;
}

.report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.report-card-head p {
  margin: 4px 0 0;
  color: #607282;
  font-size: 0.84rem;
}

.dash-table-wrap {
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  overflow: auto;
  background: #ffffff;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.dash-table th,
.dash-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #e5ebf1;
  font-size: 0.84rem;
  color: #2d4458;
}

.dash-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f8fa;
  font-size: 0.75rem;
  color: #607181;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-table tbody tr:last-child td {
  border-bottom: 0;
}

.dash-table a {
  color: #225a83;
  font-weight: 600;
  text-decoration: none;
}

.dash-table a:hover {
  text-decoration: underline;
}

.table-cell-title,
.table-cell-subtitle {
  display: block;
}

.table-cell-title {
  color: #1d3042;
  font-size: 0.84rem;
  font-weight: 700;
}

.table-cell-subtitle {
  margin-top: 2px;
  color: #66798a;
  font-size: 0.76rem;
  line-height: 1.35;
}

.table-actions-cell {
  white-space: nowrap;
}

.inspection-badge {
  display: inline-flex;
  min-height: 24px;
  max-width: 220px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.inspection-badge.green {
  background: #dff5e8;
  color: #12643d;
}

.inspection-badge.yellow {
  background: #fff0b8;
  color: #795200;
}

.inspection-badge.red {
  background: #ffe1df;
  color: #9c1d18;
}

.inspection-badge.muted {
  background: #edf1f5;
  color: #627486;
}

.inspection-detail-grid {
  display: grid;
  gap: 8px;
}

.inspection-detail-item {
  border: 1px solid #e0e7ee;
  border-radius: 11px;
  background: #fbfcfd;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inspection-detail-item span:first-child {
  color: #52687b;
  font-size: 0.8rem;
  font-weight: 800;
}

.inspection-editor-grid {
  border: 1px solid #e0e7ee;
  border-radius: 13px;
  background: #fbfcfd;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.inspection-editor-grid h3 {
  margin: 0;
  color: #1f2f3f;
  font-size: 0.95rem;
}

.inspection-editor-grid .filter-field {
  margin: 0;
}

.dash-action-grid {
  display: grid;
  gap: 8px;
}

.dash-toolbar,
.dash-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-message {
  min-height: 18px;
  margin: 8px 0 10px;
  color: #607181;
  font-size: 0.8rem;
  font-weight: 700;
}

.toolbar-message:empty {
  margin: 0;
  min-height: 0;
}

.toolbar-message.is-error {
  color: #a64646;
}

.toolbar-message.is-success {
  color: #1f6f4a;
}

.logs-filter-form {
  border: 1px solid #d9e1e8;
  border-radius: 12px;
  background: #fbfcfd;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) repeat(2, minmax(132px, 0.75fr)) auto;
  gap: 8px;
  align-items: end;
}

.report-filter-form {
  grid-template-columns: minmax(160px, 0.9fr) repeat(2, minmax(132px, 0.7fr)) repeat(3, minmax(150px, 1fr)) auto;
}

.pdf-filter-form {
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.8fr) minmax(180px, 1fr) repeat(2, minmax(132px, 0.7fr)) auto;
}

.pdf-scan-filter-form {
  grid-template-columns: repeat(4, minmax(145px, 1fr)) repeat(2, minmax(130px, 0.72fr)) auto;
}

.archive-head {
  align-items: center;
  margin: 8px 0 10px;
}

.archive-head .logs-result-line {
  margin: 0;
}

.filter-field {
  display: grid;
  gap: 5px;
}

.filter-field span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  color: #667789;
}

.filter-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #ccd7e2;
  border-radius: 9px;
  background: #ffffff;
  color: #25384b;
  font: inherit;
  font-size: 0.84rem;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.filter-field textarea,
.filter-field select {
  width: 100%;
  border: 1px solid #ccd7e2;
  border-radius: 9px;
  background: #ffffff;
  color: #25384b;
  font: inherit;
  font-size: 0.84rem;
  padding: 10px;
  outline: none;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.filter-field select {
  min-height: 38px;
  resize: none;
}

.filter-field input[readonly] {
  background: #f3f6f8;
  color: #687a8a;
}

.filter-field input:focus,
.filter-field textarea:focus,
.filter-field select:focus {
  border-color: #2f648d;
  box-shadow: 0 0 0 3px rgba(47, 100, 141, 0.12);
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.logs-result-line {
  min-height: 22px;
  color: #607282;
  font-size: 0.84rem;
}

.dash-panel-head.compact {
  margin-top: 8px;
  gap: 3px;
}

.dash-panel-head.compact h2 {
  font-size: 1.05rem;
}

.pdf-generator-card {
  border: 1px solid #d7e0e8;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(36, 79, 117, 0.075), transparent 46%),
    #ffffff;
  box-shadow: 0 12px 30px rgba(22, 43, 62, 0.07);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.pdf-generator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pdf-generator-head h3 {
  margin: 8px 0 4px;
  color: #1c2f40;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  line-height: 1.12;
}

.pdf-generator-head p {
  color: #607282;
  font-size: 0.86rem;
}

.pdf-generator-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pdf-selection-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
}

.pdf-selection-stats > div {
  border: 1px solid #dbe4ec;
  border-radius: 12px;
  background: rgba(248, 251, 253, 0.86);
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.pdf-selection-stats span {
  color: #647789;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.pdf-selection-stats strong {
  color: #1f3850;
  font-size: 1.35rem;
  line-height: 1;
}

.pdf-location-select {
  position: relative;
}

.pdf-dropdown-trigger {
  width: 100%;
  min-height: 58px;
  border: 1px solid #cdd9e4;
  border-radius: 13px;
  background: #f8fbfd;
  color: #20364a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pdf-dropdown-trigger:hover,
.pdf-dropdown-trigger[aria-expanded="true"] {
  border-color: #9fb8cc;
  background: #f3f8fb;
  box-shadow: 0 0 0 3px rgba(36, 79, 117, 0.08);
}

.pdf-dropdown-trigger span {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.pdf-dropdown-trigger small {
  color: #65798b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.pdf-dropdown-trigger strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.pdf-dropdown-trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.18s ease;
}

.pdf-dropdown-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.pdf-chip-dropdown {
  position: absolute;
  z-index: 15;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border: 1px solid #cdd9e4;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(23, 42, 58, 0.16);
  padding: 10px;
}

.pdf-chip-dropdown-head {
  border-bottom: 1px solid #e1e8ee;
  padding: 4px 4px 10px;
  display: grid;
  gap: 3px;
}

.pdf-chip-dropdown-head strong {
  color: #20364a;
  font-size: 0.9rem;
}

.pdf-chip-dropdown-head span {
  color: #607282;
  font-size: 0.78rem;
}

.pdf-chip-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 10px 2px 2px;
}

.pdf-chip-picker > p {
  color: #607282;
  font-size: 0.84rem;
}

.pdf-chip-pill {
  border: 1px solid #d6e0e9;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.pdf-chip-pill:hover {
  border-color: #b8cbd9;
  background: #f2f6f9;
}

.pdf-chip-pill.is-selected {
  border-color: #244f75;
  background: #edf5fb;
  box-shadow: 0 0 0 3px rgba(36, 79, 117, 0.1);
}

.pdf-chip-pill input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #244f75;
}

.pdf-chip-pill span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pdf-chip-pill strong {
  color: #20364a;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-chip-pill small {
  color: #6b7f91;
  font-size: 0.76rem;
}

.pdf-scans-panel {
  border: 1px solid #d7e0e8;
  border-radius: 14px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.pdf-scans-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.pdf-scans-panel-head h3 {
  margin: 6px 0 2px;
  color: #1c2f40;
  font-family: var(--font-heading);
  font-size: 1.14rem;
}

.pdf-scans-panel-head .muted-inline {
  max-width: 520px;
  text-align: right;
}

.pdf-scans-table-wrap {
  min-height: 140px;
}

.pdf-scans-table {
  min-width: 980px;
}

.pdf-scans-table tbody tr.is-selected td {
  background: #f0f7fc;
}

.pdf-scans-table tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 #244f75;
}

.select-col {
  width: 82px;
  text-align: center !important;
}

.pdf-scan-checkbox {
  width: 17px;
  height: 17px;
  accent-color: #244f75;
  cursor: pointer;
}

.pdf-download-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf5fb;
}

.dashboard-body .flat-btn {
  border: 1px solid #d2dae2;
  border-radius: 8px;
  padding: 9px 11px;
  background: #f7f9fb;
  color: #2b455a;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.dashboard-body .flat-btn:hover {
  background: #edf2f6;
}

.dashboard-body .flat-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.dashboard-body .flat-btn.primary {
  border-color: #214d73;
  background: #244f75;
  color: #ffffff;
}

.dashboard-body .flat-btn.primary:hover {
  background: #1f4567;
}

.dashboard-body .flat-btn.danger {
  border-color: #e6b5b5;
  background: #fff8f8;
  color: #9b3131;
}

.dashboard-body .flat-btn.danger:hover {
  background: #ffecec;
}

.dashboard-body .flat-btn.danger.solid {
  border-color: #9b3131;
  background: #a83a3a;
  color: #ffffff;
}

.dashboard-body .flat-btn.danger.solid:hover {
  background: #922f2f;
}

.table-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #225a83;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.table-link:hover {
  text-decoration: underline;
}

.danger-link {
  color: #a64646;
}

.device-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.device-actions-row:empty {
  display: none;
}

.scan-details-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.scan-details-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.scan-details-panel {
  position: fixed;
  top: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 41;
  width: min(440px, calc(100vw - 44px));
  border: 1px solid #d5dee7;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
  transform: translateX(calc(100% + 32px));
  transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.25, 1);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.scan-details-panel.is-open {
  transform: translateX(0);
}

.scan-details-head {
  border-bottom: 1px solid #e2e8ef;
  padding: 16px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: flex-start;
  gap: 14px;
}

.scan-details-title-block {
  min-width: 0;
}

.scan-details-head > .scan-details-title-block:first-child,
.scan-details-head > div:first-child {
  grid-column: 2;
}

.scan-details-head span {
  display: block;
  margin-bottom: 5px;
  color: #6b7d8d;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scan-details-head h2 {
  margin: 0;
  color: #1f2f3f;
  font-size: 1.24rem;
  line-height: 1.15;
}

.panel-back-btn,
.scan-details-close {
  width: 34px;
  height: 34px;
  border: 1px solid #d6dfe8;
  border-radius: 10px;
  background: #f8fafc;
  color: #516678;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.scan-details-close {
  grid-column: 3;
}

.panel-back-btn {
  grid-column: 1;
}

.panel-back-btn svg,
.scan-details-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-back-btn:hover,
.scan-details-close:hover {
  background: #eef3f7;
}

.scan-details-body {
  padding: 16px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}

.details-grid {
  display: grid;
  gap: 9px;
}

.details-item {
  border: 1px solid #e0e7ee;
  border-radius: 11px;
  background: #fbfcfd;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.details-item span {
  color: #6b7d8d;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.details-item strong,
.details-item p {
  margin: 0;
  color: #26394c;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.details-section {
  border-top: 1px solid #e4ebf1;
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.details-section h3 {
  margin: 0;
  color: #24384a;
  font-size: 0.98rem;
}

.audit-details-link {
  display: inline-block;
  margin-top: 4px;
}

.audit-compare-wrap {
  overflow: auto;
  border: 1px solid #dfe7ee;
  border-radius: 12px;
  background: #ffffff;
}

.audit-compare-table {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
}

.audit-compare-table th,
.audit-compare-table td {
  border-bottom: 1px solid #e7edf3;
  padding: 10px 11px;
  color: #26394c;
  font-size: 0.82rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.audit-compare-table thead th {
  background: #f3f6f9;
  color: #607282;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.audit-compare-table tbody tr:last-child th,
.audit-compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.audit-compare-table tbody tr.is-changed th {
  color: #214d73;
}

.audit-compare-table tbody tr.is-changed td:last-child {
  background: #f4f8fb;
  font-weight: 800;
}

.scan-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.muted-inline {
  color: #6d7f8f;
  font-size: 0.86rem;
  font-weight: 700;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-list-item {
  width: 100%;
  border: 1px solid #dfe7ee;
  border-radius: 10px;
  background: #fbfcfd;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 3px;
}

.mini-list-item:hover {
  background: #f3f7fa;
}

.mini-list-item span {
  color: #6c7d8d;
  font-size: 0.74rem;
  font-weight: 700;
}

.mini-list-item strong {
  color: #26394c;
  font-size: 0.9rem;
}

.mini-list-item small {
  color: #627486;
  font-size: 0.78rem;
}

.empty-state {
  margin: 0;
  color: #6a7c8d;
  font-size: 0.9rem;
}

.side-form {
  padding: 16px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}

.danger-zone {
  border: 1px solid #edd0d0;
  border-radius: 12px;
  background: #fffafa;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.danger-zone strong {
  color: #813131;
  font-size: 0.9rem;
}

.danger-zone p {
  margin: 4px 0 0;
  color: #765555;
  font-size: 0.78rem;
  line-height: 1.45;
}

.danger-confirm {
  border-top: 1px solid #edd0d0;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.danger-confirm span {
  flex: 1 1 100%;
  color: #813131;
  font-size: 0.8rem;
  font-weight: 700;
}

.side-form-message {
  min-height: 20px;
  margin: 0;
  color: #607282;
  font-size: 0.84rem;
}

.side-form-message.is-error {
  color: #a53b3b;
}

.side-form-message.is-success {
  color: #246644;
}

.side-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-body .filter-chip {
  border: 1px solid #d4dde5;
  background: #f7f9fb;
  color: #42586b;
}

.dashboard-body .status-badge.ok {
  background: #e8f3eb;
  color: #246644;
}

.dashboard-body .status-badge.muted {
  background: #edf1f5;
  color: #576a7b;
}

.dashboard-body .status-badge.warning {
  background: #fff3d8;
  color: #7a5117;
}

.dashboard-body .status-badge.danger {
  background: #ffe1df;
  color: #9c1d18;
}

@media (max-width: 1180px) {
  .dash-topbar {
    flex-direction: column;
  }

  .dash-meta {
    justify-content: flex-start;
  }

  .dash-kpi-grid {
    grid-template-columns: repeat(3, minmax(128px, 1fr));
  }

  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .system-status-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 980px) {
  .dash-sidebar {
    width: 72px;
    padding: 8px;
  }

  .dash-sidebar .dash-sidebar-head {
    grid-template-columns: 1fr;
  }

  .dash-sidebar .dash-profile-text,
  .dash-sidebar .dash-nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .dash-sidebar .dash-nav-item,
  .dash-sidebar .dash-logout-btn {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
  }

  .dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(128px, 1fr));
  }

  .system-status-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .dash-columns {
    grid-template-columns: 1fr;
  }

  .logs-filter-form {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .pdf-generator-head {
    flex-direction: column;
  }

  .pdf-generator-actions {
    justify-content: flex-start;
  }

  .pdf-selection-stats {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .dashboard-body {
    padding: 4px;
    overflow: auto;
  }

  .dash-shell {
    height: auto;
    min-height: calc(100vh - 8px);
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dash-sidebar {
    width: 100%;
    min-height: auto;
    border-radius: 10px;
    gap: 8px;
  }

  .dash-sidebar .dash-profile-text {
    opacity: 1;
    width: auto;
    pointer-events: auto;
  }

  .dash-sidebar .dash-nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
  }

  .dash-sidebar .dash-nav-item {
    width: auto;
    min-width: 44px;
    padding: 8px;
  }

  .dash-sidebar .dash-nav-label {
    display: none;
  }

  .dash-side-logout-form {
    display: none;
  }

  .dash-topbar,
  .dash-stage {
    border-radius: 10px;
  }

  .dash-panel {
    padding: 12px;
  }

  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }

  .report-summary-grid {
    grid-template-columns: 1fr;
  }

  .system-status-grid {
    grid-template-columns: 1fr;
  }

  .report-card-head {
    flex-direction: column;
  }

  .dash-meta-card {
    min-width: 0;
    width: 100%;
  }

  .dash-table {
    min-width: 620px;
  }

  .logs-filter-form {
    grid-template-columns: 1fr;
  }

  .pdf-selection-stats {
    grid-template-columns: 1fr;
  }

  .pdf-chip-pill {
    max-width: none;
  }

  .filter-actions {
    flex-direction: column;
  }

  .scan-details-panel {
    inset: auto 8px 8px 8px;
    top: 72px;
    width: auto;
  }
}
