:root {
  --bg: #0c1018;
  --surface: #121824;
  --surface-2: #182132;
  --surface-3: #202b40;
  --border: #29344a;
  --text: #eef3fb;
  --muted: #94a3b8;
  --quiet: #63708a;
  --accent: #4f7cff;
  --success: #21c997;
  --warning: #f5a623;
  --danger: #ff5470;
  --violet: #a78bfa;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 232px;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.brand,
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.brand-icon,
.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
}

.brand-sub,
.user-chip span {
  display: block;
  margin-top: 2px;
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}

.nav-title {
  margin: 12px 10px 4px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(79, 124, 255, 0.13);
  color: var(--text);
}

.nav-item i {
  width: 18px;
  color: var(--accent);
  font-size: 18px;
}

.nav-item b {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 11px;
}

.main {
  min-height: 100vh;
  margin-left: 232px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 24, 36, 0.96);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  flex: 1;
  margin: 0;
  font-size: 18px;
}

.mobile-menu {
  display: none;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 34vw);
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--quiet);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.content {
  padding: 24px;
}

.btn,
.icon-button,
.mobile-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
}

.btn.ghost,
.icon-button,
.mobile-menu {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.btn.danger {
  background: rgba(255, 84, 112, 0.14);
  color: var(--danger);
}

.icon-button {
  width: 36px;
  padding: 0;
}

.stats-grid,
.insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.insights {
  grid-template-columns: 1.05fr 1fr 1fr;
}

.stat,
.panel,
.table-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 20px;
}

.stat span,
.panel-title {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
}

.stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.stat > i {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: currentColor;
  font-size: 34px;
  opacity: 0.18;
}

.stat.accent { color: var(--accent); }
.stat.success { color: var(--success); }
.stat.warning { color: var(--warning); }
.stat.danger { color: var(--danger); }

.panel {
  padding: 18px;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}

.legend,
.activity,
.bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-row,
.activity-row,
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.legend-row span,
.activity-row strong {
  color: var(--text);
}

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

.bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 28px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.table-panel {
  overflow: hidden;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.workflow-card {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  gap: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.workflow-head {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.workflow-head i {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(79, 124, 255, 0.14);
  color: var(--accent);
  font-size: 22px;
}

.workflow-head h2 {
  margin: 0;
  font-size: 17px;
}

.workflow-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.workflow-card > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  line-height: 1.45;
}

.workflow-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.handover-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.table-head h2 {
  margin: 0;
  font-size: 16px;
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-tabs button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.status-tabs button.active {
  border-color: rgba(79, 124, 255, 0.5);
  background: rgba(79, 124, 255, 0.14);
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--surface-2);
}

.asset-tag,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.asset-tag {
  padding: 4px 9px;
  background: rgba(79, 124, 255, 0.14);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.badge {
  padding: 4px 10px;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.deployed { background: rgba(33, 201, 151, 0.13); color: var(--success); }
.badge.available { background: rgba(79, 124, 255, 0.13); color: var(--accent); }
.badge.maintenance { background: rgba(245, 166, 35, 0.14); color: var(--warning); }
.badge.retired { background: rgba(99, 112, 138, 0.18); color: var(--muted); }
.badge.broken { background: rgba(255, 84, 112, 0.13); color: var(--danger); }
.badge.active { background: rgba(33, 201, 151, 0.13); color: var(--success); }
.badge.inactive { background: rgba(99, 112, 138, 0.18); color: var(--muted); }

.asset-title strong {
  display: block;
}

.asset-title span {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 12px;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(33, 201, 151, 0.16);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.person-cell strong,
.person-cell small {
  display: block;
}

.person-cell small,
.muted {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions button {
  width: 30px;
  height: 30px;
}

.empty {
  padding: 42px;
  color: var(--quiet);
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: var(--quiet);
}

#page-buttons {
  display: flex;
  gap: 6px;
}

#page-buttons button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

#page-buttons button.active {
  background: var(--accent);
  color: white;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
}

.modal-backdrop[hidden],
.drawer[hidden] {
  display: none;
}

.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head,
.modal-foot,
.drawer-head,
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2,
.drawer-head h2 {
  margin: 0;
  font-size: 17px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

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

.field input,
.field select,
.field textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  text-transform: none;
  letter-spacing: 0;
}

.field textarea {
  min-height: 84px;
  padding-top: 10px;
  resize: vertical;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  align-self: end;
  color: var(--muted);
  font-weight: 700;
}

.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.modal-foot,
.drawer-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  display: flex;
  width: min(420px, 100%);
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.drawer-head {
  justify-content: flex-start;
}

.drawer-head .icon-button {
  margin-left: auto;
}

.drawer-head p {
  margin: 4px 0 0;
  color: var(--quiet);
}

.drawer-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(79, 124, 255, 0.14);
  color: var(--accent);
  font-size: 24px;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 18px;
}

.detail-section {
  margin-bottom: 22px;
}

.detail-section h3 {
  margin: 0 0 10px;
  color: var(--quiet);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row strong {
  color: var(--text);
  text-align: right;
}

.linked-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.linked-row strong {
  color: var(--text);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  transform: translateY(20px);
  opacity: 0;
  min-width: 220px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--success);
  color: white;
  font-weight: 800;
  transition: 180ms ease;
  pointer-events: none;
}

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

@media (max-width: 1040px) {
  .stats-grid,
  .insights,
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 12px;
  }

  .topbar h1 {
    min-width: calc(100% - 52px);
  }

  .search {
    order: 3;
    width: 100%;
  }

  .content {
    padding: 14px;
  }

  .stats-grid,
  .insights,
  .workflow-grid,
  .handover-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .table-head,
  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  table {
    min-width: 760px;
  }

  #assets-table,
  #users-table,
  #recent-table {
    overflow-x: auto;
  }
}

@media print {
  .sidebar,
  .topbar,
  .workflow-card:not(:nth-child(2)),
  #print-handover,
  .toast,
  .btn,
  .filters-bar,
  .status-tabs {
    display: none !important;
  }

  body,
  .main,
  .content {
    margin: 0;
    padding: 0;
    background: white !important;
    color: black !important;
  }

  .workflow-grid,
  .stats-grid,
  .insights,
  .table-panel {
    display: block !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .workflow-card,
  .stat,
  .panel,
  .table-panel {
    border: 1px solid #ddd !important;
    color: black !important;
    background: white !important;
    margin-bottom: 20px !important;
    page-break-inside: avoid;
  }

  .field input,
  .field textarea,
  .field select {
    border-color: #999 !important;
    background: white !important;
    color: black !important;
  }
}

/* ==========================================================================
   PREMIUM ENTERPRISE LIGHT MODE THEME OVERRIDES
   ========================================================================= */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
  --quiet: #64748b;
  --accent: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --violet: #8b5cf6;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Smooth transition for theme switching */
body {
  transition: background-color 0.25s ease, color 0.25s ease;
}

.sidebar,
.topbar,
.panel,
.stat,
.table-panel,
.workflow-card,
.filters-bar,
.compliance-card,
.doc-card,
.audit-row,
.field input,
.field select,
.field textarea,
.linked-row {
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

/* Adjustments for light theme specific details */
:root[data-theme="light"] .nav-item:hover,
:root[data-theme="light"] .nav-item.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.94);
}

:root[data-theme="light"] .asset-tag {
  background: rgba(37, 99, 235, 0.09);
}

:root[data-theme="light"] .person-avatar {
  background: rgba(16, 185, 129, 0.12);
}

/* ==========================================================================
   ADVANCED LIFECYCLE, GOVERNANCE & TICKETING WIDGETS
   ========================================================================= */

/* Progress Bars */
.progress-bar {
  display: block;
  height: 8px;
  width: 100%;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamic Filters Bar */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filters-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--quiet);
}

.filters-bar select {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 10px;
  outline: 0;
  font-size: 13px;
  cursor: pointer;
}

/* Compliance Governance Cards */
.compliance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.compliance-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 124px;
}

.compliance-card h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quiet);
}

.compliance-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 10px;
}

.compliance-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
}

.compliance-status {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.compliance-status.excellent { background: rgba(33, 201, 151, 0.13); color: var(--success); }
.compliance-status.warning { background: rgba(245, 166, 35, 0.14); color: var(--warning); }
.compliance-status.danger { background: rgba(255, 84, 112, 0.13); color: var(--danger); }

/* Asset Timeline Node View */
.timeline-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  padding-left: 20px;
  margin: 12px 4px;
}

.timeline-feed::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-node::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

.timeline-node.registration::before { background: var(--violet); }
.timeline-node.return::before { background: var(--success); }
.timeline-node.update::before { background: var(--warning); }

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--quiet);
}

.timeline-meta strong {
  color: var(--muted);
  font-weight: 600;
}

.timeline-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

/* Document Upload Drag-and-Drop Area */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 140px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  color: var(--muted);
}

.dropzone:hover {
  border-color: var(--accent);
  background: rgba(79, 124, 255, 0.03);
  color: var(--text);
}

.dropzone i {
  font-size: 38px;
  color: var(--accent);
}

.dropzone strong {
  font-size: 14px;
  margin-bottom: 2px;
}

.dropzone span {
  font-size: 12px;
  color: var(--quiet);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.doc-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.doc-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: rgba(167, 139, 250, 0.14);
  color: var(--violet);
  border-radius: var(--radius);
  font-size: 20px;
  flex-shrink: 0;
}

.doc-details h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  word-break: break-all;
}

.doc-details span {
  display: block;
  font-size: 11px;
  color: var(--quiet);
  margin-top: 4px;
  text-transform: uppercase;
}

.doc-details p {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.doc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Audit Log List Feed */
.audit-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.audit-row {
  display: grid;
  grid-template-columns: 140px 140px 1fr 150px;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.audit-row:last-child {
  border-bottom: 0;
}

.audit-row:hover {
  background: var(--surface-2);
}

.audit-time {
  color: var(--quiet);
  font-family: monospace;
}

.audit-actor {
  font-weight: 700;
  color: var(--muted);
}

.audit-action-badge {
  display: inline-block;
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text);
  width: fit-content;
}

.audit-details {
  color: var(--text);
  font-weight: 500;
}

/* Warnings and Alerts Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 84, 112, 0.12);
  border: 1px solid rgba(255, 84, 112, 0.25);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 18px;
  color: var(--danger);
  font-weight: 600;
}

.alert-banner i {
  font-size: 20px;
}

/* Speedometer/Risk Meter custom drawing */
.risk-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.risk-level-badge {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: 999px;
  margin-top: -30px;
}

.risk-level-badge.low { background: rgba(33, 201, 151, 0.16); color: var(--success); }
.risk-level-badge.medium { background: rgba(245, 166, 35, 0.16); color: var(--warning); }
.risk-level-badge.high { background: rgba(255, 84, 112, 0.16); color: var(--danger); }

/* Theme Selector style in Topbar */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Modal Steps indicator */
.modal-steps {
  display: flex;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--quiet);
}

.step-indicator.active {
  color: var(--accent);
}

.step-indicator.completed {
  color: var(--success);
}

.step-num {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 11px;
}

/* Responsive grid adaptations */
@media (max-width: 1200px) {
  .compliance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .compliance-grid,
  .doc-grid {
    grid-template-columns: 1fr;
  }
  .audit-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
  }
}

/* =========================================================================
   AENEXA PREMIUM GLASSMORPHIC LOGIN SYSTEM
   ========================================================================= */
body.login-mode {
  background: radial-gradient(circle at 10% 20%, rgb(12, 16, 24) 0%, rgb(18, 24, 36) 90.2%);
}

.login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display:grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 12, 20, 0.7);
  backdrop-filter: blur(20px);
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(18, 24, 36, 0.85);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  padding: 40px;
  text-align: left;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 8px 24px rgba(79, 124, 255, 0.4);
}

.login-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text);
}

.login-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.login-field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-field input {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s;
}

.login-field input:focus {
  border-color: var(--accent);
}

/* =========================================================================
   IDLE SESSION TIMEOUT OVERLAY
   ========================================================================= */
.idle-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(24px);
  padding: 24px;
}

.idle-modal {
  width: min(400px, 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 30px;
  text-align: center;
}

.idle-modal h2 {
  margin: 15px 0 8px;
  font-size: 18px;
  font-weight: 800;
}

.idle-modal p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* =========================================================================
   GOVERNANCE ALERTS BELL DROPDOWN
   ========================================================================= */
.notification-dropdown {
  position: absolute;
  top: 46px;
  right: 0;
  width: 340px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1001;
  text-align: left;
  overflow: hidden;
  animation: slideDown 0.25s ease-out;
}

.notification-item {
  transition: background 0.2s;
}

.notification-item:hover {
  background: var(--surface-3);
}

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

/* =========================================================================
   SPINNER ANIMATIONS & UTILITIES
   ========================================================================= */
.animate-spin {
  animation: spin 1s linear infinite;
}

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

/* =========================================================================
   EXECUTIVE REPORTS PRINT OVERRIDES
   ========================================================================= */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  aside, .topbar, .filters-bar, .row-actions, .pagination, button {
    display: none !important;
  }
  .main {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .table-panel {
    border: none !important;
    box-shadow: none !important;
  }
  th, td {
    border-bottom: 1px solid #ddd !important;
    color: #000 !important;
  }
}
