/* ========== Dashboard: variables y base ========== */
* {
  box-sizing: border-box;
}

:root {
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 56px;
  --topbar-height: 56px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --color-bg: #f1f5f9;
  --color-card: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-primary: #0f766e;
  --color-primary-hover: #0d9488;
  /* Movimiento (estética moderna, sin tocar colores) */
  --ease-out-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.15s;
  --dur-normal: 0.28s;
  --dur-slow: 0.45s;
}

/* ========== Animaciones base ========== */
@keyframes ui-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ui-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ui-slide-in-right {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ui-brand-icon {
  0% { transform: scale(0.85) rotate(-6deg); opacity: 0.6; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-content > .card,
  .login-box,
  .sidebar-brand-icon,
  .dashboard-topbar .topbar-title,
  .module-card,
  .tab-panel.active,
  .table-toolbar,
  .home-welcome,
  .tabs-container,
  .sidebar-nav .nav-link,
  .sidebar-nav .nav-group-label,
  .pipeline-card--land,
  .pipeline-columna__total--flash,
  .pipeline-empty--appear,
  .pipeline-card--busy,
  .pipeline-card--flying {
    animation: none !important;
  }
  .card:hover,
  .module-card:hover,
  .pipeline-card:hover,
  .actividad-item:hover,
  .tab-btn:hover {
    transform: none !important;
  }
  .pipeline-card {
    transition: box-shadow var(--dur-fast) ease, border-color var(--dur-fast) ease !important;
  }
}

body.dashboard-body,
body.dashboard-body * {
  font-family: 'Sarabun', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.dashboard-body {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

/* ========== Layout ========== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--dur-normal) var(--ease-out-smooth),
    min-width var(--dur-normal) var(--ease-out-smooth),
    box-shadow var(--dur-normal) ease;
}

/* Sidebar colapsado: solo iconos */
.dashboard-layout.sidebar-collapsed .dashboard-sidebar {
  width: var(--sidebar-width-collapsed);
  min-width: var(--sidebar-width-collapsed);
}

.dashboard-layout.sidebar-collapsed .sidebar-brand .sidebar-brand-titles,
.dashboard-layout.sidebar-collapsed .sidebar-brand .sidebar-brand-text,
.dashboard-layout.sidebar-collapsed .sidebar-brand .sidebar-brand-tagline,
.dashboard-layout.sidebar-collapsed .nav-text,
.dashboard-layout.sidebar-collapsed .nav-submenu,
.dashboard-layout.sidebar-collapsed .nav-group-nested .nav-submenu {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  padding: 0;
  margin: 0;
  border: none;
  visibility: hidden;
  position: absolute;
}

.dashboard-layout.sidebar-collapsed .sidebar-brand-link,
.dashboard-layout.sidebar-collapsed .sidebar-brand a,
.dashboard-layout.sidebar-collapsed .nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.dashboard-layout.sidebar-collapsed .nav-group-label,
.dashboard-layout.sidebar-collapsed .nav-sublink {
  justify-content: center;
}

.dashboard-layout.sidebar-collapsed .nav-group .nav-group-label {
  padding-left: 0;
  padding-right: 0;
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.dashboard-layout.sidebar-collapsed .nav-group-nested .nav-group-label {
  padding: 0.35rem 0;
}

.dashboard-layout.sidebar-collapsed .nav-group-toggle {
  display: none !important;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand a,
.sidebar-brand-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sidebar-brand-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.sidebar-brand-text {
  font-size: 1.15rem;
  font-weight: 700;
}

.sidebar-brand-tagline {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.72;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
}

.sidebar-brand-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.1rem;
  animation: ui-brand-icon var(--dur-slow) var(--ease-out-smooth) both;
}

.sidebar-brand a:hover,
.sidebar-brand-link:hover {
  opacity: 0.92;
}

.sidebar-brand-link:hover .sidebar-brand-icon {
  transform: scale(1.06);
  transition: transform var(--dur-fast) var(--ease-spring);
}

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

.sidebar-nav .nav-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  transition:
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out-smooth),
    box-shadow var(--dur-fast) ease;
  margin: 0.5rem 0.105rem;
  animation: ui-slide-in-right var(--dur-normal) var(--ease-out-smooth) both;
}

.sidebar-nav .nav-text {
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
  border-left-color: rgba(255,255,255,0.4);
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(3px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.sidebar-nav .nav-group {
  padding: 0;
}

.sidebar-nav .nav-group-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.85;
  cursor: default;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0 8px 8px 0;
  margin: 0.5rem 0.105rem;
  transition: opacity var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out-smooth);
  animation: ui-slide-in-right var(--dur-normal) var(--ease-out-smooth) both;
}

.sidebar-nav .nav-group-label.nav-group-header {
  cursor: pointer;
  user-select: none;
}

.sidebar-nav .nav-group-label.nav-group-header:hover {
  opacity: 1;
  transform: translateX(2px);
}

.sidebar-nav .nav-group-toggle {
  font-size: 0.85rem;
  opacity: 0.9;
  flex-shrink: 0;
  width: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav .nav-submenu {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.35s var(--ease-out-smooth), opacity 0.25s ease;
}

.sidebar-nav .nav-group.collapsed .nav-submenu {
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-left-color: transparent;
  transition: max-height 0.25s ease-in, margin 0.2s, padding 0.2s;
}

.sidebar-nav .nav-group.collapsed .nav-group-toggle.bi-dash {
  display: none;
}

.sidebar-nav .nav-group.collapsed .nav-group-toggle.bi-plus {
  display: inline-flex;
}

.sidebar-nav .nav-group .nav-group-toggle.bi-plus {
  display: none;
}

.sidebar-nav .nav-submenu {
  padding-left: 0.9rem;

  margin-bottom: 0.25rem;
}

.sidebar-nav .nav-group-nested {
  margin-bottom: 0.25rem;
}

.sidebar-nav .nav-group-nested .nav-group-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: none;
  padding: 0.35rem 1rem;
}

.sidebar-nav .nav-group-nested .nav-submenu {
  margin-left: 1rem;
  padding-left: 0.35rem;
  max-height: 300px;
}

.sidebar-nav .nav-sublink {
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  opacity: 0.95;
  margin: 0.33rem 0.105rem;
  border-radius: 0 8px 8px 0;
}

.sidebar-nav .nav-sublink:hover {
  transform: translateX(4px);
}

.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-link-logout {
  color: #94a3b8 !important;
  font-size: 0.85rem;
}

.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dashboard-topbar {
  height: var(--topbar-height);
  padding: 0 1rem 0 0.5rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
  transition: box-shadow var(--dur-normal) ease, background var(--dur-normal) ease;
}

.topbar-sidebar-toggle {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}

.topbar-sidebar-toggle:hover {
  background: var(--color-bg);
  transform: scale(1.05);
}

.topbar-sidebar-toggle:active {
  transform: scale(0.95);
}

.topbar-title {
  flex: 1;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  animation: ui-fade-up var(--dur-slow) var(--ease-out-smooth) both;
  letter-spacing: -0.02em;
}

.topbar-profile {
  position: relative;
}

.topbar-profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border: none;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition:
    background var(--dur-normal) ease,
    box-shadow var(--dur-normal) ease,
    transform var(--dur-fast) var(--ease-out-smooth);
}

.topbar-profile-trigger:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.topbar-profile-trigger.open {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.topbar-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.topbar-profile-avatar-img {
  object-fit: cover;
  background: var(--color-bg);
}

.topbar-profile-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-profile-chevron {
  font-size: 0.75rem;
  opacity: 0.8;
  transition: transform 0.25s ease;
}

.topbar-profile-trigger.open .topbar-profile-chevron {
  transform: rotate(180deg);
}

.topbar-profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1), var(--shadow-md);
  padding: 0.35rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity var(--dur-normal) var(--ease-out-smooth),
    transform var(--dur-normal) var(--ease-out-smooth),
    visibility var(--dur-normal);
  z-index: 100;
}

.topbar-profile-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.topbar-profile-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--dur-fast) ease, padding-left var(--dur-fast) var(--ease-out-smooth);
}

.topbar-profile-item:hover {
  background: var(--color-bg);
  padding-left: 1.15rem;
}

.topbar-profile-item i {
  font-size: 1rem;
  opacity: 0.85;
}

.dashboard-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* ========== Cards ========== */
.card {
  background: var(--color-card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition:
    box-shadow var(--dur-normal) var(--ease-out-smooth),
    transform var(--dur-normal) var(--ease-out-smooth),
    border-color var(--dur-fast) ease;
  animation: ui-fade-up var(--dur-slow) var(--ease-out-smooth) both;
}

.card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.card-title {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.dashboard-content .main section {
  margin-bottom: 1.5rem;
}

.dashboard-content .main section h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.home-welcome {
  animation: ui-fade-up var(--dur-slow) var(--ease-out-smooth) both;
}

/* Inicio: quitar “caja” doble; el tablero lleva sus propias tarjetas */
.dashboard-content > .card:has(.home-hero) {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 0;
  animation: none;
}

.dashboard-content > .card:has(.home-hero):hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

/* ========== Inicio / tablero de widgets ========== */
.home-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0%, rgba(15, 118, 110, 0.02) 50%, transparent 100%);
  border-radius: 14px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  animation: ui-fade-up var(--dur-slow) var(--ease-out-smooth) both;
}

.home-hero__text {
  flex: 1;
  min-width: 200px;
}

.home-hero__text .home-welcome {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  animation: none;
}

.home-hero__cta {
  align-self: center;
  flex-shrink: 0;
}

.home-widgets {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
}

.home-widgets__row {
  display: flex;
  flex-flow: row wrap;
  gap: 1.25rem;
  align-items: stretch;
  min-width: 0;
}

/* Zona de destino invisible al final: al arrastrar un widget hacia abajo se crea una fila nueva */
.home-widgets__row--tail {
  min-height: 36px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-sizing: border-box;
}

.home-widget {
  --span: 12;
  display: flex;
  flex-direction: column;
  /* Ancho visible según peso (1–36): si no cambia al arrastrar, el problema era flex-grow con un solo bloque */
  flex: 0 1 calc(100% * var(--span) / 36);
  box-sizing: border-box;
  max-width: 100%;
  min-width: min(100%, 8rem);
  background: var(--color-card);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition:
    box-shadow var(--dur-normal) var(--ease-out-smooth),
    transform var(--dur-normal) var(--ease-out-smooth),
    border-color var(--dur-fast) ease;
  animation: ui-fade-up 0.55s var(--ease-out-smooth) both;
}

@media (max-width: 768px) {
  .home-widgets__row .home-widget {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }

  .home-widget__resize {
    display: none !important;
  }
}

.home-widget:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}

/* Ancho relativo dentro de la fila: flex-grow = --span (1–36) */

.home-widgets--editable .home-widget {
  position: relative;
}

.home-widgets--editable .home-widget__header {
  cursor: grab;
  user-select: none;
  padding-right: 2.25rem;
}

.home-widgets--editable .home-widget__header:active {
  cursor: grabbing;
}

.home-widget__resize {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 16px;
  z-index: 15;
  cursor: ew-resize;
  touch-action: none;
  pointer-events: auto;
  border-radius: 0 16px 16px 0;
  -webkit-user-select: none;
  user-select: none;
}

.home-widgets--editable .home-widget__resize {
  /* Siempre un poco visible para poder cliquear (opacity:0 fallaba en algunos casos) */
  opacity: 0.22;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.home-widgets--editable .home-widget:hover .home-widget__resize {
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(15, 118, 110, 0.18));
}

body.home-widget-resizing {
  cursor: ew-resize !important;
  user-select: none;
}

body.home-widget-resizing .home-widget__resize {
  opacity: 1;
}

.home-widget--ghost {
  opacity: 0.45;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.home-widget--chosen {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.home-widget__header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.home-widget__icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.12), rgba(15, 118, 110, 0.06));
  color: var(--color-primary);
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.08);
}

.home-widget__titles {
  flex: 1;
  min-width: 0;
}

.home-widget__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.home-widget__desc {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.home-widget__corner-link {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 20;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition:
    color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-spring);
}

.home-widget__corner-link:hover {
  color: var(--color-primary);
  background: #fff;
  transform: scale(1.06);
}

.home-widget__body {
  flex: 1;
  padding: 0.85rem 1rem 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-widget__fallback {
  margin: 0 0 1rem;
  text-align: center;
}

/* Contenido interno de widgets (CRM, etc.) */
.widget-content {
  flex: 1;
  font-size: 0.875rem;
}

.widget-mini-table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  border-radius: 10px;
}

.widget-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.widget-table th {
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: #f1f5f9;
  border: none;
}

.widget-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  transition: background var(--dur-fast) ease;
}

.widget-table tbody tr:hover td {
  background: #f8fafc;
}

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

.widget-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.widget-num--money {
  font-weight: 600;
  color: var(--color-primary);
}

.widget-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.widget-muted {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.widget-link-name {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.widget-link-name:hover {
  color: var(--color-primary);
}

.widget-footer {
  margin-top: auto;
  padding: 0.75rem 0 1rem;
  border-top: 1px dashed var(--color-border);
}

.widget-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: gap var(--dur-fast) var(--ease-out-smooth), color var(--dur-fast) ease;
}

.widget-footer-link:hover {
  gap: 0.55rem;
  color: var(--color-primary-hover);
}

.widget-empty-msg {
  margin: 0.5rem 0 0.75rem;
  padding: 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  background: #f8fafc;
  border-radius: 10px;
}

.widget-empty-msg i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
  opacity: 0.45;
}

/* Timeline actividades */
.widget-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.25rem;
}

.widget-timeline__item {
  position: relative;
  padding: 0 0 0.85rem 1.15rem;
  border-left: 2px solid #e2e8f0;
}

.widget-timeline__item:last-child {
  border-left-color: transparent;
  padding-bottom: 0.25rem;
}

.widget-timeline__dot {
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.widget-timeline__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.widget-timeline__tipo {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.widget-timeline__titulo {
  font-size: 0.88rem;
  color: var(--color-text);
}

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

/* Lista tipo tarjetas (pipeline) */
.widget-cards-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget-cards-list__item {
  margin-bottom: 0.45rem;
}

.widget-cards-list__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition:
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out-smooth);
}

.widget-cards-list__link:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  transform: translateX(4px);
}

.widget-cards-list__title {
  flex: 1;
  font-weight: 600;
  font-size: 0.88rem;
  min-width: 0;
}

.widget-cards-list__meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.widget-cards-list__chev {
  font-size: 0.85rem;
  opacity: 0.4;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.widget-cards-list__link:hover .widget-cards-list__chev {
  opacity: 0.9;
  transform: translateX(2px);
}

/* Seguimientos */
.widget-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget-alert-list__item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.4rem;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.widget-alert-list__item--act {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), transparent);
  border-left: 3px solid #f59e0b;
}

.widget-alert-list__item--opp {
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.1), transparent);
  border-left: 3px solid var(--color-primary);
}

.widget-alert-list__item i {
  flex-shrink: 0;
  margin-top: 0.1rem;
  opacity: 0.85;
}

.widget-alert-list__item a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.widget-alert-list__item a:hover {
  text-decoration: underline;
}

/* Estado vacío inicio */
.home-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 420px;
  margin: 2rem auto;
  animation: ui-fade-up var(--dur-slow) var(--ease-out-smooth) both;
}

.home-empty__illustration {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  color: var(--color-text-muted);
  font-size: 2.5rem;
}

.home-empty__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.home-empty__text {
  margin: 0 0 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Página configurar widgets (contenido home) */
.home-config-hero {
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.07), transparent);
  border-radius: 14px;
  border: 1px solid var(--color-border);
}

.home-config-hero p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.home-config-section {
  margin-bottom: 2rem;
}

.home-config-section__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
}

.home-config-add-card {
  max-width: 480px;
  padding: 1.25rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.home-config-add-card .form-group {
  margin-bottom: 1rem;
}

.home-config-add-card select.form-control {
  max-width: 100%;
}

/* Tarjetas para elegir widget (contenido home) */
.home-widget-pick-intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.home-widget-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.home-widget-pick-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition:
    box-shadow var(--dur-normal) var(--ease-out-smooth),
    border-color var(--dur-fast) ease,
    transform var(--dur-normal) var(--ease-out-smooth);
}

.home-widget-pick-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.home-widget-pick-card__visual {
  position: relative;
  height: 140px;
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.16), rgba(15, 118, 110, 0.05));
  overflow: hidden;
}

.home-widget-pick-card:nth-child(6n + 2) .home-widget-pick-card__visual {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.05));
}

.home-widget-pick-card:nth-child(6n + 3) .home-widget-pick-card__visual {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.14), rgba(139, 92, 246, 0.05));
}

.home-widget-pick-card:nth-child(6n + 4) .home-widget-pick-card__visual {
  background: linear-gradient(145deg, rgba(234, 88, 12, 0.12), rgba(234, 88, 12, 0.04));
}

.home-widget-pick-card:nth-child(6n + 5) .home-widget-pick-card__visual {
  background: linear-gradient(145deg, rgba(220, 38, 38, 0.12), rgba(220, 38, 38, 0.04));
}

.home-widget-pick-card:nth-child(6n + 6) .home-widget-pick-card__visual {
  background: linear-gradient(145deg, rgba(5, 150, 105, 0.14), rgba(5, 150, 105, 0.05));
}

.home-widget-pick-card__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-widget-pick-card__thumb.is-hidden {
  display: none !important;
}

.home-widget-pick-card__icon-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.home-widget-pick-card__icon-fallback.is-visible {
  display: flex;
}

.home-widget-pick-card__icon-fallback .bi {
  font-size: 3.25rem;
  color: rgba(15, 118, 110, 0.55);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

.home-widget-pick-card:nth-child(6n + 2) .home-widget-pick-card__icon-fallback .bi {
  color: rgba(37, 99, 235, 0.55);
}

.home-widget-pick-card:nth-child(6n + 3) .home-widget-pick-card__icon-fallback .bi {
  color: rgba(124, 58, 237, 0.5);
}

.home-widget-pick-card:nth-child(6n + 4) .home-widget-pick-card__icon-fallback .bi {
  color: rgba(234, 88, 12, 0.5);
}

.home-widget-pick-card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
}

.home-widget-pick-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.home-widget-pick-card__desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  flex: 1;
}

.home-widget-pick-card__meta {
  margin: 0;
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.home-widget-pick-card__code {
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

.home-widget-pick-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border);
}

.home-widget-pick-card__form {
  display: inline;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .home-widget-pick-card:hover {
    transform: none;
  }
  .home-widget:hover {
    transform: none;
  }
  .home-widget {
    animation: none;
  }
  .widget-cards-list__link:hover {
    transform: none;
  }
}

/* ========== Tablas ========== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--dur-fast) ease;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:hover td {
  background: #f8fafc;
}

/* ========== DataTables 2.x (estilo rain/poppy) ========== */
/* DataTables 2.0 usa div.dt-container en vez de div.dataTables_wrapper */
.dashboard-content .dt-container {
  --dt-rain: #546e7a;
  --dt-rain-dark-6: #455a64;
  --dt-rain-dark-4: #4a6270;
  --dt-rain-dark-2: #4d6572;
  --dt-rain-light-35: #90a4ae;
  --dt-subtle: #78909c;
  --dt-poppy: #ff5722;
  font-family: inherit;
}

/* Controles: dt-length = "Mostrar X", dt-search = "Buscar" */
.dashboard-content .dt-container .dt-length label,
.dashboard-content .dt-container .dt-search label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: normal;
}

.dashboard-content .dt-container .dt-length select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--dt-rain-dark-2);
  border-radius: 5px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
}

.dashboard-content .dt-container .dt-search input {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--dt-rain-dark-2) !important;
  border-radius: 5px !important;
  font-size: 0.9rem;
  margin-left: 0.25rem;
  min-width: 180px;
}

.dashboard-content .dt-container .dt-search input:focus {
  outline: none;
  border-color: var(--dt-rain) !important;
  box-shadow: 0 0 0 2px rgba(84,110,122,0.2);
}

/* Tabla */
.dashboard-content .dt-container table.dataTable {
  width: 100% !important;
  border-collapse: collapse !important;
}

/* Cabecera: fondo oscuro, texto blanco */
.dashboard-content .dt-container table.dataTable thead th,
.dashboard-content .dt-container table.dataTable thead td {
  background-color: #f4f7fa !important;
  color: #474747 !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  text-align: left !important;
  padding: 10px !important;
  border: 1px solid #f0f2f3 !important;
}

.dashboard-content .dt-container table.dataTable thead th.dt-orderable-asc:hover,
.dashboard-content .dt-container table.dataTable thead th.dt-orderable-desc:hover {
  background-color: var(--dt-rain) !important;
  outline: none !important;
}

/* Filas impares (blancas) */
.dashboard-content .dt-container table.dataTable tbody tr:nth-child(odd) td,
.dashboard-content .dt-container table.dataTable tbody tr:nth-child(odd) th {
  background-color: #fff !important;
}

/* Filas pares (gris azulado claro) */
.dashboard-content .dt-container table.dataTable tbody tr:nth-child(even) td,
.dashboard-content .dt-container table.dataTable tbody tr:nth-child(even) th {
  box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-stripe), 0.05);
}

/* Celdas */
.dashboard-content .dt-container table.dataTable tbody td,
.dashboard-content .dt-container table.dataTable tbody th {
  padding: 10px !important;
  font-size: 0.9rem !important;
  color: #494c53 !important;
  border: 1px solid #f0f2f3 !important;
  vertical-align: middle !important;
}

/* Hover filas */
.dashboard-content .dt-container table.dataTable tbody tr:hover td,
.dashboard-content .dt-container table.dataTable tbody tr:hover th {
  background-color: var(--dt-rain-light-35) !important;
  color: #fff !important;
}

/* Info (pie izquierdo) */
.dashboard-content .dt-container .dt-info {
  font-size: 0.9rem;
  color: var(--dt-rain-light-35);
  padding: 0;
  margin-top: 0.25rem;
}

/* Paginación: botones con estilo .button del adjunto */
.dashboard-content .dt-container .dt-paging .dt-paging-button {
  min-width: 2rem;
  padding: 7px 0.8rem !important;
  margin: 0 2px !important;
  border-radius: 5px !important;
  border: none !important;
  background: #607d8b !important;
  color: #fff !important;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none !important;
  line-height: 1;
  transition: background 0.2s;
}

.dashboard-content .dt-container .dt-paging .dt-paging-button:hover:not(.disabled):not(.current) {
  background: var(--dt-rain) !important;
  color: #fff !important;
  border: none !important;
}

.dashboard-content .dt-container .dt-paging .dt-paging-button.current,
.dashboard-content .dt-container .dt-paging .dt-paging-button.current:hover {
  background: var(--dt-poppy) !important;
  color: #fff !important;
  border: none !important;
}

.dashboard-content .dt-container .dt-paging .dt-paging-button.disabled,
.dashboard-content .dt-container .dt-paging .dt-paging-button.disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--dt-subtle) !important;
  color: #fff !important;
}

/* Responsive móvil: formato tarjetas */
@media (max-width: 767px) {
  .dashboard-content .dt-container table.dataTable {
    display: block;
  }
  .dashboard-content .dt-container table.dataTable thead {
    display: none;
  }
  .dashboard-content .dt-container table.dataTable tbody {
    display: block;
  }
  .dashboard-content .dt-container table.dataTable tbody tr {
    display: block;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--dt-rain-dark-2);
  }
  .dashboard-content .dt-container table.dataTable tbody td {
    display: block !important;
    text-align: center !important;
    padding: 8px 10px 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--dt-rain-dark-2) !important;
    background: transparent !important;
  }
  .dashboard-content .dt-container table.dataTable tbody td:before {
    content: attr(data-title);
    color: var(--dt-rain-light-35);
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
  }
}

@media (min-width: 768px) {
  .dashboard-content .dt-container table.dataTable tbody td:before {
    display: none;
  }
}

/* ========== Table toolbar ========== */
.table-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  animation: ui-fade-up var(--dur-slow) var(--ease-out-smooth) both;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.toolbar-search input[type="text"] {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.875rem;
  min-width: 220px;
  font-family: inherit;
}

.toolbar-search input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(15,118,110,0.15);
}

/* ========== Action buttons in table cells ========== */
.action-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ========== Status badges ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.status-badge--on  { background: #d1fae5; color: #065f46; }
.status-badge--off { background: #fee2e2; color: #991b1b; }

/* ========== Role badge ========== */
.role-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  background: #eff6ff;
  color: #1d4ed8;
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ========== Actividades list (cards) ========== */
.actividades-cards {
  margin-top: 0.5rem;
}

.actividades-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.actividad-card {
  --act-tipo: #64748b;
  position: relative;
  padding: 1rem 1.15rem 1rem 1.25rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--act-tipo);
  border-radius: 12px;
  box-shadow:
    inset 0 3px 0 0 var(--act-tipo),
    0 2px 8px rgba(15, 23, 42, 0.06);
  transition:
    box-shadow var(--dur-normal) ease,
    transform var(--dur-fast) var(--ease-out-smooth),
    border-color var(--dur-fast) ease;
}

.actividad-card:hover {
  box-shadow:
    inset 0 3px 0 0 var(--act-tipo),
    0 10px 28px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--act-tipo) 35%, var(--color-border));
}

.actividad-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  row-gap: 0.35rem;
}

.actividad-tipo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--act-tipo) 16%, transparent);
  color: var(--act-tipo);
  flex-shrink: 0;
}

.actividad-titulo {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
  flex: 1 1 140px;
  min-width: 0;
}

.actividad-meta {
  font-size: 0.8rem;
}

.actividad-fecha {
  margin-left: auto;
  font-size: 0.8rem;
  white-space: nowrap;
}

.actividad-seguimiento {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
  padding: 0.45rem 0.65rem;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 8px;
}

.actividad-contenido {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0.5rem 0 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.actividad-adjunto {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.actividad-actions {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--color-border);
}

/* Compatibilidad: listas antiguas con .actividad-item */
.actividad-item {
  border-left: 4px solid #64748b;
  padding: 0.85rem 1rem;
  background: var(--color-card);
  border-radius: 0 10px 10px 0;
  box-shadow: var(--shadow);
  transition: box-shadow var(--dur-normal) ease, transform var(--dur-fast) var(--ease-out-smooth);
}

.actividad-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateX(2px);
}

/* ========== select pequeño ========== */
.form-select-sm {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-size: 0.8rem;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
}

/* ========== Pipeline kanban (mejorado) ========== */
@keyframes pipeline-card-land {
  0% {
    opacity: 0.92;
    transform: scale(0.985) translateY(6px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }
}

@keyframes pipeline-total-flash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 45%, transparent);
  }
  45% {
    transform: scale(1.12);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-primary) 22%, transparent);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 transparent;
  }
}

@keyframes pipeline-busy {
  0%,
  100% {
    opacity: 0.62;
  }
  50% {
    opacity: 0.82;
  }
}

@keyframes pipeline-empty-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Halo de la tarjeta en vuelo: un solo ciclo, acoplado a --pipeline-flip-duration */
@keyframes pipeline-card-flying-glow {
  0%,
  100% {
    filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.05));
  }
  50% {
    filter: drop-shadow(0 4px 11px rgba(15, 23, 42, 0.065));
  }
}

/* Todas las etapas visibles a la vez: columnas reparten el ancho (sin scroll horizontal) */
.pipeline-kanban {
  display: flex;
  gap: clamp(0.4rem, 1.2vw, 0.85rem);
  width: 100%;
  min-width: 0;
  overflow-x: visible;
  padding-bottom: 0.5rem;
  align-items: flex-start;
}

.pipeline-columna {
  flex: 1 1 0;
  min-width: 0;
  background: #f1f5f9;
  border-radius: 10px;
  padding: clamp(0.5rem, 1.5vw, 0.85rem);
}

.pipeline-columna__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  min-width: 0;
}

.pipeline-columna__title {
  font-weight: 700;
  font-size: clamp(0.78rem, 1.4vw, 0.9rem);
  color: var(--color-text);
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-columna__total {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  display: inline-block;
  transition: transform var(--dur-normal) var(--ease-out-smooth);
}

.pipeline-columna__total--flash {
  animation: pipeline-total-flash 0.55s var(--ease-spring) both;
}

.pipeline-card {
  background: var(--color-card);
  padding: clamp(0.55rem, 1.8vw, 0.85rem);
  margin-bottom: 0.5rem;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-border);
  min-width: 0;
  transition:
    box-shadow var(--dur-normal) var(--ease-out-smooth),
    transform var(--dur-normal) var(--ease-out-smooth),
    border-color var(--dur-fast) ease,
    filter var(--dur-normal) var(--ease-out-smooth);
}

.pipeline-card:hover {
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.pipeline-card--busy {
  opacity: 0.65;
  pointer-events: none;
  animation: pipeline-busy 1.1s ease-in-out infinite;
}

.pipeline-card--land {
  animation: pipeline-card-land 0.42s var(--ease-out-smooth) both;
  z-index: 1;
}

/* Transición entre etapas (FLIP): tarjeta “viaja” a la nueva columna */
.pipeline-card--flying {
  position: relative;
  z-index: 30;
  pointer-events: none;
  will-change: transform, filter;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.055);
  animation: pipeline-card-flying-glow var(--pipeline-flip-duration, 520ms)
    ease-in-out forwards;
}

.pipeline-card__title {
  display: block;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  margin-bottom: 0.3rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pipeline-card__monto {
  font-size: clamp(0.72rem, 1.3vw, 0.82rem);
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 0.2rem;
  overflow-wrap: anywhere;
}

.pipeline-card__meta {
  font-size: clamp(0.68rem, 1.2vw, 0.78rem);
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pipeline-card__footer {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Ver + Editar en una sola fila (columnas estrechas del Kanban) */
.pipeline-card .action-btns {
  flex-wrap: nowrap;
  gap: 0.2rem;
}

.pipeline-card .action-btns .btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  padding: 0.26rem 0.35rem;
  font-size: 0.7rem;
  gap: 0.18rem;
  border-radius: 4px;
  line-height: 1.25;
}

.pipeline-card .action-btns .btn i {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.pipeline-move-form select {
  width: 100%;
}

.pipeline-empty {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 1rem 0;
}

.pipeline-empty--appear {
  animation: pipeline-empty-in 0.38s var(--ease-out-smooth) both;
}

/* ========== Tabs ========== */
.tabs-container {
  margin-top: 0.25rem;
  animation: ui-fade-in var(--dur-slow) var(--ease-out-smooth) both;
}

.tabs-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition:
    color var(--dur-fast) ease,
    border-color var(--dur-normal) var(--ease-out-smooth),
    background var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-spring);
}

.tab-btn:hover {
  color: var(--color-text);
  background: rgba(0,0,0,0.03);
  transform: translateY(-1px);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
  transform: translateY(0);
}

.tab-badge {
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-spring);
}

.tab-btn:hover .tab-badge {
  transform: scale(1.08);
}

.tabs-actions {
  margin-left: auto;
  padding-bottom: 0.5rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: ui-fade-up var(--dur-normal) var(--ease-out-smooth) both;
}

.tab-description {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

/* ========== Module Grid / Cards ========== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.module-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    box-shadow var(--dur-normal) var(--ease-out-smooth),
    transform var(--dur-normal) var(--ease-out-smooth),
    border-color var(--dur-fast) ease;
  animation: ui-fade-up var(--dur-slow) var(--ease-out-smooth) both;
}

.module-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
  border-color: #cbd5e1;
}

.module-card--enabled {
  border-top: 3px solid var(--color-primary);
}

.module-card--disabled {
  border-top: 3px solid #94a3b8;
  opacity: 0.85;
}

.module-card--system {
  border-top: 3px solid #7c3aed;
}

.module-card__icon {
  padding: 1.1rem 1.25rem 0;
  font-size: 1.6rem;
  color: var(--color-text-muted);
}

.module-card--system .module-card__icon {
  color: #7c3aed;
}

.module-card--enabled .module-card__icon {
  color: var(--color-primary);
}

.module-card__body {
  padding: 0.5rem 1.25rem 0.75rem;
  flex: 1;
}

.module-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.module-card__name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
}

.module-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.module-badge--system   { background: #ede9fe; color: #6d28d9; }
.module-badge--enabled  { background: #d1fae5; color: #065f46; }
.module-badge--disabled { background: #f1f5f9; color: #64748b; }
.module-badge--available{ background: #dbeafe; color: #1e40af; }

.module-card__desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
  line-height: 1.45;
}

.module-card__meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.module-card__meta i {
  margin-right: 0.2rem;
}

.module-card__footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.empty-state p {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

/* ========== Botones ========== */
/* ============================================================
   BOTONES — colores + animaciones
   ============================================================ */
@keyframes btn-ripple {
  to { transform: scale(4); opacity: 0; }
}

.btn,
button:not(.tab-btn):not(.nav-group-header),
input[type="submit"]:not([class]),
input[type="button"]:not([class]) {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
  /* Animación base */
  transition:
    background-color 0.18s ease,
    color            0.18s ease,
    border-color     0.18s ease,
    box-shadow       0.18s ease,
    transform        0.12s ease;
}

/* Efecto elevación al hover */
.btn:hover,
button:not(.tab-btn):not(.nav-group-header):not([class]):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}

/* Efecto presión al hacer click */
.btn:active,
button:not(.tab-btn):not(.nav-group-header):not([class]):active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition-duration: 0.06s;
}

/* Ripple al hacer click */
.btn .btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  width: 8px;
  height: 8px;
  pointer-events: none;
  transform: scale(0);
  animation: btn-ripple 0.55s linear;
}

/* ── Primary (verde-azulado) ── */
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(15,118,110,0.35);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: 0 5px 14px rgba(15,118,110,0.4);
  color: #fff;
}
.btn-primary:active { box-shadow: 0 1px 4px rgba(15,118,110,0.3); }

/* ── Outline ── */
.btn-outline {
  background: #3e3ccc;
  color: #ffffff;
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--color-text);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

/* ── Secondary ── */
.btn-secondary {
  background: #e2e8f0;
  color: var(--color-text);
  border-color: #cbd5e1;
}
.btn-secondary:hover {
  background: #cbd5e1;
  border-color: #94a3b8;
  color: var(--color-text);
}

/* ── Success (verde) ── */
.btn-success {
  background: #059669;
  color: #fff;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(5,150,105,0.35);
}
.btn-success:hover {
  background: #047857;
  border-color: #047857;
  box-shadow: 0 5px 14px rgba(5,150,105,0.4);
  color: #fff;
}

/* ── Warning (naranja) ── */
.btn-warning {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
  box-shadow: 0 2px 6px rgba(217,119,6,0.35);
}
.btn-warning:hover {
  background: #b45309;
  border-color: #b45309;
  box-shadow: 0 5px 14px rgba(217,119,6,0.4);
  color: #fff;
}

/* ── Danger (rojo) ── */
.btn-danger,
button.danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 2px 6px rgba(220,38,38,0.35);
}
.btn-danger:hover,
button.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 5px 14px rgba(220,38,38,0.4);
  color: #fff;
}

/* ── Info (azul) ── */
.btn-info {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2,132,199,0.35);
}
.btn-info:hover {
  background: #0369a1;
  border-color: #0369a1;
  box-shadow: 0 5px 14px rgba(2,132,199,0.4);
  color: #fff;
}

/* ── Tamaños ── */
.btn-sm {
  font-size: 0.8rem;
  border-radius: 5px;
  gap: 0.3rem;
}

.btn-lg {
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
}

/* Botones deshabilitados */
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* ========== CRM nav grid ========== */
.crm-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.alert-card {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  border-left: 4px solid transparent;
}

.alert-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.alert-card p {
  margin: 0.2rem 0;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.alert-card--warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
  color: #78350f;
}

/* ========== Formularios ========== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.text-muted {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* ========== Modales ========== */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop[hidden] {
  display: flex !important; /* se muestra pero invisible hasta modal-visible */
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease-out-smooth);
}

.modal-backdrop.modal-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop.modal-visible .modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-box {
  background: var(--color-card);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(28px) scale(0.96);
  opacity: 0;
  transition:
    transform var(--dur-normal) var(--ease-out-smooth),
    opacity var(--dur-normal) var(--ease-out-smooth);
}

.modal-box--sm {
  max-width: 420px;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-card);
  border-radius: 12px 12px 0 0;
  z-index: 1;
}

.modal-header--danger {
  background: #fef2f2;
  border-bottom-color: #fecaca;
}

.modal-header--danger .modal-title {
  color: #b91c1c;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-text);
}

.modal-close {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--color-text-muted) !important;
  padding: 0.3rem !important;
  border-radius: 6px !important;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: #f1f5f9 !important;
  color: var(--color-text) !important;
  transform: none !important;
  box-shadow: none !important;
}

.modal-form {
  padding: 1.25rem 1.4rem 0;
}

.modal-body {
  padding: 1.25rem 1.4rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 0 1.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.required {
  color: #dc2626;
  font-size: 0.8rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ========== Perfil ========== */
.profile-view {
  max-width: 400px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.profile-dl {
  margin: 0 0 1.5rem 0;
}

.profile-dl dt {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

.profile-dl dt:first-of-type {
  margin-top: 0;
}

.profile-dl dd {
  margin: 0.25rem 0 0 0;
  font-size: 1rem;
}

.profile-avatar-large.profile-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 0;
}

.profile-photo-section .form-control {
  max-width: 100%;
}

.profile-edit-avatar-wrap {
  margin-bottom: 0.75rem;
}

.profile-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 0.5rem;
}

.profile-remove-photo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: normal;
  font-size: 0.875rem;
  cursor: pointer;
}

form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form select {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

form input:focus,
form select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}

form button,
form input[type="submit"] {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--color-primary);
  color: #fff;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
}

form button:hover,
form input[type="submit"]:hover {
  background: var(--color-primary-hover);
}

/* ========== Utilidades ========== */
.error {
  color: #b91c1c;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border-radius: 6px;
}

.success {
  color: #166534;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: #f0fdf4;
  border-radius: 6px;
}

.muted {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.dashboard-content p {
  margin: 0.5rem 0;
}

.dashboard-content a:not(.btn):not(.nav-link) {
  color: var(--color-primary);
  text-decoration: none;
}

.dashboard-content a:not(.btn):not(.nav-link):hover {
  text-decoration: underline;
}

/* ========== Login (página sin dashboard) ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
}

.login-box {
  background: var(--color-card);
  padding: 2rem;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 380px;
  animation: ui-fade-up var(--dur-slow) var(--ease-out-smooth) both;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.login-brand-icon {
  font-size: 2.25rem;
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.35rem;
}

.login-brand-name {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.login-brand-tagline {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.35;
}

.login-heading {
  margin: 0 0 1rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}

.btn-login-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem !important;
  justify-content: center;
}

.login-form label {
  margin-bottom: 0.5rem;
}

.login-form input {
  width: 100%;
  margin-bottom: 1rem;
}

.login-form button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .dashboard-sidebar {
    width: 100%;
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .sidebar-brand {
    width: 100%;
    padding: 0.5rem;
    border-bottom: none;
    text-align: center;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.25rem;
    flex: 1;
  }

  .sidebar-nav .nav-link {
    padding: 0.4rem 0.75rem;
    border-left: none;
    border-radius: 6px;
  }

  .sidebar-footer {
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.5rem;
    text-align: center;
  }

  .dashboard-layout {
    flex-direction: column;
  }

  .dashboard-content {
    padding: 1rem;
  }
}
