/* Dashboard Styles */

.dashboard-container,
.tenant-dashboard,
.modal-card {
  --dashboard-card-gradient: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

/* Dashboard shell */
.dashboard-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-container button {
  font: inherit;
}

.dashboard-container button:not(.btn):not(.header-nav-btn):not(.header-action-btn):not(.header-logout-btn):not(.sidebar-menu-item):not(.sidebar-submenu-item):not(.start-shortcut-card):not(.case-review-btn) {
  font: inherit;
}

.top-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
  position: sticky;
  top: 0;
  z-index: 200;
  min-height: 64px;
}

.header-logo {
  height: 40px;
  flex-shrink: 0;
}


.header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header-tenant {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-user {
  font-size: 12px;
  color: var(--muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-user-avatar,
.header-user-avatar-fallback {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  flex-shrink: 0;
}

.header-user-avatar {
  object-fit: cover;
  border: 1px solid #dbe5ef;
  background: #ffffff;
}

.header-user-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e3a5f;
  background: #e8eff6;
  border: 1px solid #d0dbe8;
  text-transform: uppercase;
}

.user-identity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.user-identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 8px 2px 2px;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  background: #f8fbff;
}

.user-identity-avatar,
.user-identity-initials {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  flex-shrink: 0;
}

.user-identity-avatar {
  object-fit: cover;
  border: 1px solid #d5e2ee;
  background: #fff;
}

.user-identity-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8eff6;
  color: #1e3a5f;
  border: 1px solid #cfdae8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.user-identity-label {
  display: inline-block;
  min-width: 0;
  font-size: 12px;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.user-identity-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-identity.has-avatar .user-identity-initials {
  display: none;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-info-menu {
  position: relative;
  display: inline-flex;
}

.header-info-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
  z-index: 250;
}

.header-info-dropdown-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text, #111827);
  text-decoration: none;
  text-align: left;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}

.header-info-dropdown-item:hover {
  background: #f3f4f6;
}

.header-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: #f9fafb;
  color: var(--text, #111827);
  padding: 6px 10px;
  border-radius: 8px;
}

.header-nav-btn:hover {
  background: #eef5ff;
  border-color: #bfd9f6;
}

.header-action-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: #f9fafb;
}

.header-action-btn:hover {
  background: #f3f4f6;
  color: var(--text, #111827);
  border-color: #d1d5db;
}

.header-action-btn.notifications-on {
  background: #0078d4;
  border-color: #0078d4;
  color: #fff;
}

.header-action-btn.notifications-on:hover {
  background: #006cbe;
}

.header-action-btn.notifications-denied {
  opacity: 0.45;
  cursor: not-allowed;
}

.header-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border, #e5e7eb);
  background: #f9fafb;
  color: var(--muted, #6b7280);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.header-logout-btn:hover {
  background: #f3f4f6;
  color: var(--text, #111827);
  border-color: #d1d5db;
}

.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  background: #dc2626;
  color: #fff;
}

.menu-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.menu-icon-wrap .notification-badge {
  position: absolute;
  top: -7px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 1;
}

.submenu-badge {
  margin-left: auto;
  position: static;
  transform: none;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  padding: 0 5px;
}

.refresh-update-badge {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 1300;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
}

.notification-toast {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 1300;
  min-width: 260px;
  max-width: 360px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification-toast.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notification-toast-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
}

.notification-toast-icon {
  color: #2563eb;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-toast-text {
  flex: 1;
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
}

.notification-toast-title {
  font-weight: 700;
  margin-bottom: 2px;
  color: #1e3a8a;
}

.notification-toast-close {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  font-size: 18px;
  padding: 2px;
  border-radius: 6px;
  flex-shrink: 0;
}

.notification-toast-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
}

.notification-card.unread {
  border-left: 4px solid #2563eb;
  background: #f8fbff;
}

.notification-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.notification-group {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.notification-group-title {
  margin: 10px 0 2px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notification-status-row {
  display: flex;
  justify-content: flex-end;
  min-height: 22px;
  margin-bottom: 4px;
}

.notification-title {
  font-size: 0.95rem;
  color: #111827;
  line-height: 1.3;
}

.notification-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.notification-new-badge {
  white-space: nowrap;
  flex-shrink: 0;
  background: #eff6ff;
  color: #1d4ed8;
}

.notification-detail-message {
  margin-top: 8px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.notification-detail-message ul,
.notification-detail-message ol {
  margin: 12px 0 12px 20px;
  padding-left: 18px;
}

.notification-detail-message li {
  margin: 4px 0;
}

.main-content-container {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dashboard-sidebar {
  width: 280px;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%);
  border-right: 1px solid var(--border, #e5e7eb);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: static;
}

.sidebar-header,
.sidebar-logo {
  display: none;
}

.sidebar-menu {
  flex: 1;
  display: block;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text, #111827);
  text-decoration: none;
  font-size: 14px;
  border: none;
  background: transparent;
  width: calc(100% - 16px);
  text-align: left;
}

.sidebar-menu-group-trigger {
  cursor: default;
  margin-bottom: 2px;
}

.sidebar-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-menu-item.active {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  color: #fff;
  font-weight: 600;
}

.sidebar-menu-item i {
  min-width: 20px;
  width: 20px;
  height: 20px;
}

.sidebar-menu-item * {
  pointer-events: none;
}

.menu-caret {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.75;
}

.sidebar-submenu {
  display: grid;
  gap: 4px;
  margin: 0 8px 8px 28px;
  padding-left: 12px;
  border-left: 2px solid rgba(59, 130, 246, 0.22);
}

.sidebar-submenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #111827);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: all 0.25s ease;
  padding: 8px 10px;
}

.sidebar-submenu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-submenu-item.active {
  background: rgba(30, 64, 175, 0.1);
  color: #1e40af;
  font-weight: 600;
}

.start-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.start-shortcut-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--dashboard-card-gradient);
  min-height: 120px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--text, #111827);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.start-shortcut-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.start-shortcut-card i {
  width: 28px;
  height: 28px;
  color: var(--brand-600, #2563eb);
}

.start-shortcut-card span {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-menu-group-trigger,
.sidebar-menu-item,
.sidebar-submenu-item,
.header-nav-btn,
.header-action-btn,
.header-logout-btn,
.case-review-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: none;
}

.dashboard-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border, #e5e7eb);
}

.sidebar-footer button {
  width: 100%;
}

.dashboard-content {
  overflow-y: auto;
}

@media (min-width: 769px) {
  .dashboard-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    height: auto;
    z-index: 120;
  }

  .dashboard-main-wrapper {
    margin-left: 280px;
    width: calc(100% - 280px);
  }
}

.dashboard-loading-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(2px);
  z-index: 300;
  padding: 24px;
}

.dashboard-loading-overlay.active {
  display: flex;
}

.dashboard-loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--dashboard-card-gradient);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  color: var(--text, #111827);
  font-weight: 600;
}

.dashboard-loading-card i {
  animation: spin 1s linear infinite;
}

.case-detail-loading {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted, #6b7280);
  font-weight: 500;
}

.case-detail-loading.active {
  display: flex;
}

.case-detail-loading i {
  animation: spin 1s linear infinite;
}

.case-detail-content.is-loading {
  display: none;
}

.case-review-panel {
  margin-bottom: 16px;
  border-left: 4px solid #2563eb;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(15, 23, 42, 0.02));
}

.case-review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.case-review-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.case-review-btn.accept {
  background: #16a34a;
}

.case-review-btn.accept:hover {
  background: #15803d;
}

.case-review-btn.incident {
  background: #dc2626;
}

.case-review-btn.incident:hover {
  background: #b91c1c;
}

.case-review-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.case-review-feedback {
  margin-top: 10px;
  color: #166534;
  font-size: 13px;
  font-weight: 600;
  display: none;
}

.case-review-feedback.visible {
  display: block;
}

.case-review-help {
  margin-top: 6px;
  color: var(--muted, #6b7280);
  font-size: 12px;
}

.case-review-error {
  margin-top: 8px;
  color: #b91c1c;
  font-size: 12px;
  display: none;
}

.case-review-error.visible {
  display: block;
}

.case-review-confirmation {
  display: none;
  margin-top: 12px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.case-review-confirmation.visible {
  display: block;
}

#case-detail-status {
  background-color: #e5e7eb;
  color: #4b5563;
}

#case-detail-status.open {
  background-color: #fef3c7;
  color: #92400e;
}

#case-detail-status.accepted {
  color: #1d4ed8;
}

#case-detail-status.closed,
#case-detail-status.resolved {
  background-color: #dcfce7;
  color: #166534;
}

#case-detail-status.in-progress {
  background-color: #e0f2fe;
  color: #075985;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

#risk-detail-modal.active {
  position: fixed;
  inset: 0;
  z-index: 3700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  overflow: auto;
}

#risk-detail-modal > .modal-card {
  width: min(860px, 100%);
}

#certification-wizard {
  display: none;
  padding: 0;
  flex: 1;
  overflow-y: auto;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 16px;
}

.modal[hidden] {
  display: none !important;
}

#dashboard-task-modal {
  z-index: 3600;
}

.modal-content {
  background: var(--dashboard-card-gradient, linear-gradient(180deg, #ffffff 0%, #f8fbff 100%));
  border-radius: 12px;
  padding: 18px;
  width: min(520px, 100%);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 12px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3,
.modal-content h4 {
  margin: 0;
}

#knowledge-asset-detail-modal .detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 14px;
}

#knowledge-asset-detail-modal .detail-grid > div {
  min-width: 0;
}

#knowledge-asset-detail-modal .detail-grid label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--muted, #6b7280);
}

#case-review-modal .modal-card {
  max-width: 560px;
  width: min(560px, calc(100vw - 24px));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
  padding: 18px;
}

#case-review-modal textarea {
  width: 100%;
}

.content-section h1 {
  margin-bottom: 20px;
  font-size: 24px;
}

.content-section h2 {
  margin-bottom: 16px;
  font-size: 18px;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .content-section {
    padding-bottom: 120px;
  }
}

@keyframes submenuPopIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  .main-content-container {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-direction: row;
    padding: 0;
    order: -1;
  }

  .sidebar-menu {
    flex: 1;
    padding: 0;
    overflow-x: auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }

  .sidebar-menu-group {
    display: flex;
    flex: 1;
  }

  .sidebar-menu-item {
    margin: 0;
    padding: 12px 16px;
    border-radius: 0;
    width: auto;
    min-width: 80px;
    justify-content: center;
    flex-direction: column;
    font-size: 12px;
    gap: 4px;
  }

  .sidebar-menu-group-trigger {
    width: 100%;
    cursor: pointer;
    position: relative;
  }

  .sidebar-submenu {
    display: none;
  }

  .menu-caret {
    display: none;
  }

  .sidebar-menu-group {
    position: relative;
  }

  .sidebar-menu-group .submenu-badge {
    position: absolute !important;
    top: 8px !important;
    right: 12px !important;
    margin-left: 0 !important;
    display: inline-flex !important;
    visibility: visible !important;
    z-index: 100 !important;
    transform: none !important;
  }

  .mobile-submenu-overlay {
    display: none;
  }

  .mobile-submenu-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 74px;
    z-index: 240;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
    padding: 10px;
    display: block;
    animation: submenuPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mobile-submenu-sheet[hidden] {
    display: none;
  }

  .mobile-submenu-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted, #6b7280);
  }

  .mobile-submenu-list {
    display: grid;
    gap: 6px;
  }

  .mobile-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
  }

  .mobile-submenu-item > span:first-child {
    min-width: 0;
    flex: 1;
  }

  .mobile-submenu-item .submenu-badge {
    margin-left: auto;
    flex-shrink: 0;
  }

  .sidebar-menu-item i {
    width: 24px;
    height: 24px;
  }

  .sidebar-menu-item .menu-icon-wrap {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }

  .sidebar-footer {
    display: none;
  }

  .dashboard-main-wrapper {
    height: auto;
  }

  .dashboard-content {
    padding: 12px;
  }

  .top-header {
    min-height: 56px;
    padding: 10px 12px;
    gap: 12px;
  }

  .header-logo {
    height: 36px;
  }


  .header-tenant {
    font-size: 13px;
  }

  .header-user {
    font-size: 11px;
  }

  .header-logout-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* Foreign Logins Map - Mobile Styling */
  #foreign-logins-map-panel {
    position: relative;
    z-index: 50;
  }

  #foreign-logins-dashboard-map {
    position: relative;
    z-index: 50;
  }

  /* Ensure sidebar menu is on top of map in mobile view */
  .dashboard-sidebar {
    z-index: 101;
    position: relative;
  }

  .sidebar-submenu {
    z-index: 102;
  }
}

@media (max-width: 576px) {
  .main-content-container {
    flex-direction: column;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .dashboard-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--border, #e5e7eb);
    border-bottom: none;
    flex-direction: row;
    padding: 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    order: 1;
    z-index: 100;
  }

  .sidebar-header {
    display: none;
  }

  .sidebar-menu {
    width: 100%;
    min-width: 60px;
  }

  .sidebar-menu-item {
    flex: 1;
    min-width: 60px;
    padding: 8px 4px;
    font-size: 11px;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .sidebar-menu-group-trigger {
    padding: 8px 4px;
  }

  .mobile-submenu-sheet {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .sidebar-menu-item * {
    pointer-events: none;
  }

  .top-header {
    min-height: 48px;
    padding: 8px 12px;
    gap: 8px;
  }


  .refresh-update-badge {
    top: 8px;
    right: 10px;
    font-size: 11px;
    padding: 5px 8px;
  }

  .notification-toast {
    top: 42px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .header-logo {
    font-size: 11px;
  }

  .header-logout-btn span {
    display: none;
  }
}

/* Universal Form Field Styling */
input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="file"],
select,
textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  font-family: inherit;
  font-size: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-600, #5B9BD5);
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
}

input[type="text"]:disabled,
input[type="date"]:disabled,
input[type="number"]:disabled,
input[type="email"]:disabled,
input[type="tel"]:disabled,
input[type="url"]:disabled,
input[type="search"]:disabled,
input[type="file"]:disabled,
select:disabled,
textarea:disabled {
  background-color: #f9fafb;
  color: var(--muted, #9ca3af);
  cursor: not-allowed;
}

input[readonly],
textarea[readonly] {
  background-color: #f9fafb;
  color: var(--muted, #9ca3af);
  cursor: default;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Modal action buttons */
.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 16px;
}

.tenant-dashboard {
  min-height: 100vh;
  padding: 24px;
  background: var(--bg, #f6f8fb);
}

.tenant-dashboard .wrap {
  max-width: 1100px;
  margin: 0 auto;
}

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

.tenant-card {
  background: var(--dashboard-card-gradient);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.knowledge-ref-link {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tenant-card a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tenant-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.dashboard-main .tenant-card,
.dashboard-side .tenant-card {
  margin-bottom: 0;
}

.kpi-card {
  background: var(--dashboard-card-gradient);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
}

.kpi-title {
  color: #6b7280;
  font-size: 0.85rem;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 6px;
}

.ratio-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.case-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  background: var(--dashboard-card-gradient);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.case-card:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

#execution-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.exec-progress {
  margin-top: 8px;
}

.exec-progress[hidden] {
  display: none;
}

.exec-progress-text {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 6px;
}

.exec-progress-bar {
  position: relative;
  height: 6px;
  border-radius: 6px;
  overflow: hidden;
  background: #e5e7eb;
}

.exec-progress-fill {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: #2563eb;
  animation: exec-progress-move 1.1s linear infinite;
}

@keyframes exec-progress-move {
  from { left: -40%; }
  to { left: 100%; }
}

.ratio-item,
.list-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px;
  background: var(--dashboard-card-gradient);
}

.procedure-card {
  display: flex;
  flex-direction: column;
  min-height: 130px;
}

.procedure-card .tenant-actions {
  margin-top: auto;
  justify-content: flex-end;
}

.procedure-card-compact {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  background: var(--dashboard-card-gradient);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: auto;
  transition: all 0.2s ease;
}

.procedure-card-compact:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.procedure-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink, #111827);
  overflow: hidden;
}

.procedure-card-title-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--muted, #6b7280);
}

.procedure-card-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.procedure-card-actions {
  display: none;
  gap: 8px;
  margin-top: auto;
  justify-content: flex-end;
}

#procedure-cards {
  grid-template-columns: 1fr;
}

.actions-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

#pending-actions-body.actions-cards {
  grid-template-columns: 1fr;
}

.action-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  background: var(--dashboard-card-gradient);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.action-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.action-card-date {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

.action-card-title {
  font-size: 0.95rem;
  color: var(--ink, #111827);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.list-date {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 6px;
}

.list-desc {
  color: #111827;
  font-weight: 600;
}

.controls-status-group {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--dashboard-card-gradient);
  margin-bottom: 12px;
}

#incidents-list {
  display: grid;
  gap: 12px;
}

#incidents-list > .dashboard-card {
  margin: 0;
}

.incident-note-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.issue-note-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

#incidents-list .dashboard-card .pill {
  border: 1px solid transparent;
  font-weight: 600;
}

#incidents-list .dashboard-card .pill.open {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

#incidents-list .dashboard-card .pill.in-progress {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}

#incidents-list .dashboard-card .pill.accepted {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

#incidents-list .dashboard-card .pill.closed,
#incidents-list .dashboard-card .pill.resolved {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

#cases-list .case-card .pill {
  border: 1px solid transparent;
  font-weight: 600;
}

#cases-list .case-card .pill.open {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

#cases-list .case-card .pill.in-progress {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}

#cases-list .case-card .pill.accepted {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

#cases-list .case-card .pill.closed,
#cases-list .case-card .pill.resolved {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

#incidents-list > .controls-status-group:first-of-type {
  margin-top: 14px;
}

#security-control-certcontrols-list .controls-status-group {
  margin-bottom: 12px;
}

#security-control-certcontrols-list .controls-status-group .detail-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

#cert-control-detail-security-controls .detail-list-row-badges,
#security-control-certcontrols-list .detail-list-row-badges {
  margin-top: 10px;
}

#dashboard-executed-actions-list .controls-status-group .detail-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.controls-status-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 14px;
  padding-right: 34px;
  font-weight: 600;
  color: var(--ink, #111827);
  text-align: left;
  position: relative;
}

.controls-status-summary > :first-child {
  margin-right: auto;
  min-width: 0;
  text-align: left;
}

.controls-status-summary::-webkit-details-marker,
.controls-card-summary::-webkit-details-marker {
  display: none;
}

.controls-status-summary::marker,
.controls-card-summary::marker {
  display: none;
}

.controls-status-summary::after,
.controls-card-summary::after {
  content: '';
  width: 8px;
  height: 8px;
  position: absolute;
  right: 14px;
  top: 50%;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: translateY(-58%) rotate(-45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.controls-status-group[open] > .controls-status-summary::after,
.controls-card[open] > .controls-card-summary::after {
  transform: translateY(-42%) rotate(45deg);
}

.controls-status-summary:hover::after,
.controls-card-summary:hover::after {
  border-color: #64748b;
}

.controls-status-body {
  padding: 12px 14px;
}

.controls-group-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 12px 12px;
}

.security-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.security-status-implemented {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.security-status-requested {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}

.security-status-in-progress {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}

.security-status-accepted-risk {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.security-status-not-implemented {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.security-status-unknown {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
}

.status-implemented {
  border-color: #86efac !important;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.status-requested {
  border-color: #fdba74 !important;
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
}

.status-accepted-risk {
  border-color: #93c5fd !important;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.status-not-implemented {
  border-color: #fca5a5 !important;
  background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
}

.status-unknown {
  border-color: #d1d5db !important;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

.detail-list-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  color: var(--ink, #111827);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.detail-list-row:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.detail-list-row > [data-lucide="chevron-right"],
.detail-list-row > i[data-lucide] {
  flex-shrink: 0;
  color: #94a3b8;
}

.detail-list-row-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink, #111827);
}

#dashboard-executed-actions-list .detail-list-row-main {
  width: 100%;
}

#dashboard-executed-actions-list .executed-action-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#dashboard-executed-actions-list .executed-action-heading .timeline-date-badge {
  flex: 0 0 auto;
}

#dashboard-executed-actions-list .executed-action-main {
  min-width: 0;
  flex: 1 1 auto;
}

#dashboard-executed-actions-list .executed-action-title {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

#dashboard-executed-actions-list .detail-list-row-meta {
  margin-top: 4px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

@media (max-width: 640px) {
  #dashboard-executed-actions-list .executed-action-heading {
    align-items: center;
  }

  #dashboard-executed-actions-list .executed-action-heading .timeline-date-badge {
    width: 64px;
    min-height: 64px;
  }
}

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

.detail-list-row-info-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}

.detail-list-row-small-pill {
  padding: 4px 8px;
  font-size: 0.72rem;
  line-height: 1.1;
}

#cert-control-detail-applicability-section {
  margin-top: 14px;
  padding: 16px 18px 78px;
  border-top: 1px solid var(--border, #e5e7eb);
  position: relative;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fbff 100%);
}

.applicability-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.applicability-status-implemented {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.applicability-status-inprogress {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}

.applicability-status-notapplicable {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.applicability-status-notimplemented {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.applicability-status-unknown {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
}

.applicability-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin: 10px 0 0;
}

.applicability-btn-applied,
.applicability-btn-not-applied {
  font-weight: 700;
  border-width: 1px;
}

.applicability-btn-applied {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.applicability-btn-applied:hover:not(:disabled) {
  background: #d1fae5;
  border-color: #34d399;
  color: #065f46;
}

.applicability-btn-not-applied {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.applicability-btn-not-applied:hover:not(:disabled) {
  background: #fecaca;
  border-color: #f87171;
  color: #b91c1c;
}

.applicability-btn-applied:disabled,
.applicability-btn-not-applied:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#cert-control-detail-applicability-motivation {
  margin-top: 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  padding: 10px 12px;
  resize: vertical;
}

#cert-control-detail-security-controls {
  display: grid;
  gap: 14px;
}

#cert-control-detail-security-controls .controls-status-group {
  margin-bottom: 0;
  overflow: hidden;
}

#cert-control-detail-security-controls .controls-status-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

#execution-cards .controls-status-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

#cert-control-detail-security-controls .controls-status-summary {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

#cert-control-detail-security-controls .controls-status-summary > span:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e0ecff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 800;
}

@media (max-width: 640px) {
  .detail-list-row {
    padding: 12px;
  }

  .detail-list-row-title {
    font-size: 0.9rem;
  }

  #cert-control-detail-applicability-section {
    padding: 14px 14px 86px;
  }
}

.controls-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--dashboard-card-gradient);
}

.controls-card-notimplemented {
  border-color: #d1d5db;
  border-left: 4px solid #9ca3af;
}

.controls-card-inprogress {
  border-color: #fed7aa;
  border-left: 4px solid #f97316;
}

.controls-card-implemented {
  border-color: #bbf7d0;
  border-left: 4px solid #22c55e;
}

.controls-card-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
}

.controls-card-summary > div:first-child {
  flex: 1;
  min-width: 0;
}

.controls-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink, #111827);
  margin-bottom: 4px;
}

.controls-card-teaser {
  font-size: 0.87rem;
  color: var(--muted, #6b7280);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls-card-quote {
  font-size: 0.87rem;
  color: #0f172a;
  font-style: italic;
  margin-top: 8px;
  line-height: 1.45;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.controls-card-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  padding: 4px 8px;
  margin: 6px 0 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  white-space: nowrap;
  border: 1px solid transparent;
}

.controls-card-status-notimplemented {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.controls-card-status-inprogress {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.controls-card-status-implemented {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.controls-card-type-label {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.controls-card-body {
  border-top: 1px solid var(--border, #e5e7eb);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.controls-marketing-text {
  color: var(--ink, #111827);
  font-size: 0.9rem;
  line-height: 1.5;
}

.controls-card-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.controls-card-field {
  display: grid;
  gap: 2px;
}

.controls-meta-grid {
  display: grid;
  gap: 6px;
}

.controls-meta-row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) 1fr;
  gap: 10px;
}

.controls-meta-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #6b7280);
}

.controls-meta-value {
  font-size: 0.86rem;
  color: var(--ink, #111827);
}

@media (max-width: 576px) {
  .controls-card-fields-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .controls-meta-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.exec-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 8px;
}

.exec-status.completed {
  background: #dcfce7;
  color: #166534;
}

.exec-status.failed {
  background: #fee2e2;
  color: #991b1b;
}

.exec-status.inprogress {
  background: #fef3c7;
  color: #92400e;
}

.exec-status.default {
  background: #e5e7eb;
  color: #374151;
}

.ratio-head,
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ratio-meta,
.list-meta {
  color: #6b7280;
  font-size: 0.85rem;
}

.ratio-bar {
  width: 100%;
  height: 8px;
  border-radius: 8px;
  background: #e5e7eb;
  overflow: hidden;
  margin-top: 8px;
}

.ratio-fill {
  height: 100%;
  background: #22c55e;
}

.ratio-fill.warn { background: #f59e0b; }
.ratio-fill.err { background: #ef4444; }

.section-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.spotty-summary {
  border-left: 4px solid #2563eb;
}

.spotty-summary-text {
  margin: 0;
  color: #1f2937;
  white-space: pre-wrap;
  line-height: 1.45;
}

.spotty-summary-loading {
  color: #6b7280;
  font-size: 0.9rem;
}

.empty-state {
  color: #6b7280;
  font-size: 0.9rem;
}

.impl-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 14px;
}

.impl-group {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: var(--dashboard-card-gradient);
}

.impl-group-title {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.impl-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.impl-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: var(--dashboard-card-gradient);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.impl-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1);
  background: var(--dashboard-card-gradient);
}

.impl-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  width: fit-content;
}

.impl-status-badge.implemented {
  background: #dcfce7;
  color: #166534;
}

.impl-status-badge.inprogress {
  background: #fef3c7;
  color: #92400e;
}

.impl-status-badge.notimplemented {
  background: #fee2e2;
  color: #991b1b;
}

.impl-status-badge.notapplicable {
  background: #dbeafe;
  color: #1d4ed8;
}

.impl-card-icon {
  display: flex;
  justify-content: center;
}

.impl-card-code {
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.impl-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.impl-card-title {
  font-weight: 400;
  color: #111827;
  font-size: 0.9rem;
  word-break: break-word;
}

.impl-card-type {
  color: #6b7280;
  font-size: 0.75rem;
}

.impl-card-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0c4a6e;
}

.impl-card-summary {
  color: #6b7280;
  font-size: 0.8rem;
  line-height: 1.35;
  margin-top: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.impl-card-summary-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

#certifications-impl-grid .impl-card-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.impl-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

.status-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-icon.implemented {
  background: #22c55e;
}

.status-icon.inprogress {
  background: #f59e0b;
}

.status-icon.notimplemented {
  background: #ef4444;
}

.status-icon.notapplicable {
  background: #3b82f6;
}

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

.quick-launch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-launch a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--dashboard-card-gradient);
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

.quick-launch a:hover {
  border-color: #cbd5f5;
  background: #eef2ff;
}

.quick-launch .link-arrow {
  color: #6b7280;
  font-size: 0.9rem;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.dashboard-table th,
.dashboard-table td {
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.dashboard-table th {
  color: #6b7280;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.certifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.certifications-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.cert-item {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px;
  background: var(--dashboard-card-gradient);
  display: grid;
  gap: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.cert-item.selected {
  border-color: #2563eb;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.cert-meta {
  color: #6b7280;
  font-size: 0.85rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.cert-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
  white-space: nowrap;
  flex-shrink: 0;
  width: fit-content;
}

.cert-status.not-started { background: #f3f4f6; color: #374151; }
.cert-status.initializing { background: #fef3c7; color: #92400e; }
.cert-status.implementing { background: #dbeafe; color: #1d4ed8; }
.cert-status.certified { background: #dcfce7; color: #166534; }

.cert-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #f3f4f6;
  color: #6b7280;
  letter-spacing: 0.5px;
}

.cert-control-detail-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cert-control-detail-category-pill {
  background: #ecfeff;
  border-color: #67e8f9;
  color: #155e75;
}

.cert-control-detail-certification-pill {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.type-pill-policy {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0c4a6e;
}

.type-pill-process {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.type-pill-technical {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #4c1d95;
}

.type-pill-general {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.cert-users {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}

.wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.first-use-overlay {
  position: fixed;
  inset: 0;
  z-index: 1800;
  background: rgba(10, 20, 35, 0.36);
}

.first-use-cutout {
  position: fixed;
  border: 2px solid #f8fafc;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(10, 20, 35, 0.36), 0 0 0 6px rgba(255, 255, 255, 0.18);
  pointer-events: none;
  transition: all 0.2s ease;
}

.first-use-note {
  position: fixed;
  width: min(390px, calc(100vw - 20px));
  max-height: 72vh;
  overflow-y: auto;
  color: #172033;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(147, 197, 253, 0.18) 0%, rgba(147, 197, 253, 0) 52%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #cfdbec;
  border-radius: 24px 24px 20px 26px;
  box-shadow:
    0 24px 52px rgba(15, 23, 42, 0.30),
    0 2px 0 rgba(255, 255, 255, 0.75) inset;
  padding: 18px 18px 14px;
  pointer-events: auto;
}

.first-use-note::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(
    12deg,
    rgba(23, 32, 51, 0.02) 0,
    rgba(23, 32, 51, 0.02) 2px,
    rgba(255, 255, 255, 0) 2px,
    rgba(255, 255, 255, 0) 9px
  );
}

.first-use-note-title {
  margin: 0 0 10px;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0.2px;
  font-family: 'Kalam', 'Segoe Print', 'Bradley Hand', cursive;
}


.first-use-note-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  font-family: 'Kalam', 'Segoe Print', 'Bradley Hand', cursive;
}

.first-use-note-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
  gap: 8px;
}

.first-use-step-counter {
  display: none;
}

.first-use-note-actions .btn {
  font-family: inherit;
}

@media (max-width: 640px) {
  .first-use-note {
    width: min(360px, calc(100vw - 14px));
    max-height: 68vh;
    border-radius: 20px;
    padding: 14px 14px 12px;
  }

  .first-use-note-title {
    font-size: 21px;
    margin-bottom: 8px;
  }

  .first-use-note-text {
    font-size: 14px;
    line-height: 1.35;
  }

}

.wizard-panel {
  background: #fff;
  border-radius: 14px;
  width: min(1100px, 96vw);
  max-height: 90vh;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
  align-items: start;
}

.wizard-thread {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  height: 60vh;
  overflow-y: auto;
  background: #f9fafb;
}

.wizard-input .btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wizard-input-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid #dbeafe;
  border-radius: 10px;
  padding: 12px;
  background: #f0f9ff;
  transition: all 0.2s ease;
}

.wizard-input-container:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  background: #fff;
}

.wizard-textarea {
  appearance: none;
  border: none;
  background: transparent;
  color: #111827;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 0;
  resize: vertical;
  min-height: 36px;
  max-height: 96px;
  outline: none;
}

.wizard-textarea::placeholder {
  color: #9ca3af;
}

.wizard-send-btn {
  align-self: flex-end;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.wizard-send-btn:active {
  transform: scale(0.98);
}

.ai-bubble {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  max-width: 80%;
}

.ai-bubble.user {
  margin-left: auto;
  background: #e0f2fe;
  border-color: #bae6fd;
}

.ai-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
}

.ai-text p,
.ai-text ul,
.ai-text h1,
.ai-text h2,
.ai-text h3,
.ai-text h4,
.ai-text h5,
.ai-text h6 {
  margin: 0 0 8px 0;
}

.ai-text p:last-child,
.ai-text ul:last-child,
.ai-text h1:last-child,
.ai-text h2:last-child,
.ai-text h3:last-child,
.ai-text h4:last-child,
.ai-text h5:last-child,
.ai-text h6:last-child {
  margin-bottom: 0;
}

.ai-text ul {
  padding-left: 18px;
}

.ai-text li {
  margin: 3px 0;
}

#cert-control-detail-policy {
  line-height: 1.65;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  max-height: min(52vh, 520px);
  overflow: auto;
  word-break: break-word;
}

#cert-control-detail-policy h1,
#cert-control-detail-policy h2,
#cert-control-detail-policy h3,
#cert-control-detail-policy h4,
#cert-control-detail-policy h5,
#cert-control-detail-policy h6 {
  margin: 18px 0 10px;
  line-height: 1.35;
}

#cert-control-detail-policy h1 { font-size: 1.15rem; }
#cert-control-detail-policy h2 { font-size: 1.08rem; }
#cert-control-detail-policy h3,
#cert-control-detail-policy h4,
#cert-control-detail-policy h5,
#cert-control-detail-policy h6 { font-size: 1rem; }

#cert-control-detail-policy p {
  margin: 0 0 12px;
}

#cert-control-detail-policy ul {
  margin: 0 0 14px;
  padding-left: 1.4rem;
  list-style-position: outside;
}

#cert-control-detail-policy li {
  margin: 6px 0;
  padding-left: 2px;
}

#cert-control-detail-policy > *:first-child {
  margin-top: 0;
}

#cert-control-detail-policy > *:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  #cert-control-detail-policy {
    max-height: 42vh;
    padding: 10px 12px;
  }
}

.wizard-status {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  background: var(--dashboard-card-gradient);
  display: grid;
  gap: 8px;
  align-self: start;
}

.wizard-props {
  display: grid;
  gap: 10px;
}

.wizard-props label {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 600;
}

.wizard-props input,
.wizard-props select {
  width: 100%;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.wizard-props .btn {
  justify-self: start;
}

.wizard-improvements {
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
  display: grid;
  gap: 6px;
}

.wizard-improvements h5 {
  margin: 0;
  font-size: 0.85rem;
  color: #374151;
}

.wizard-improvements ul {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
}

.wizard-improvements li {
  font-size: 0.8rem;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.impr-status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #6b7280;
  white-space: nowrap;
}

.impr-status.open {
  background: #fef3c7;
  color: #92400e;
}

.impr-status.inprogress {
  background: #dbeafe;
  color: #1d4ed8;
}

.impr-status.completed {
  background: #dcfce7;
  color: #166534;
}

.improvement-kpi-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.improvement-kpi-overview-card {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.improvement-kpi-overview-value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.improvement-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.improvement-kpi-card {
  cursor: pointer;
  border-left: 4px solid #0ea5e9;
  display: grid;
  gap: 10px;
}

.improvement-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.improvement-kpi-head .pill {
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.improvement-kpi-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.improvement-kpi-title {
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.improvement-kpi-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.improvement-kpi-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.improvement-kpi-value {
  display: block;
  font-size: 13px;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.improvement-kpi-core {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.improvement-kpi-values-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.improvement-kpi-progress-track {
  height: 9px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.improvement-kpi-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9 0%, #22c55e 100%);
  border-radius: inherit;
}

.improvement-kpi-trend {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.improvement-kpi-trend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.improvement-kpi-trend-delta {
  font-size: 12px;
  font-weight: 700;
}

.improvement-kpi-trend-delta.is-positive {
  color: #047857;
}

.improvement-kpi-trend-delta.is-negative {
  color: #b91c1c;
}

.improvement-kpi-trend-chart-wrap {
  width: 100%;
  position: relative;
  overflow: visible;
}

.improvement-kpi-trend-chart-wrap svg {
  display: block;
}

.improvement-card-trend-point {
  cursor: pointer;
  transition: transform 120ms ease, stroke 120ms ease, filter 120ms ease;
  transform-origin: center;
  transform-box: fill-box;
}

.improvement-card-trend-point.is-hovered {
  transform: scale(1.28);
  stroke: rgba(186, 230, 253, 0.95);
  stroke-width: 4;
  filter: drop-shadow(0 0 5px rgba(2, 132, 199, 0.25));
}

.improvement-kpi-trend-tooltip {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 6px));
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.22);
}

.improvement-kpi-trend-range {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.improvement-kpi-trend-single {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.improvement-kpi-description {
  display: grid;
  gap: 3px;
}

.improvement-kpi-normeringen-list {
  display: grid;
  gap: 4px;
}

.improvement-kpi-normeringen-item {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #334155;
  line-height: 1.4;
}

.improvement-history-kpi-chart-wrap {
  position: relative;
  overflow-x: auto;
}

.improvement-history-trend-point {
  cursor: pointer;
  transition: transform 120ms ease, stroke 120ms ease, filter 120ms ease;
  transform-origin: center;
  transform-box: fill-box;
}

.improvement-history-trend-point.is-hovered {
  transform: scale(1.22);
  stroke: rgba(186, 230, 253, 0.95);
  stroke-width: 5;
  filter: drop-shadow(0 0 6px rgba(2, 132, 199, 0.25));
}

.improvement-history-kpi-tooltip {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 6px));
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
}

@media (max-width: 780px) {
  .improvement-kpi-meta-grid,
  .improvement-kpi-values-row {
    grid-template-columns: 1fr;
  }
}

.wizard-impls {
  margin-top: 12px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.wizard-impl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.wizard-impl-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--dashboard-card-gradient);
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.wizard-impl-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.08);
}

.wizard-impl-group {
  grid-column: 1 / -1;
  font-weight: 700;
  color: #374151;
  margin-top: 6px;
}

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

.modal-card {
  background: var(--dashboard-card-gradient);
  border-radius: 12px;
  padding: 18px;
  width: min(860px, 100%);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 12px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.dashboard-risk-card {
  padding: 14px 16px;
}

.dashboard-risk-card-inner {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.dashboard-risk-kpi {
  width: 86px;
  min-width: 86px;
  aspect-ratio: 1 / 1;
  align-self: flex-start;
  border: 1px solid;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  box-sizing: border-box;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.dashboard-risk-kpi-button {
  appearance: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-risk-kpi-button:hover,
.dashboard-risk-kpi-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.dashboard-risk-kpi-button:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.4);
  outline-offset: 2px;
}

.dashboard-risk-kpi-value {
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
}

.dashboard-risk-kpi-label {
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dashboard-risk-picker-summary {
  display: grid;
  gap: 10px;
}

.dashboard-risk-picker-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.dashboard-risk-picker-overview-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.95);
  color: #334155;
}

.dashboard-risk-picker-modal[hidden] {
  display: none !important;
}

.dashboard-risk-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
}

.dashboard-risk-picker-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.dashboard-risk-picker-modal-card {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  height: min(80vh, 920px);
  margin: 5vh auto;
  background: var(--dashboard-card-gradient);
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  min-height: 0;
}

.dashboard-risk-picker-modal-body {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  align-content: start;
  align-items: stretch;
}

.dashboard-risk-picker-modal-body .linked-asset-picker {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  align-content: start;
  align-items: stretch;
  grid-auto-rows: max-content;
  align-self: stretch;
  height: 100%;
}

.dashboard-risk-picker-modal-body .linked-asset-picker > label {
  display: grid;
  gap: 4px;
  align-self: start;
  width: min(280px, 100%);
}

.dashboard-risk-picker-modal-body .linked-asset-picker > .linked-asset-card-list {
  display: grid;
  gap: 10px;
  align-content: stretch;
  align-items: start;
  justify-content: stretch;
  grid-auto-rows: max-content;
  min-height: 0;
  align-self: stretch;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}

#dashboard-risk-linked-asset-modal .dashboard-risk-picker-modal-body,
#dashboard-risk-security-implementation-modal .dashboard-risk-picker-modal-body,
#dashboard-risk-certification-control-modal .dashboard-risk-picker-modal-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

#dashboard-risk-linked-asset-modal .dashboard-risk-picker-modal-body > p,
#dashboard-risk-security-implementation-modal .dashboard-risk-picker-modal-body > p,
#dashboard-risk-certification-control-modal .dashboard-risk-picker-modal-body > p {
  flex: 0 0 auto;
}

#dashboard-risk-linked-asset-modal #dashboard-risk-linked-asset-picker,
#dashboard-risk-security-implementation-modal #dashboard-risk-security-implementation-picker,
#dashboard-risk-certification-control-modal #dashboard-risk-certification-control-picker {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

#dashboard-risk-security-implementation-modal #dashboard-risk-security-implementation-picker,
#dashboard-risk-certification-control-modal #dashboard-risk-certification-control-picker {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  align-items: stretch;
}

#dashboard-risk-linked-asset-modal #dashboard-risk-linked-asset-list,
#dashboard-risk-security-implementation-modal #dashboard-risk-security-implementation-list,
#dashboard-risk-certification-control-modal #dashboard-risk-certification-control-list {
  flex: 1 1 0;
  display: grid;
  align-content: stretch;
  justify-content: stretch;
  gap: 10px;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.dashboard-risk-picker-modal-body .linked-asset-picker > .linked-asset-card-list > .linked-asset-card,
.dashboard-risk-picker-modal-body .linked-asset-picker > .linked-asset-card-list > .controls-status-group {
  align-self: start;
  margin-bottom: 0;
}

.dashboard-risk-picker-modal-body .controls-status-summary {
  align-items: flex-start;
}

.dashboard-risk-picker-modal-body .controls-status-summary > * {
  align-self: flex-start;
}

.dashboard-risk-matrix-block {
  width: 232px;
  min-width: 232px;
  align-self: flex-start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96));
  box-sizing: border-box;
}

.dashboard-risk-matrix-block.is-modal {
  width: min(100%, 420px);
  min-width: 0;
  margin: 0 auto;
  padding: 14px;
}

.dashboard-risk-matrix-block.is-modal .dashboard-risk-matrix-title {
  font-size: 0.84rem;
}

.dashboard-risk-matrix-block.is-modal .dashboard-risk-matrix-coordinates,
.dashboard-risk-matrix-block.is-modal .dashboard-risk-matrix-axis,
.dashboard-risk-matrix-block.is-modal .dashboard-risk-matrix-axis-labels {
  font-size: 0.76rem;
}

.dashboard-risk-matrix-block.is-modal .dashboard-risk-matrix-grid {
  gap: 6px;
}

.dashboard-risk-matrix-block.is-modal .dashboard-risk-matrix-cell {
  border-radius: 10px;
  font-size: 0.82rem;
}

.dashboard-risk-matrix-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dashboard-risk-matrix-title {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.dashboard-risk-matrix-coordinates {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
}

.dashboard-risk-matrix-layout {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.dashboard-risk-matrix-axis {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-risk-matrix-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  justify-content: center;
  align-items: center;
}

.dashboard-risk-matrix-grid-wrap {
  flex: 1;
  min-width: 0;
}

.dashboard-risk-matrix-content {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.dashboard-risk-matrix-axis-labels {
  display: grid;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.dashboard-risk-matrix-axis-labels-top {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 6px 24px;
}

.dashboard-risk-matrix-axis-labels-top span {
  text-align: center;
}

.dashboard-risk-matrix-axis-labels-left {
  grid-template-rows: repeat(5, 1fr);
  width: 18px;
}

.dashboard-risk-matrix-axis-labels-left span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-risk-matrix-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.dashboard-risk-matrix-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dashboard-risk-matrix-cell.is-current {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dashboard-risk-matrix-marker {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  border: 1px solid rgba(255, 255, 255, 0.95);
}

.dashboard-risk-matrix-axis-x {
  margin-top: 6px;
  text-align: center;
}

#dashboard-risk-implementation-picker #dashboard-risk-implementation-list {
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

#dashboard-risk-implementation-picker #dashboard-risk-implementation-list .linked-asset-card-list {
  max-height: none;
  overflow: visible;
}

.dashboard-risk-main {
  flex: 1;
  min-width: 0;
}

.dashboard-risk-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .dashboard-risk-card-inner {
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-risk-kpi {
    width: 72px;
    min-width: 72px;
    padding: 8px 6px;
  }

  .dashboard-risk-kpi-value {
    font-size: 1.25rem;
  }

  .dashboard-risk-matrix-block {
    width: 100%;
    min-width: 0;
  }

  .dashboard-risk-picker-modal-card {
    width: calc(100vw - 16px);
    height: 80vh;
    margin: 10vh auto;
    padding: 14px;
  }
}

#risk-history-modal-list,
#improvement-history-modal-list,
#knowledge-asset-history-list,
#implementation-history-modal-list {
  display: grid;
  gap: 10px;
}

.implementation-history-entry {
  border-left: 4px solid #94a3b8;
  border-radius: 12px;
  border-top: 1px solid var(--border, #e5e7eb);
  border-right: 1px solid var(--border, #e5e7eb);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  padding: 10px 12px;
}

.implementation-history-entry.major {
  border-left-color: #0f766e;
}

.implementation-history-entry.minor {
  border-left-color: #64748b;
}

.implementation-history-entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.implementation-history-entry-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.implementation-history-entry-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.25;
  font-size: 0.8rem;
  color: #64748b;
}

.implementation-history-entry-remarks {
  margin-top: 8px;
  color: #1f2937;
  line-height: 1.45;
}

.implementation-history-change-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.implementation-history-change-badge.major {
  color: #0f766e;
  background: #ccfbf1;
  border-color: #99f6e4;
}

.implementation-history-change-badge.minor {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.risk-history-entry {
  border-left: 4px solid #94a3b8;
  border-radius: 12px;
  border-top: 1px solid var(--border, #e5e7eb);
  border-right: 1px solid var(--border, #e5e7eb);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.risk-history-entry-inner {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: 10px 12px;
}

.risk-history-kpi {
  min-width: 84px;
  border: 1px solid;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
}

.risk-history-kpi-value {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.risk-history-kpi-label {
  margin-top: 5px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.risk-history-content {
  flex: 1;
  min-width: 0;
}

.risk-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.risk-history-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.risk-history-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.risk-history-change {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.risk-history-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.25;
  font-size: 0.8rem;
  color: #64748b;
}

.implementation-history-entry-meta .user-identity,
.risk-history-meta .user-identity {
  margin: 0;
  vertical-align: middle;
}

.risk-history-reason {
  margin-top: 8px;
  color: #1f2937;
  line-height: 1.45;
}

.risk-detail-summary-grid {
  display: grid;
  gap: 14px;
  align-items: start;
}

.risk-detail-summary-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.risk-detail-summary-description-card {
  display: grid;
  gap: 10px;
}

.risk-detail-summary-measures {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.risk-detail-metric-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.risk-detail-metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.risk-detail-metric-value {
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.risk-detail-metric-value.score {
  font-size: 1.6rem;
}

.risk-detail-summary-description {
  color: #1f2937;
  line-height: 1.55;
  white-space: pre-wrap;
}

.risk-detail-link-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #1f2937;
  line-height: 1.4;
}

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

.risk-detail-trend-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 220px;
}

.risk-detail-trend-point {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.risk-detail-trend-bar-wrap {
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: flex-end;
}

.risk-detail-trend-bar {
  width: 100%;
  min-height: 12px;
  border-radius: 12px 12px 6px 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.risk-detail-trend-value {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dbe4ee;
  color: #0f172a;
  white-space: nowrap;
}

.risk-detail-trend-label {
  font-size: 0.78rem;
  color: #475569;
  text-align: center;
  line-height: 1.3;
}

.risk-detail-trend-caption {
  font-size: 0.8rem;
  color: #64748b;
}

.risk-detail-trend-chart-wrap {
  display: grid;
  gap: 12px;
  overflow: visible;
}

.risk-detail-trend-svg {
  display: block;
  overflow: visible;
}

#risk-detail-activity-list {
  display: grid;
  gap: 20px;
}

.risk-detail-activity-entry {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: 9px 11px;
}

.risk-detail-activity-entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.risk-detail-activity-entry-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.risk-detail-activity-date {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.risk-detail-activity-date-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.risk-detail-activity-date-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.risk-detail-activity-date-value {
  font-size: 0.7rem;
  color: #0f172a;
}

.risk-detail-activity-entry-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #111827;
}

.risk-detail-activity-entry-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #64748b;
}

.risk-detail-activity-entry-body {
  margin-top: 8px;
  color: #1f2937;
  line-height: 1.45;
  white-space: pre-wrap;
}

.risk-detail-activity-entry-description {
  margin-top: 4px;
}

.risk-detail-timeline {
  display: grid;
  gap: 10px;
}

.risk-detail-timeline-entry {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: 12px 14px;
}

.risk-detail-timeline-entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.risk-detail-timeline-entry-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.risk-detail-timeline-entry-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #64748b;
}

.risk-detail-timeline-entry-body {
  margin-top: 8px;
  color: #1f2937;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .implementation-history-entry {
    padding: 10px;
  }

  .risk-history-entry-inner {
    gap: 10px;
    padding: 10px;
  }

  .risk-history-kpi {
    min-width: 72px;
  }

  .risk-history-kpi-value {
    font-size: 1.05rem;
  }

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

  .risk-detail-trend-chart {
    grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  }
}

/* Modal card form fields width (ensure full width) */
.modal-card input[type="text"],
.modal-card input[type="date"],
.modal-card input[type="number"],
.modal-card input[type="email"],
.modal-card input[type="tel"],
.modal-card input[type="url"],
.modal-card input[type="search"],
.modal-card input[type="file"],
.modal-card select,
.modal-card textarea {
  width: 100%;
}

/* Dashboard modal sections and case detail styling */
section.content-section[id$="-modal"]:not(#procedure-execute-modal),
section.content-section#modal-procedure-overview-dashboard,
section.content-section#modal-procedure-execution-dashboard {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 16px;
  overflow-y: auto;
}

section.content-section[id$="-modal"]:not(#procedure-execute-modal).active,
section.content-section#modal-procedure-overview-dashboard.active,
section.content-section#modal-procedure-execution-dashboard.active {
  display: flex;
}

/* Procedure execute section behaves like a regular detail page */
#procedure-execute-modal {
  position: static;
  inset: auto;
  background: transparent;
  z-index: auto;
  padding: 0;
  overflow-y: visible;
}

#procedure-execute-modal.active {
  display: block;
}

#procedure-execute-modal .detail-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

#panel-cert-impl-history-dashboard {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 16px;
  overflow-y: auto;
}

#panel-cert-impl-history-dashboard[hidden] {
  display: none !important;
}

#panel-cert-impl-history-dashboard .modal-content {
  max-width: 860px;
  width: min(860px, calc(100vw - 24px));
}

/* Status label colors */
#case-detail-status.open {
  background-color: #fef3c7;
  color: #92400e;
}

#case-detail-status.accepted {
  color: #1d4ed8;
}

#case-detail-status.closed,
#case-detail-status.resolved {
  background-color: #dcfce7;
  color: #166534;
}

#case-detail-status.in-progress {
  background-color: #e0f2fe;
  color: #075985;
}

#case-detail-status {
  background-color: #e5e7eb;
  color: #4b5563;
}

.dashboard-case-analysis-trigger {
  border-color: #99f6e4;
  color: #0f766e;
  background: linear-gradient(135deg, #ecfeff, #d1fae5);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.15), 0 0 18px rgba(20, 184, 166, 0.2);
}

.dashboard-case-analysis-trigger:hover {
  background: linear-gradient(135deg, #cffafe, #bbf7d0);
  border-color: #2dd4bf;
  color: #115e59;
}

.dashboard-case-analysis-panel {
  margin-bottom: 16px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 35%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.1), transparent 30%),
    linear-gradient(180deg, #f8fdff 0%, #f1f8ff 45%, #ecf6ff 100%);
  color: #334155;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

.dashboard-case-analysis-shell {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-case-analysis-hero {
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(236, 253, 245, 0.92));
  overflow: hidden;
}

.dashboard-case-analysis-hero-top {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  display: grid;
  gap: 8px;
}

.dashboard-case-analysis-hero-bottom {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
}

.dashboard-case-analysis-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-case-analysis-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.dashboard-case-analysis-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55);
}

.dashboard-case-analysis-badge-pending { background: rgba(71, 85, 105, 0.24); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.28); }
.dashboard-case-analysis-badge-running { background: rgba(14, 165, 233, 0.14); color: #0e7490; border-color: rgba(14, 165, 233, 0.3); }
.dashboard-case-analysis-badge-safe { background: rgba(34, 197, 94, 0.14); color: #15803d; border-color: rgba(34, 197, 94, 0.3); }
.dashboard-case-analysis-badge-review { background: rgba(249, 115, 22, 0.14); color: #c2410c; border-color: rgba(249, 115, 22, 0.3); }
.dashboard-case-analysis-badge-danger { background: rgba(239, 68, 68, 0.14); color: #b91c1c; border-color: rgba(239, 68, 68, 0.32); }

.dashboard-case-analysis-score {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  transition: color 0.24s ease, text-shadow 0.24s ease;
}

.dashboard-case-analysis-score.score-low,
.dashboard-case-analysis-scan-percent.score-low {
  color: #f87171;
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.55), 0 0 18px rgba(248, 113, 113, 0.25);
}

.dashboard-case-analysis-score.score-medium,
.dashboard-case-analysis-scan-percent.score-medium {
  color: #fb923c;
  text-shadow: 0 0 10px rgba(251, 146, 60, 0.55), 0 0 18px rgba(251, 146, 60, 0.25);
}

.dashboard-case-analysis-score.score-high,
.dashboard-case-analysis-scan-percent.score-high {
  color: #4ade80;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.55), 0 0 18px rgba(74, 222, 128, 0.25);
}

.dashboard-case-analysis-hero h4 { margin: 0; color: #0f172a; }

.dashboard-case-analysis-scan {
  position: relative;
  height: 128px;
  background:
    linear-gradient(180deg, rgba(186, 230, 253, 0.4), rgba(224, 242, 254, 0.12)),
    repeating-linear-gradient(180deg, rgba(125, 211, 252, 0.38) 0 2px, transparent 2px 10px);
  overflow: hidden;
}

.dashboard-case-analysis-scan::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22d3ee, transparent);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.4);
  animation: dashboardCaseScan 2.8s linear infinite;
}

.dashboard-case-analysis-scan-hud {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-case-analysis-scan-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.dashboard-case-analysis-scan-percent {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  transition: color 0.24s ease, text-shadow 0.24s ease;
}

.dashboard-case-analysis-scan-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0284c7;
}

.dashboard-case-analysis-scan-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(191, 219, 254, 0.55);
  overflow: hidden;
}

.dashboard-case-analysis-scan-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #06b6d4, #22c55e);
  transition: width 0.35s ease;
}

.dashboard-case-analysis-scan-action {
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.3;
  min-height: 2.6em;
  color: #0f4c81;
}

.dashboard-case-analysis-hero-main {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-case-analysis-progress,
.dashboard-case-analysis-card {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 14px;
  background: var(--dashboard-card-gradient);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.dashboard-case-analysis-progress { padding: 14px; }
.dashboard-case-analysis-progress-top,
.dashboard-case-analysis-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dashboard-case-analysis-progress-top { margin-bottom: 10px; color: #334155; font-size: 13px; }
.dashboard-case-analysis-progress-bar { height: 10px; border-radius: 999px; background: rgba(191, 219, 254, 0.5); overflow: hidden; }
.dashboard-case-analysis-progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22d3ee, #22c55e); transition: width 0.35s ease; }

.dashboard-case-analysis-steps { margin-top: 10px; display: grid; gap: 10px; }
.dashboard-case-analysis-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, 0.14); background: rgba(248, 250, 252, 0.9); }
.dashboard-case-analysis-step-index { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: rgba(226, 232, 240, 0.92); color: #334155; }
.dashboard-case-analysis-step strong,
.dashboard-case-analysis-card h4 { color: #0f172a; margin: 0; }
.dashboard-case-analysis-step p { margin: 5px 0 0; color: #475569; font-size: 13px; line-height: 1.4; }
.dashboard-case-analysis-step.is-active { border-color: rgba(34, 211, 238, 0.42); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.22), 0 0 24px rgba(34, 211, 238, 0.08); }
.dashboard-case-analysis-step.is-active .dashboard-case-analysis-step-index { background: linear-gradient(135deg, #0ea5e9, #06b6d4); color: #eff6ff; }
.dashboard-case-analysis-step.is-complete { border-color: rgba(74, 222, 128, 0.32); }
.dashboard-case-analysis-step.is-complete .dashboard-case-analysis-step-index { background: linear-gradient(135deg, #16a34a, #22c55e); color: #f0fdf4; }
.dashboard-case-analysis-step.is-error { border-color: rgba(248, 113, 113, 0.3); }
.dashboard-case-analysis-step.is-error .dashboard-case-analysis-step-index { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fef2f2; }

.dashboard-case-analysis-grid { display: grid; gap: 12px; }
.dashboard-case-analysis-card { padding: 14px; }
.dashboard-case-analysis-muted { color: #64748b; font-size: 12px; }
.dashboard-case-analysis-sections,
.dashboard-case-analysis-context,
.dashboard-case-analysis-list,
.dashboard-case-analysis-summary { margin-top: 12px; display: grid; gap: 10px; }
.dashboard-case-analysis-section-card,
.dashboard-case-analysis-context-card { padding: 11px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, 0.14); background: rgba(248, 250, 252, 0.86); }
.dashboard-case-analysis-section-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dashboard-case-analysis-risk-pill,
.dashboard-case-analysis-context-risk,
.dashboard-case-analysis-summary-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid rgba(148, 163, 184, 0.2); background: rgba(248, 250, 252, 0.95); color: #334155; }
.dashboard-case-analysis-list-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; border-radius: 12px; background: rgba(248, 250, 252, 0.9); border: 1px solid rgba(148, 163, 184, 0.14); color: #334155; font-size: 13px; }
.dashboard-case-analysis-list-marker { width: 10px; height: 10px; min-width: 10px; min-height: 10px; flex: 0 0 10px; margin-top: 6px; border-radius: 50%; background: linear-gradient(135deg, #22d3ee, #3b82f6); box-shadow: 0 0 14px rgba(34, 211, 238, 0.45); }
.dashboard-case-analysis-empty { padding: 11px; border-radius: 10px; border: 1px dashed rgba(148, 163, 184, 0.28); color: #64748b; background: rgba(241, 245, 249, 0.9); font-size: 13px; }

.dashboard-case-analysis-risk-low { border-color: rgba(34, 197, 94, 0.38) !important; background: rgba(34, 197, 94, 0.16) !important; color: #14532d !important; }
.dashboard-case-analysis-risk-medium { border-color: rgba(249, 115, 22, 0.4) !important; background: rgba(249, 115, 22, 0.16) !important; color: #7c2d12 !important; }
.dashboard-case-analysis-risk-high { border-color: rgba(239, 68, 68, 0.42) !important; background: rgba(239, 68, 68, 0.16) !important; color: #7f1d1d !important; }

#case-foreign-analysis-panel.is-loading .dashboard-case-analysis-progress,
#case-foreign-analysis-panel.is-loading .dashboard-case-analysis-grid,
#case-foreign-analysis-panel.is-loading .dashboard-case-analysis-summary-card,
#case-foreign-analysis-panel.is-loading .dashboard-case-analysis-hero-main,
#case-foreign-analysis-panel.is-loading .dashboard-case-analysis-score {
  display: none;
}

#case-foreign-analysis-panel.is-loading .dashboard-case-analysis-hero-top {
  border-bottom: 0;
}

#case-foreign-analysis-panel.is-loading .dashboard-case-analysis-hero-bottom,
#case-foreign-analysis-panel.is-complete .dashboard-case-analysis-hero-bottom {
  grid-template-columns: 1fr;
}

#case-foreign-analysis-panel.is-complete .dashboard-case-analysis-scan {
  display: none;
}

@keyframes dashboardCaseScan {
  from { top: 0; }
  to { top: calc(100% - 2px); }
}

@media (max-width: 760px) {
  .dashboard-case-analysis-hero-bottom { grid-template-columns: 1fr; }
  .dashboard-case-analysis-scan { height: 98px; }
  .dashboard-case-analysis-score { font-size: 22px; }
}

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

/* Input field styling for modals */
.input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.input:focus {
  outline: none;
  border-color: var(--brand-600, #5B9BD5);
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
}

.input:disabled {
  background-color: #f9fafb;
  color: var(--muted, #9ca3af);
  cursor: not-allowed;
}

textarea.input {
  resize: vertical;
  font-family: inherit;
}

select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  appearance: none;
}

/* Progress bar animation for task proposal */
@keyframes task-proposal-progress {
  0% { width: 10%; }
  50% { width: 70%; }
  100% { width: 90%; }
}

@media (max-width: 980px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  .wizard-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .cert-item {
    padding: 10px;
    gap: 8px;
  }

  .cert-meta {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .cert-status {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .cert-code {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .cert-users {
    font-size: 0.75rem;
    margin-top: 4px;
    padding-top: 6px;
  }

  .tenant-card {
    padding: 12px;
  }
.knowledge-ref-link {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .dashboard-side {
    max-width: 100%;
  }

  .certifications-list {
    gap: 8px;
  }

  .impl-card {
    padding: 10px;
    gap: 6px;
  }

  .impl-status-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .impl-card-type-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .impl-card-summary {
    font-size: 0.75rem;
  }
}

/* Execution Details Modal */
.execution-modal {
  max-width: 900px !important;
  width: 90vw !important;
  min-width: 300px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
}

.modal-header h3 {
  margin: 0;
  flex: 1;
  padding-right: 16px;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  padding: 8px;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  pointer-events: auto;
}

.btn-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.btn-close i,
.btn-close [data-lucide] {
  pointer-events: none;
}

.modal-body {
  display: grid;
  gap: 20px;
  width: 100%;
  padding: 0;
}

.execution-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item.full-width {
  grid-column: 1 / -1;
}

.info-item label {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

.info-item span {
  color: #111827;
  font-weight: 600;
}

.info-item .exec-status {
  width: fit-content;
}

#execution-status {
  width: fit-content;
  align-self: flex-start;
}

.execution-steps h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: #111827;
}

.execution-details-content {
  display: grid;
  gap: 24px;
  padding: 0;
  width: 100%;
}

#execution-steps-list {
  display: grid;
  gap: 10px;
}

.execution-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.execution-step > div {
  min-width: 0;
}

.execution-step div[style*="flex: 1"] {
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.step-content {
  flex: 1;
  display: grid;
  gap: 4px;
}

.step-description {
  color: #111827;
  font-weight: 600;
}

.step-webhook,
.step-wait {
  color: #6b7280;
  font-size: 0.85rem;
}

.list-card.clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.list-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .execution-info {
    grid-template-columns: 1fr;
  }
  
  .execution-step {
    padding: 10px;
    gap: 8px;
  }
  
  .execution-details-content {
    gap: 16px;
  }
}

.dashboard-vertical-timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 170px;
}

.dashboard-vertical-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 150px;
  width: 2px;
  background: linear-gradient(180deg, #bfdbfe 0%, #93c5fd 100%);
}

.timeline-event-row {
  position: relative;
}

.timeline-date-left {
  position: absolute;
  left: -170px;
  top: 10px;
  width: 130px;
  display: flex;
  justify-content: flex-end;
}

.timeline-date-left-empty {
  min-height: 72px;
}

.timeline-date-badge {
  width: 72px;
  min-height: 72px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 6px 14px rgba(30, 64, 175, 0.08);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #1e3a8a;
}

.timeline-date-badge-month {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.timeline-date-badge-day {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.timeline-date-badge-year {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  line-height: 1.1;
}

.dashboard-date-badge {
  width: 74px;
  min-height: 74px;
  padding: 6px 8px;
  gap: 2px;
  border-radius: 12px;
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.dashboard-date-badge--empty {
  opacity: 0.9;
}

.timeline-event-card,
.timeline-now-marker {
  position: relative;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.timeline-event-card::before,
.timeline-now-marker::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #2563eb;
  background: #fff;
}

.timeline-event-card.is-future {
  border-color: #e5e7eb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.timeline-event-card.is-future::before {
  border-color: #94a3b8;
  background: #ffffff;
}

.timeline-event-card.is-created {
  border-color: #d1d5db;
  background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
}

.timeline-event-card.is-created::before {
  border-color: #6b7280;
  background: #f3f4f6;
}

.timeline-event-card.is-warning {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
}

.timeline-event-card.is-warning::before {
  border-color: #ea580c;
  background: #ffedd5;
}

.timeline-event-card.is-important {
  border-left-width: 4px;
  border-left-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.08);
}

.timeline-event-card.is-editable {
  cursor: pointer;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.timeline-event-card.is-editable:hover,
.timeline-event-card.is-editable:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  border-color: #94a3b8;
  outline: none;
}

.timeline-event-card.is-completed {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
}

.timeline-event-card.is-completed::before {
  border-color: #16a34a;
  background: #dcfce7;
}

.timeline-event-card.is-overdue {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff1f2 0%, #fee2e2 100%);
}

.timeline-event-card.is-overdue::before {
  border-color: #dc2626;
  background: #fee2e2;
}

.timeline-now-marker {
  border-color: #f59e0b;
  background: #fffbeb;
}

.timeline-now-marker::before {
  border-color: #f59e0b;
  background: #f59e0b;
}

.timeline-event-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.timeline-event-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.timeline-event-date {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.timeline-event-subtitle {
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.5;
}

.timeline-event-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.timeline-calendar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.timeline-calendar-action:hover,
.timeline-calendar-action:focus-visible {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.14);
  outline: none;
}

.timeline-calendar-action i {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.timeline-calendar-action svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.timeline-month-separator {
  position: relative;
  margin: 10px 0 6px;
  padding-top: 10px;
  border-top: 1px solid #bfdbfe;
}

.timeline-month-separator > span {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .dashboard-vertical-timeline {
    padding-left: 22px;
  }

  .dashboard-vertical-timeline::before {
    left: 9px;
  }

  .timeline-date-left {
    position: static;
    width: auto;
    justify-content: flex-start;
    margin: 0 0 6px 0;
  }

  .timeline-date-left-empty {
    min-height: 0;
    margin: 0;
  }

  .timeline-date-badge {
    width: 64px;
    min-height: 64px;
    border-radius: 10px;
  }

  .timeline-date-badge-day {
    font-size: 20px;
  }

  .timeline-event-card::before,
  .timeline-now-marker::before {
    left: -19px;
  }
}

.location-supplier-grid {
  margin-top: 16px;
  margin-bottom: 26px;
  row-gap: 16px;
}

.location-supplier-grid .entra-card {
  border-radius: 12px;
  padding: 14px;
}

.location-supplier-grid .entra-card.has-critical-ribbon {
  position: relative;
  overflow: visible;
  border-color: #fed7aa;
  box-shadow: 0 8px 18px rgba(154, 52, 18, 0.08);
}

.supplier-critical-wrap {
  position: absolute;
  top: -1px;
  right: 14px;
  left: auto;
  display: inline-flex;
  pointer-events: none;
  z-index: 2;
}

.supplier-critical-wrap-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 12px;
  border-radius: 0 0 10px 10px;
  border: 1px solid #fdba74;
  border-top: 0;
  background: linear-gradient(180deg, #fff8ef 0%, #fff1dd 100%);
  font-size: 11px;
  letter-spacing: 0.03em;
  font-weight: 700;
  color: #9a3412;
  text-transform: uppercase;
}

.dashboard-card.process-card.has-critical-ribbon {
  position: relative;
  overflow: visible;
  border-color: #fed7aa;
  box-shadow: 0 8px 18px rgba(154, 52, 18, 0.08);
}

.dashboard-card.has-critical-ribbon {
  position: relative;
  overflow: visible;
  border-color: #fed7aa;
  box-shadow: 0 8px 18px rgba(154, 52, 18, 0.08);
}

.dashboard-card.process-card.process-card--internal {
  border-left: 4px solid #166534;
  background: linear-gradient(180deg, #ffffff 0%, #f3fbf6 100%);
}

.dashboard-card.process-card.process-card--outsourced {
  border-left: 4px solid #9a3412;
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
}

.process-card-title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.process-card-priority-icon {
  width: 15px;
  height: 15px;
  color: #b91c1c;
  flex: 0 0 auto;
}

.location-supplier-grid .entra-card-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.location-supplier-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.location-supplier-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.location-supplier-card-icon i {
  width: 15px;
  height: 15px;
}

.supplier-critical-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  cursor: pointer;
}

.supplier-critical-switch-label {
  font-weight: 600;
  color: #334155;
}

.supplier-critical-switch {
  position: relative;
  width: 48px;
  height: 28px;
  display: inline-block;
  flex: 0 0 auto;
}

.supplier-critical-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.supplier-critical-switch-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.supplier-critical-switch-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.supplier-critical-switch input:checked + .supplier-critical-switch-slider {
  background: #0ea5e9;
}

.supplier-critical-switch input:checked + .supplier-critical-switch-slider::before {
  transform: translateX(20px);
}

.supplier-critical-switch input:focus-visible + .supplier-critical-switch-slider {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.abbr-help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: help;
  outline: none;
  z-index: 0;
}

.abbr-help-tooltip-content {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 300px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
  z-index: 10000;
}

.abbr-help-tooltip-content::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.abbr-help-tooltip:hover .abbr-help-tooltip-content,
.abbr-help-tooltip:focus .abbr-help-tooltip-content,
.abbr-help-tooltip:focus-visible .abbr-help-tooltip-content {
  opacity: 1;
  visibility: visible;
}

.abbr-help-tooltip:hover,
.abbr-help-tooltip:focus,
.abbr-help-tooltip:focus-visible {
  z-index: 10001;
}

.competency-cv-card {
  border: 1px solid var(--border, #d8e0ea);
  border-radius: 12px;
  background: var(--dashboard-card-gradient, linear-gradient(180deg, #ffffff 0%, #f8fbff 100%));
  padding: 0;
  overflow: hidden;
}

.competency-person-group {
  border: 0;
}

.competency-person-group > summary {
  list-style: none;
}

.competency-person-group > summary::-webkit-details-marker {
  display: none;
}

.competency-person-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 12px;
}

.competency-person-summary-chevron {
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.competency-person-group[open] .competency-person-summary-chevron {
  transform: rotate(180deg);
}

.competency-cv-person {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
  width: 100%;
}

.competency-cv-person .user-identity {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 10px;
}

.competency-cv-person .user-identity-avatar,
.competency-cv-person .user-identity-initials {
  width: 64px !important;
  height: 64px !important;
  border-radius: 999px;
}

.competency-cv-person .user-identity-label {
  font-size: 16px;
  font-weight: 700;
}

.competency-person-list {
  border-top: 1px solid #e2e8f0;
  background: #fff;
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.competency-person-item-card {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.competency-person-item-main {
  display: grid;
  gap: 8px;
}

.competency-person-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.competency-person-item-type {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  font-weight: 700;
}

.competency-person-item-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.competency-person-item-date {
  flex-shrink: 0;
}

.competency-person-item-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.competency-person-item-title {
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.4;
}

.competency-person-item-description {
  font-size: 12px;
  color: #334155;
  line-height: 1.45;
  white-space: pre-wrap;
}

.competency-person-item-validity {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.competency-person-item-evidence {
  display: grid;
  gap: 6px;
}

.competency-edit-btn {
  justify-self: flex-start;
}

.competency-evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.competency-evidence-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #d6e2ef;
  background: #ffffff;
  font-size: 12px;
  color: #0f172a;
  text-decoration: none;
}

.competency-evidence-item:hover,
.competency-evidence-item:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
  outline: none;
}

.competency-evidence-item--plain {
  background: #f8fafc;
}

@media (max-width: 900px) {
  .competency-person-item-head {
    align-items: flex-start;
  }
}

.handbook-dynamic-blocks {
  display: grid;
  gap: 10px;
}

.hb-dynamic-card-list {
  display: grid;
  gap: 8px;
}

.hb-dynamic-item-card {
  border: 1px solid var(--border, #d8e0ea);
  border-radius: 10px;
  background: var(--dashboard-card-gradient, linear-gradient(180deg, #ffffff 0%, #f8fbff 100%));
  padding: 10px;
  display: grid;
  gap: 7px;
}

.hb-dynamic-card-primary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  font-weight: 700;
}

.hb-dynamic-card-primary-value {
  font-size: 14px;
  line-height: 1.35;
  color: #0f172a;
  font-weight: 700;
}

.hb-dynamic-card-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
}

.hb-dynamic-card-field {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 8px;
  min-width: 0;
}

.hb-dynamic-card-field-label {
  font-size: 11px;
  color: #475569;
  font-weight: 600;
  margin-bottom: 2px;
}

.hb-dynamic-card-field-value {
  font-size: 12px;
  color: #1e293b;
  line-height: 1.35;
  word-break: break-word;
}

.hb-dynamic-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  padding: 10px;
}

.hb-risk-status-groups {
  display: grid;
  gap: 10px;
}

.hb-risk-status-group {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #f8fbff;
  overflow: hidden;
}

.hb-risk-status-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  color: #1e293b;
}

.hb-risk-status-summary::-webkit-details-marker {
  display: none;
}

.hb-risk-status-group[open] > .hb-risk-status-summary {
  border-bottom: 1px solid #dbe4ef;
  background: #eef4fa;
}

.hb-risk-group-list {
  padding: 10px 12px 12px;
}

.hb-risk-item-card {
  gap: 10px;
}

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

.hb-risk-value-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.hb-risk-fields {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
