:root {
  /* Dashboard Dark Theme Colors */
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 31, 49, 0.75);
  --bg-sidebar: #070a12;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;

  /* MetaMap Replica Canvas Colors (Clean Enterprise Look) */
  --mm-bg: #f7f9fc;
  --mm-card: #ffffff;
  --mm-border: #e2e8f0;
  --mm-text-dark: #0f172a;
  --mm-text-muted: #64748b;
  --mm-text-subtle: #94a3b8;
  --mm-primary: #3b82f6;
  --mm-primary-hover: #2563eb;
  --mm-primary-bg: #eff6ff;

  --mm-green: #10b981;
  --mm-green-bg: #10b981;
  --mm-green-light: #ecfdf5;
  --mm-red: #ef4444;
  --mm-red-bg: #ef4444;
  --mm-red-light: #fef2f2;
  --mm-yellow: #f59e0b;
  --mm-yellow-bg: #f59e0b;
  --mm-yellow-light: #fffbeb;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
}

/* Page Views Switcher & Utilities */
.hidden {
  display: none !important;
}

.page-view {
  display: none;
  min-height: 100vh;
}
.page-view.active:not(.hidden) {
  display: block;
}

/* ======================================================== */
/* VISTA 1: DASHBOARD LISTADO                               */
/* ======================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 1.8rem;
  background: rgba(99, 102, 241, 0.2);
  padding: 0.5rem;
  border-radius: 12px;
}

.brand-text h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--accent-primary);
  color: #fff;
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.dot.online {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.main-content {
  flex: 1;
  padding: 2rem;
  background-color: var(--bg-main);
  max-width: 1600px;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  font-size: 1.5rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.stat-info .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

.stat-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.filter-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent-primary);
}

.custom-select {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.data-table code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: monospace;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge.verified {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.badge.reviewneeded {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.badge.expired {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ======================================================== */
/* VISTA 2: METAMAP REPLICA OFICIAL                         */
/* ======================================================== */
#view-detail {
  background-color: var(--mm-bg);
  color: var(--mm-text-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 4rem;
}

/* Top Navigation Bar */
.mm-top-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--mm-border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-back-link {
  background: none;
  border: none;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s;
}

.btn-back-link:hover {
  color: var(--mm-primary);
}

.back-arrow {
  font-size: 1.2rem;
  line-height: 1;
}

.help-link {
  font-size: 0.85rem;
  color: #64748b;
  cursor: pointer;
}

/* Sub-tabs header */
.mm-sub-header {
  background: #ffffff;
  border-bottom: 1px solid var(--mm-border);
  padding: 0 2rem;
}

.mm-sub-tabs {
  display: flex;
  gap: 2rem;
}

.mm-sub-tab {
  background: none;
  border: none;
  padding: 0.85rem 0.5rem;
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mm-sub-tab.active {
  color: var(--mm-primary);
  border-bottom-color: var(--mm-primary);
}

/* Main Layout Container */
.mm-layout-container {
  max-width: 1500px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

/* Top Action Banner */
.mm-action-banner {
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.mm-status-box {
  background: var(--mm-green-bg);
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  min-width: 170px;
}

.mm-status-box.rejected {
  background: var(--mm-red-bg);
}

.mm-status-box.reviewneeded {
  background: var(--mm-yellow-bg);
}

.mm-status-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.mm-status-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 2px;
}

.mm-meta-item {
  display: flex;
  flex-direction: column;
}

.mm-meta-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mm-text-dark);
}

.mm-meta-value.mono {
  font-family: monospace;
}

.mm-meta-label {
  font-size: 0.75rem;
  color: var(--mm-text-muted);
  margin-top: 2px;
}

.mm-id-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-copy-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.btn-copy-icon:hover {
  opacity: 1;
}

.mm-banner-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-lock {
  border: 1px solid #fca5a5;
  color: #dc2626;
  background: #fef2f2;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.btn-mm-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}

.btn-mm-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Two-Column Workspace */
.mm-workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Left Profile Card */
.mm-profile-card {
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.mm-avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.mm-avatar-wrapper img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e2e8f0;
  background: #f1f5f9;
}

.mm-profile-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.mm-profile-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.mm-p-label {
  display: block;
  font-size: 0.75rem;
  color: var(--mm-text-muted);
  margin-bottom: 0.25rem;
}

.mm-p-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mm-text-dark);
  line-height: 1.3;
}

.mm-p-val {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mm-text-dark);
}

.mm-p-val.with-icon {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mm-p-val.mono {
  font-family: monospace;
  font-size: 0.8rem;
  word-break: break-all;
}

/* Right Details Area */
.mm-details-area {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Vertical Sub-tabs */
.mm-vertical-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mm-nav-pill {
  background: #f8fafc;
  border: 1px solid var(--mm-border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: #475569;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.mm-nav-pill:hover {
  background: #f1f5f9;
  color: var(--mm-text-dark);
}

.mm-nav-pill.active {
  background: #ffffff;
  border-color: var(--mm-primary);
  color: var(--mm-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

/* Tab Panes */
.mm-tab-panes {
  min-height: 500px;
}

.mm-pane {
  display: none;
}

.mm-pane.active {
  display: block;
}

.mm-subcard {
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  margin-bottom: 1.5rem;
}

.mm-subcard-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mm-text-dark);
  margin-bottom: 1.25rem;
}

/* 1. LOCATION PANE */
.mm-location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 1.5rem;
}

.mm-info-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.mm-row-icon {
  font-size: 1.1rem;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mm-row-content {
  display: flex;
  flex-direction: column;
}

.mm-row-label {
  font-size: 0.75rem;
  color: var(--mm-text-muted);
}

.mm-row-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mm-text-dark);
  margin-top: 2px;
}

.mm-field-item {
  margin-bottom: 1rem;
}

.mm-f-label {
  display: block;
  font-size: 0.75rem;
  color: var(--mm-text-muted);
  margin-bottom: 2px;
}

.mm-f-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mm-text-dark);
}

.mm-map-card {
  padding: 0;
  overflow: hidden;
  height: 360px;
}

.leaflet-map {
  width: 100%;
  height: 100%;
  min-height: 360px;
}

/* 2. DOCUMENTS PANE */
.mm-doc-header {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mm-doc-badge {
  background: #f1f5f9;
  border: 1px solid var(--mm-border);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.mm-doc-subtitle {
  font-size: 0.85rem;
  color: var(--mm-primary);
  font-weight: 500;
}

.mm-doc-grid {
  display: grid;
  grid-template-columns: 260px 1fr 1fr;
  gap: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.mm-doc-photos-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mm-photo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mm-photo-wrapper {
  position: relative;
  width: 100%;
  min-height: 150px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mm-photo-wrapper img {
  width: 100%;
  min-height: 140px;
  max-height: 220px;
  display: block;
  object-fit: contain;
  background: #f8fafc;
  transition: transform 0.2s ease;
}

.mm-photo-wrapper:hover img {
  transform: scale(1.02);
}

.zoom-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.mm-photo-wrapper:hover .zoom-badge {
  opacity: 1;
}

.mm-photo-label {
  font-size: 0.75rem;
  color: var(--mm-text-muted);
  margin-top: 0.4rem;
}

/* OCR Column */
.mm-ocr-col {
  padding: 0 1rem;
  border-left: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
}

.mm-ocr-item {
  margin-bottom: 0.9rem;
}

.ocr-val {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mm-text-dark);
}

.ocr-lbl {
  font-size: 0.7rem;
  color: var(--mm-text-muted);
}

.ocr-lbl.sub {
  margin-top: -0.4rem;
  margin-bottom: 0.8rem;
  display: block;
}

.mm-ocr-date-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.2rem;
}

.date-part {
  display: flex;
  flex-direction: column;
}

/* Checks Column */
.mm-checks-col {
  padding-left: 0.5rem;
}

.doc-valid-banner {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.doc-valid-banner .icon {
  font-size: 1.5rem;
  color: var(--mm-green);
}

.doc-valid-banner h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mm-green);
}

.doc-valid-banner p {
  font-size: 0.75rem;
  color: var(--mm-text-muted);
  margin-top: 2px;
}

.mm-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mm-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mm-text-dark);
  transition: background 0.15s;
}

.mm-check-row.failed-row {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.mm-check-text-wrapper {
  display: flex;
  flex-direction: column;
}

.mm-check-title {
  line-height: 1.3;
}

.mm-check-error-msg {
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 500;
  margin-top: 3px;
  line-height: 1.25;
}

.mm-check-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ecfdf5;
  color: var(--mm-green);
  border: 1px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  font-weight: 700;
}

.mm-check-circle.failed {
  background: #fef2f2;
  color: var(--mm-red);
  border-color: var(--mm-red);
}

/* 3. BIOMETRICS PANE */
.mm-bio-grid {
  display: grid;
  grid-template-columns: 500px 1fr;
  gap: 1.5rem;
}

.mm-bio-media-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mm-video-wrapper video {
  width: 100%;
  max-height: 280px;
  border-radius: 8px;
  background: #000;
  display: block;
}

/* 4. WATCHLISTS PANE */
.aml-header-badge {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.aml-header-badge .check-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ecfdf5;
  color: var(--mm-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.aml-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.aml-sub {
  font-size: 0.75rem;
  color: var(--mm-text-muted);
}

.aml-person-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.aml-name, .aml-dob {
  font-size: 0.9rem;
  font-weight: 700;
  display: block;
}

.aml-lbl {
  font-size: 0.7rem;
  color: var(--mm-text-muted);
}

.aml-action-buttons {
  display: flex;
  gap: 0.75rem;
}

.btn-aml-pill {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: default;
}

/* 5. DEVICE PANE */
.mm-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.mm-device-item {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}

.mm-device-item .icon {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.dev-label {
  font-size: 0.75rem;
  color: var(--mm-text-muted);
  margin-bottom: 0.2rem;
}

.dev-value {
  font-size: 0.95rem;
  color: var(--mm-text-dark);
}

.mm-raw-ua {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}

.mm-raw-ua code {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #475569;
  word-break: break-all;
}

/* 6. METADATA PANE */
.mm-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.mm-meta-card {
  background: #f8fafc;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}

.mm-meta-k {
  font-size: 0.75rem;
  color: var(--mm-text-muted);
  display: block;
}

.mm-meta-v {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mm-text-dark);
  word-break: break-all;
  font-family: monospace;
}

/* ======================================================== */
/* MODALES: LIGHTBOX & RAW JSON                             */
/* ======================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f8fafc;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
}

.json-actions {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.json-box {
  background: #0f172a;
  padding: 1.5rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  overflow: auto;
  max-height: 60vh;
}

/* Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.lightbox-backdrop.hidden {
  display: none;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 85vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-caption {
  color: #ffffff;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

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

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  background: #10b981;
  color: #ffffff;
}

.toast.error .toast-icon {
  background: #ef4444;
  color: #ffffff;
}

.toast.info .toast-icon {
  background: #3b82f6;
  color: #ffffff;
}

/* Print Stylesheet for PDF Export */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .page-view, .sidebar, .mm-top-nav, .mm-sub-header, .btn-mm-action, .btn-copy-icon {
    display: none !important;
  }
  #view-detail {
    display: block !important;
    padding: 0 !important;
  }
  .mm-pane {
    display: block !important;
    page-break-inside: avoid;
    margin-bottom: 2rem;
  }
  .mm-vertical-nav {
    display: none !important;
  }
  .mm-details-area {
    display: block !important;
  }
}

/* ==========================================
   PANTALLA DE LOGIN SEGURO (VIEW-LOGIN)
   ========================================== */
.login-view {
  min-height: 100vh;
  width: 100vw;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
              linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 1.5rem;
  box-sizing: border-box;
}

.login-view.active:not(.hidden) {
  display: flex !important;
}

.login-card-wrapper {
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.login-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.login-brand-titles h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.login-brand-titles .brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-header {
  margin-bottom: 1.75rem;
}

.login-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.login-header p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  opacity: 0.6;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 0.75rem 0.85rem 0.75rem 2.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  font-size: 0.9rem;
  color: #0f172a;
  background: #f8fafc;
  box-sizing: border-box;
  transition: all 0.2s ease;
  font-family: inherit;
}

.input-with-icon input:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.6;
  padding: 0.2rem;
  transition: opacity 0.2s;
}

.btn-toggle-pwd:hover {
  opacity: 1;
}

.login-error-box {
  background: #fef2f2;
  border: 1px solid #fecdd3;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-login-submit {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.btn-login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.login-disclaimer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* ==========================================
   TARJETA DE USUARIO EN SIDEBAR Y TOP NAV
   ========================================== */
.sidebar-user-card {
  margin-top: 0.85rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-logout-icon {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.3rem;
  border-radius: 0.35rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout-icon:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.mm-top-user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  margin-right: 0.75rem;
  font-size: 0.82rem;
}

.user-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-user-name {
  font-weight: 600;
  color: #334155;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout-link {
  background: none;
  border: none;
  color: #ef4444;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  transition: background 0.2s;
}

.btn-logout-link:hover {
  background: #fee2e2;
}

/* ==========================================
   ESTILOS DE TABLA DE AUDITORÍA
   ========================================== */
/* ==========================================
   ESTILOS DE TABLA DE AUDITORÍA Y USUARIOS (TEMA OSCURO)
   ========================================== */
.custom-input-sm {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
  background: var(--bg-card);
  min-width: 220px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.custom-input-sm:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.custom-input-sm::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.audit-badge.badge-view {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.audit-badge.badge-login {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.audit-badge.badge-logout {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.audit-badge.badge-failed {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.audit-badge.badge-admin {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.audit-resource-link {
  font-family: monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.audit-resource-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.audit-details-cell {
  font-size: 0.82rem;
  color: #cbd5e1;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-ip-cell {
  font-family: monospace;
  font-size: 0.8rem;
  color: #94a3b8;
}


