@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: #fffbeb;
  --app-warn-text: #92400e;
  --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;
}

.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: 96px;
  height: auto;
  display: block;
  mix-blend-mode: screen;
  flex-shrink: 0;
  
}

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

.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;
}

.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 {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 12px;
}

.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.3px;
}

.user-meta .name {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
}

.user-meta .role {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.logout-link {
  display: inline-block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  text-decoration: none;
}

.logout-link:hover {
  color: var(--rsm-white);
  text-decoration: underline;
}

.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;
}

.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;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 7px 38px 7px 14px;
  font-size: 13px;
  color: var(--rsm-grey-dark);
  background: var(--app-bg);
  font-family: var(--font-system);
  outline: none;
  transition: border-color 0.15s;
}

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

.search-input::placeholder {
  color: var(--rsm-grey-mid);
}

.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);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  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;
  white-space: nowrap;
}

.btn:hover {
  background: var(--app-bg);
}

.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-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.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;
}

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

.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-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, #fffbeb 0%, #fef9f0 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);
}

.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 {
  font-size: 20px;
}

.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-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;
}

.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);
}

.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;
}

.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);
}

.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--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 {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: var(--rsm-blue);
  color: var(--rsm-white);
  border: 1px solid var(--rsm-blue);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-system);
  transition: all 0.15s;
}

.btn-rul-inline:hover:not(:disabled) {
  background: #0088c6;
  border-color: #0088c6;
}

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

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

.btn-open-inline:hover,
.btn-open-inline:focus-visible {
  background: 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);
}

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

.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-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.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 20px 0;
  border-top: 1px solid var(--app-border-light);
  margin-top: 8px;
}

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

.worker-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);
}

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

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

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

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

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

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

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

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

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

.worker-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;
}

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

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

.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-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, #fffbeb 0%, #fff7ed 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;
  gap: 16px;
  margin-bottom: 16px;
}

.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-body {
  padding: 4px 0;
}

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

.field:last-child {
  border-bottom: none;
}

.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;
}

.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 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--rsm-blue);
  background: transparent;
  color: var(--rsm-blue);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  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 {
  background: var(--rsm-blue);
  color: white;
}

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

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

.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;
}

.attn-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attn-card {
  border: 1px solid var(--app-border);
  border-radius: 18px;
  box-shadow: var(--app-shadow);
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  border-left: 4px solid transparent;
  background: var(--app-surface);
}

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

.attn-card.sev-err {
  border-left-color: var(--rsm-red);
  background: linear-gradient(135deg, rgba(228, 0, 70, 0.04), var(--app-surface) 60%);
}

.attn-card.sev-warn {
  border-left-color: var(--rsm-orange);
  background: linear-gradient(135deg, rgba(232, 119, 34, 0.04), var(--app-surface) 60%);
}

.attn-card.sev-info {
  border-left-color: var(--rsm-blue);
  background: linear-gradient(135deg, rgba(0, 156, 222, 0.04), var(--app-surface) 60%);
}

.attn-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--rsm-white);
}

.sev-err .attn-card-icon {
  background: var(--rsm-red);
}

.sev-warn .attn-card-icon {
  background: var(--rsm-orange);
}

.sev-info .attn-card-icon {
  background: var(--rsm-blue);
}

.attn-card-body {
  flex: 1;
}

.attn-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--rsm-blue);
  margin-bottom: 2px;
}

.attn-card-desc {
  font-size: 13px;
  color: var(--rsm-grey-dark);
  margin-bottom: 6px;
  line-height: 1.5;
}

.attn-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--rsm-grey-mid);
}

.attn-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.attn-card-time {
  font-size: 11px;
  color: var(--rsm-grey-mid);
  white-space: nowrap;
}

.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-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: grid;
  gap: 0;
  min-width: 0;
}

.fy-file-card .fy-link {
  display: flex;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.fy-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 21, 61, 0.08);
  border-radius: 10px;
  background: rgba(0, 21, 61, 0.03);
}

.fy-file-card .fy-meta-grid {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

.fy-meta-item {
  display: grid;
  gap: 2px;
  min-width: 0;
}

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

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

.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);
}

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

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

.worker-job-details 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;
}

.scan-root-list {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.scan-root-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-bg);
  cursor: pointer;
}

.scan-root-option input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--rsm-blue);
}

.scan-root-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-root-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--rsm-grey-dark);
}

.scan-root-meta {
  font-size: 12px;
  color: var(--rsm-grey-mid);
  word-break: break-all;
}

.hidden {
  display: none !important;
}

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

  .kpi-row-4,
  .kpi-row-3,
  .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-bar {
    width: 100%;
    flex-wrap: wrap;
  }

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

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

  .attn-card {
    flex-direction: column;
  }

  .attn-card-right {
    align-items: flex-start;
  }

  .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;
}
