@import url('rsm-brand.css');

:root {
  --app-bg: #f3f4f6;
  --app-surface: #ffffff;
  --app-border: #e5e7eb;
  --app-border-light: #f0f1f3;
  --app-radius: 10px;
  --app-radius-lg: 14px;
  --app-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --app-shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.08);
  --app-ok-bg: #ecfdf5;
  --app-ok-text: #065f46;
  --app-warn-bg: #fff7ed;
  --app-warn-text: #9a3412;
  --app-err-bg: #fef2f2;
  --app-err-text: #991b1b;
  --app-info-bg: #eff6ff;
  --app-info-text: #1e40af;
  --app-gray-bg: #f3f4f6;
  --app-gray-text: #6b7280;
  --sidebar-w: 240px;
  --topbar-h: 56px;
}

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

body {
  font-family: var(--font-system);
  font-size: 14px;
  line-height: 1.5;
  color: var(--rsm-grey-dark);
  background: var(--app-bg);
  min-height: 100vh;
  overflow: hidden;
}

.env-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.env-banner.hidden { display: none; }
.env-banner.env-test { background: #a16207; }
.env-banner.env-development { background: #c2410c; }

body.has-env-banner .app,
body.has-env-banner .lock-screen {
  margin-top: 26px;
  height: calc(100vh - 26px);
}

.sidebar-version {
  padding: 6px 20px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.18);
  font-family: monospace;
}
.sidebar-version.hidden { display: none; }

.app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--rsm-midnight);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-brand {
  padding: 0px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  display: block;
  flex-shrink: 0;
  margin: 8px 0;
}

.brand-product {
  font-size: 20px;
  font-weight: 700;
  color: var(--rsm-white);
  letter-spacing: 0.5px;
  line-height: 1;
}

.brand-tagline {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.30);
  margin-top: 0px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 20px 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  position: relative;
  text-align: left;
  font-family: var(--font-system);
}

.nav-item:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--rsm-white);
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--rsm-blue);
}

.nav-badge {
  margin-left: auto;
  background: var(--rsm-red);
  color: var(--rsm-white);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

#task-shelf-nav-count {
  background: var(--rsm-blue);
  color: var(--rsm-white);
}

#customers-nav-count {
  background: var(--rsm-orange);
  color: var(--rsm-white);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-icon-img {
  filter: invert(1) grayscale(1) brightness(10);
  mix-blend-mode: screen;
}

.sidebar-user-wrap {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.user-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 8px;
  right: 8px;
  background: #0d1c38;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 100;
  padding: 6px 0;
}

.user-popup-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-system);
  transition: background 0.12s, color 0.12s;
}

.user-popup-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--rsm-white);
}

.user-popup-item.active {
  color: var(--rsm-blue);
}

.user-popup-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

.user-popup-icon-img {
  filter: invert(1) grayscale(1) brightness(10);
  mix-blend-mode: screen;
}

.user-popup-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
  margin: 4px 0;
}

.user-popup-logout {
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-user {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-user[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.07);
}

.user-menu-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.4;
  transition: transform 0.2s;
}

.sidebar-user[aria-expanded="true"] .user-menu-chevron {
  transform: rotate(180deg);
  opacity: 0.7;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--rsm-blue);
  color: var(--rsm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0;
  overflow: hidden;
  position: relative;
}

.user-avatar.has-photo {
  background: transparent;
  font-size: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.user-meta {
  min-width: 0;
}

.user-meta .name {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta .role {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 24px;
  background: linear-gradient(90deg, var(--app-surface), rgba(239, 246, 255, 0.5));
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}


.topbar-rsm-logo {
  height: 42px;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--rsm-blue);
}

.topbar-subtitle {
  font-size: 13px;
  color: var(--rsm-grey-mid);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 320px;
  height: 36px;
  border: 1px solid var(--app-border);
  border-right: none;
  border-radius: var(--app-radius) 0 0 var(--app-radius);
  padding: 0 38px 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--rsm-midnight);
  background: var(--app-surface);
  outline: none;
  position: relative;
  z-index: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--rsm-blue);
  box-shadow: 0 0 0 2px rgba(0, 156, 222, 0.18);
  z-index: 1;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-clear {
  position: absolute;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 21, 61, 0.08);
  color: var(--rsm-grey-dark);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover {
  background: rgba(0, 21, 61, 0.14);
}

.search-form {
  display: flex;
  align-items: center;
}

.search-submit-btn {
  height: 36px;
  width: 38px;
  border: 1px solid var(--rsm-blue);
  border-radius: 0 var(--app-radius) var(--app-radius) 0;
  background: var(--rsm-blue);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.search-submit-btn:hover {
  background: var(--rsm-midnight);
  border-color: var(--rsm-midnight);
}

.search-load-spinner {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 156, 222, 0.2);
  border-top-color: var(--rsm-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.search-wrap:has(#customer-load-spinner:not(.hidden)) .search-input {
  padding-left: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid rgba(0, 156, 222, 0.45);
  background: rgba(0, 156, 222, 0.08);
  color: var(--rsm-blue);
  cursor: pointer;
  font-family: var(--font-system);
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--rsm-blue);
  background: rgba(0, 156, 222, 0.14);
}

.btn-primary {
  background: var(--rsm-blue);
  border-color: var(--rsm-blue);
  color: var(--rsm-white);
}

.btn-primary:hover {
  background: #0088c6;
  border-color: #0088c6;
}

.btn-green {
  background: var(--rsm-green);
  border-color: var(--rsm-green);
  color: var(--rsm-white);
}

.btn-green:hover {
  background: #358a2c;
  border-color: #358a2c;
}

.btn:disabled {
  border-color: var(--app-border);
  background: var(--app-gray-bg);
  color: var(--rsm-grey-mid);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-danger {
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-danger:hover {
  background: #a93226;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background:
    radial-gradient(ellipse at top left, rgba(0, 156, 222, 0.06), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(63, 156, 53, 0.04), transparent 50%),
    var(--app-bg);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.lock-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-bg);
  z-index: 9999;
}

.lock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 40px;
  background: var(--app-surface);
  border: 1px solid var(--app-border-light);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  text-align: center;
}

.lock-logo {
  height: 32px;
}

.lock-product {
  font-size: 22px;
  font-weight: 700;
  color: var(--rsm-midnight);
  letter-spacing: 0.5px;
}

.lock-icon {
  width: 48px;
  height: 48px;
  color: var(--rsm-blue);
  margin: 8px 0;
}

.lock-spinner {
  display: none;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 156, 222, 0.2);
  border-top-color: var(--rsm-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 12px 0;
}

.lock-screen.loading .lock-icon { display: none; }
.lock-screen.loading .lock-spinner { display: block; }
.lock-screen.loading .lock-btn { display: none; }
.lock-screen.loading .lock-message { opacity: 0.6; }

.lock-message {
  font-size: 15px;
  color: var(--rsm-grey-mid);
}

.lock-btn {
  margin-top: 8px;
  text-decoration: none;
}

.kpi-row {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card {
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--app-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow-lg);
}

.kpi-filter {
  cursor: pointer;
}

.kpi-filter.active {
  outline: 2px solid var(--rsm-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 156, 222, 0.12), var(--app-shadow-lg);
}

.kpi-filter:focus-visible {
  outline: 2px solid var(--rsm-blue);
  outline-offset: 2px;
}

.kpi-card.kpi-ok {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-color: rgba(63, 156, 53, 0.2);
}

.kpi-card.kpi-warn {
  background: linear-gradient(135deg, #fff7ed 0%, #fff1e6 100%);
  border-color: rgba(232, 119, 34, 0.2);
}

.kpi-card.kpi-err {
  background: linear-gradient(135deg, #fef2f2 0%, #fef5f5 100%);
  border-color: rgba(228, 0, 70, 0.2);
}

.kpi-card.kpi-info {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f7ff 100%);
  border-color: rgba(0, 156, 222, 0.2);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.kpi-ok::before {
  background: var(--rsm-green);
}

.kpi-card.kpi-warn::before {
  background: var(--rsm-orange);
}

.kpi-card.kpi-err::before {
  background: var(--rsm-red);
}

.kpi-card.kpi-info::before {
  background: var(--rsm-blue);
}

/* Solid brand-coloured quick-filter cards (Kundeoversigt + Indberetningsstatus selskaber).
   Coordinated palette: blue → green → grey → midnight, white text. */
.kpi-card.kpi-solid {
  color: var(--rsm-white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), var(--app-shadow);
}

.kpi-card.kpi-solid:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), var(--app-shadow-lg);
}

.kpi-card.kpi-solid::before {
  display: none;
}

.kpi-card.kpi-solid .kpi-value {
  color: var(--rsm-white);
}

.kpi-card.kpi-solid .kpi-label,
.kpi-card.kpi-solid .kpi-sub {
  color: rgba(255, 255, 255, 0.82);
}

.kpi-filter.kpi-solid.active {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9),
              0 0 0 3px var(--rsm-midnight),
              var(--app-shadow-lg);
}

.kpi-card.kpi-c1 {
  background: var(--rsm-blue);
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--rsm-blue) 90%, black) 0%,
    var(--rsm-blue) 45%,
    color-mix(in srgb, var(--rsm-blue) 84%, white) 100%);
}

.kpi-card.kpi-c2 {
  background: var(--rsm-green);
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--rsm-green) 90%, black) 0%,
    var(--rsm-green) 45%,
    color-mix(in srgb, var(--rsm-green) 84%, white) 100%);
}

.kpi-card.kpi-c3 {
  background: var(--rsm-grey-dark);
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--rsm-grey-dark) 90%, black) 0%,
    var(--rsm-grey-dark) 45%,
    color-mix(in srgb, var(--rsm-grey-dark) 84%, white) 100%);
}

.kpi-card.kpi-c4 {
  background: var(--rsm-midnight);
  background: linear-gradient(100deg,
    var(--rsm-midnight) 0%,
    var(--rsm-midnight) 40%,
    color-mix(in srgb, var(--rsm-midnight) 80%, white) 100%);
}

.kpi-label {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.kpi-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--rsm-grey-dark);
  line-height: 1;
}

.kpi-value.small-kpi,
.kpi-value-sm {
  font-size: 18px;
}

.kpi-sub {
  font-size: 11px;
  margin-top: 8px;
  font-weight: 500;
}

.kpi-sub.ok {
  color: var(--rsm-green);
}

.kpi-sub.warn {
  color: var(--rsm-orange);
}

.kpi-sub.err {
  color: var(--rsm-red);
}

.kpi-sub.info {
  color: var(--rsm-blue);
}

.scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.scope-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.scope-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.scope-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  padding: 3px;
  width: fit-content;
  box-shadow: var(--app-shadow);
}

.scope-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--rsm-grey-dark);
  cursor: pointer;
  font-family: var(--font-system);
  transition: all 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scope-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  color: var(--rsm-grey-dark);
  font-size: 13px;
  font-weight: 600;
}

.scope-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--rsm-blue);
}

.scope-btn:hover:not(:disabled) {
  color: var(--rsm-grey-dark);
  background: var(--app-bg);
}

.scope-btn.active {
  background: var(--rsm-blue);
  color: var(--rsm-white);
  box-shadow: 0 1px 3px rgba(0, 156, 222, 0.3);
}

.scope-btn:disabled {
  color: #c5c7ca;
  cursor: not-allowed;
}

.scope-count {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 2px;
}

.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--rsm-grey-dark);
  cursor: pointer;
  font-family: var(--font-system);
  transition: all 0.15s;
}

.filter-chip:hover {
  border-color: var(--rsm-blue);
  color: var(--rsm-blue);
}

.filter-chip.active {
  background: var(--rsm-blue);
  border-color: var(--rsm-blue);
  color: var(--rsm-white);
}

.filter-count {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  margin-left: 8px;
}

.filter-toggle-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.advanced-filter-btn {
  position: relative;
  border-color: rgba(0, 156, 222, 0.28);
  background: rgba(0, 156, 222, 0.08);
  color: var(--rsm-blue);
  font-weight: 700;
}

.filter-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 11px;
  height: 11px;
  background: var(--rsm-blue);
  border-radius: 50%;
  border: 2px solid white;
}

.advanced-filter-btn:hover,
.advanced-filter-btn.active {
  border-color: var(--rsm-blue);
  color: var(--rsm-blue);
  background: rgba(0, 156, 222, 0.14);
}

.filter-arrow {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
  margin-top: -3px;
  transition: transform 0.15s ease, margin-top 0.15s ease;
}

.advanced-filter-btn.active .filter-arrow {
  transform: rotate(225deg);
  margin-top: 3px;
}

.customer-filter-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

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

.filter-field span {
  font-size: 11px;
  font-weight: 700;
  color: var(--rsm-grey-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--app-border);
  border-radius: 3px;
  padding: 0 10px;
  background: #fff;
  color: var(--rsm-grey-dark);
  font: inherit;
  outline: none;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--rsm-blue);
}

.filter-multiselect {
  position: relative;
}

.filter-multiselect-toggle {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--app-border);
  background: #fff;
  border-radius: 3px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.filter-multiselect-toggle:focus {
  outline: none;
  border-color: var(--rsm-blue);
}

.filter-multiselect-toggle[aria-expanded="true"] {
  border-color: var(--rsm-blue);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.filter-multiselect-toggle[aria-expanded="true"] .filter-arrow {
  transform: rotate(225deg);
  margin-top: 3px;
}

.filter-multiselect-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid var(--rsm-blue);
  border-top: none;
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-height: 220px;
  overflow-y: auto;
}

.filter-multiselect-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
}

.filter-multiselect-item:hover {
  background: rgba(0, 156, 222, 0.08);
}

.filter-multiselect-item input[type="checkbox"] {
  width: auto;
  min-height: unset;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.filter-multiselect-search {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 6px 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--app-border);
  list-style: none;
}

.filter-multiselect-search-input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--app-border);
  border-radius: 3px;
  padding: 0 8px;
  font-size: 13px;
  box-sizing: border-box;
}

.filter-multiselect-search-input:focus {
  outline: none;
  border-color: var(--rsm-blue);
}

.filter-multiselect-empty {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--app-muted, #888);
  list-style: none;
}

.filter-grid {
  grid-template-columns: repeat(7, minmax(112px, 1fr));
}

.customer-filter-grid {
  grid-template-columns: repeat(8, minmax(112px, 1fr));
}

/* Indberetningsstatus selskaber: all nine filters on a single row, matching column order */
.ar-filter-grid {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.active-filters,
.filter-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-empty {
  font-size: 12px;
  color: var(--rsm-grey-mid);
}

.empty-state-action {
  margin-top: 10px;
}

.active-filter-chip {
  border: 1px solid rgba(0, 156, 222, 0.24);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(0, 156, 222, 0.08);
  color: var(--rsm-blue);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.active-filter-chip::after {
  content: " ×";
  font-weight: 700;
}

.page-settings {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.inline-select span {
  font-size: 12px;
  color: var(--rsm-grey-mid);
}

.inline-select select {
  border: none;
  background: transparent;
  color: var(--rsm-grey-dark);
  font: inherit;
  outline: none;
  cursor: pointer;
}

.server-note,
.perm-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--app-border);
  background: var(--app-info-bg);
  color: var(--app-info-text);
}

.perm-notice.hidden {
  display: none;
}

.perm-notice.force-visible {
  display: flex;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(0, 21, 61, 0.08);
  box-shadow: 0 14px 30px rgba(0, 21, 61, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 253, 0.95));
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  margin-bottom: 16px;
}

.data-table {
  width: 100%;
  min-width: 860px;
  background: var(--app-surface);
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  color: var(--rsm-grey-dark);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 2px solid rgba(0, 21, 61, 0.1);
  background: linear-gradient(180deg, #f8fafc, #f0f3f7);
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.sort-header::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0;
}

.sort-header.active::after {
  opacity: 0.9;
}

.sort-header.active[data-sort-direction="Asc"]::after {
  border-bottom: 6px solid var(--rsm-blue);
}

.sort-header.active[data-sort-direction="Desc"]::after {
  border-top: 6px solid var(--rsm-blue);
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(0, 21, 61, 0.018);
}

.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(0, 156, 222, 0.07), rgba(63, 156, 53, 0.04));
  box-shadow: inset 4px 0 0 var(--rsm-blue);
}

.data-table tbody td {
  padding: 16px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--app-border-light);
  vertical-align: middle;
}

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

.cell-customer-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  color: var(--rsm-blue);
  line-height: 1.3;
}

.data-table tbody tr:hover .cell-customer-name {
  color: #0077a8;
}

.cell-cvr {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  margin-top: 3px;
}

.cell-customer-number {
  font-weight: 700;
  font-size: 15px;
  color: var(--rsm-grey-dark);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.cell-top-project {
  font-weight: 400;
  font-size: 12px;
  color: var(--rsm-grey-mid);
  cursor: default;
}

.col-year-end {
  width: 80px;
  text-align: center;
  white-space: nowrap;
}

.col-cvr-status {
  width: 56px;
  text-align: center;
  white-space: nowrap;
}

.cvr-light {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.cvr-light--ok   { background: var(--rsm-green); }
.cvr-light--warn { background: var(--rsm-orange); }

.year-end-date {
  font-variant-numeric: tabular-nums;
}

.col-creditro {
  width: 64px;
  text-align: center;
}

.kyc-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.kyc-dot--badge-ok   { background: var(--rsm-green); }
.kyc-dot--badge-warn { background: var(--rsm-orange); }
.kyc-dot--badge-err  { background: var(--rsm-red); }
.kyc-dot--badge-gray { background: var(--rsm-grey-mid); }

.skat-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.skat-lock--open   { color: var(--rsm-green); }
.skat-lock--closed { color: var(--rsm-red); }

.col-ar-status {
  width: 110px;
  text-align: center;
}

/* Indberetningsstatus selskaber has many columns — tighten spacing so they all fit */
#ar-table thead th,
#ar-table tbody td {
  padding-left: 9px;
  padding-right: 9px;
}

#ar-table .col-ar-status {
  width: 62px;
}

.col-ar-year {
  width: 80px;
  white-space: nowrap;
}

.data-table tbody tr:hover .cell-customer-number {
  color: var(--rsm-grey-dark);
}

.col-id {
  width: 110px;
  white-space: nowrap;
}

.cell-muted,
.state-caption {
  color: var(--rsm-grey-mid);
}

.duration-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rsm-grey-mid);
  margin-right: 3px;
}

.state-caption.warn {
  color: var(--app-warn-text);
}

.state-text {
  font-size: 12px;
}

.state-text.ok {
  color: var(--app-ok-text);
}

.state-text.warn {
  color: var(--app-warn-text);
}

.state-text.info {
  color: var(--app-info-text);
}

.resp-avatars {
  display: flex;
  gap: 3px;
  align-items: center;
}

.resp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  cursor: default;
  white-space: nowrap;
}

.resp-avatar[data-responsible-name] {
  cursor: pointer;
}

.resp-avatar[data-responsible-name]:hover {
  opacity: 0.82;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.resp-avatar--lr {
  background: var(--rsm-blue);
  color: var(--rsm-white);
  border: 1.5px solid var(--rsm-blue);
}

.resp-avatar--ar {
  background: var(--rsm-green);
  color: var(--rsm-white);
  border: 1.5px solid var(--rsm-green);
}

.resp-avatar--ur {
  background: var(--rsm-teal);
  color: var(--rsm-white);
  border: 1.5px solid var(--rsm-teal);
}

.resp-avatar--es {
  background: var(--rsm-midnight);
  color: var(--rsm-white);
  border: 1.5px solid var(--rsm-midnight);
}

.resp-detail-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 24px;
  padding: 14px 18px;
}

.resp-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.resp-detail-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.resp-detail-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.resp-detail-email {
  font-size: 12px;
  color: var(--rsm-blue);
  text-decoration: none;
}

.resp-detail-email:hover {
  text-decoration: underline;
}

.resp-detail-role {
  font-size: 11px;
  color: var(--rsm-grey-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cw-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.cw-cell-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-cell-year {
  font-weight: 700;
  font-size: 14px;
  color: var(--rsm-grey-dark);
  line-height: 1.2;
}

.cw-cell-file {
  font-size: 11px;
  color: var(--rsm-grey-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.btn-rul-inline,
.btn-open-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--rsm-blue);
  background: rgba(0, 156, 222, 0.08);
  color: var(--rsm-blue);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-system);
  line-height: 1.2;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-rul-inline:hover:not(:disabled),
.btn-rul-inline:focus-visible,
.btn-open-inline:hover,
.btn-open-inline:focus-visible {
  background: var(--rsm-blue);
  border-color: var(--rsm-blue);
  color: var(--rsm-white);
}

.btn-rul-inline:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-open-list {
  background: var(--rsm-blue);
  border-color: var(--rsm-blue);
  color: var(--rsm-white);
}

.btn-open-list:hover {
  background: #0088c6;
  border-color: #0088c6;
  color: var(--rsm-white);
}

.btn-open-list:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--rsm-blue);
  border-color: var(--rsm-blue);
  color: var(--rsm-white);
}

.dept-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 156, 222, 0.18);
  background: linear-gradient(135deg, rgba(0, 156, 222, 0.08), rgba(0, 21, 61, 0.05));
  font-size: 12px;
  font-weight: 700;
  color: var(--rsm-grey-dark);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-ok {
  background: var(--app-ok-bg);
  color: var(--app-ok-text);
}

.badge-warn {
  background: var(--app-warn-bg);
  color: var(--app-warn-text);
}

.badge-err {
  background: var(--app-err-bg);
  color: var(--app-err-text);
}

.badge-info {
  background: var(--app-info-bg);
  color: var(--app-info-text);
}

.badge-gray {
  background: var(--app-gray-bg);
  color: var(--app-gray-text);
}

.badge-more {
  background: var(--app-gray-bg);
  color: var(--app-gray-text);
  cursor: help;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.attention-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 260px;
}

.attn-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.attn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.attn-dot.ok {
  background: var(--rsm-green);
}

.attn-dot.warn {
  background: var(--rsm-orange);
  box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.15);
}

.attn-dot.err {
  background: var(--rsm-red);
  box-shadow: 0 0 0 3px rgba(228, 0, 70, 0.15);
  animation: pulse-err 2s ease-in-out infinite;
}

@keyframes pulse-err {
  0%, 100% { box-shadow: 0 0 0 3px rgba(228, 0, 70, 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(228, 0, 70, 0.08); }
}

.attn-label {
  font-size: 13px;
  font-weight: 600;
}

.attn-label.ok {
  color: var(--rsm-grey-mid);
}

.attn-label.warn {
  color: var(--app-warn-text);
}

.attn-label.err {
  color: var(--app-err-text);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pagination-summary {
  font-size: 12px;
  color: var(--rsm-grey-mid);
}

.pagination-status {
  min-height: 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-controls-top,
.pagination-bar .pagination-controls {
  display: none;
}

.page-indicator {
  min-width: 120px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.pagination-controls-top {
  justify-content: flex-end;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  color: var(--rsm-grey-dark);
  font-size: 12px;
  font-weight: 600;
}

.page-jump input {
  width: 64px;
  padding: 5px 8px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #fff;
  color: var(--rsm-grey-dark);
  font: inherit;
  text-align: center;
}

.page-jump input:focus {
  outline: none;
  border-color: var(--rsm-blue);
  box-shadow: 0 0 0 3px rgba(0, 156, 222, 0.12);
}

.empty-state {
  padding: 28px 20px;
  text-align: center;
  color: var(--rsm-grey-mid);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.section-subtitle {
  font-size: 13px;
  color: var(--rsm-grey-mid);
  margin-top: 4px;
}

.count-chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0, 21, 61, 0.05);
  color: var(--rsm-grey-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.section-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.panel-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.int-tabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--app-border-light);
  margin-top: 8px;
}

.cw-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--app-border-light);
  margin-bottom: 8px;
}

.cw-filter-input,
.cw-filter-select {
  min-height: 34px;
  border: 1px solid var(--app-border);
  border-radius: 3px;
  padding: 0 10px;
  background: #fff;
  color: var(--rsm-grey-dark);
  font: inherit;
  outline: none;
}

.cw-filter-input:focus,
.cw-filter-select:focus {
  border-color: var(--rsm-blue);
}

.cw-filter-input {
  flex: 1 1 180px;
  max-width: 260px;
}

.cw-filter-select {
  min-width: 130px;
}

.cw-filter-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--rsm-grey-dark);
  cursor: pointer;
  white-space: nowrap;
}

.robot-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px 0;
}

.robot-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--app-shadow);
}

.robot-card--idle {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-color: rgba(63, 156, 53, 0.25);
  border-left-color: var(--rsm-green);
}

.robot-card--busy {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f7ff 100%);
  border-color: rgba(0, 156, 222, 0.25);
  border-left-color: var(--rsm-blue);
}

.robot-card--offline {
  background: linear-gradient(135deg, #fef2f2 0%, #fef5f5 100%);
  border-color: rgba(220, 38, 38, 0.25);
  border-left-color: #dc2626;
}

.robot-card--dead {
  opacity: 0.82;
  padding: 10px 12px;
}

.robot-card--dead .robot-card-name {
  font-size: 13px;
  font-weight: 600;
}

.robot-card--dead .robot-card-id {
  margin-top: 2px;
}

.robot-card--dead .robot-card-footer {
  margin-top: 6px;
  gap: 4px;
}

.robot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.robot-card-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--rsm-grey-dark);
}

.robot-card-id {
  font-size: 12px;
  color: var(--rsm-grey-mid);
}

.robot-card-job {
  font-size: 13px;
  color: var(--rsm-grey-dark);
  background: rgba(0, 156, 222, 0.06);
  padding: 6px 10px;
  border-radius: 6px;
}

.robot-card-job-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rsm-grey-mid);
  margin-right: 6px;
}

.robot-card-idle {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  font-style: italic;
}

.robot-card-footer {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  border-top: 1px solid var(--app-border-light);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.robot-card-err {
  color: var(--app-err-text);
}

.system-config-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
  margin-bottom: 4px;
}

.system-config-label {
  font-size: 13px;
  color: var(--rsm-grey-mid);
  white-space: nowrap;
}

.system-config-input {
  width: 100px;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid var(--app-border);
  border-radius: 4px;
}

.system-config-bar--readonly .system-config-input {
  color: var(--rsm-grey-mid);
  background: var(--app-surface-muted);
}

.admin-panel {
  padding: 10px 0 16px;
}

.admin-panel .system-config-input {
  width: 180px;
}

.robot-cards-empty {
  padding: 20px;
  color: var(--rsm-grey-mid);
  font-size: 13px;
  font-style: italic;
}

.robot-log-row--dead td {
  opacity: 0.55;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--rsm-blue);
  cursor: pointer;
  margin-bottom: 16px;
  background: none;
  border: none;
  font-family: var(--font-system);
  font-weight: 500;
}

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

.detail-hero {
  background: linear-gradient(110deg, #00153d 50%, #154488 100%);
  border: none;
  border-radius: 18px;
  padding: 22px 26px;
  margin-bottom: 12px;
  box-shadow: 0 4px 24px rgba(0, 21, 61, 0.3);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  gap: 16px;
}

.detail-hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07), transparent 70%);
  pointer-events: none;
}

.detail-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.detail-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.detail-meta strong {
  color: rgba(255, 255, 255, 0.9);
}

.detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.detail-actions .attention-badges {
  max-width: none;
  justify-content: flex-end;
}

.detail-rolebar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
}

.role-pill strong {
  font-size: 11px;
  color: var(--rsm-grey-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-pill span {
  font-size: 13px;
  color: var(--rsm-grey-dark);
  font-weight: 600;
}

.ai-panel {
  border-radius: var(--app-radius-lg);
  padding: 18px 22px;
  margin-bottom: 16px;
  box-shadow: var(--app-shadow);
  position: relative;
}

.ai-panel.ai-ok {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
}

.ai-panel.ai-warn {
  background: linear-gradient(135deg, #fff7ed 0%, #fff1e6 100%);
  border: 1px solid #fed7aa;
}

.ai-panel.ai-err {
  background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
  border: 1px solid #fecaca;
}

.ai-panel.ai-pending {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f7ff 100%);
  border: 1px solid #bfdbfe;
}

.ai-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ai-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--rsm-blue);
  color: var(--rsm-white);
}

.ai-ok .ai-tag {
  background: var(--rsm-green);
}

.ai-warn .ai-tag {
  background: var(--rsm-orange);
}

.ai-err .ai-tag {
  background: var(--rsm-red);
}

.ai-heading {
  font-size: 14px;
  font-weight: 600;
}

.ai-ok .ai-heading {
  color: var(--app-ok-text);
}

.ai-warn .ai-heading {
  color: var(--app-warn-text);
}

.ai-err .ai-heading {
  color: var(--app-err-text);
}

.ai-pending .ai-heading {
  color: var(--app-info-text);
}

.ai-body {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.ai-ok .ai-body {
  color: #14532d;
}

.ai-warn .ai-body {
  color: #7c2d12;
}

.ai-err .ai-body {
  color: #450a0a;
}

.ai-pending .ai-body {
  color: #1e3a5f;
}

.ai-checks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.ai-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
}

.ai-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--rsm-white);
}

.ai-icon.ok {
  background: var(--rsm-green);
}

.ai-icon.warn {
  background: var(--rsm-orange);
}

.ai-icon.err {
  background: var(--rsm-red);
}

.ai-icon.info {
  background: var(--rsm-blue);
}

.ai-action {
  font-size: 13px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ai-action strong {
  font-weight: 600;
}

.ai-ok .ai-action strong {
  color: var(--app-ok-text);
}

.ai-warn .ai-action strong {
  color: var(--app-warn-text);
}

.ai-err .ai-action strong {
  color: var(--app-err-text);
}

.ai-pending .ai-action strong {
  color: var(--app-info-text);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

/* When RGDatabank is shown, external links spans both rows so Kundeinformation
   + RGDatabank stack tightly in the left column instead of one card stretching
   to fill a tall row. Toggled from renderRgDatabank. */
#det-ext-links-card.ext-links-span-2 {
  grid-row: span 2;
  align-self: stretch;
}

.card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 18px;
  box-shadow: var(--app-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.card-head {
  padding: 14px 18px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--rsm-grey-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--app-border-light);
  background: linear-gradient(180deg, rgba(0, 156, 222, 0.03), transparent);
}

.card-head-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}

.card-body {
  padding: 4px 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--app-border-light);
}

/* In the two-column grid the last visual row keeps its divider; only the
   true final cell drops it. Single-column lists keep the old behaviour. */
.field:last-child {
  border-bottom: none;
}

.meta-cvr-status {
  margin-left: 6px;
  opacity: 0.75;
  font-weight: 400;
}

.field-label {
  font-size: 13px;
  color: var(--rsm-grey-mid);
}

.field-value {
  font-size: 13px;
  color: var(--rsm-grey-dark);
  font-weight: 500;
  text-align: right;
}

.rgd-col {
  display: flex;
  flex-direction: column;
}

.rgd-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.rgd-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.rgd-sub {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  font-weight: 400;
}

.rgd-error {
  color: var(--rsm-red);
}

.sys-list {
  display: flex;
  flex-direction: column;
}

.sys-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--app-border-light);
  cursor: pointer;
  transition: background 0.1s;
}

.sys-row:last-child {
  border-bottom: none;
}

.sys-row:hover {
  background: rgba(0, 156, 222, 0.03);
}

.sys-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sys-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--rsm-white);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.sys-icon.teams {
  background: #464eb8;
}

.sys-icon.uniconta {
  background: #0078d4;
}

.sys-icon.creditro {
  background: var(--rsm-green);
}

.sys-icon.caseware {
  background: #8b5e3c;
}

.sys-icon.rgdata {
  background: #5a2d82;
}

.sys-icon.rgdatabank {
  background: #1a6b3a;
}

.sys-icon.cvr {
  background: #00537e;
}

.ext-link-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  flex-shrink: 0;
  overflow: hidden;
}

.ext-link-fallback {
  font-size: 10px;
  font-weight: 700;
  color: var(--rsm-grey-mid);
  letter-spacing: -0.02em;
}

.ext-link-row {
  color: inherit;
  text-decoration: none;
}

.ext-link-row:focus-visible {
  outline: 2px solid var(--rsm-blue);
  outline-offset: -2px;
}

.ext-link-action {
  appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--rsm-blue);
  background: rgba(0, 156, 222, 0.08);
  color: var(--rsm-blue);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.ext-link-row:hover .ext-link-action,
.ext-link-row:focus-visible .ext-link-action,
.ext-link-action:hover:not(:disabled) {
  background: var(--rsm-blue);
  color: white;
}

.ext-link-action:disabled {
  border-color: var(--app-border);
  background: var(--app-gray-bg);
  color: var(--rsm-grey-mid);
  cursor: not-allowed;
  opacity: 0.7;
}

.ext-link-action-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.ext-link-action-icon--browser {
  width: auto;
  height: auto;
  line-height: 1;
}

.sys-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--rsm-grey-dark);
}

.sys-desc {
  font-size: 11px;
  color: var(--rsm-grey-mid);
}

.creditro-status-line {
  position: relative;
  display: block;
  white-space: nowrap;
  width: fit-content;
  line-height: normal;
}

.creditro-status-chip {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  line-height: 1;
}

.sys-unavail {
  font-size: 11px;
  color: var(--rsm-orange);
  font-style: italic;
}

.timeline {
  padding: 12px 18px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--app-border-light);
  font-size: 13px;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-dot.ok {
  background: var(--rsm-green);
}

.timeline-dot.warn {
  background: var(--rsm-orange);
}

.timeline-dot.err {
  background: var(--rsm-red);
}

.timeline-dot.info {
  background: var(--rsm-blue);
}

.timeline-dot.gray {
  background: var(--rsm-grey-mid);
}

.timeline-text {
  color: var(--rsm-grey-dark);
}

.timeline-date {
  font-size: 11px;
  color: var(--rsm-grey-mid);
  margin-top: 2px;
}

.card-full {
  grid-column: 1 / -1;
}

/* --- Fiscal Years (Regnskabsår) --- */

.fiscal-years {
  display: flex;
  flex-direction: column;
}

.fy-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-border-light);
  transition: background 0.15s;
}

#det-responsibles .fy-row {
  grid-template-columns: 170px 1fr auto;
}

#det-responsibles .fy-year-label {
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.fy-row:last-child {
  border-bottom: none;
}

.fy-row:hover {
  background: rgba(0, 156, 222, 0.04);
}

.fy-row.fy-current {
  background: linear-gradient(90deg, rgba(0, 156, 222, 0.06), transparent);
}

.fy-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  color: var(--rsm-grey-dark);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.fy-toggle-btn:hover {
  background: var(--app-bg);
  border-color: var(--rsm-blue);
  color: var(--rsm-blue);
}

.fy-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--rsm-blue);
  color: white;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.fy-year {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fy-year-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--rsm-grey-dark);
}

.fy-current-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 156, 222, 0.12);
  color: var(--rsm-blue);
}

.fy-period {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  margin-top: 2px;
}

.fy-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.fy-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--rsm-grey-dark);
}

.fy-link:hover {
  background: var(--app-bg);
  border-color: var(--rsm-blue);
  color: var(--rsm-blue);
}

.fy-link .fy-link-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  color: white;
}

.fy-link-icon.caseware { background: var(--rsm-teal); }
.fy-link-icon.filing { background: var(--rsm-purple); }

.fy-link-status {
  margin-left: 4px;
}

.fy-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.fy-file-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  min-width: 0;
}

.fy-file-icon {
  flex-shrink: 0;
}

.fy-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
  white-space: nowrap;
  flex-shrink: 0;
}

.fy-file-chips {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  flex-wrap: wrap;
}

.fy-chip {
  font-size: 11px;
  color: var(--rsm-grey-mid);
  background: var(--app-bg);
  border: 1px solid var(--app-border);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

.fy-file-warnings {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.fy-file-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.customer-job-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--app-border-light);
}

.customer-job-row:last-child {
  border-bottom: none;
}

.customer-job-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.customer-job-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.customer-job-progress {
  font-size: 12px;
  color: var(--rsm-blue);
}

.customer-job-error {
  font-size: 11px;
  color: var(--app-err-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.customer-job-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.customer-job-date {
  font-size: 12px;
  color: var(--rsm-grey-mid);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
  overflow-x: auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rsm-grey-mid);
  position: relative;
  white-space: nowrap;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid var(--app-border);
  background: var(--app-surface);
  color: var(--rsm-grey-mid);
  flex-shrink: 0;
}

.step.done .step-num {
  background: var(--rsm-green);
  border-color: var(--rsm-green);
  color: var(--rsm-white);
}

.step.active .step-num {
  background: var(--rsm-blue);
  border-color: var(--rsm-blue);
  color: var(--rsm-white);
}

.step.done {
  color: var(--rsm-green);
}

.step.active {
  color: var(--rsm-blue);
}

.step-line {
  flex: 1;
  height: 2px;
  min-width: 20px;
  background: var(--app-border);
}

.step-line.done {
  background: var(--rsm-green);
}

.rulning-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rulning-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.rulning-dot.ready {
  background: var(--rsm-blue);
}

.rulning-dot.running {
  background: var(--rsm-orange);
  animation: pulse 1.2s infinite;
}

.rulning-dot.done {
  background: var(--rsm-green);
}

.rulning-dot.failed {
  background: var(--rsm-red);
}

.rulning-dot.blocked {
  background: var(--rsm-grey-mid);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.btn-action {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: var(--font-system);
  transition: all 0.15s;
}

.btn-action.start {
  background: var(--rsm-blue);
  color: var(--rsm-white);
}

.btn-action.start:hover {
  background: #0088c6;
}

.btn-action:disabled {
  background: var(--app-gray-bg);
  color: var(--rsm-grey-mid);
  cursor: not-allowed;
}

.muted-row {
  opacity: 0.55;
}

.int-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.int-card {
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 18px 20px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s;
}

.int-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow-lg);
}

.int-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.int-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--rsm-blue);
}

.int-card-role {
  font-size: 12px;
  color: var(--rsm-grey-mid);
}

.int-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.int-stat {
  font-size: 12px;
}

.int-stat-label {
  color: var(--rsm-grey-mid);
}

.int-stat-value {
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.int-health {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.int-health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.int-health-dot.healthy {
  background: var(--rsm-green);
}

.int-health-dot.degraded {
  background: var(--rsm-orange);
}

.int-health-dot.down {
  background: var(--rsm-red);
}

.danger-text {
  color: var(--rsm-red);
}

.robot-job-row {
  cursor: pointer;
}

.robot-job-row.expanded {
  background: rgba(0, 156, 222, 0.04);
}

.robot-job-details td,
.sync-detail-row td {
  padding: 0 !important;
  background: rgba(0, 21, 61, 0.02);
}

.job-detail-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.job-detail-group {
  display: grid;
  gap: 6px;
}

.job-detail-group strong {
  font-size: 12px;
  color: var(--rsm-grey-dark);
}

.job-detail-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  margin-right: 6px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: var(--app-info-bg);
  color: var(--app-info-text);
  font-size: 12px;
  font-weight: 600;
}

.job-detail-path,
.job-detail-warning {
  font-size: 12px;
  color: var(--rsm-grey-dark);
  word-break: break-all;
}

.job-detail-warning {
  color: var(--rsm-orange);
}

.caseware-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
}

.caseware-meta-item {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.caseware-meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rsm-grey-mid);
}

.caseware-meta-value {
  font-size: 13px;
  color: var(--rsm-grey-dark);
  word-break: break-word;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 21, 61, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(80vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  box-shadow: var(--app-shadow-lg);
}

.modal-head,
.modal-toolbar,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface);
  color: var(--rsm-grey-dark);
  font-size: 20px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 1240px) {
  .topbar {
    padding: 0 16px;
  }

  .kpi-row-4,
  .kpi-row-3,
  .filter-grid,
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .resp-detail-list {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 16px;
  }
}

@media (max-width: 1040px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    display: none;
  }

  .main {
    min-height: 100vh;
  }

  .search-input {
    width: min(100%, 320px);
  }
}

@media (max-width: 800px) {
  .content,
  .topbar {
    padding: 16px;
  }

  .topbar {
    height: auto;
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-left,
  .topbar-right,
  .filter-toolbar,
  .pagination-bar,
  .section-head,
  .detail-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right,
  .search-input,
  .btn,
  .btn-sm {
    width: 100%;
  }

  .scope-left {
    width: 100%;
  }

  .scope-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .scope-bar {
    width: 100%;
    flex-wrap: wrap;
  }

  .kpi-row-4,
  .kpi-row-3,
  .filter-grid,
  .detail-grid,
  .field-grid,
  .int-grid,
  .resp-detail-list {
    grid-template-columns: 1fr;
  }

  .detail-actions,
  .detail-meta,
  .pagination-controls {
    width: 100%;
  }

  .field {
    flex-direction: column;
    align-items: flex-start;
  }

  .field-value {
    text-align: left;
  }
}

/* =========================================================
   JOB QUEUE — aktive jobs
   ========================================================= */

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

/* Inline spinner badge i tabel */
.job-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

.job-spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--rsm-blue);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.job-spinner-pending {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--app-gray-text);
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.5;
}

.job-inline-label {
  font-size: 11px;
  color: var(--rsm-blue);
  font-weight: 500;
}

.job-inline-label.pending {
  color: var(--app-gray-text);
}

/* Igangværende jobs panel på detaljesiden */
.jobs-panel {
  border: 1.5px solid var(--rsm-blue);
  border-radius: var(--app-radius);
  background: #f0f9ff;
  overflow: hidden;
}

.jobs-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--rsm-blue);
  color: var(--rsm-white);
  font-size: 13px;
  font-weight: 600;
}

.jobs-panel-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.job-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #dbeafe;
}

.job-row:last-child {
  border-bottom: none;
}

.job-row-icon {
  flex-shrink: 0;
}

.job-row-body {
  flex: 1;
  min-width: 0;
}

.job-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.job-row-meta {
  font-size: 11px;
  color: var(--app-gray-text);
  margin-top: 1px;
}

.job-row-status {
  flex-shrink: 0;
}

.job-status-running {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

.job-status-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--app-gray-bg);
  color: var(--app-gray-text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

/* ── Status page ── */

.status-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--app-border);
  margin-bottom: 24px;
  padding-bottom: 0;
}

.status-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--app-gray-text);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.status-tab:hover {
  color: var(--rsm-grey-dark);
}

.status-tab.active {
  color: var(--rsm-blue);
  border-bottom-color: var(--rsm-blue);
  font-weight: 600;
}

.status-tab-panel {
  max-width: 800px;
}

.status-loading {
  color: var(--app-gray-text);
  padding: 32px 0;
  text-align: center;
}

/* Release cards (changelog) */

.release-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--app-shadow);
}

.release-card-header {
  background: var(--app-bg);
  border-bottom: 1px solid var(--app-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.release-version-badge {
  background: var(--rsm-blue);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.release-date {
  font-size: 12px;
  color: var(--app-gray-text);
}

/* Status items (shared between changelog and roadmap) */

.status-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-border-light);
}

.status-item:last-child {
  border-bottom: none;
}

.status-item-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--rsm-grey-dark);
  margin-bottom: 4px;
}

.status-item-description {
  font-size: 13px;
  color: var(--app-gray-text);
  line-height: 1.6;
}

.status-item-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-details {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--app-bg);
  border-radius: var(--app-radius);
  font-size: 13px;
  color: var(--rsm-grey-dark);
  line-height: 1.7;
}

.status-details p {
  margin-bottom: 8px;
}

.status-details p:last-child {
  margin-bottom: 0;
}

.status-details ul {
  margin: 6px 0 8px 18px;
}

.status-details li {
  margin-bottom: 3px;
}

/* Roadmap groups */

.roadmap-group {
  margin-bottom: 28px;
}

.roadmap-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-gray-text);
  margin-bottom: 10px;
  padding: 0 2px;
}

.roadmap-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  overflow: hidden;
  box-shadow: var(--app-shadow);
  margin-bottom: 10px;
}

/* Feature requests */

.fr-submit-form {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--app-shadow);
}

.fr-submit-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

.fr-form-field {
  margin-bottom: 10px;
}

.fr-input,
.fr-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-bg);
  color: var(--rsm-grey-dark);
  transition: border-color 0.15s;
  resize: vertical;
}

.fr-input:focus,
.fr-textarea:focus {
  outline: none;
  border-color: var(--rsm-blue);
  background: white;
}

.fr-submit-msg {
  margin-top: 10px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--app-radius);
}

.fr-submit-msg.ok {
  background: var(--app-ok-bg);
  color: var(--app-ok-text);
}

.fr-submit-msg.err {
  background: var(--app-err-bg);
  color: var(--app-err-text);
}

.fr-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  padding: 16px 20px;
  margin-bottom: 10px;
  box-shadow: var(--app-shadow);
}

.fr-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.fr-card-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.fr-meta {
  font-size: 12px;
  color: var(--app-gray-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.fr-card-desc {
  font-size: 13px;
  color: var(--app-gray-text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.fr-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--app-border);
  border-radius: 20px;
  background: var(--app-bg);
  font-size: 12px;
  font-weight: 500;
  color: var(--app-gray-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fr-vote-btn:hover {
  background: var(--app-info-bg);
  border-color: var(--rsm-blue);
  color: var(--rsm-blue);
}

.fr-vote-btn.voted {
  background: var(--rsm-blue);
  border-color: var(--rsm-blue);
  color: white;
}

.fr-vote-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--app-gray-text);
  white-space: nowrap;
}

.fr-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.fr-status-open { background: var(--app-gray-bg); color: var(--app-gray-text); }
.fr-status-planned { background: var(--app-info-bg); color: var(--app-info-text); }
.fr-status-inprogress { background: var(--app-warn-bg); color: var(--app-warn-text); }
.fr-status-done { background: var(--app-ok-bg); color: var(--app-ok-text); }
.fr-status-declined { background: var(--app-err-bg); color: var(--app-err-text); }

.fr-release-link {
  margin-top: 8px;
  font-size: 12px;
  color: var(--app-gray-text);
  background: var(--app-bg);
  border-radius: var(--app-radius);
  padding: 6px 10px;
  border-left: 3px solid var(--rsm-blue);
}

.fr-admin-panel {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--app-bg);
  border-radius: var(--app-radius);
  font-size: 12px;
  color: var(--app-gray-text);
  border: 1px solid var(--app-border);
}

.fr-admin-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.fr-admin-edit {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.fr-admin-input {
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: white;
  flex: 1;
  min-width: 120px;
}

.status-deploy-info {
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--app-gray-text);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.status-deploy-info span strong {
  color: var(--rsm-grey-dark);
}

/* ─── Insight: CVR ejerstruktur ──────────────────────────────────────────── */

/* When insight is active, remove scroll/padding from the content wrapper so the graph fills to bottom */
.content:has(#page-insight.active) {
  overflow-y: hidden;
  padding: 0;
}

.page-insight.active {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  overflow: hidden;
}

/* ─── Ledelsesrapportering: Medarbejder timer (PowerBI) ─────────────────── */

.content:has(#page-employee-hours.active) {
  overflow-y: hidden;
  padding: 0;
}

.page-employee-hours.active {
  position: relative;
  display: block;
  height: 100%;
}

.powerbi-toolbar {
  position: absolute;
  top: 12px;
  right: 24px;
  z-index: 1;
}

.powerbi-toolbar .btn {
  background: var(--app-bg);
  box-shadow: 0 1px 4px rgba(0, 21, 61, 0.15);
}

.powerbi-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

.insight-lookup-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px 12px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  flex-wrap: wrap;
}

.insight-search-wrap {
  position: relative;
}

.insight-lookup-form {
  display: flex;
  align-items: center;
}

.insight-search-input {
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius) 0 0 var(--app-radius);
  border-right: none;
  height: 36px;
  padding: 0 12px;
  width: 340px;
  background: var(--app-surface);
  color: var(--rsm-midnight);
}

.insight-search-input:focus {
  outline: none;
  border-color: var(--rsm-blue);
  box-shadow: 0 0 0 2px rgba(0, 156, 222, 0.18);
  z-index: 1;
  position: relative;
}

.insight-search-btn {
  height: 36px;
  width: 38px;
  border: 1px solid var(--rsm-blue);
  border-radius: 0 var(--app-radius) var(--app-radius) 0;
  background: var(--rsm-blue);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.insight-search-btn:hover { background: var(--rsm-midnight); border-color: var(--rsm-midnight); }
.insight-search-btn:disabled { opacity: 0.6; cursor: default; }

.insight-search-overlay {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
  z-index: 200;
}

.insight-search-overlay.hidden { display: none; }

.insight-search-result {
  padding: 9px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--app-border-light);
}

.insight-search-result:last-child { border-bottom: none; }
.insight-search-result:hover, .insight-search-result:focus { background: var(--app-bg); outline: none; }

.insight-search-result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--rsm-midnight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-search-result-meta {
  font-size: 11px;
  color: var(--app-gray-text);
}

.insight-search-empty, .insight-search-searching {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--app-gray-text);
}

.insight-search-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.insight-search-tag--person {
  background: rgba(63, 156, 53, 0.12);
  color: var(--rsm-green);
}

.insight-intro {
  font-size: 12px;
  color: var(--app-gray-text);
}

.insight-workspace {
  display: grid;
  grid-template-columns: 1fr 280px;
  min-height: 0;
  overflow: hidden;
}

.insight-graph-wrap {
  min-width: 0;
  min-height: 0;
  position: relative;
  background: #e7e7e7;
}

#cvr-graph {
  position: absolute;
  inset: 0;
}

.insight-status {
  position: absolute;
  left: 16px;
  top: 16px;
  max-width: min(460px, calc(100% - 32px));
  background: rgba(255, 255, 255, 0.94);
  border-left: 4px solid var(--rsm-blue);
  box-shadow: var(--app-shadow-lg);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.35;
  transition: opacity 0.5s ease;
}

.insight-status.hidden { display: none; }
.insight-status.insight-status-error { border-left-color: var(--rsm-red, #d32f2f); }
.insight-status.insight-status-fading { opacity: 0; pointer-events: none; }

.insight-status.insight-status-info {
  left: auto;
  right: 12px;
  top: auto;
  bottom: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  font-size: 10px;
  color: var(--rsm-grey-dark);
  opacity: 0.55;
}

.insight-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--app-shadow);
  padding: 8px 10px;
  font-size: 11px;
}

.insight-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.insight-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid white;
  display: inline-block;
  flex-shrink: 0;
}

.insight-swatch-root    { background: var(--rsm-midnight); border-radius: 50%; }
.insight-swatch-company { background: var(--rsm-blue); }
.insight-swatch-owned   { background: var(--rsm-blue); transform: rotate(45deg); }
.insight-swatch-person  { background: var(--rsm-green); }
.insight-swatch-roleperson { background: var(--rsm-purple, #7b2d8b); transform: rotate(45deg); }
.insight-swatch-person-dual { background: var(--rsm-green); border-color: var(--rsm-purple, #7b2d8b); }
.insight-swatch-other   { background: var(--rsm-grey-dark); }

.insight-line-swatch {
  width: 22px;
  border-top: 2px solid var(--rsm-grey-dark);
  display: inline-block;
}

.insight-line-swatch-dashed { border-top-style: dashed; }

.insight-panel {
  min-width: 0;
  border-left: 1px solid var(--app-border);
  background: var(--app-surface);
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  overflow-y: auto;
}

.insight-panel-section {
  padding: 16px;
  border-bottom: 1px solid var(--app-border-light);
}

.insight-panel-title {
  color: var(--rsm-blue);
  font-size: 15px;
  margin: 0 0 10px;
}

.insight-panel-subtitle {
  color: var(--rsm-grey-dark);
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.insight-details-name {
  color: var(--rsm-midnight);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
}

.insight-details-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  margin: 4px 0;
  font-size: 12px;
}

.insight-details-row span:first-child { color: var(--app-gray-text); }

.insight-empty {
  color: var(--app-gray-text);
  font-size: 12px;
}

.insight-tools {
  display: grid;
  grid-template-columns: repeat(4, 36px);
  gap: 6px;
}

.insight-icon-btn {
  font: inherit;
  font-size: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--app-radius);
  background: var(--rsm-blue);
  color: white;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.insight-icon-btn:hover { background: var(--rsm-midnight); }

.insight-panel-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--app-border-light);
}

.insight-pdf-btn {
  width: 42px;
  height: 42px;
  padding: 6px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.insight-pdf-btn:hover {
  border-color: var(--rsm-blue);
  background: rgba(0, 156, 222, 0.08);
}

.insight-pdf-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.insight-pdf-btn img {
  width: 24px;
  height: 28px;
  display: block;
}

.insight-checks {
  display: grid;
  gap: 8px;
  font-size: 12px;
}

.insight-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}


.insight-filing-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid var(--app-border-light);
  font-size: 12px;
  color: var(--app-text);
}

.insight-filing-row:last-child { border-bottom: none; }

.insight-filing-year-link {
  color: var(--rsm-blue);
  text-decoration: none;
  font-size: 12px;
}

.insight-filing-year-link:hover { text-decoration: underline; }

.insight-filing-format {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.insight-filing-format--pdf {
  background: rgba(180, 30, 30, 0.1);
  color: #b41e1e;
}

.insight-filing-format--ixbrl {
  background: rgba(0, 156, 222, 0.12);
  color: var(--rsm-blue);
}

/* ─── Opgavebørs ─────────────────────────────────────────────────── */

.task-shelf-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-posting-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-posting-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-posting-card-header-left { flex: 1; min-width: 0; }
.task-posting-card-header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.task-posting-customer {
  font-size: 12px;
  color: var(--rsm-grey-dark);
  margin-bottom: 2px;
}

.task-posting-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--rsm-midnight);
}

.task-posting-desc {
  font-size: 13px;
  color: var(--rsm-grey-dark);
  white-space: pre-wrap;
}

.task-posting-meta {
  font-size: 12px;
  color: var(--rsm-grey-dark);
}

.task-posting-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skill-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  background: rgba(0, 156, 222, 0.1);
  color: var(--rsm-blue);
  font-weight: 500;
}

.skill-chip-selected {
  background: var(--rsm-blue);
  color: #fff;
}

.task-posting-footer {
  font-size: 12px;
  color: var(--rsm-grey-dark);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--app-border);
  padding-top: 8px;
  margin-top: 4px;
}

.task-posting-date { margin-left: auto; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--rsm-grey-dark);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover { background: rgba(0,0,0,0.06); }

/* ─── Modal ─────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 21, 61, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--app-border);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-system);
  color: var(--rsm-grey-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--rsm-grey-dark);
  line-height: 1;
  padding: 0 4px;
}

.modal-body { padding: 16px 20px 20px; }

.form-row { margin-bottom: 14px; }

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
  margin-bottom: 4px;
}

.form-label .required { color: var(--rsm-blue); }

.form-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--app-border);
  border-radius: 5px;
  font-size: 13px;
  font-family: var(--font-system);
  color: var(--rsm-grey-dark);
  background: #fff;
  box-sizing: border-box;
}

.form-input:focus { outline: none; border-color: var(--rsm-blue); box-shadow: 0 0 0 2px rgba(0,156,222,0.15); }

.form-textarea { resize: vertical; min-height: 80px; }

.form-error {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(180, 30, 30, 0.08);
  color: #b41e1e;
  border-radius: 5px;
  font-size: 12px;
}

.form-hint {
  font-size: 12px;
  color: var(--rsm-grey-mid, #999);
  font-style: italic;
}

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

.caseware-pdf-context {
  font-size: 13px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
  margin-bottom: 14px;
}

.caseware-pdf-check-list {
  display: grid;
  gap: 8px;
}

.caseware-pdf-toggle-all {
  display: block;
  width: fit-content;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rsm-blue);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.caseware-pdf-toggle-all:hover {
  color: var(--rsm-midnight);
}

.caseware-pdf-check,
.caseware-pdf-mode label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--rsm-grey-dark);
}

.caseware-pdf-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.caseware-pdf-mode label {
  border: 1px solid var(--app-border);
  border-radius: 6px;
  padding: 8px 10px;
  min-width: 90px;
}

.caseware-pdf-delivery {
  border: 1px solid rgba(0, 156, 222, 0.25);
  background: rgba(0, 156, 222, 0.06);
  color: var(--rsm-grey-dark);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.roll-forward-card {
  width: min(680px, 100%);
  max-height: min(88vh, 900px);
  padding: 0;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
}

.roll-forward-card .modal-head {
  align-items: flex-start;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--app-border);
}

.roll-forward-card .modal-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--app-border);
  border-radius: 50%;
  background: var(--app-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.roll-forward-card form {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.roll-forward-card .modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--rsm-midnight);
}

.roll-forward-card .modal-subtitle {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  margin-top: 3px;
}

.roll-forward-body {
  padding: 14px 20px;
  overflow-y: auto;
  min-height: 0;
}

.roll-forward-sec {
  border: 1.5px solid var(--app-border);
  border-radius: 12px;
  overflow: hidden;
}

.roll-forward-sec.on { border-color: var(--rsm-blue); }

.roll-forward-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  background: #f0f8fd;
}

.roll-forward-main-check {
  width: 17px;
  height: 17px;
  accent-color: var(--rsm-blue);
  margin-top: 3px;
  flex-shrink: 0;
}

.roll-forward-head-text {
  flex: 1;
  min-width: 0;
}

.roll-forward-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--rsm-midnight);
}

.roll-forward-desc {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  margin-top: 2px;
}

.roll-forward-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  background: #eff6ff;
  color: #1e40af;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.roll-forward-sec-body {
  padding: 13px 16px 13px 45px;
  border-top: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roll-forward-option,
.roll-forward-option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roll-forward-option {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--rsm-grey-dark);
  cursor: pointer;
}

.roll-forward-option input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--rsm-blue);
  flex-shrink: 0;
  cursor: pointer;
}

.roll-forward-option-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
  margin-top: 2px;
}

.roll-forward-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--app-border);
}

.skill-picker {
  border: 1px solid var(--app-border);
  border-radius: 5px;
  padding: 8px;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 6px;
  background: #fafbfc;
}

.skill-category { margin-bottom: 8px; }
.skill-category:last-child { margin-bottom: 0; }

.skill-category-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rsm-grey-dark);
  margin-bottom: 4px;
}

.skill-category-items { display: flex; flex-wrap: wrap; gap: 4px; }

.skill-pick-btn {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--app-border);
  cursor: pointer;
  color: var(--rsm-grey-dark);
  font-family: var(--font-system);
}

.skill-pick-btn:hover { border-color: var(--rsm-blue); color: var(--rsm-blue); }
.skill-pick-btn.selected { background: var(--rsm-blue); border-color: var(--rsm-blue); color: #fff; }

.selected-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 24px;
}

#task-shelf-filter-bar {
  margin: 0 0 16px;
}

.task-shelf-filter-panel {
  margin-bottom: 0;
}

.task-shelf-filter-grid {
  grid-template-columns: repeat(7, minmax(130px, 1fr));
}

.task-filter-control {
  width: 100%;
}

.task-filter-input-wrap {
  position: relative;
  width: 100%;
}

.task-filter-input-wrap .filter-input {
  padding-right: 34px;
}

.task-filter-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 21, 61, 0.08);
  color: var(--rsm-grey-dark);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.task-filter-clear:hover {
  background: rgba(0, 21, 61, 0.14);
}

.task-shelf-action-field {
  align-self: end;
}

.task-shelf-create-btn {
  width: 100%;
  height: 34px;
  justify-content: center;
}

.filter-input {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--app-border);
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--font-system);
  color: var(--rsm-grey-dark);
  background: var(--app-surface);
  width: 240px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-input:focus {
  border-color: var(--rsm-blue);
  box-shadow: 0 0 0 2px rgba(0, 156, 222, 0.18);
}

.filter-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--app-border);
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--font-system);
  color: var(--rsm-grey-dark);
  background: var(--app-surface);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-select:focus {
  border-color: var(--rsm-blue);
  box-shadow: 0 0 0 2px rgba(0, 156, 222, 0.18);
}

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

@media (max-width: 1200px) {
  .task-shelf-filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 720px) {
  .task-shelf-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Customer search dropdown in task posting modal ────────────── */

.customer-search-wrap { position: relative; }

.customer-search-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 5px;
  box-shadow: var(--app-shadow-lg);
  z-index: 300;
  max-height: 240px;
  overflow-y: auto;
}

.customer-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-system);
  font-size: 13px;
}

.customer-search-item:hover { background: #f0f4ff; }

.customer-search-name { color: var(--rsm-grey-dark); flex: 1; }

.customer-search-num {
  color: var(--rsm-grey-mid);
  font-size: 11px;
  flex-shrink: 0;
}

.customer-search-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--rsm-grey-mid);
  font-family: var(--font-system);
}
