/* ============================================
   OKIO - Modern App Shell Design
   Inspired by front_example.js (Tailwind-style)
   Built on Bulma with custom overrides
   ============================================ */

/* ---- Color Palette ---- */
:root {
  /* Dark sidebar */
  --sidebar-bg: #0f172a;         /* slate-900 */
  --sidebar-bg-dark: #020617;    /* slate-950 */
  --sidebar-border: #1e293b;     /* slate-800 */
  --sidebar-text: #cbd5e1;       /* slate-300 */
  --sidebar-text-muted: #64748b; /* slate-500 */
  --sidebar-text-white: #ffffff;

  /* Main content */
  --content-bg: #f8fafc;         /* slate-50 */
  --content-surface: #ffffff;
  --content-border: #e2e8f0;     /* slate-200 */
  --content-text: #1e293b;       /* slate-800 */
  --content-text-muted: #64748b; /* slate-500 */

  /* Accent colors */
  --accent-blue: #3b82f6;        /* blue-500 */
  --accent-blue-light: #93c5fd;  /* blue-300 */
  --accent-blue-dark: #1e3a5f;   /* blue-900 */
  --accent-emerald: #10b981;     /* emerald-500 */
  --accent-emerald-light: #d1fae5;
  --accent-amber: #f59e0b;       /* amber-500 */
  --accent-amber-light: #fffbeb; /* amber-50 */
  --accent-orange: #f97316;      /* orange-500 */
  --accent-red: #ef4444;         /* red-500 */

  /* Legacy compat */
  --color-primary: #001378;
  --color-primary-light: #0395FB;
  --color-secondary: #00A7D2;
  --color-background: #f8fafc;
  --color-light: #ffffff;
}

/* ---- Global Reset ---- */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--content-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  overflow: hidden;
}

/* ============================================
   APP SHELL - 3-Column Layout
   ============================================ */

.app-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ---- Left Sidebar ---- */
.left-sidebar {
  width: 320px;
  min-width: 320px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--sidebar-text-white);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

.sidebar-logo img {
  height: 28px;
  width: 28px;
}

.sidebar-logo .logo-icon {
  color: var(--accent-blue);
  font-size: 1.25rem;
}

.sector-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(30, 58, 95, 0.5);
  color: var(--accent-blue-light);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.sidebar-context {
  padding: 1rem;
  background-color: var(--sidebar-bg-dark);
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-context-label {
  font-size: 0.7rem;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.sidebar-context-title {
  color: var(--sidebar-text-white);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-progress {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-progress-bar {
  flex: 1;
  height: 8px;
  background-color: var(--sidebar-border);
  border-radius: 9999px;
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background-color: var(--accent-blue);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.sidebar-progress-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-blue-light);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
  border-radius: 4px;
}

.nav-group {
  margin-bottom: 1.5rem;
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--sidebar-text);
  margin-bottom: 0.25rem;
}

.nav-item:hover {
  background-color: rgba(30, 41, 59, 0.5);
  color: #e2e8f0;
}

.nav-item.is-active {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--accent-blue-light);
  font-weight: 500;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-item-status {
  font-size: 0.875rem;
}

.status-approved { color: var(--accent-emerald); }
.status-in-progress { color: var(--accent-amber); }
.status-warning { color: var(--accent-orange); }
.status-pending { color: var(--sidebar-text-muted); }
.status-draft { color: var(--accent-amber); }
.status-active { color: var(--accent-emerald); }

.nav-item-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  border: 1px solid;
}

.badge-approved {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}

.badge-in-progress {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
}

.badge-warning {
  background-color: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.2);
  color: var(--accent-orange);
}

.badge-pending {
  background-color: var(--sidebar-border);
  border-color: var(--sidebar-border);
  color: var(--sidebar-text-muted);
}

/* ---- PM Advisory Card (above user card) ---- */
.sidebar-pm-section {
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.pm-advisory-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(23, 37, 84, 0.4);
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(30, 58, 138, 0.5);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pm-advisory-card:hover {
  background: rgba(30, 58, 138, 0.3);
  border-color: rgba(59, 130, 246, 0.3);
}

.pm-advisory-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
}

.pm-advisory-avatar .online-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  background: #34d399;
  border: 2px solid var(--sidebar-bg);
  border-radius: 50%;
}

.pm-advisory-card .pm-advisory-info {
  flex: 1;
  min-width: 0;
}

.pm-advisory-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sidebar-text-white);
  margin-bottom: 0.125rem;
  transition: color 0.15s;
}

.pm-advisory-card:hover .pm-advisory-name {
  color: #60a5fa;
}

.pm-advisory-hint {
  font-size: 10px;
  color: var(--sidebar-text-muted);
  line-height: 1.4;
}

/* ---- Sidebar Footer / User Card ---- */
.sidebar-footer {
  margin-top: auto;
  background-color: var(--sidebar-bg-dark);
  border-top: 1px solid var(--sidebar-border);
  padding: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-text);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--sidebar-text-white);
  line-height: 1.2;
}

.user-info-role {
  font-size: 10px;
  color: var(--sidebar-text-muted);
  font-weight: 500;
}

.sidebar-footer-actions {
  display: flex;
  gap: 0.25rem;
  color: var(--sidebar-text-muted);
}

.sidebar-footer-actions a,
.sidebar-footer-actions button {
  background: none;
  border: none;
  color: var(--sidebar-text-muted);
  padding: 0.375rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1rem;
}

.sidebar-footer-actions a:hover,
.sidebar-footer-actions button:hover {
  color: var(--sidebar-text-white);
  background: var(--sidebar-border);
}

.sidebar-footer-actions .logout-btn:hover {
  color: #f87171;
}

/* Legacy pm-card (keep for compat) */
.pm-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background-color: var(--sidebar-bg);
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--sidebar-border);
}

.pm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue-light);
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.pm-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sidebar-text-white);
  margin-bottom: 0.125rem;
}

.pm-message {
  font-size: 10px;
  color: var(--sidebar-text-muted);
  line-height: 1.4;
}

/* ---- Main Content Area ---- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.main-header {
  background-color: var(--content-surface);
  border-bottom: 1px solid var(--content-border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.main-header-left .breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--content-text-muted);
  margin-bottom: 0.25rem;
}

.breadcrumb-trail a {
  color: var(--content-text-muted);
  text-decoration: none;
}

.breadcrumb-trail a:hover {
  color: var(--accent-blue);
}

.breadcrumb-trail .breadcrumb-current {
  color: var(--accent-blue);
  font-weight: 500;
}

.breadcrumb-sep {
  font-size: 0.625rem;
  color: var(--content-text-muted);
}

.main-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--content-text);
  margin: 0;
}

.main-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.autosave-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--content-text-muted);
  background-color: #f1f5f9;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
}

.btn-audit-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid;
}

.btn-audit-toggle.is-active {
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text-white);
  border-color: var(--sidebar-bg);
}

.btn-audit-toggle:not(.is-active) {
  background-color: var(--content-surface);
  color: #475569;
  border-color: #cbd5e1;
}

.btn-audit-toggle:not(.is-active):hover {
  background-color: #f8fafc;
}

/* Alert Strip */
.alert-strip {
  background-color: var(--accent-amber-light);
  border-bottom: 1px solid #fde68a;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
}

.alert-strip-icon {
  color: #d97706;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.alert-strip-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #78350f;
}

.alert-strip-text {
  font-size: 0.75rem;
  color: #92400e;
  margin-top: 0.125rem;
}

/* Scrollable Content Body */
.main-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  background-color: var(--content-bg);
}

.main-body-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* Section Header within content */
.content-section-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--content-border);
  margin-bottom: 2rem;
}

.content-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--content-text);
}

.content-section-description {
  font-size: 0.875rem;
  color: var(--content-text-muted);
  margin-top: 0.25rem;
}

/* Field Blocks (card-style form fields) */
.field-block {
  background-color: var(--content-surface);
  border: 1px solid var(--content-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: border-color 0.15s ease;
  margin-bottom: 2rem;
}

.field-block:hover {
  border-color: var(--accent-blue-light);
}

.field-block-header {
  padding: 1rem;
  background-color: rgba(248,250,252,0.5);
  border-bottom: 1px solid var(--content-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-block-title {
  font-weight: 600;
  color: var(--content-text);
  font-size: 0.95rem;
}

.field-block-body {
  padding: 1.25rem;
}

/* Bottom Action Bar */
.main-footer {
  background-color: var(--content-surface);
  border-top: 1px solid var(--content-border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--content-text-muted);
}

.footer-info-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-amber);
}

.footer-info strong {
  color: #475569;
}

.footer-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  background: var(--content-surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background-color: #f8fafc;
}

.btn-primary-dark {
  padding: 0.5rem 1.25rem;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text-white);
  border: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-primary-dark:hover {
  background-color: #1e293b;
}

/* ---- Right Sidebar (Audit Panel) ---- */
.right-sidebar {
  width: 320px;
  min-width: 320px;
  background-color: var(--content-surface);
  border-left: 1px solid var(--content-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: -4px 0 15px -3px rgba(0,0,0,0.05);
  z-index: 10;
  transition: margin-right 0.3s ease, opacity 0.3s ease;
}

.right-sidebar.is-hidden {
  margin-right: -320px;
  opacity: 0;
  pointer-events: none;
}

.audit-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--content-border);
  background-color: #f8fafc;
}

.audit-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: var(--content-text);
  font-size: 1rem;
}

.audit-header-title .fa-shield-alt,
.audit-header-title .fa-shield {
  color: var(--accent-emerald);
}

.audit-header-description {
  font-size: 0.75rem;
  color: var(--content-text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.audit-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.audit-body::-webkit-scrollbar {
  width: 4px;
}

.audit-body::-webkit-scrollbar-thumb {
  background: var(--content-border);
  border-radius: 4px;
}

/* Audit Timeline Items */
.audit-item {
  position: relative;
  padding-left: 1rem;
  border-left: 2px solid var(--content-border);
  margin-bottom: 1.5rem;
}

.audit-item:first-child {
  border-left-color: var(--accent-emerald);
}

.audit-item-dot {
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #cbd5e1;
}

.audit-item:first-child .audit-item-dot {
  background-color: var(--accent-emerald);
}

.audit-item-time {
  font-size: 0.75rem;
  color: var(--content-text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.audit-item-text {
  font-size: 0.875rem;
  color: var(--content-text);
}

.audit-item-text strong {
  font-weight: 700;
}

.audit-item-detail {
  font-size: 0.75rem;
  color: var(--content-text-muted);
  margin-top: 0.25rem;
  background-color: #f1f5f9;
  padding: 0.375rem;
  border-radius: 4px;
  border: 1px solid var(--content-border);
}

.audit-item-alert {
  background-color: #fef2f2;
  color: #991b1b;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  border: 1px solid #fecaca;
  font-weight: 500;
}

.audit-item-quote {
  font-size: 0.75rem;
  color: var(--content-text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

.audit-footer {
  padding: 1rem;
  border-top: 1px solid var(--content-border);
}

.btn-audit-export {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #065f46;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-audit-export:hover {
  background-color: #d1fae5;
}

.audit-export-hint {
  font-size: 10px;
  text-align: center;
  color: var(--content-text-muted);
  margin-top: 0.5rem;
}

/* Audit Change Details Styling */
.audit-changes-list {
  list-style: none;
  margin: 0.75rem 0 0 0;
  padding: 0;
}

.audit-change-item {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background-color: #f8fafc;
  border-radius: 6px;
  border: 1px solid var(--content-border);
  font-size: 0.8rem;
}

.audit-change-item:last-child {
  margin-bottom: 0;
}

/* Field name header for changes */
.change-field-name {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  color: var(--content-text);
}

.change-field-name i {
  font-size: 0.7rem;
  color: var(--accent-blue);
}

/* Text field changes (old → new) */
.change-text-values {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: 1.125rem;
}

.change-old,
.change-new {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.change-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--content-text-muted);
}

.change-value {
  font-size: 0.8rem;
  color: var(--content-text);
  background-color: white;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  line-height: 1.4;
}

.change-old .change-value {
  border-left: 3px solid #fca5a5;
  background-color: #fef2f2;
}

.change-new .change-value {
  border-left: 3px solid #86efac;
  background-color: #f0fdf4;
}

/* Read more/less links */
.read-more,
.read-less {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  margin-left: 0.25rem;
}

.read-more:hover,
.read-less:hover {
  text-decoration: underline;
}

/* Simple changes (choice/fk) */
.change-simple {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.change-simple i {
  font-size: 0.7rem;
  color: var(--accent-blue);
}

.badge-old,
.badge-new {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.badge-old {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  text-decoration: line-through;
}

.badge-new {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* M2M changes */
.change-m2m {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.change-m2m-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.change-m2m-header i {
  font-size: 0.7rem;
  color: var(--content-text-muted);
}

.change-m2m-add .change-m2m-header i {
  color: var(--accent-emerald);
}

.change-m2m-remove .change-m2m-header i {
  color: var(--accent-red);
}

.change-m2m-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-left: 1.125rem;
}

.change-m2m-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid;
  font-style: normal;
}

.badge-added {
  background-color: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.badge-removed {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.change-m2m-section {
  margin-top: 0.5rem;
}

.change-m2m-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--content-text-muted);
  display: block;
  margin-bottom: 0.375rem;
  margin-left: 1.125rem;
}

/* Different audit item types */
.audit-item-create .audit-item-dot {
  background-color: var(--accent-emerald) !important;
}

.audit-item-update .audit-item-dot {
  background-color: var(--accent-blue) !important;
}

.audit-item-delete .audit-item-dot {
  background-color: var(--accent-red) !important;
}

/* ============================================
   TRADITIONAL LAYOUT (non-app-shell pages)
   ============================================ */

/* Override Bulma primary navbar for app-shell pages */
.app-shell .navbar {
  display: none;
}

/* Keep navbar for non-app pages */
.navbar.is-primary {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e293b 100%) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar.is-primary .navbar-item:hover,
.navbar.is-primary .navbar-link:hover {
  background-color: rgba(59, 130, 246, 0.2);
}

.navbar-dropdown {
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-top: 3px solid var(--accent-blue);
  overflow: hidden;
}

/* ============================================
   BULMA COMPONENT OVERRIDES (New Palette)
   ============================================ */

/* Buttons */
.button {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.15s ease;
}

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

.button.is-primary {
  background: var(--accent-blue);
  border-color: transparent;
  color: white;
}

.button.is-primary:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.button.is-success {
  background: var(--sidebar-bg);
  border-color: transparent;
  color: white;
}

.button.is-success:hover {
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.button.is-info {
  background: var(--accent-blue);
  border-color: transparent;
}

.button.is-info:hover {
  background: #2563eb;
}

.button.is-warning {
  background: var(--accent-amber);
}

.button.is-danger {
  background: var(--accent-red);
}

/* Cards */
.card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--content-surface);
  border: 1px solid var(--content-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Tables */
.table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table thead th {
  background: var(--sidebar-bg);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.table.is-hoverable tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

/* Tags */
.tag {
  border-radius: 8px;
  font-weight: 500;
}

.tag.is-primary {
  background: var(--accent-blue);
  color: white;
}

.tag.is-info {
  background: var(--accent-blue);
  color: white;
}

.tag.is-success {
  background: var(--accent-emerald);
  color: white;
}

/* Forms */
.input, .textarea, .select select {
  border-radius: 8px;
  border-color: #cbd5e1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .textarea:focus, .select select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.field .label {
  font-weight: 600;
  color: var(--content-text);
  margin-bottom: 0.5rem;
}

/* Box */
.box {
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--content-border);
}

/* Notifications */
.notification {
  border-radius: 8px;
  border-left: 4px solid;
}

.notification .delete {
  background-color: rgba(10, 10, 10, 0.3);
}

.notification .delete:hover {
  background-color: rgba(10, 10, 10, 0.5);
}

/* Breadcrumb */
.breadcrumb a {
  color: var(--content-text-muted);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--accent-blue);
}

/* Progress */
.progress {
  height: 0.5rem;
  border-radius: 9999px;
}

/* Pagination */
.pagination-link, .pagination-previous, .pagination-next {
  border-radius: 8px;
}

.pagination-link.is-current {
  background: var(--sidebar-bg);
  border-color: transparent;
}

/* Hero sections - modernized */
.hero.is-primary {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e3a5f 100%);
}

.hero.is-info {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
}

/* ============================================
   CHECKBOX LIST (Removed - see new definition below at line 2320)
   ============================================ */

/* Field help links */
.field .help a {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  background: var(--sidebar-bg);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  margin-top: 0.375rem;
  transition: all 0.15s ease;
}

.field .help a:hover {
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: white;
}

.field .help a::before {
  content: "+";
  font-size: 1.1rem;
  margin-right: 0.375rem;
  font-weight: bold;
}

/* ============================================
   RAT FORM - App Shell Layout
   ============================================ */

.rat-form-page {
  width: 100%;
}

/* In app-shell mode, the sidebar IS the tab navigation */
.rat-form-layout {
  display: block;
}

.rat-form-sidebar {
  display: none; /* Hidden in app-shell since left-sidebar handles nav */
}

.rat-form-content {
  min-width: 0;
}

.rat-form-content .tab-pane .box {
  margin-bottom: 0;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* ============================================
   RAT DETAIL - Section Panels (modernized)
   ============================================ */

.section-panel {
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  background: white;
  border: 1px solid var(--content-border);
  transition: border-color 0.15s ease;
}

.section-panel:hover {
  border-color: var(--accent-blue-light);
}

.panel-header {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e3a5f 100%);
  padding: 1rem 1.25rem;
}

.panel-body {
  padding: 1.25rem;
}

.inner-box {
  padding: 1rem;
  margin-bottom: 1.25rem;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid var(--accent-blue);
}

.inner-box:last-child {
  margin-bottom: 0;
}

.inner-box h3 {
  color: var(--content-text);
}

/* ============================================
   VECTOR SEARCH
   ============================================ */

.vector-search-input {
  position: relative;
}

.vector-search-input .icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--content-text-muted);
  z-index: 1;
}

.vector-search-input .input {
  padding-left: 2.25rem;
}

/* ============================================
   HOME PAGE
   ============================================ */

.home-hero-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* Progress Arrow Styles */
.progress-arrow-container {
  overflow-x: auto;
  padding: 1rem 0;
}

.progress-arrow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  gap: 0;
}

.progress-step {
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.progress-step:hover {
  transform: translateY(-4px);
}

.step-arrow {
  position: relative;
  background: #f8fafc;
  border: 2px solid var(--content-border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  min-width: 160px;
  text-align: center;
  transition: all 0.2s ease;
}

.progress-step.complete .step-arrow {
  background: #ecfdf5;
  border-color: var(--accent-emerald);
}

.progress-step.incomplete .step-arrow {
  background: var(--accent-amber-light);
  border-color: var(--accent-amber);
}

.step-icon { margin-bottom: 0.75rem; }
.progress-step.complete .step-icon { color: var(--accent-emerald); }
.progress-step.incomplete .step-icon { color: var(--accent-amber); }

.step-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--content-text);
  margin-bottom: 0.5rem;
}

.step-status { font-size: 0.85rem; }

.arrow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  color: #cbd5e1;
  font-size: 1.5rem;
  transition: color 0.2s ease;
}

.arrow-connector.complete { color: var(--accent-emerald); }

/* ============================================
   ALERT STYLES
   ============================================ */

.alert-debug { color: black; background-color: white; border-color: #d6e9c6; }
.alert-error { color: #b94a48; background-color: #f2dede; border-color: #eed3d7; }

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page-background {
  background: linear-gradient(135deg, var(--content-bg) 0%, #e8f0f7 100%);
  min-height: 100vh;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

.floating-orb { animation: float 6s ease-in-out infinite; }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-panel {
  animation: fadeInUp 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media screen and (max-width: 1200px) {
  .left-sidebar {
    width: 260px;
    min-width: 260px;
  }
  .right-sidebar {
    width: 280px;
    min-width: 280px;
  }
  .right-sidebar.is-hidden {
    margin-right: -280px;
  }
}

@media screen and (max-width: 1024px) {
  .right-sidebar {
    display: none;
  }
  .btn-audit-toggle {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .app-shell {
    flex-direction: column;
    height: auto;
    overflow: auto;
  }
  
  .left-sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 60vh;
  }
  
  .main-content {
    overflow: auto;
  }
  
  .main-body {
    padding: 1rem;
  }
  
  .main-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  
  .main-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .progress-arrow-steps {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  .arrow-connector { display: none; }
  .progress-step { flex: 0 0 calc(50% - 1rem); }
}

@media screen and (max-width: 480px) {
  .progress-step { flex: 0 0 100%; }
  .step-arrow { padding: 1rem; min-width: auto; }
}

/* ============================================
   SELECT MULTIPLE
   ============================================ */

.select.is-multiple select {
  min-height: 200px;
  padding: 0.75rem;
  border: 1px solid var(--content-border);
  border-radius: 8px;
}

.select.is-multiple select option {
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 4px;
}

.select.is-multiple select option:checked {
  background: var(--accent-blue);
  color: white;
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scope spin animation only to chat widget elements, not entire divs/containers */
.chat-widget .is-loading { animation: spin 1s linear infinite; }

/* ============================================
   RAT LIST CARDS (modernized)
   ============================================ */

.rat-card-header {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e3a5f 100%);
}

/* ============================================
   CHAT WIDGET - Línea Directa DPO (Enterprise)
   ============================================ */

.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Toggle Button (Blue Corporate) ---- */
.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid white;
  background: #1d4ed8;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(29, 78, 216, 0.3);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chat-toggle:hover {
  transform: scale(1.05);
  background: #1e40af;
}

.chat-toggle.is-active {
  display: none;
}

/* ---- Notification Badge ---- */
.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid white;
}

/* ---- Chat Panel (Enterprise DPO Hotline) ---- */
.chat-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 360px;
  max-height: calc(100vh - 3rem);
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--content-border);
  z-index: 9999;
}

@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-panel[style*="flex"] {
  animation: chatSlideIn 0.2s ease-out;
}

/* ---- Header (Dark Corporate with Blue Accent) ---- */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--sidebar-bg);
  color: white;
  flex-shrink: 0;
  border-bottom: 4px solid #2563eb;
  position: relative;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header-icon-box {
  width: 40px;
  height: 40px;
  background: var(--sidebar-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  color: #60a5fa;
  font-size: 1.1rem;
}

.chat-header-title {
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.chat-header-subtitle {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
}

.chat-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s;
}

.chat-close:hover {
  color: white;
}

/* ---- Messages Area ---- */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #f8fafc;
}

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem;
}

/* Encrypted Channel Indicator */
.chat-system-badge {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.chat-system-badge span {
  background: #e2e8f0;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ---- Message Bubbles ---- */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

/* PM Author line with avatar + badge */
.chat-msg-author-line {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
  margin-left: 0.25rem;
}

.chat-msg-pm-avatar {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
  font-weight: 700;
}

.chat-msg-author {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
}

.chat-msg-pm-badge {
  font-size: 9px;
  color: #3b82f6;
  font-weight: 600;
  background: #eff6ff;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
}

.chat-msg-bubble {
  padding: 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg-time {
  font-size: 9px;
  color: #94a3b8;
  margin-top: 0.25rem;
  padding: 0 0.25rem;
  font-weight: 500;
}

/* Own messages (right, dark) */
.chat-msg-own {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-own .chat-msg-bubble {
  background: #1e293b;
  color: white;
  border-radius: 16px;
  border-top-right-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Other / PM messages (left, white card) */
.chat-msg-other {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-msg-other .chat-msg-bubble {
  background: white;
  color: #475569;
  border: 1px solid var(--content-border);
  border-radius: 16px;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Campfire messages (left, subtle warm) */
.chat-msg-campfire {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-msg-campfire .chat-msg-bubble {
  background: white;
  color: #475569;
  border: 1px solid var(--content-border);
  border-radius: 16px;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ---- Input Area ---- */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--content-border);
  background: white;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--content-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
  background: #f1f5f9;
}

.chat-input:focus {
  border-color: #2563eb;
  background: white;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.chat-input:disabled {
  opacity: 0.5;
}

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-send:hover {
  background: #1d4ed8;
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Screenshot Button ---- */
.chat-screenshot-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--content-border);
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chat-screenshot-btn:hover {
  background: #e2e8f0;
  color: #2563eb;
  border-color: #2563eb;
}

.chat-screenshot-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Screenshot Preview Bar ---- */
.chat-screenshot-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--content-border);
  background: #f8fafc;
}

.chat-screenshot-thumb {
  max-width: 120px;
  max-height: 68px;
  border-radius: 6px;
  border: 1px solid var(--content-border);
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-screenshot-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: background 0.15s;
  flex-shrink: 0;
}

.chat-screenshot-remove:hover {
  background: #dc2626;
}

/* ---- Screenshot in Message Bubble ---- */
.chat-msg-screenshot {
  display: block;
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  margin-top: 0.5rem;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: opacity 0.15s;
}

.chat-msg-screenshot:hover {
  opacity: 0.85;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
    max-height: 70vh;
  }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 300px;
  max-width: 400px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: var(--content-text);
}

/* Success Toast */
.toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.toast-success .toast-icon {
  color: var(--accent-emerald);
}

/* Info Toast */
.toast.toast-info {
  border-left: 4px solid var(--accent-blue);
}

.toast.toast-info .toast-icon {
  color: var(--accent-blue);
}

/* Error Toast */
.toast.toast-error {
  border-left: 4px solid var(--accent-red);
}

.toast.toast-error .toast-icon {
  color: var(--accent-red);
}

/* Warning Toast */
.toast.toast-warning {
  border-left: 4px solid var(--accent-amber);
}

.toast.toast-warning .toast-icon {
  color: var(--accent-amber);
}

/* ============================================
   CUSTOM BADGES & INDICATORS
   ============================================ */

/* Badge for Assignees in Sidebar Navigation */
.badge-assignee {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--sidebar-bg-dark);
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
}

/* Badge for Sensitive Data */
.badge-sensitive {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: #fee;
  color: #c00;
  border: 1px solid #fcc;
  margin-left: 8px;
}

/* Badge for Maybe Sensitive Data */
.badge-maybe {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  margin-left: 8px;
}

/* Status Dot for Footer */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-dot-amber {
  background-color: var(--accent-amber);
}

.status-dot-green {
  background-color: var(--accent-emerald);
}

.status-dot-red {
  background-color: var(--accent-red);
}

.status-dot-blue {
  background-color: var(--accent-blue);
}

/* ============================================
   CHECKBOX LIST - 2 COLUMN GRID
   ============================================ */

/* Containers */
.checkbox-list,
.checkbox-list-single {
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid var(--content-border);
  border-radius: 8px;
  padding: 0.75rem;
  background-color: var(--content-surface);
}

/* Apply grid to the inner div (Django renders DIVs, not ULs) */
.field-block-body .checkbox-list > div {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 0.75rem !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Single column variant for legal bases */
.field-block-body .checkbox-list-single > div {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.field-block-body .checkbox-list-single > div > div {
  margin-bottom: 0.75rem !important;
}

.field-block-body .checkbox-list-single > div > div:last-child {
  margin-bottom: 0 !important;
}

@media (max-width: 768px) {
  .field-block-body .checkbox-list > div {
    grid-template-columns: 1fr !important;
  }
}

/* Checkbox list items - explicit positioning */
.field-block-body .checkbox-list > div > div {
  margin-bottom: 0 !important;
  display: block !important;
}

.field-block-body .checkbox-list-single > div > div {
  margin-bottom: 0.75rem !important;
  display: block !important;
}

.field-block-body .checkbox-list label,
.field-block-body .checkbox-list-single label {
  display: flex !important;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--content-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--content-surface);
  width: 100%;
  box-sizing: border-box;
}

.field-block-body .checkbox-list label:hover,
.field-block-body .checkbox-list-single label:hover {
  background-color: var(--content-bg);
  border-color: var(--accent-blue);
}

.field-block-body .checkbox-list label input[type="checkbox"],
.field-block-body .checkbox-list label input[type="radio"],
.field-block-body .checkbox-list-single label input[type="checkbox"],
.field-block-body .checkbox-list-single label input[type="radio"] {
  margin-right: 0.75rem;
  flex-shrink: 0;
  accent-color: var(--accent-blue);
  width: 1.125rem;
  height: 1.125rem;
}

/* Ensure checked items stand out */
.field-block-body .checkbox-list input[type="checkbox"]:checked + span,
.field-block-body .checkbox-list label:has(input[type="checkbox"]:checked),
.field-block-body .checkbox-list-single input[type="checkbox"]:checked + span,
.field-block-body .checkbox-list-single label:has(input[type="checkbox"]:checked) {
  font-weight: 600;
  color: var(--accent-blue);
}

/* ============================================
   ALERT STRIP VARIANTS
   ============================================ */

/* Base alert strip already exists, adding type variants */
.alert-strip-warning {
  background-color: var(--accent-amber-light);
  border-color: #fcd34d;
}

.alert-strip-warning .alert-strip-icon {
  color: #d97706;
}

.alert-strip-danger {
  background-color: #fee;
  border-color: #fca5a5;
}

.alert-strip-danger .alert-strip-icon {
  color: var(--accent-red);
}

.alert-strip-info {
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

.alert-strip-info .alert-strip-icon {
  color: var(--accent-blue);
}

.alert-strip-success {
  background-color: var(--accent-emerald-light);
  border-color: #86efac;
}

.alert-strip-success .alert-strip-icon {
  color: var(--accent-emerald);
}

/* ============================================
   DOSSIER CARD SYSTEM — rat_detail.html
   Style inspired by example_rat_view.js
   ============================================ */

/* Container of all dossier sections */
.dossier-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---- Card base ---- */
.dossier-card {
  background-color: var(--content-surface);
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,0.6);
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  overflow: hidden;
}

.dossier-card-header {
  padding: 1.125rem 2rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dossier-card-title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--content-text);
  letter-spacing: -0.01em;
  margin: 0;
}

.dossier-card-body {
  padding: 1.75rem 2rem;
}

/* ---- Icon circles ---- */
.dossier-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.dossier-icon-blue   { background-color: #eff6ff; color: #2563eb; }
.dossier-icon-indigo { background-color: #eef2ff; color: #4f46e5; }
.dossier-icon-emerald{ background-color: #ecfdf5; color: #059669; }
.dossier-icon-cyan   { background-color: #ecfeff; color: #0891b2; }
.dossier-icon-violet { background-color: #f5f3ff; color: #7c3aed; }
.dossier-icon-slate  { background-color: #f1f5f9; color: #475569; }
.dossier-icon-amber  { background-color: #fffbeb; color: #d97706; }

/* ---- Field labels & values ---- */
.dossier-field-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.375rem;
}

.dossier-field-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--content-text);
  line-height: 1.55;
  margin: 0;
}

/* ---- 2-column grid ---- */
.dossier-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 640px) {
  .dossier-grid-2 { grid-template-columns: 1fr; }
}

/* ---- Metadata row (dates etc) ---- */
.dossier-meta-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
}

.dossier-meta-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.dossier-meta-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.6875rem;
  flex-shrink: 0;
}

.dossier-meta-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  line-height: 1.2;
}

.dossier-meta-value {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
}

/* ---- Subsections (spacing within a card body) ---- */
.dossier-subsection {
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid #f8fafc;
}

.dossier-subsection:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

/* ---- Responsibility layout ---- */
.dossier-responsibility-layout {
  display: flex;
  gap: 2.5rem;
}

@media (max-width: 640px) {
  .dossier-responsibility-layout { flex-direction: column; gap: 1.25rem; }
}

.dossier-org-block {
  flex: 1;
  background-color: #f8fafc;
  border-radius: 10px;
  padding: 1.125rem;
  border: 1px solid #f1f5f9;
}

.dossier-org-chip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.625rem;
}

.dossier-org-initials {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: var(--content-surface);
  border: 1px solid var(--content-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-blue);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.dossier-org-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--content-text);
}

.dossier-owners-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.dossier-owner-row {}

.dossier-owner-value {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--content-text);
}

/* ---- Legal basis boxes ---- */
.dossier-legal-box {
  border-radius: 10px;
  padding: 1.125rem;
  border: 1px solid;
}

.dossier-legal-green {
  background-color: rgba(236,253,245,0.5);
  border-color: rgba(167,243,208,0.6);
}

.dossier-legal-red {
  background-color: rgba(254,242,242,0.5);
  border-color: rgba(254,202,202,0.6);
}

.dossier-legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--content-surface);
  border: 1px solid;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.dossier-legal-badge-green {
  border-color: #bbf7d0;
  color: #065f46;
}

.dossier-legal-badge-red {
  border-color: #fecaca;
  color: #991b1b;
}

/* ---- Prose box (justification) ---- */
.dossier-prose-box {
  background-color: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  font-size: 0.8125rem;
  color: var(--content-text);
  line-height: 1.6;
  margin-top: 0.375rem;
}

.dossier-prose-empty {
  color: #94a3b8;
}

/* ---- Data inventory grid ---- */
.dossier-data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

@media (max-width: 900px) {
  .dossier-data-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .dossier-data-grid { grid-template-columns: 1fr; }
}

.dossier-data-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: background-color 0.12s, border-color 0.12s;
}

.dossier-data-chip:hover {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

.dossier-data-chip-sensitive {
  background-color: #fef2f2;
  border-color: #fecaca !important;
}

.dossier-chip-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.6875rem;
}

.dossier-chip-icon-blue { background-color: #eff6ff; color: #2563eb; }
.dossier-chip-icon-red  { background-color: #fef2f2; color: #dc2626; }

.dossier-chip-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dossier-chip-badge-sensitive {
  margin-left: auto;
  font-size: 0.5625rem;
  background-color: #dc2626;
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.dossier-chip-badge-mandatory {
  font-size: 0.6rem;
  background-color: #e0e7ff;
  color: #3730a3;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- Bearer rows ---- */
.dossier-bearer-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  background-color: #f8fafc;
  border-radius: 10px;
  padding: 0.875rem;
  border: 1px solid #f1f5f9;
}

.dossier-bearer-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--content-text);
  margin-bottom: 0.125rem;
}

.dossier-bearer-desc {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
}

/* ---- Dossier table ---- */
.dossier-table-wrapper {
  border: 1px solid var(--content-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.dossier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.dossier-table thead {
  background-color: #f8fafc;
  border-bottom: 1px solid var(--content-border);
}

.dossier-table thead th {
  padding: 0.625rem 1.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  text-align: left;
}

.dossier-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

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

.dossier-table tbody tr:hover {
  background-color: #fafafa;
}

.dossier-table tbody td {
  padding: 0.75rem 1.25rem;
  color: var(--content-text);
  vertical-align: middle;
}

.dossier-table-empty {
  background-color: rgba(248,250,252,0.5);
}

.dossier-table-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 1.5rem 0;
  text-align: center;
}

/* ---- Tags / chips ---- */
.dossier-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.dossier-tag {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.dossier-tag-green {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.dossier-tag-amber {
  background-color: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

/* ---- State badges in header ---- */
.dossier-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid;
}

.dossier-state-active {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.dossier-state-draft {
  background-color: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.dossier-state-disabled {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* ---- Empty text ---- */
.dossier-empty-text {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin: 0.375rem 0 0 0;
  font-style: italic;
}
