/* public/css/main.css — Estilos globales de la app (ERP corporativo sobrio) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ==========================================================================
   LAYOUT SHELL
   ========================================================================== */
#app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
#sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-sidebar);
  transition: width 0.3s;
  z-index: 100;
}

#sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  gap: 12px;
  background-color: var(--bg-sidebar-brand);
  flex-shrink: 0;
}

.sidebar-header img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebar.collapsed .sidebar-header h2 {
  display: none;
}

/* Marca del sidebar: nombre de la app + desarrollador */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.sidebar-brand-sub {
  font-size: 0.6rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

#sidebar.collapsed .sidebar-brand-sub {
  display: none;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 20px;
  color: var(--text-sidebar);
  text-decoration: none;
  gap: 12px;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  white-space: nowrap;
  border-left: 2px solid transparent;
}

.sidebar-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #fff;
}

.sidebar-item.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left: 2px solid var(--accent-secondary);
}

.sidebar-item i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  transition: color var(--transition-fast);
}

/* Ubicación activa: además de la línea coral, el icono cambia de color */
.sidebar-item.active > i,
.sidebar-item:hover > i {
  color: var(--accent-secondary);
}

.submenu-toggle i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  transition: color var(--transition-fast);
}

.submenu-toggle:hover > i {
  color: var(--accent-secondary);
}

/* Submenú abierto porque contiene la vista actual */
.has-submenu.parent-active > .submenu-toggle {
  border-left-color: var(--accent-secondary);
}
.has-submenu.parent-active > .submenu-toggle > i {
  color: var(--accent-secondary);
}

#sidebar.collapsed .sidebar-text {
  display: none;
}

/* Submenu caret rotation for button toggle */
.has-submenu.open > .submenu-toggle .submenu-caret {
  transform: rotate(90deg);
}

/* Grupos del menú (estilo plantilla de proyecto) */
.sidebar-group-label {
  padding: 16px 20px 6px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(215, 222, 228, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sidebar.collapsed .sidebar-group-label {
  display: none;
}

.submenu-caret {
  font-size: 0.65rem !important;
  width: auto !important;
  margin-left: auto;
  opacity: 0.55;
  transition: transform 0.15s ease-in-out;
}
.has-submenu.open > .sidebar-item .submenu-caret {
  transform: rotate(90deg);
}

/* Dropdown de usuario (header superior derecho) */
.user-menu-wrapper {
  position: relative;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
  user-select: none;
}
.user-profile:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-color);
}
.user-caret {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.15s ease-in-out;
}
.user-menu-wrapper.open .user-caret {
  transform: rotate(180deg);
}
#user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  overflow: hidden;
}
.user-menu-wrapper.open #user-dropdown {
  display: block;
  animation: fadeIn 0.15s ease;
}
.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-lighter);
}
.user-dropdown-meta {
  min-width: 0;
}
.user-dropdown-meta .name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-meta .role {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease-in-out;
}
.user-dropdown-item:last-child {
  border-bottom: none;
}
.user-dropdown-item:hover {
  background-color: var(--bg-hover);
}
.user-dropdown-item i {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
}
.user-dropdown-item.danger {
  color: var(--status-danger);
}
.user-dropdown-item.danger i {
  color: var(--status-danger);
}
.user-dropdown-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Submenu Toggle Button */
.submenu-toggle {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0.6rem 20px;
  color: var(--text-sidebar);
  text-decoration: none;
  gap: 12px;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  border-left: 2px solid transparent;
  display: flex;
  align-items: center;
}
.submenu-toggle:hover {
  background-color: var(--bg-sidebar-hover);
  color: #fff;
}
.submenu-toggle:focus {
  outline: none;
  background-color: var(--bg-sidebar-hover);
}

/* Submenu - Animated */
.has-submenu .submenu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  background-color: var(--bg-submenu);
  border-left: 2px solid var(--border-submenu);
  margin-left: 10px;
  padding-left: 8px;
  transition: max-height var(--transition-base), opacity var(--transition-fast), padding var(--transition-fast);
}
.has-submenu.open .submenu {
  max-height: 500px;
  opacity: 1;
  padding-top: 6px;
  padding-bottom: 6px;
}
.submenu .sidebar-item {
  padding: 0.5rem 12px 0.5rem 20px;
  font-size: 0.88rem;
  border-left: 2px solid transparent;
}
.submenu .sidebar-item:hover {
  border-left-color: var(--accent-secondary);
  background-color: var(--bg-submenu-hover);
}
.submenu .sidebar-item.active {
  background-color: var(--bg-submenu-hover);
  color: var(--text-sidebar-active);
  border-left-color: var(--accent-secondary);
}
.submenu .sidebar-item.active > i {
  color: var(--accent-secondary);
}
.submenu .sidebar-item:hover > i {
  color: var(--accent-secondary);
}

/* Parent active state (submenú con la vista actual dentro) */
.has-submenu.parent-active > .submenu-toggle {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-sidebar-active);
  border-left-color: var(--accent-secondary);
}

/* Collapsed Sidebar - Flyout Submenu */
#sidebar.collapsed .has-submenu {
  position: relative;
}
#sidebar.collapsed .has-submenu:hover .submenu,
#sidebar.collapsed .has-submenu:focus-within .submenu {
  display: block;
  position: absolute;
  left: 70px;
  top: 0;
  width: 220px;
  max-height: none;
  opacity: 1;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-sidebar);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  margin-left: 0;
  z-index: 200;
  animation: flyoutIn var(--transition-fast) ease-out;
}
#sidebar.collapsed .has-submenu:hover .submenu .sidebar-item,
#sidebar.collapsed .has-submenu:focus-within .submenu .sidebar-item {
  padding: 0.55rem 16px;
  border-left: none;
  white-space: nowrap;
}
#sidebar.collapsed .has-submenu:hover .submenu .sidebar-item:hover,
#sidebar.collapsed .has-submenu:focus-within .submenu .sidebar-item:hover {
  background-color: var(--bg-sidebar-hover);
}
#sidebar.collapsed .has-submenu:hover .submenu-toggle,
#sidebar.collapsed .has-submenu:focus-within .submenu-toggle {
  background-color: var(--bg-sidebar-hover);
  color: #fff;
}

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

#sidebar.collapsed .has-submenu .submenu {
  display: none;
}

/* Main Content Area */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
#header {
  height: 64px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-in-out;
}

.btn-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Views Container */
#content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease;
}
.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   UI COMPONENTS
   ========================================================================== */

/* Typography */
h1, h2, h3 { color: var(--text-strong); }
.page-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 20px; color: var(--text-strong); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--status-success); }
.text-danger { color: var(--status-danger); }
.text-warning { color: var(--status-warning); }
.text-info { color: var(--status-info); }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

/* Buttons — todos con superficie propia para no confundirse con el fondo de la app */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.btn i { font-size: 0.95em; }

.btn-primary {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.btn-secondary {
  background-color: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-main);
}

.btn-danger {
  background-color: var(--status-danger);
  border-color: var(--status-danger);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-danger:hover {
  background-color: var(--status-danger-hover);
  border-color: var(--status-danger-hover);
}

/* Botón terciario: sin fondo en reposo, superficie sólo al pasar el cursor */
.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background-color: var(--bg-lighter);
  border-color: var(--border-strong);
  color: var(--text-main);
}

/* Inputs */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}
.form-control {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
textarea.form-control {
  height: auto;
  padding: 8px 12px;
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.75; }
.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--focus-ring);
}
.form-control:disabled {
  background-color: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Tables — el encabezado lleva superficie propia (nunca el fondo de la app) */
.table-container {
  overflow-x: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th, td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
th {
  background-color: var(--bg-lighter);
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-strong);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background-color: var(--bg-hover); }

/* Compact table rows (Historial de Accesos) */
.table-compact th,
.table-compact td {
  padding: 4px 10px;
  font-size: 0.78rem;
  line-height: 1.25;
}
.table-compact th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* Badges */
.badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-block;
}
.badge.success { background-color: var(--status-success-soft); color: var(--status-success); }
.badge.warning { background-color: var(--status-warning-soft); color: var(--status-warning); }
.badge.danger { background-color: var(--status-danger-soft); color: var(--status-danger); }
.badge.info { background-color: var(--status-info-soft); color: var(--status-info); }
.badge.primary { background-color: var(--accent-primary-light); color: var(--accent-primary); }
.badge.secondary { background-color: var(--bg-lighter); color: var(--text-muted); }

/* SOP navigation structure */
.sop-subarea-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-primary);
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.sop-subarea-header:first-child { margin-top: 0; }
.sop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--bg-card);
}
.sop-item-code {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent-primary);
  background: var(--bg-lighter);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.sop-item-name { flex: 1; font-size: 0.9rem; }
.sop-item .btn { white-space: nowrap; }

/* Form builder: el formulario ocupa TODO el ancho del modal. La rejilla de 2 columnas
   vive dentro de cada sección (`.dyn-grid`), no en el contenedor del formulario. */
#dynamic-form { display: block; }
#dynamic-form .bitacora-link-banner { margin-bottom: 14px; }
/* Aviso de vínculo ticket → bitácora (FOR-302) */
.bitacora-link-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-primary-light);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  color: var(--accent-primary);
}
.form-section {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0 6px;
  margin: 8px 0 4px;
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.signature-pad {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: #fff;
}
.signature-pad canvas {
  display: block;
  width: 100%;
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
}
.signature-pad .btn { margin-top: 6px; }

/* Tablas dinámicas en formularios — full width, legibles */
.dyn-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 10px;
}
.dyn-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: auto;
}
.dyn-table th, .dyn-table td {
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}
.dyn-table th {
  background: var(--accent-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}
.dyn-table tbody tr:nth-child(even) { background: var(--bg-lighter); }
.dyn-table-input {
  width: 100%;
  min-width: 80px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.85rem;
  background: var(--bg-input);
  color: var(--text-main);
  box-sizing: border-box;
}
.plantilla-preview {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  background: var(--bg-card);
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background-color: rgba(23, 32, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease-in-out;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  transition: transform 0.15s ease-in-out;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 1.05rem; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background-color: var(--bg-sidebar);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.2s ease forwards;
}
.toast.success i { color: var(--status-success); }
.toast.error i { color: var(--status-danger); }
.toast.info i { color: var(--status-info); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Skeleton Loaders */
.skeleton-line {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-lighter) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Paneles KPI estilo tablero de proyecto (Dashboard) */
.page-head {
  margin-bottom: 20px;
}
/* Breadcrumbs unificados — mismo componente en toda la app (barra superior) */
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.crumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.crumbs a:hover {
  color: var(--accent-primary);
}
.crumbs .crumb-sep {
  opacity: 0.35;
  font-size: 0.6rem;
}
.crumbs > span:last-child {
  color: var(--text-main);
  font-weight: 600;
}

/* Breadcrumb dentro del header (barra global) */
#app-breadcrumb {
  margin: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
  font-size: 0.8rem;
}
#app-breadcrumb > a,
#app-breadcrumb > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
#app-breadcrumb > a:hover {
  color: var(--accent-secondary);
}
@media (max-width: 640px) {
  #app-breadcrumb { display: none; }
}
.panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: visible;
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
}
.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}
.panel-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-left: 1px solid var(--border-color);
  min-width: 0;
}
.stat:first-child {
  border-left: none;
}
.stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}
.stat-chip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-left: 8px;
  background: var(--bg-lighter);
  color: var(--accent-primary);
}
.stat-chip i {
  display: block;
}

/* KPI Info Tooltip */
.kpi-info {
  position: static; /* posicionamiento gestionado por JS al mostrar */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: help;
  border-radius: 50%;
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
  vertical-align: middle;
}
.kpi-info:hover,
.kpi-info:focus {
  color: var(--accent-primary);
  background: var(--accent-primary-light);
  border-color: var(--accent-primary);
  outline: none;
}

/* Tooltip bubble — se muestra por JS con clase .tooltip-open */
.kpi-tooltip-bubble {
  position: fixed;       /* fixed para salir de cualquier overflow/clip */
  z-index: 99999;
  width: 280px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.18), 0 2px 8px -2px rgba(0,0,0,0.1);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-main);
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
.kpi-tooltip-bubble.visible {
  opacity: 1;
  visibility: visible;
}
[data-theme="dark"] .kpi-tooltip-bubble {
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.5), 0 2px 8px -2px rgba(0,0,0,0.35);
}
/* Flecha del bubble */
.kpi-tooltip-bubble::before {
  content: '';
  position: absolute;
  border: 6px solid transparent;
}
.kpi-tooltip-bubble.arrow-down::before {
  top: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border-top-color: var(--border-color);
}
.kpi-tooltip-bubble.arrow-up::before {
  bottom: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border-bottom-color: var(--border-color);
}

/* Título del tooltip (primera parte hasta ":") */
.kpi-tooltip-title {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--accent-primary);
  margin-bottom: 4px;
  display: block;
}
.kpi-tooltip-body {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

/* Ensure stat-label doesn't clip tooltip */
.stat-label {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible !important;
}

/* Panel content area - ensure tooltips can overflow */
.panel > div:last-child,
.stat-grid {
  overflow: visible !important;
}

/* Lista de actividad (columna derecha del dashboard) */
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child {
  border-bottom: none;
}
.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: rgba(52, 81, 99, 0.08);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.activity-title {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
}
.activity-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FICHA DE CLIENTE (Customer Detail) — Estructura del ejemplo adaptada
   ========================================================================== */
.customer-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  padding: 22px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.customer-logo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 1.8rem;
  flex-shrink: 0;
}
.customer-meta {
  flex: 1;
  min-width: 260px;
}
.customer-meta h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}
.customer-meta .customer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.customer-info-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.customer-info-line span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.customer-info-line i {
  color: var(--accent-primary);
  font-size: 0.9rem;
}
.customer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

/* Tabs unificadas (ficha de cliente) — mismo componente que el resto de la app */
.customer-tabs,
.sop-tabs,
.db2-tabs,
.proc-tabs {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.customer-tabs::-webkit-scrollbar,
.sop-tabs::-webkit-scrollbar,
.db2-tabs::-webkit-scrollbar,
.proc-tabs::-webkit-scrollbar { display: none; }

.customer-tab-btn,
.sop-tab-btn,
.db2-tab,
.proc-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  margin-bottom: -1px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}
.customer-tab-btn:hover,
.sop-tab-btn:hover,
.db2-tab:hover,
.proc-tab:hover {
  color: var(--text-main);
  background-color: var(--bg-hover);
  border-bottom-color: var(--border-strong);
}
.customer-tab-btn.active,
.sop-tab-btn.active,
.db2-tab.active,
.proc-tab.active {
  color: var(--text-main);
  background-color: var(--bg-lighter);
  border-bottom-color: var(--accent-secondary);
}
.customer-tab-btn.active i,
.sop-tab-btn.active i,
.db2-tab.active i,
.proc-tab.active i { color: var(--accent-secondary); }

/* Subheader con filtros */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 60%;
}

/* ==========================================================================
   SOPs — Vistas de categorías y cards de procedimientos/formatos
   ========================================================================== */
.sop-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.sop-category-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 120px;
  padding: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}
.sop-category-card:hover {
  border-color: var(--accent-primary);
}
.sop-category-card .top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.sop-category-card .icon-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.sop-category-card .count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.sop-category-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.sop-category-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 4px 0 0 0;
  line-height: 1.3;
}

.sop-list-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: background-color 0.15s ease-in-out;
  align-items: flex-start;
}
.sop-list-card:hover {
  background-color: var(--bg-hover);
}
.sop-list-card .icon-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--bg-lighter);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.sop-list-card .body {
  flex: 1;
  min-width: 0;
}
.sop-list-card .body .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.sop-list-card .code {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sop-list-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sop-list-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sop-list-card .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   PyG — Professional Section Grouping for Estado de Resultados
   ========================================================================== */

/* Section container with colored sidebar indicator */
.pyl-section {
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
}

.pyl-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
}

.pyl-section-header .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #fff;
}

/* Section colors - Professional palette */
.pyl-section-operacion { border-left: 3px solid var(--status-success); }
.pyl-section-operacion .pyl-section-header { background-color: var(--status-success-soft); color: var(--status-success); }
.pyl-section-operacion .pyl-section-header .icon { background-color: var(--status-success); }

.pyl-section-inversion { border-left: 3px solid var(--accent-primary); }
.pyl-section-inversion .pyl-section-header { background-color: var(--accent-primary-light); color: var(--accent-primary); }
.pyl-section-inversion .pyl-section-header .icon { background-color: var(--accent-primary); }

.pyl-section-financiamiento { border-left: 3px solid var(--status-danger); }
.pyl-section-financiamiento .pyl-section-header { background-color: var(--status-danger-soft); color: var(--status-danger); }
.pyl-section-financiamiento .pyl-section-header .icon { background-color: var(--status-danger); }

.pyl-section-finales { border-left: 3px solid var(--status-info); }
.pyl-section-finales .pyl-section-header { background-color: var(--status-info-soft); color: var(--status-info); }
.pyl-section-finales .pyl-section-header .icon { background-color: var(--status-info); }

/* Section body */
.pyl-section-body {
  padding: 8px 0;
}

/* Row styles within sections - FULL ROW highlighting */
.pyl-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  transition: background-color 0.1s ease;
  border-radius: 6px;
  margin: 0 -8px;
  padding-left: 24px;
  padding-right: 24px;
}
.pyl-row:last-child { border-bottom: none; }
.pyl-row:hover { background-color: var(--bg-hover); }

.pyl-row-label {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-main);
  padding-left: 4px;
}

.pyl-row-label.indent { padding-left: 32px; font-size: 0.8rem; color: var(--text-muted); }

.pyl-row-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  min-width: 140px;
  white-space: nowrap;
}

.pyl-row.bold .pyl-row-label,
.pyl-row.bold .pyl-row-value { font-weight: 700; }

.pyl-row.subtotal .pyl-row-value { color: var(--accent-primary); }
.pyl-row.total .pyl-row-value { color: var(--text-main); font-weight: 700; }

/* FULL ROW BACKGROUND HIGHLIGHTS */
.pyl-row.key-metric {
  background-color: rgba(var(--accent-primary-rgb), 0.04);
}

/* Divider lines */
.pyl-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 8px 0;
}

/* ==========================================================================
   PyG — Professional Metric Highlights (Full Row Backgrounds)
   ========================================================================== */

.pyl-row {
  background-color: transparent;
  transition: background-color 0.15s ease;
}

/* Operación section - verde sutil full row */
.pyl-section-operacion .pyl-row.key-metric,
.pyl-section-operacion .pyl-row.subtotal,
.pyl-section-operacion .pyl-row.total {
  background: rgba(22, 163, 74, 0.06);
}
.pyl-section-operacion .pyl-row.key-metric .pyl-row-value,
.pyl-section-operacion .pyl-row.subtotal .pyl-row-value,
.pyl-section-operacion .pyl-row.total .pyl-row-value {
  color: #16a34a;
  font-weight: 700;
}

/* Ganancia Bruta - verde sutil full row */
.pyl-section-operacion .pyl-row.subtotal {
  background: rgba(22, 163, 74, 0.12);
}
.pyl-section-operacion .pyl-row.subtotal .pyl-row-value {
  color: #16a34a;
  font-weight: 700;
}

/* Gastos - rojo sutil full row */
.pyl-section-operacion .pyl-row.indent:not(.no-highlight),
.pyl-section-operacion .pyl-row.expense:not(.no-highlight) {
  background: rgba(220, 38, 38, 0.05);
}
.pyl-section-operacion .pyl-row.indent:not(.no-highlight) .pyl-row-value,
.pyl-section-operacion .pyl-row.expense:not(.no-highlight) .pyl-row-value {
  color: #dc2626;
  font-weight: 600;
}

/* No highlight rows - transparent background */
.pyl-row.no-highlight {
  background: transparent !important;
}
.pyl-row.no-highlight .pyl-row-value {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
}
.pyl-row.no-highlight .pyl-row-label {
  color: var(--text-muted) !important;
}

/* EBIT - verde sutil full row */
.pyl-section-operacion .pyl-row.total {
  background: rgba(22, 163, 74, 0.12);
}
.pyl-section-operacion .pyl-row.total .pyl-row-value {
  color: #16a34a;
  font-weight: 700;
}

/* Inversión - azul sutil full row */
.pyl-section-inversion .pyl-row.total,
.pyl-section-inversion .pyl-row.key-metric {
  background: rgba(37, 99, 235, 0.08);
}
.pyl-section-inversion .pyl-row.total .pyl-row-value,
.pyl-section-inversion .pyl-row.key-metric .pyl-row-value {
  color: #2563eb;
  font-weight: 700;
}

/* Financiamiento - rojo sutil full row */
.pyl-section-financiamiento .pyl-row.total,
.pyl-section-financiamiento .pyl-row.key-metric {
  background: rgba(220, 38, 38, 0.08);
}
.pyl-section-financiamiento .pyl-row.total .pyl-row-value,
.pyl-section-financiamiento .pyl-row.key-metric .pyl-row-value {
  color: #dc2626;
  font-weight: 700;
}

/* Resultado Final - azul sutil full row */
.pyl-section-finales .pyl-row.key-metric,
.pyl-section-finales .pyl-row.total {
  background: rgba(37, 99, 235, 0.1);
}
.pyl-section-finales .pyl-row.key-metric .pyl-row-value,
.pyl-section-finales .pyl-row.total .pyl-row-value {
  color: #2563eb;
  font-weight: 700;
}

/* Expense rows */
.pyl-row.expense {
  background: rgba(220, 38, 38, 0.05);
}
.pyl-row.expense .pyl-row-value {
  color: #dc2626;
}

/* Category titles (expense categories) - rojo sutil full row */
.pyl-row.category {
  background: rgba(220, 38, 38, 0.08);
}
.pyl-section-operacion .pyl-row.category .pyl-row-value,
.pyl-section-operacion .pyl-row.category .pyl-row-label {
  color: #dc2626;
  font-weight: 700;
}

/* Divider lines */
.pyl-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 8px 0;
}

/* ==========================================================================
   PIPELINE — Vista compacta sin scroll horizontal
   ========================================================================== */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  height: calc(100vh - 180px);
  min-height: 420px;
}
.pipeline-column {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.pipeline-header {
  padding: 8px 10px;
  border-bottom: 2px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.pipeline-header span:last-child {
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.65rem;
  color: #fff;
}
.pipeline-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
}
.pipeline-deal-card {
  padding: 8px;
  background-color: var(--surface-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: grab;
  transition: transform 0.1s, border-color 0.15s;
}
.pipeline-deal-card:hover {
  border-color: var(--accent-primary);
}
.pipeline-deal-card.dragging {
  opacity: 0.5;
}
.pipeline-deal-title {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 3px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pipeline-deal-client {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipeline-deal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
}

@media (max-width: 1400px) {
  .pipeline-board { grid-template-columns: repeat(3, minmax(0, 1fr)); height: auto; }
}
@media (max-width: 900px) {
  .pipeline-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .pipeline-board { grid-template-columns: 1fr; }
}

/* ==========================================================================
   UNIFIED FINANCIAL CARDS — Bank & Accounts (Compact Professional)
   ========================================================================== */
.financial-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.2s ease;
  border-left: 4px solid transparent;
  position: relative;
}
.financial-card:hover {
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.12), 
              0 4px 12px -4px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}
.financial-card:focus-within {
  box-shadow: var(--focus-ring);
}

/* Card type colors - left accent border */
.financial-card.bank { border-left-color: var(--status-success); }
.financial-card.account { border-left-color: var(--accent-primary); }
.financial-card.bank:hover { 
  box-shadow: 0 12px 28px -8px rgba(21, 128, 61, 0.25), 
              0 4px 12px -4px rgba(21, 128, 61, 0.15);
}
.financial-card.account:hover { 
  box-shadow: 0 12px 28px -8px rgba(30, 58, 95, 0.25), 
              0 4px 12px -4px rgba(30, 58, 95, 0.15);
}

/* Subtle glow on hover for the accent border */
.financial-card.bank:hover::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--status-success);
  opacity: 0.8;
}
.financial-card.account:hover::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent-primary);
  opacity: 0.8;
}

.financial-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--bg-lighter);
  border-bottom: 1px solid var(--border-color);
}
.financial-card-header .entity {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}
.financial-card.bank .entity i { color: var(--status-success); }
.financial-card.account .entity i { color: var(--accent-primary); }

.financial-card-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.financial-card-badge.success { background-color: var(--status-success-soft); color: var(--status-success); }
.financial-card-badge.danger { background-color: var(--status-danger-soft); color: var(--status-danger); }
.financial-card-badge.secondary { background-color: var(--bg-lighter); color: var(--text-muted); }

.financial-card-body {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 90px;
}

/* Integrated footer with edit/delete actions - INSIDE container, centered at bottom */
.financial-card-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 10px;
  border-top: 1px solid var(--border-color);
  background-color: var(--surface-inset);
  opacity: 1;
  transition: background-color 0.15s ease;
}
.financial-card:hover .financial-card-footer {
  background-color: var(--bg-lighter);
}
.financial-card-footer .btn {
  font-size: 0.65rem;
  padding: 6px 12px;
  border-radius: 6px;
}
.financial-card-footer .btn i { font-size: 0.7rem; }

/* Grid for financial cards - Bank Accounts: 3 columns */
.financial-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px !important;
  grid-auto-flow: dense !important;
  align-items: stretch !important; /* Force equal height cards */
}

/* Plan de Cuentas Contables - 4 columns for compact informative cards */
#accounts-cards-container.financial-cards-grid {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
}

@media (max-width: 1400px) {
  #accounts-cards-container.financial-cards-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 1200px) {
  #accounts-cards-container.financial-cards-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .financial-cards-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 900px) {
  #accounts-cards-container.financial-cards-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 768px) {
  #accounts-cards-container.financial-cards-grid { grid-template-columns: 1fr !important; }
  .financial-cards-grid { grid-template-columns: 1fr !important; }
}

/* Ensure financial cards stretch to fill grid cell height */
.financial-cards-grid > .financial-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Compact card for 4-column layout - accounts */
#accounts-cards-container .financial-card {
  min-height: 140px;
}
#accounts-cards-container .financial-card-header {
  padding: 8px 10px;
}
#accounts-cards-container .financial-card-header .entity {
  font-size: 0.78rem;
  gap: 6px;
}
#accounts-cards-container .financial-card-badge {
  font-size: 0.55rem;
  padding: 2px 6px;
}
#accounts-cards-container .financial-card-body {
  padding: 8px 10px;
  min-height: 70px;
}
#accounts-cards-container .financial-card-body .label {
  font-size: 0.65rem;
}
#accounts-cards-container .financial-card-body .value {
  font-size: 1rem;
  font-weight: 700;
}
#accounts-cards-container .financial-card-meta {
  font-size: 0.6rem;
  gap: 4px;
}
#accounts-cards-container .financial-card-footer {
  padding: 8px 8px;
  gap: 6px;
}
#accounts-cards-container .financial-card-footer .btn {
  font-size: 0.6rem;
  padding: 5px 10px;
  border-radius: 5px;
}
#accounts-cards-container .financial-card-footer .btn i { font-size: 0.65rem; }

.financial-card-footer .btn {
  font-size: 0.65rem;
  padding: 6px 12px;
  border-radius: 6px;
}
.financial-card-footer .btn i { font-size: 0.7rem; }

/* Ensure cards don't have margins breaking grid */
.financial-card {
  margin: 0 !important;
}

/* Meta layout inside card body */
.financial-card-body .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.financial-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
}
#accounts-cards-container .financial-card-meta {
  font-size: 0.6rem;
  gap: 3px;
}

/* General financial card body label/value styles */
.financial-card-body .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.financial-card-body .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

/* ==========================================================================
   CHAT INTERNO — Layout moderno tipo Slack/Discord sin glassmorphism
   ========================================================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  height: calc(100vh - 180px);
  min-height: 480px;
}
/* Panel lateral de canales: azul de la app muy tenue (claro) / superficie propia (oscuro) */
.chat-sidebar {
  background-color: var(--chat-sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.chat-channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.chat-channel-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 2px;
  border: none;
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.chat-channel-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}
.chat-channel-btn.active {
  background-color: var(--surface-raised);
  color: var(--chat-channel-active-text);
  font-weight: 600;
  border-left-color: var(--accent-secondary);
  box-shadow: var(--shadow-xs);
}
.chat-channel-btn i {
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
}
.chat-channel-btn.active i {
  color: var(--accent-secondary);
}
.chat-main {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-main-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-main-header .title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}
.chat-main-header .desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background-color: var(--surface-inset);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.chat-message.self {
  flex-direction: row-reverse;
}
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.chat-message.self .chat-avatar {
  background-color: var(--accent-secondary);
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  border-top-left-radius: 2px;
}
.chat-message.self .chat-bubble {
  border-top-left-radius: 8px;
  border-top-right-radius: 2px;
  background-color: rgba(52, 81, 99, 0.08);
  border-color: rgba(52, 81, 99, 0.2);
}
.chat-bubble .author {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 3px;
}
.chat-message.self .chat-bubble .author {
  color: var(--accent-secondary);
  text-align: right;
}
.chat-bubble .time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}
.chat-bubble .text {
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.chat-input-area {
  padding: 14px 18px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
  display: flex;
  gap: 10px;
  position: relative;
}
.chat-input-area input {
  flex: 1;
}

/* Chat Mentions & Autocomplete Dropdown */
.chat-mention {
  display: inline-block;
  background-color: rgba(241, 114, 121, 0.18);
  color: var(--accent-primary);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  margin: 0 1px;
}
.chat-mention.self-mention {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.mention-suggestions-dropdown {
  position: absolute;
  bottom: 100%;
  left: 18px;
  right: 60px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  display: none;
  padding: 4px;
}
.mention-suggestions-dropdown.active {
  display: block;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.mention-item:hover, .mention-item.active {
  background: var(--bg-hover);
}
.mention-item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
}
.mention-item-info {
  display: flex;
  flex-direction: column;
}
.mention-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.mention-item-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@keyframes mentionPulse {
  0% { box-shadow: 0 0 0 0 rgba(241, 114, 121, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(241, 114, 121, 0); }
  100% { box-shadow: 0 0 0 0 rgba(241, 114, 121, 0); }
}
.chat-message.highlight-mention, .chat-msg-item.highlight-mention {
  animation: mentionPulse 1.5s infinite;
  border-color: var(--accent-primary) !important;
  background-color: rgba(241, 114, 121, 0.08) !important;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

/* ── Chat estilo Slack: color de canal, no leídos, separadores de día y formularios ── */
.chat-channel-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--chat-sidebar-bg);
}
.chat-channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-channel-unread {
  background: var(--status-danger, #dc2626); color: #fff; font-size: 0.68rem; font-weight: 700;
  border-radius: 10px; padding: 1px 7px; line-height: 1.5;
}
.chat-channel-btn.active .chat-channel-unread { background: var(--accent-secondary); color: #fff; }
.chat-day-sep { display: flex; align-items: center; gap: 10px; margin: 6px 0; color: var(--text-muted); }
.chat-day-sep::before, .chat-day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.chat-day-sep span { font-size: 0.7rem; font-weight: 700; text-transform: capitalize; letter-spacing: 0.02em; }
.chat-formref {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 10px;
  background: rgba(3, 105, 161, 0.12); color: var(--status-info, #0369a1); font-size: 0.78rem; font-weight: 600;
}
.chat-msg-tag {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  background: rgba(3, 105, 161, 0.12); color: var(--status-info, #0369a1); border-radius: 8px; padding: 1px 6px; margin-left: 4px;
}
.chat-message.chat-msg-formulario .chat-bubble { border-left: 3px solid var(--status-info, #0369a1); }
.chat-avatar-system { background: #1F3B4D !important; color: #fff; }
.chat-msg-tag-system { background: var(--bg-hover); color: var(--text-muted); }
.chat-message.chat-msg-evento .chat-bubble {
  background: rgba(31, 59, 77, 0.05);
  border-style: dashed;
}
.chat-message.chat-msg-evento .chat-bubble .text { font-style: italic; color: var(--text-muted); }

/* ── Chat de la ficha del cliente: conversación + contexto del caso ── */
.client-chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.client-chat-box {
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: 16px; background-color: var(--surface-inset); max-height: 440px; min-height: 260px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.client-chat-context { position: sticky; top: 12px; }
.context-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); padding: 14px; }
.context-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 10px; color: var(--text-main); }
.context-row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; padding: 4px 0; border-bottom: 1px dashed var(--border-color); }
.context-row:last-of-type { border-bottom: none; }
.context-row span:first-child { color: var(--text-muted); }
.context-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }

@media (max-width: 720px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-sidebar { display: none; }
  .client-chat-layout { grid-template-columns: 1fr; }
  .client-chat-context { position: static; }
}

/* ==========================================================================
   KANBAN — Layout responsive que se ajusta a la ventana (sin scroll horizontal)
   ========================================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  height: calc(100vh - 180px);
  min-height: 480px;
  align-content: start;
}
.kanban-column {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 100%;
  min-width: 0;
}
.kanban-column-header {
  padding: 12px 14px;
  border-bottom: 2px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-lighter);
}
.kanban-column-header h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-column-header .count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
}
.kanban-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kanban-card {
  padding: 12px;
  background-color: var(--surface-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: transform 0.1s, border-color 0.15s;
}
.kanban-card:hover {
  border-color: var(--accent-primary);
}
.kanban-card.dragging {
  opacity: 0.5;
}
.kanban-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.35;
}
.kanban-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-card-tags {
  display: flex;
  gap: 6px;
}
.kanban-card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
}
.kanban-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}
.kanban-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 4px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Kanban Sub-tasks / Activities (PASO 5)
   ========================================================================== */
.kanban-card-subtasks {
  animation: fadeInUp 0.2s ease-out;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.subtasks-progress {
  position: relative;
}
.subtasks-progress > div {
  box-shadow: 0 0 8px var(--status-success);
}

.subtask-checkbox {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}
.subtask-checkbox:hover {
  background: var(--bg-hover) !important;
  border-color: var(--border-color);
}
.subtask-checkbox.completed {
  background: var(--status-success-soft) !important;
}
.subtask-checkbox.completed:hover {
  background: var(--status-success-soft) !important;
  filter: brightness(1.05);
}
.subtask-checkbox input[type="checkbox"]:checked + span {
  text-decoration: line-through;
  color: var(--text-muted) !important;
}
.subtask-checkbox input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.subtasks-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.subtasks-list::-webkit-scrollbar {
  width: 4px;
}
.subtasks-list::-webkit-scrollbar-track {
  background: transparent;
}
.subtasks-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.subtask-item {
  animation: slideInRight 0.15s ease-out;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.subtasks-input-group .form-control {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.subtasks-input-group .form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.subtasks-input-group .btn-primary {
  transition: all 0.15s ease;
}
.subtasks-input-group .btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px var(--accent-primary-light);
}

/* ==========================================================================
   Kanban Archivo Toolbar — Professional Search & Filter Bar
   ========================================================================== */
.archivo-toolbar {
  animation: fadeSlideDown 0.3s ease-out;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-input-group {
  position: relative;
}
.search-input-group .form-control {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-input-group .form-control:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}
.search-input-group .form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
  background: var(--bg-card);
}
.search-input-group .form-control:focus + .search-icon,
.search-input-group:focus-within .search-icon {
  color: var(--accent-primary) !important;
}

.search-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.search-clear-btn:hover {
  background: var(--accent-primary-light) !important;
  color: var(--accent-primary) !important;
}
.search-input-group .form-control:not(:placeholder-shown) + .search-clear-btn,
.search-input-group.has-value .search-clear-btn {
  display: flex !important;
}

.toolbar-divider {
  opacity: 0.6;
}

.filter-group {
  transition: all 0.2s ease;
}
.filter-group select.form-control {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.filter-group select.form-control:hover {
  border-color: var(--accent-primary);
}
.filter-group select.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
  background: var(--bg-card);
}

/* .btn-ghost: estilo base y hover centralizados en la sección "Buttons" (no duplicar aquí) */

#archivo-active-filters {
  animation: pulseIn 0.2s ease-out;
}
@keyframes pulseIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .archivo-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }
  .toolbar-divider {
    display: none;
  }
  .archivo-search-wrapper {
    max-width: none !important;
  }
  .archivo-filters {
    justify-content: flex-start;
  }
  .filter-group {
    flex: 1;
    min-width: 140px;
  }
}

@media (max-width: 600px) {
  .filter-group {
    min-width: 100%;
  }
  .archivo-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    width: 100%;
  }
  .filter-group label {
    margin-bottom: 4px;
  }
}

/* ==========================================================================
   Dense Data Table (Customer Detail SOPs, etc.)
   ========================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th,
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  background-color: var(--bg-lighter);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-strong);
}
.data-table tbody tr {
  transition: background-color 0.12s ease;
}
.data-table tbody tr:hover {
  background-color: var(--bg-hover);
}
.data-table .row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.data-table tbody tr:hover .row-actions {
  opacity: 1;
}
.data-table .row-actions .btn {
  height: 28px;
  padding: 0 10px;
  font-size: 0.75rem;
}
.data-table .row-actions .btn-icon {
  width: 28px;
  height: 28px;
}
.data-table .mono-code {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.data-table .cell-title {
  font-weight: 600;
  color: var(--text-main);
}
.data-table .cell-muted {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-lighter);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.table-footer .pagination {
  display: flex;
  gap: 4px;
}
.table-footer .pagination button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.table-footer .pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Pill badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}
.pill.success { background-color: rgba(21, 128, 61, 0.08); color: var(--status-success); border-color: rgba(21, 128, 61, 0.2); }
.pill.warning { background-color: rgba(180, 83, 9, 0.08); color: var(--status-warning); border-color: rgba(180, 83, 9, 0.2); }
.pill.danger { background-color: rgba(180, 35, 24, 0.08); color: var(--status-danger); border-color: rgba(180, 35, 24, 0.2); }
.pill.info { background-color: rgba(3, 105, 161, 0.08); color: var(--status-info); border-color: rgba(3, 105, 161, 0.2); }
.pill.secondary { background-color: var(--bg-hover); color: var(--text-muted); border-color: var(--border-color); }

/* ==========================================================================
   SOPs Bento / Menu Cards
   ========================================================================== */
.sop-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.sop-bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 132px;
  padding: 18px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  color: inherit;
}
.sop-bento-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}
.sop-bento-card .top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.sop-bento-card .icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.sop-bento-card .count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.sop-bento-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}
.sop-bento-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 4px 0 0 0;
  line-height: 1.3;
}

/* .sop-tabs / .sop-tab-btn → unificadas en la sección "Tabs unificadas" */

.sop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.sop-grid-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}
.sop-grid-card:hover {
  border-color: var(--accent-primary);
  background-color: var(--bg-hover);
}
.sop-grid-card .icon-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: var(--bg-lighter);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.sop-grid-card .body {
  flex: 1;
  min-width: 0;
}
.sop-grid-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.sop-grid-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sop-grid-card .code {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.sop-grid-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sop-grid-card .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.sop-grid-card .footer button {
  height: 26px;
  padding: 0 8px;
  font-size: 0.7rem;
}

/* ==========================================================================
   Customer header refinements
   ========================================================================== */
.customer-header .customer-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.customer-header .customer-logo {
  border-radius: 8px;
  overflow: hidden;
}
.customer-header .btn-primary {
  background-color: var(--accent-primary);
  color: white;
}

/* ==========================================================================
   Data utilities
   ========================================================================== */
.mono { font-family: 'Inter', sans-serif; font-weight: 600; letter-spacing: 0.02em; }

/* Utilities */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.hidden { display: none !important; }

/* ================================================================
   DASHBOARD v2 — Rediseño SaaS/Fintech (PASO 2)
   ================================================================ */

/* ── Hero MRR ──────────────────────────────────────────────────── */
.db2-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.db2-hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.db2-hero-value {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -.02em;
}
.db2-hero-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.db2-hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.db2-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.hero-badge-green  { background: #10b98120; color: #10b981; }
.hero-badge-yellow { background: #f59e0b20; color: #f59e0b; }
.hero-badge-red    { background: #ef444420; color: #ef4444; }

/* ── Tabs ──────────────────────────────────────────────────────── */
/* .db2-tabs / .db2-tab → unificadas en la sección "Tabs unificadas" */

/* ── Tab panels ────────────────────────────────────────────────── */
.db2-tab-panels { position: relative; }
.db2-panel { display: none; }
.db2-panel.active { display: block; }

/* ── KPI Cards grid ────────────────────────────────────────────── */
/* auto-fit (no auto-fill): las tarjetas ocupan TODO el ancho disponible
   y se reparten por igual, sin dejar espacio muerto a la derecha. */
.db2-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.db2-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow .15s, border-color .15s;
}
.db2-card:hover {
  box-shadow: 0 4px 16px -4px rgba(0,0,0,.12);
  border-color: var(--accent-primary);
}
.db2-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.db2-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.icon-green  { background: #10b98118; color: #10b981; }
.icon-blue   { background: #3b82f618; color: #3b82f6; }
.icon-red    { background: #ef444418; color: #ef4444; }
.icon-pink   { background: #F1727918; color: #F17279; }
.icon-yellow { background: #f59e0b18; color: #f59e0b; }
.icon-teal   { background: #34516318; color: #345163; }

.db2-card-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
}
.db2-card-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -.02em;
}
.db2-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.db2-period { color: var(--text-muted); }

/* ── Trend badges ──────────────────────────────────────────────── */
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
}
.trend-up      { background: #10b98118; color: #10b981; }
.trend-down    { background: #ef444418; color: #ef4444; }
.trend-neutral { background: var(--bg-lighter); color: var(--text-muted); }

/* ── Chart panel ───────────────────────────────────────────────── */
.db2-chart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.db2-chart-container {
  position: relative;
  height: 180px;
  max-height: 180px;
  width: 100%;
}
.db2-chart-panel canvas {
  max-height: 180px !important;
  width: 100% !important;
}
.db2-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}
.db2-chart-sub { font-size: 0.72rem; font-weight: 400; color: var(--text-muted); }

/* ── Actividad (acordeón) ──────────────────────────────────────── */
.db2-accordion {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.db2-accordion-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  list-style: none;
  user-select: none;
}
.db2-accordion-head::-webkit-details-marker { display: none; }
.db2-accordion-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}
.db2-chev {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform .2s;
  color: var(--text-muted);
}
details[open] .db2-chev { transform: rotate(180deg); }
.db2-accordion-body {
  padding: 0 20px 8px;
  border-top: 1px solid var(--border-color);
}

/* ── PASO 5.2 · Panel de Permisos (cascada) ────────────────────── */
.perm-role-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.perm-role-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-base);
}
.perm-role-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.perm-role-card.active {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
  box-shadow: var(--shadow-md);
}
.perm-role-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}
.perm-role-card-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.perm-role-card-bar {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.perm-role-card-bar > span {
  display: block;
  height: 100%;
  background: var(--accent-primary);
  border-radius: 99px;
  transition: width var(--transition-base);
}
.perm-panel { }
.perm-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.perm-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  list-style: none;
  user-select: none;
  transition: background var(--transition-fast);
}
.perm-group-head:hover { background: var(--bg-lighter); }
.perm-group-head::-webkit-details-marker { display: none; }
.perm-group-body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--border-color);
  animation: perm-fade-in var(--transition-base);
}
@keyframes perm-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.perm-group-count {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-weight: 600;
}
.perm-status-badge {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.perm-status-badge.full { background: rgba(21,128,61,.12); color: var(--status-success); }
.perm-status-badge.read { background: rgba(3,105,161,.12); color: var(--status-info); }
.perm-status-badge.none { background: var(--bg-hover); color: var(--text-muted); }
.perm-status-badge.partial { background: rgba(180,83,9,.12); color: var(--status-warning); }
.perm-module {
  background: var(--surface-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}
/* Pista bajo el título del módulo: a qué menú/submenú corresponde exactamente */
.perm-module-hint {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: -4px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
}
/* Explicación de cómo funciona el panel, arriba de todo */
.perm-howto {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--accent-primary-light);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-secondary);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-main);
}
.perm-howto > i {
  color: var(--accent-secondary);
  margin-top: 2px;
}
.perm-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.perm-module-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.perm-chip-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.perm-chip-cat {
  flex: 0 0 150px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
}
.perm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.perm-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.perm-chip:hover {
  border-color: var(--accent-primary);
  color: var(--text-main);
}
.perm-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.perm-chip.on {
  background: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}
.perm-chip.on i { color: var(--accent-primary); }
.perm-chip:focus-within {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.perm-group-toggle-wrap,
.perm-module-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: var(--surface-raised);
  transition: all var(--transition-fast);
}
.perm-group-toggle-wrap:hover,
.perm-module-toggle-wrap:hover {
  border-color: var(--accent-primary);
  color: var(--text-main);
}
.perm-savebar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 900;
  transition: transform var(--transition-base);
  opacity: 0;
  pointer-events: none;
}
.perm-savebar.pending {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.perm-savebar-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}
.perm-savebar-text i {
  color: var(--status-warning);
  margin-right: 6px;
}
.perm-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
@media (max-width: 640px) {
  .perm-role-cards { grid-template-columns: 1fr 1fr; }
  .perm-chip-cat { flex: 0 0 100%; padding-top: 0; }
  .perm-savebar { left: 12px; right: 12px; transform: translateY(120%); width: auto; }
  .perm-savebar.pending { transform: translateY(0); }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .db2-hero { flex-direction: column; align-items: flex-start; }
  .db2-cards-grid { grid-template-columns: 1fr 1fr; }
  .db2-card-value { font-size: 1.4rem; }
  .db2-hero-value { font-size: 2rem; }
}
@media (max-width: 400px) {
  .db2-cards-grid { grid-template-columns: 1fr; }
}


/* ── PASO 8 · Ajustes de Empresa (OMNIA) ───────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

/* Rejilla de activos visuales (logos y firmas) */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.asset-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background-color: var(--surface-inset);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.asset-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.asset-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
}
.asset-head i { color: var(--accent-primary); }

.asset-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 10px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.asset-preview {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
}

.asset-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.asset-placeholder i { font-size: 1.6rem; opacity: 0.5; }

.asset-uso {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.asset-rec {
  font-size: 0.72rem;
  color: var(--accent-primary);
  margin: 0;
  cursor: help;
  line-height: 1.4;
}
.asset-rec i { margin-right: 4px; }

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

/* ==========================================================================
   PROCEDIMIENTOS (SOP) — Afiche interactivo
   Contenido en public/js/data/procedures.js · render en sop.js renderProcedure()
   ========================================================================== */
.proc-open-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
}
.proc-open-hint i { margin-left: 2px; }

.proc-affiche { max-width: 1080px; }

/* ── Hero del procedimiento ────────────────────────────────────── */
.proc-hero {
  position: relative;
  background:
    linear-gradient(135deg, var(--proc-tint, rgba(52,81,99,.08)), transparent 55%),
    var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--proc-color, var(--accent-primary));
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  overflow: hidden;
}
.proc-hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.proc-code {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--proc-color, var(--accent-primary));
  background: var(--proc-tint, rgba(52,81,99,.08));
  padding: 4px 12px;
  border-radius: 99px;
}
.proc-area-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 3px 11px;
  border-radius: 99px;
}
.proc-read-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--status-success);
  background: rgba(21,128,61,.12);
  padding: 3px 11px;
  border-radius: 99px;
}
.proc-title {
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--text-main);
}
.proc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.proc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.proc-meta i { color: var(--proc-color, var(--accent-primary)); }

.proc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.proc-actions .btn.is-read {
  background: var(--status-success);
  border-color: var(--status-success);
}

/* ── Tarjetas Objetivo / Alcance ───────────────────────────────── */
.proc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.proc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.proc-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.proc-card-head i { color: var(--proc-color, var(--accent-primary)); }
.proc-card-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-main);
}
.proc-card p { margin: 0 0 8px; font-size: 0.86rem; line-height: 1.55; color: var(--text-main); }
.proc-note { font-size: 0.8rem !important; color: var(--text-muted) !important; margin-top: 8px !important; }

.proc-ul { margin: 6px 0 0; padding-left: 4px; list-style: none; }
.proc-ul > li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 5px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-main);
}
.proc-ul > li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--proc-color, var(--accent-primary));
}
.proc-ul .proc-ul { margin-top: 5px; }
.proc-ul .proc-ul > li { font-size: 0.82rem; color: var(--text-muted); }
.proc-ul .proc-ul > li::before { background: var(--border-color); }

/* ── Secciones ─────────────────────────────────────────────────── */
.proc-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.proc-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
}
.proc-section-title i { color: var(--proc-color, var(--accent-primary)); }
.proc-section-intro { margin: 0 0 12px; font-size: 0.85rem; color: var(--text-muted); }
.proc-section-nota {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Principios (lista numerada) ───────────────────────────────── */
.proc-principles { list-style: none; counter-reset: prin; margin: 0; padding: 0; }
.proc-principles > li {
  position: relative;
  counter-increment: prin;
  padding: 10px 0 10px 44px;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-main);
}
.proc-principles > li:last-child { border-bottom: none; }
.proc-principles > li::before {
  content: counter(prin);
  position: absolute;
  left: 0;
  top: 9px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--proc-color, var(--accent-primary));
}

/* ── Diagrama de flujo (nodos conectados, sin dependencias) ────── */
.proc-flow {
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  margin-bottom: 4px;
  scrollbar-width: thin;
}
.proc-flow-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  flex-shrink: 0;
}
.proc-flow-node {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  padding: 9px 13px;
  background: var(--surface-inset);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.proc-flow-node:hover {
  border-color: var(--proc-color, var(--accent-primary));
  background: var(--proc-tint, var(--bg-hover));
}
.proc-flow-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--proc-color, var(--accent-primary));
}
.proc-flow-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Paso a paso (acordeón) ────────────────────────────────────── */
.proc-steps { display: flex; flex-direction: column; gap: 10px; }
.proc-step {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-inset);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.proc-step.open { border-color: var(--proc-color, var(--accent-primary)); }
.proc-step-flash {
  box-shadow: 0 0 0 3px var(--proc-tint, rgba(52,81,99,.2));
}
.proc-step-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.proc-step-head:hover { background: var(--bg-hover); }
.proc-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--proc-color, var(--accent-primary));
}
.proc-step-title {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}
.proc-step-resp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.proc-step-caret { color: var(--text-muted); font-size: 0.75rem; transition: transform .2s; }
.proc-step.open .proc-step-caret { transform: rotate(180deg); }
.proc-step-body {
  display: none;
  padding: 4px 18px 18px 58px;
  border-top: 1px solid var(--border-color);
}
.proc-step.open .proc-step-body { display: block; }
.proc-step-desc { margin: 12px 0 4px; font-size: 0.83rem; color: var(--text-muted); }
.proc-step-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--proc-color, var(--accent-primary));
  margin: 14px 0 2px;
}
.proc-activities > li { font-size: 0.85rem; }
.proc-criterio {
  margin-top: 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--proc-color, var(--accent-primary));
  background: var(--proc-tint, rgba(52,81,99,.06));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-main);
}
.proc-criterio strong { color: var(--proc-color, var(--accent-primary)); }

/* ── Definiciones ──────────────────────────────────────────────── */
.proc-defs { margin: 0; }
.proc-def {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}
.proc-def:last-child { border-bottom: none; }
.proc-def dt { font-weight: 700; font-size: 0.84rem; color: var(--text-main); }
.proc-def dd { margin: 3px 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--text-muted); }

/* ── Tablas del afiche ─────────────────────────────────────────── */
.proc-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.proc-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.proc-table thead th {
  background: var(--proc-tint, var(--bg-lighter));
  color: var(--text-main);
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.proc-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: top;
  line-height: 1.45;
}
.proc-table tbody tr:last-child td { border-bottom: none; }
.proc-table tbody tr:hover { background: var(--bg-hover); }

@media (max-width: 760px) {
  .proc-grid { grid-template-columns: 1fr; }
  .proc-hero { padding: 18px 16px; }
  .proc-step-body { padding-left: 18px; }
  .proc-step-resp { display: none; }
}

/* ── Pestañas por capítulos (procedimientos extensos) ──────────────────── */
/* .proc-tabs / .proc-tab: base unificada; el color de acento lo aporta el área del SOP */
.proc-tabs { margin-top: 8px; max-width: 100%; }
.proc-tab { max-width: 100%; }
.proc-tab.active { border-bottom-color: var(--proc-color, var(--accent-secondary)); }
.proc-tab.active i { color: var(--proc-color, var(--accent-secondary)); }
.proc-tab-num { font-weight: 800; opacity: .85; }
.proc-tab-panel { display: none; }
.proc-tab-panel.active { display: block; animation: proc-fade .18s ease; }
@keyframes proc-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Impresión: "Exportar PDF del SOP" (Guardar como PDF del navegador) ── */
@media print {
  #sidebar, #header, #toast-container, .proc-actions, .crumbs, .notif-wrapper,
  .user-menu-wrapper { display: none !important; }
  #main-content { margin: 0 !important; padding: 0 !important; }
  #content-area { padding: 0 !important; }
  .proc-affiche { max-width: 100%; }
  .proc-step-body { display: block !important; }
  .proc-tabs { display: none !important; }
  .proc-tab-panel { display: block !important; }
  .proc-section, .proc-card, .proc-step, .proc-hero { break-inside: avoid; }
  body { background: #fff !important; }
}

/* ── Edición de procedimientos (solo admin) ────────────────────── */
.proc-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.7rem;
  transition: all var(--transition-fast);
}
.proc-edit-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-hover);
}
.proc-card-head h3 { margin: 0 auto 0 0; }
.proc-card-head .proc-edit-btn,
.proc-section-title .proc-edit-btn { width: 22px; height: 22px; font-size: 0.62rem; margin-left: 8px; }
.proc-title .proc-edit-btn { width: 24px; height: 24px; margin-left: 6px; vertical-align: middle; }
.proc-step-head:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.proc-edit-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
}
@media (max-width: 640px) {
  .proc-edit-meta { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PASO 9 — Búsqueda global, exportación a Excel y vistas de operación
   ========================================================================== */

/* Búsqueda global (barra superior) */
.global-search {
  position: relative;
  width: 280px;
  max-width: 34vw;
}
.global-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}
.global-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
}
.global-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--focus-ring);
}
.global-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 380px;
  max-width: 80vw;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
}
.global-search-results.open { display: block; }
.gs-group { padding: 6px 0; border-bottom: 1px solid var(--border-color); }
.gs-group:last-child { border-bottom: none; }
.gs-group-label {
  padding: 6px 14px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.gs-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
}
.gs-item:hover,
.gs-item.active { background: var(--bg-hover); }
.gs-item-title { font-size: 0.86rem; font-weight: 600; }
.gs-item-sub { font-size: 0.74rem; color: var(--text-muted); }
.gs-empty { padding: 14px; font-size: 0.84rem; color: var(--text-muted); text-align: center; }

/* Botón de exportación a Excel sobre cada tabla */
.table-export-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* Tarjetas KPI de las vistas de operación (cobranzas, conciliación) */
.ops-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ops-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.ops-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ops-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.ops-kpi-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-strong);
}

/* Guía operativa dentro de las vistas de operación (Cobranzas) */
.ops-help {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}
.ops-help > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.ops-help > summary::-webkit-details-marker { display: none; }
.ops-help > summary i { color: var(--accent-secondary); }
.ops-help > summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}
.ops-help[open] > summary::after { transform: rotate(180deg); }
.ops-help-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 2px 18px 18px;
}
.ops-help-col h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.ops-help-body ol,
.ops-help-list { margin: 0; padding-left: 18px; }
.ops-help-body li {
  font-size: 0.83rem;
  line-height: 1.5;
  margin-bottom: 7px;
  color: var(--text-main);
}
.ops-help-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--bg-lighter);
  border-radius: var(--radius-sm);
  font-size: 0.79rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.ops-help-note i { color: var(--status-warning); }
.ops-help code {
  background: var(--bg-lighter);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.78rem;
}
@media (max-width: 900px) {
  .ops-help-body { grid-template-columns: 1fr; }
  .global-search { width: 180px; }
}
@media (max-width: 640px) {
  .global-search { display: none; }
}

/* ── Clientes: barra de búsqueda, filtro y pestañas ─────────────── */
.clients-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 18px;
}
.clients-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 420px;
  min-width: 0;
  flex-wrap: wrap;
}
.clients-search { position: relative; flex: 1 1 320px; min-width: 220px; }
.clients-search > i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.82rem;
  pointer-events: none;
}
.clients-search .form-control { padding-left: 34px; }
.clients-toolbar .clients-estado { flex: 0 0 190px; width: 190px; }
.clients-toolbar .tab-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: var(--surface-inset);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  flex-shrink: 0;
}
.clients-toolbar .tab-pills .btn { border-radius: 999px; }
.clients-toolbar .tab-pills .btn i { margin-right: 4px; }
@media (max-width: 640px) {
  .clients-toolbar .clients-estado { flex: 1 1 100%; width: 100%; }
  .clients-toolbar .tab-pills { width: 100%; justify-content: center; }
}

/* ── Formularios dinámicos (builder) — estilo profesional ───────── */
.dyn-form { display: flex; flex-direction: column; gap: 18px; }
.dyn-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.dyn-form-head h3 { margin: 6px 0 4px; font-size: 1.05rem; }
.dyn-form-head p { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.dyn-form-code {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  padding: 3px 9px;
  border-radius: 999px;
}
.dyn-form-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.dyn-req { color: var(--status-danger); font-weight: 700; }
.firma-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-lighter);
  color: var(--text-muted);
  font-size: 0.82rem;
}
.firma-box i { color: var(--accent-primary); font-size: 1rem; }
.dyn-section {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}
.dyn-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: var(--bg-lighter);
  border-bottom: 1px solid var(--border-color);
}
.dyn-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.dyn-section-head h4 { margin: 0; font-size: 0.9rem; font-weight: 700; }
.dyn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
  padding: 18px;
}
.dyn-cell { min-width: 0; }
.dyn-cell.dyn-span-2 { grid-column: 1 / -1; }
.dyn-grid .form-group { margin-bottom: 0; }
.dyn-form .form-group > label { color: var(--text-main); font-weight: 600; font-size: 0.8rem; }
@media (max-width: 720px) {
  .dyn-grid { grid-template-columns: 1fr; }
  .dyn-cell.dyn-span-2 { grid-column: auto; }
}

/* ── Foto de perfil de usuario ──────────────────────────────────── */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--accent-primary);
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar img, img.user-avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* Imagen de avatar reutilizable (barra superior, chat y kanban) */
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar, .chat-avatar, .kanban-card-avatar { overflow: hidden; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.photo-preview-box { display: flex; justify-content: center; margin-bottom: 14px; }
.photo-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  background: var(--bg-lighter);
}
.photo-rules { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.photo-rules li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }
.photo-rules li i { color: var(--accent-primary); margin-top: 2px; }
