/* =====================================================
   O'T CRM — style.css (FINAL FUSIONADO - SIN ERRORES)
   Paleta, layout, sidebar, tarjetas, kanban y utilidades.
   >>> El CSS del chat está separado en chat.css <<<
   ===================================================== */

/* =========================================
   1) VARIABLES (PALETA PREMIUM & ACCESIBILIDAD)
   ========================================= */
:root{
  /* Textos */
  --text-main: #ffffff;
  --text-sec: #cbd5e1;
  --text-muted: #94a3b8;

  /* Marca */
  --brand-green: #10b981;
  --brand-green-hover: #059669;
  --brand-purple: #6366f1;
  --danger: #ef4444;

  /* Fondos / Glass */
  --bg-app: #050505;
  --bg-glass: rgba(20,20,25,.70); 
  --bg-glass-hover: rgba(30,30,35,.80);
  --border-glass: rgba(255,255,255,.15);

  /* Inputs */
  --input-bg: rgba(0,0,0,.30);
  --input-border: rgba(255,255,255,.20);
  --input-focus: rgba(255,255,255,.40);

  /* Z-index */
  --z-video: -100;
  --z-sidebar: 50;
  --z-modal: 1000;
  --z-toast: 2000;
}

/* =========================================
   2) RESET BÁSICO
   ========================================= */
*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* SPA */
}

/* =========================================
   3) BACKGROUND (VIDEO + OVERLAY)
   ========================================= */
#bg-video-global{
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: var(--z-video);
  opacity: .5;
  pointer-events: none;
}
.video-overlay{
  position: fixed; inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,.40) 0%, #000 100%);
  z-index: calc(var(--z-video) + 1);
  pointer-events: none;
}

/* =========================================
   4) LAYOUT (APP + CONTENT + HEADER)
   ========================================= */
.app-container{ display:flex; height:100vh; width:100vw; }

.content-area{
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header superior */
.header-top{
  padding: 20px 30px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,.20);
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.header-title {
    font-size: 1.5rem; font-weight: bold; color: #e9edef; 
    display: flex; align-items: center; gap: 10px;
}

/* =========================================
   5) SIDEBAR (MENU COMPACTO Y REFINADO)
   ========================================= */
.sidebar {
    width: 88px; flex: 0 0 88px;
    background: rgba(10,10,14,.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex; flex-direction: column;
    z-index: var(--z-sidebar);
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap; overflow: visible; 
}
.sidebar:hover { width: 260px; }

/* HEADER SIDEBAR */
.sidebar-header {
    height: 80px; padding: 0 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex; align-items: center; gap: 15px; 
    overflow: hidden; width: 100%;
}
.logo-circle {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, #e4e4e7 0%, #9ca3af 100%);
    color: #000; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1rem; flex-shrink: 0;
    box-shadow: 0 0 15px rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}
.sidebar:hover .logo-circle { transform: rotate(360deg); }

.brand-text {
    font-size: 1.2rem; font-weight: 800; color: #fff; letter-spacing: 2px;
    opacity: 0; transition: opacity 0.3s ease; transform: translateX(-20px);
}
.sidebar:hover .brand-text { opacity: 1; transform: translateX(0); transition-delay: 0.1s; }

/* MENÚ LISTA */
.menu-list {
    list-style: none; padding: 20px 15px; margin: 0;
    display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto;
    overflow: hidden; width: 100%;
}
.menu-item a {
    display: flex; align-items: center; gap: 18px; 
    padding: 12px 16px; color: var(--text-sec);
    text-decoration: none; border-radius: 12px;
    transition: all 0.2s ease; font-weight: 600; font-size: 0.95rem;
}
.menu-item a i { width: 24px; text-align: center; font-size: 1.2rem; flex-shrink: 0; }
.link-text { opacity: 0; transition: opacity 0.2s; }
.sidebar:hover .link-text { opacity: 1; transition-delay: 0.1s; }

.menu-item a:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-item.active a {
    background: linear-gradient(90deg, rgba(16,185,129,.15), transparent);
    color: var(--brand-green); border-left: 3px solid var(--brand-green);
}

/* FOOTER SIDEBAR */
.sidebar-footer {
    width: 100%; height: 80px; padding: 0 10px; 
    background: rgba(0,0,0,0.6); 
    border-top: 1px solid var(--border-glass);
    display: flex; align-items: center; justify-content: center; 
    gap: 0; position: relative; 
    overflow: visible !important; z-index: 100;
}

.sidebar:hover .sidebar-footer { justify-content: space-between; padding: 0 15px; gap: 10px; }

.footer-left { 
    display: flex; align-items: center; gap: 0; 
    flex-shrink: 0; justify-content: center; 
}
.sidebar:hover .footer-left { gap: 12px; justify-content: flex-start; flex: 1; overflow: hidden; }

.avatar-container { flex-shrink: 0; display: flex; justify-content: center; align-items: center; }
.user-img, .user-avatar-placeholder {
    width: 42px; height: 42px; border-radius: 50%;
    object-fit: cover; border: 2px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,#333,#111); color: white; font-weight: bold;
}

.user-info { display: none; white-space: nowrap; }
.user-info span { display: block; font-size: 0.95rem; font-weight: 600; color: var(--text-main); }
.user-info small { display: block; font-size: 0.75rem; color: var(--text-sec); }

.sidebar:hover .user-info { display: block; animation: fadeIn 0.3s ease; }

.sidebar-footer .btn-icon {
    width: 32px; height: 32px; border-radius: 6px;
    display: none; align-items: center; justify-content: center;
    color: var(--text-sec); transition: all 0.2s ease; flex-shrink: 0;
}
.sidebar:hover .sidebar-footer .btn-icon { display: flex; } 
.sidebar-footer .btn-icon:hover { background: rgba(255,255,255,0.1); color: #fff; }

.menu-container { position: relative; display: none; overflow: visible; }
.sidebar:hover .menu-container { display: block; animation: fadeIn 0.3s ease; }

/* =========================================
   === MENÚ DESPLEGABLE USUARIO (CORREGIDO) ===
   ========================================= */

/* 1. Aseguramos que el contenedor del botón sea la referencia */
.menu-container { 
    position: relative; /* CRUCIAL: El popover se posicionará relativo a este botón */
    display: none;      /* Oculto en sidebar cerrado */
    overflow: visible;  /* Permite que el menú "salga" hacia arriba */
}

/* Mostrar contenedor al hacer hover en el sidebar */
.sidebar:hover .menu-container { 
    display: block; 
    animation: fadeIn 0.3s ease; 
}

/* 2. El Menú Flotante (Popover) hacia ARRIBA */
#user-menu-popover {
    position: absolute;
    
    /* LÓGICA DE POSICIÓN HACIA ARRIBA */
    bottom: 100%;        /* Lo empuja exactamente encima del botón */
    right: 0;            /* Lo alinea al borde derecho del botón */
    margin-bottom: 12px; /* Espacio de separación entre botón y menú */
    
    /* Dimensiones y Estilo */
    width: 160px;
    background: #1e1e24; /* Color oscuro sólido para que no se trasluzca feo */
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 6px;        /* Padding interno del menú */
    
    /* Sombras y Capas */
    box-shadow: 0 -5px 25px rgba(0,0,0,0.6); /* Sombra potente para destacar */
    z-index: 9999;
    
    /* Comportamiento */
    display: none; 
    flex-direction: column;
    gap: 2px; /* Espacio entre opciones */
}

/* Animación de entrada */
#user-menu-popover.show { 
    display: flex; 
    animation: popUp 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efecto rebote sutil */
}

/* Items del menú */
.dropdown-item {
    background: transparent; 
    border: none; 
    color: var(--text-sec);
    padding: 10px 12px;
    text-align: left; 
    cursor: pointer;
    font-size: 0.9rem; 
    font-weight: 500;
    border-radius: 8px; 
    width: 100%;
    display: flex; 
    align-items: center; 
    gap: 12px;
    text-decoration: none; 
    transition: all 0.2s ease;
}

.dropdown-item i { 
    font-size: 1rem; 
    width: 20px; 
    text-align: center; 
    color: var(--text-muted);
}

/* Hover en las opciones */
.dropdown-item:hover { 
    background: rgba(255,255,255,0.1); 
    color: #fff; 
    transform: translateX(4px); /* Pequeño movimiento a la derecha */
}
.dropdown-item:hover i { color: var(--brand-green); }

/* Animación personalizada hacia arriba */
@keyframes popUp {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.95); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* =========================================
   6) TARJETAS / PANELERÍA
   ========================================= */
.dashboard-content{ padding:30px; width:100%; height:100%; overflow-y:auto; }
.metrics-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:20px; margin-bottom:30px; }
.section-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(400px,1fr)); gap:20px; }

.content-card,.metric-card{
  background: var(--bg-glass);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: 16px; padding: 25px;
  box-shadow: 0 10px 30px rgba(0,0,0,.30);
  transition: transform .2s ease, border-color .2s ease;
}
.content-card:hover,.metric-card:hover{ border-color:rgba(255,255,255,.30); }

.card-header{
  font-size: 1.1rem; font-weight: 700; color: var(--text-main);
  padding-bottom: 15px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
  letter-spacing: .5px;
}

.metric-number{
  font-size: 2.5rem; font-weight: 800; margin-top: 10px;
  background: linear-gradient(45deg,#fff,#aaa);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #fff;
}

.integration-item,.team-member{
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.integration-item:last-child,.team-member:last-child{ border-bottom: none; }

/* =========================================
   7) FORMULARIOS (INPUTS / BOTONES)
   ========================================= */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], textarea, select {
  width: 100%; background: var(--input-bg);
  border: 1px solid var(--input-border); color: #fff;
  padding: 12px 16px; border-radius: 10px;
  font-family: inherit; font-size: .95rem; outline: none;
  transition: .25s ease; appearance: none; -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
  background: rgba(0,0,0,.60); border-color: var(--brand-green);
  box-shadow: 0 0 15px rgba(16,185,129,.10);
}
input::placeholder, textarea::placeholder { color: rgba(255,255,255,.50); }

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button{ -webkit-appearance: none; margin: 0; }
input[type=number]{ -moz-appearance: textfield; appearance: textfield; }

/* Botones */
.btn-primary{
  background: #fff; color: #000;
  padding: 10px 24px; border-radius: 8px; font-weight: 700;
  border: none; cursor: pointer; transition: .2s;
  font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255,255,255,.20); }

.btn-secondary{
  background: transparent; color: #fff;
  border: 1px solid var(--border-glass);
  padding: 8px 18px; border-radius: 8px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: .9rem; font-weight: 500; transition: .2s;
}
.btn-secondary:hover{ background: rgba(255,255,255,.10); border-color: #fff; }

.btn-danger {
    background-color: #ef4444; color: white; border: none;
    padding: 10px 24px; border-radius: 8px;
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
    transition: all 0.2s ease;
}
.btn-danger:hover {
    background-color: #dc2626; box-shadow: 0 8px 15px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}
.btn-danger:active { transform: scale(0.96); box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2); }

.btn-danger-soft { 
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 25px; border-radius: 8px; 
    border: 1px solid rgba(239,68,68,0.5); 
    background: rgba(239,68,68,0.15); color: #fecaca;
    font-weight: 600; cursor: pointer; transition: all 0.3s ease; 
}
.btn-danger-soft:hover { 
    background: rgba(239,68,68,0.3); border-color: rgba(239,68,68,0.7);
    transform: translateY(-2px); box-shadow: 0 5px 15px rgba(239, 68, 68, 0.2);
}

/* =========================================
   8) KANBAN (CON DRAG & DROP STYLES)
   ========================================= */
.kanban-board{
  display: flex; align-items: flex-start;
  gap: 25px; padding: 25px 35px;
  height: 100%; overflow-x: auto;
}
.column{
  background: rgba(20,20,25,.50); backdrop-filter: blur(10px);
  min-width: 320px; width: 320px; flex: 0 0 320px;
  border-radius: 14px; border: 1px solid var(--border-glass);
  border-top: 3px solid var(--brand-purple);
  display: flex; flex-direction: column; max-height: 100%;
}
.col-header{
  padding: 15px; font-weight: 700; color: #fff;
  border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
  /* DRAG & DROP CURSORS */
  cursor: grab; user-select: none;
}
.col-header:active { cursor: grabbing; }

.col-body{
  padding: 10px; flex: 1 1 auto; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; min-height: 100px;
}

/* EFECTO ARRASTRE COLUMNA */
.column.dragging-column { 
    opacity: 0.4; 
    border: 2px dashed #10b981; 
    transform: scale(0.98);
}

/* Card lead */
.card{
  background: rgba(40,40,45,.80);
  border: 1px solid var(--border-glass);
  border-radius: 10px; padding: 12px;
  display: flex; align-items: center; gap: 12px;
  position: relative; cursor: pointer; transition: .2s ease;
}
.card:hover{ background: rgba(60,60,70,.90); border-color: rgba(255,255,255,.30); transform: translateY(-3px); }

.card-avatar{ 
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg,#6366f1,#a855f7);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; color: #fff; flex-shrink: 0;
    position: relative; overflow: hidden;
}
.card-avatar img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.card-avatar .avatar-initial{
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 1rem;
}

.card-badge{
  position: absolute; top: -5px; left: -5px;
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700;
  padding: 2px 6px; border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.card-info{ flex: 1 1 auto; overflow: hidden; }
.card-title{ display: flex; justify-content: space-between; font-weight: 600; font-size: .95rem; margin-bottom: 3px; }
.card-preview{
  font-size: .8rem; color: var(--text-sec);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* =========================================
   9) MODALES (Overlay y Contenido)
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: none; justify-content: center; align-items: center;
}

.modal-mini-content {
    background: #18181b; 
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 1px solid rgba(255,255,255,0.2); 
    padding: 30px; border-radius: 16px;
    width: 90%; max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: modalFadeIn 0.3s ease-out;
}

.modal-mini-content h3 { 
    margin-top: 0; font-size: 1.4rem; margin-bottom: 5px; 
    background: linear-gradient(to right, #fff, #aebac1);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.modal-mini-content p { color: var(--text-sec); font-size: 0.9rem; margin-bottom: 20px; }

.modal-mini-content input {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 14px; color: white;
    font-size: 1rem; border-radius: 8px;
    transition: all 0.3s ease;
}
.modal-mini-content input:focus {
    border-color: var(--brand-green);
    background: rgba(0,0,0,0.6);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 25px; }

.modal-actions button:first-child {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #ddd; padding: 10px 20px;
    border-radius: 8px; font-weight: 500;
    cursor: pointer; transition: 0.2s;
}
.modal-actions button:first-child:hover { background: rgba(255,255,255,0.05); border-color: #fff; }

.modal-actions button:last-child {
    background: var(--brand-green); color: #000;
    border: none; padding: 10px 24px;
    border-radius: 8px; font-weight: 700;
    cursor: pointer; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: 0.2s;
}
.modal-actions button:last-child:hover {
    background: var(--brand-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* =========================================
   10) UTILIDADES GENERALES
   ========================================= */
.btn-icon{
    background: none; border: none; 
    color: var(--text-sec); cursor: pointer; font-size: 1.1rem;
    padding: 5px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { color: #fff; background: rgba(255,255,255,0.1); }

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

.spinner{
  width: 30px; height: 30px;
  border: 3px solid rgba(255,255,255,.10);
  border-top-color: var(--brand-green);
  border-radius: 50%;
  animation: spin 1s linear infinite; margin: 0 auto;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-content{
  position: absolute; right: 0; top: 100%; margin-top: 5px;
  background: #202c33; border: 1px solid var(--border-glass);
  border-radius: 6px; z-index: 999; display: none; flex-direction: column;
  min-width: 150px; box-shadow: 0 4px 15px rgba(0,0,0,.5);
}
.dropdown-content.show{ display: flex; }

.loading-container{ min-height: 220px; display: grid; place-items: center; gap: 8px; }
.loading-container p{ color: var(--text-sec); margin: 0; }

::-webkit-scrollbar{ width: 8px; height: 8px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.20); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,.30); }

/* =========================================
   11) ESTILOS CONFIGURACIÓN WHATSAPP (QR)
   ========================================= */
.container-wsp { 
    max-width: 100%; margin: 2rem auto; padding: 0 16px;
    display: flex; flex-direction: column; align-items: center;
}
.alert-box { width: 100%; max-width: 450px; }

.alert-ok { 
    background: rgba(16,185,129,0.15); 
    color: #befce5; border: 1px solid #10b981; 
    padding: 12px; border-radius: 10px; margin: 10px 0; text-align: center;
}
.alert-err { 
    background: rgba(239,68,68,0.2); 
    color: #fecaca; border: 1px solid #ef4444; 
    padding: 12px; border-radius: 10px; margin: 10px 0; text-align: center;
}

.qr-card { 
    background: linear-gradient(145deg, rgba(30, 30, 36, 0.9), rgba(15, 15, 20, 0.8));
    backdrop-filter: blur(5px);
    border-radius: 16px; padding: 30px; 
    width: 100%; max-width: 450px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    text-align: center; border: 1px solid rgba(255,255,255,0.05);
}

.qr-box { 
    background: rgba(0, 0, 0, 0.3); border-radius: 12px; 
    padding: 20px; margin: 20px 0; min-height: 280px; 
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    border: 1px dashed rgba(255,255,255,0.1);
}
#qr-image {
    width: 220px; height: 220px; display: none; 
    border: 4px solid white; border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
#loading-text { color: var(--text-muted); }
#success-icon { display: none; color: #25D366; text-align: center; }

/* =========================================
   12) EXTRAS: DASHBOARD & EXCEL & MENU
   ========================================= */
.btn-excel-animado {
    display: flex; align-items: center; justify-content: center;
    background-color: #1D6F42; color: white !important;
    text-decoration: none; border-radius: 10px; height: 45px; width: 45px;
    overflow: hidden; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); white-space: nowrap; border: none;
}
.btn-excel-animado i, .btn-excel-animado svg { font-size: 1.2rem; min-width: 45px; display: flex; justify-content: center; }
.btn-excel-animado .texto-btn {
    opacity: 0; max-width: 0; transform: translateX(10px);
    transition: all 0.3s ease; padding-right: 0;
}
.btn-excel-animado:hover { width: 280px; background-color: #155734; padding-right: 20px; justify-content: flex-start; }
.btn-excel-animado:hover .texto-btn { opacity: 1; max-width: 200px; transform: translateX(0); }

.metric-card.alert-mode {
    background: rgba(220, 38, 38, 0.85) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    animation: pulse-red 2s infinite;
    transition: all 0.3s ease;
}
.metric-card.alert-mode h3, .metric-card.alert-mode .metric-number {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    background: none; -webkit-text-fill-color: white; 
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 20px 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.btn-options {
    background: transparent; border: none; color: var(--text-sec);
    cursor: pointer; padding: 5px 10px; border-radius: 4px;
    font-size: 1.1rem; transition: color 0.2s, background 0.2s;
}
.btn-options:hover { color: white; background: rgba(255, 255, 255, 0.1); }

.column-menu {
    position: absolute; top: 40px; right: 10px;
    background-color: #1f1f1f; border: 1px solid #333;
    border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 100; display: none; min-width: 120px;
    overflow: hidden; flex-direction: column;
}
.column-menu.show { display: flex; animation: fadeIn 0.1s ease-out; }
.column-menu button {
    background: transparent; border: none; color: #ddd;
    padding: 10px 15px; text-align: left; cursor: pointer;
    font-size: 0.9rem; display: flex; align-items: center; gap: 10px; width: 100%;
}
.column-menu button:hover { background-color: #333; color: white; }
.column-menu button.delete-btn:hover { color: #ef4444; }

@media (max-width: 1200px){ .sidebar{ width:240px; flex-basis:240px; } }
@media (max-width: 992px){
  .app-container{ flex-direction:column; }
  .sidebar{ width:100%; flex-basis:auto; border-right:none; border-bottom:1px solid var(--border-glass); }
  .kanban-board{ padding:20px; }
}