/* =================================================================
   Dashboard Cards — Global Styles
   Reutilizable en cualquier panel Filament (Logística, Vendedor, Admin)
   ================================================================= */

/* ── Layout grid ── */
.stats-grid { display: grid; gap: 1.5rem; }
.stats-row-1 { grid-template-columns: 1fr; }
.stats-row-2 { grid-template-columns: 1fr 1fr; }
.stats-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── KPI Cards (gradient hero cards) ── */
.kpi-card {
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
}
.kpi-card .kpi-label {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.25rem;
}
.kpi-card .kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.kpi-card .kpi-sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
}

/* Gradient variants */
.kpi-gradient-1 {
    background: var(--bio-graphite-surface, #18181b);
    border: 1px solid rgba(59,130,246,0.3);
}
.kpi-gradient-2 {
    background: var(--bio-graphite-surface, #18181b);
    border: 1px solid rgba(124,58,237,0.3);
}
.kpi-gradient-danger {
    background: var(--bio-graphite-surface, #18181b);
    border: 1px solid rgba(239,68,68,0.3);
}
.kpi-gradient-teal {
    background: var(--bio-graphite-surface, #18181b);
    border: 1px solid rgba(20,184,166,0.3);
}
.kpi-gradient-green {
    background: var(--bio-graphite-surface, #18181b);
    border: 1px solid rgba(22,163,74,0.35);
}

/* ── Gauge Cards ── */
.gauge-card {
    border-radius: 1rem;
    padding: 2rem;
    background: var(--bio-graphite-surface, #18181b);
    border: 1px solid var(--bio-graphite-border, rgba(161, 161, 170, 0.16));
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gauge-card .gauge-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
}
.gauge-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
}
.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* ── Chart Cards ── */
.chart-card {
    border-radius: 1rem;
    padding: 2rem;
    background: var(--bio-graphite-surface, #18181b);
    border: 1px solid var(--bio-graphite-border, rgba(161, 161, 170, 0.16));
}
.chart-card canvas {
    max-height: 300px;
}
.chart-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
}

/* ── Stats Header ── */
.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.stats-header .period-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
}
.stats-header .period-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}
.stats-header .generated {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
}

/* ── Section Titles ── */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title .section-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: rgba(255,255,255,0.5);
}

/* ── Rebote Table ── */
.rebote-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 1rem;
    overflow: hidden;
}
.rebote-table th {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
}
.rebote-table td {
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.rebote-table tr:hover td {
    background: rgba(255,255,255,0.02);
}
.rebote-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.rebote-badge-good { background: rgba(34,197,94,0.15); color: #22c55e; }
.rebote-badge-warn { background: rgba(245,158,11,0.15); color: #f59e0b; }
.rebote-badge-bad  { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ── Promo Table ── */
.promo-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 1rem;
    overflow: hidden;
}
.promo-table th {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
}
.promo-table td {
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.promo-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* ── Empresa Cards ── */
.empresa-card {
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bio-graphite-surface, #18181b);
    border: 1px solid var(--bio-graphite-border, rgba(161, 161, 170, 0.16));
}
.empresa-card .empresa-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.empresa-card .empresa-rebote {
    font-size: 2rem;
    font-weight: 700;
}
.empresa-card .empresa-detail {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.25rem;
}

/* ── Infolist Label/Value Styles (shared across panels) ── */
.fi-in-entry-label,
.fi-in-entry-label > span {
    font-size: 0.6rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.12em !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    margin-bottom: 0.3rem !important;
    color: #9ca3af !important;
}
.dark .fi-in-entry-label,
.dark .fi-in-entry-label > span {
    color: #6b7280 !important;
}
.fi-in-entry-content,
.fi-in-entry-content span {
    font-size: 0.925rem !important;
    font-weight: 500 !important;
}
.dark .fi-in-entry-content span:not(.fi-badge-label) {
    color: #f1f5f9 !important;
}
.fi-in-entry {
    border-left: 2px solid rgba(59, 130, 246, 0.15) !important;
    padding-left: 12px !important;
}
.dark .fi-in-entry {
    border-left-color: rgba(59, 130, 246, 0.25) !important;
}

/* ── Módulo Nav Group Highlight ── */
.modulo-group-highlight {
    border: 2px solid rgba(234, 179, 8, 0.45) !important;
    border-radius: 0.75rem !important;
    margin: 0.5rem 0.25rem !important;
    padding: 0.35rem 0.35rem !important;
    background: rgba(234, 179, 8, 0.04) !important;
    box-shadow: 0 0 14px rgba(234, 179, 8, 0.10) !important;
    transition: box-shadow 0.2s ease;
}
.modulo-group-highlight:hover {
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.18) !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .stats-row-2, .stats-row-3 { grid-template-columns: 1fr; }
}

/* ── Alertas Dashboard Styles ── */
.alert-card {
    position: relative;
    background-color: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}
.dark .alert-card {
    background-color: var(--bio-graphite-surface, #18181b);
    border-color: var(--bio-graphite-border, rgba(161, 161, 170, 0.16));
}
.alert-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.alert-accent-border {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0.25rem;
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
}
.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.alert-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.alert-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
}
.alert-type-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.alert-time {
    font-size: 0.6875rem;
    color: #9ca3af;
    font-weight: 500;
}
.dark .alert-time {
    color: #6b7280;
}
.alert-client {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .alert-client {
    color: #ffffff;
}
.alert-id {
    font-size: 0.6875rem;
    color: #6b7280;
    margin-top: 0.25rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.dark .alert-id {
    color: #9ca3af;
}
.alert-route-box {
    margin-top: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid #f3f4f6;
}
.dark .alert-route-box {
    background-color: var(--bio-graphite-canvas, #09090b);
    border-color: var(--bio-graphite-border, rgba(161, 161, 170, 0.16));
}
.alert-route-icon {
    margin-top: 0.125rem;
    width: 1rem;
    height: 1rem;
}
.alert-route-text {
    font-size: 0.8125rem;
    color: #4b5563;
    line-height: 1.375;
}
.dark .alert-route-text {
    color: #9ca3af;
}
.alert-route-movement {
    opacity: 0.6;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-block;
    margin-top: 0.25rem;
}
.alert-footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 0.5rem;
}
.alert-vendor-wrap {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.alert-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: #4b5563;
}
.dark .alert-avatar {
    background-color: var(--bio-graphite-surface-elevated, #27272a);
    color: var(--bio-graphite-muted, #a1a1aa);
}
.alert-vendor-text {
    font-size: 0.6875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dark .alert-vendor-text {
    color: #9ca3af;
}
.alert-vendor-name {
    color: #111827;
    font-weight: 600;
}
.dark .alert-vendor-name {
    color: #ffffff;
}
.alert-btn-responder {
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: opacity 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}
.alert-btn-responder:hover {
    opacity: 0.8;
}
.alert-form-wrap {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}
.dark .alert-form-wrap {
    border-color: rgba(255, 255, 255, 0.05);
}
.alert-pills {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.alert-pill-btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.15s;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    color: #6b7280;
    cursor: pointer;
}
.dark .alert-pill-btn {
    background-color: var(--bio-graphite-canvas, #09090b);
    border-color: var(--bio-graphite-border, rgba(161, 161, 170, 0.16));
}
.alert-pill-btn:hover {
    border-color: #d1d5db;
}
.dark .alert-pill-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
}
.alert-pill-active-emerald {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #10b981 !important;
}
.alert-pill-active-amber {
    background-color: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    color: #f59e0b !important;
}
.alert-textarea {
    display: block;
    width: 100%;
    border-radius: 0.375rem;
    border: 0;
    background-color: #f9fafb;
    color: #111827;
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 1rem;
    resize: none;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}
.dark .alert-textarea {
    background-color: var(--bio-graphite-canvas, #09090b);
    color: var(--bio-graphite-text, #fafafa);
}
.alert-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5);
}
.alert-save-btn {
    width: 100%;
    padding: 0.625rem;
    border-radius: 0.375rem;
    background-color: #f59e0b;
    color: #111827;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s;
    border: none;
    cursor: pointer;
}
.alert-save-btn:hover {
    background-color: #fbbf24;
}
.alert-response-box {
    margin-top: 1rem;
    padding-left: 0.5rem;
    border-left: 2px solid;
    display: flex;
    flex-direction: column;
}
.alert-response-result {
    font-size: 0.75rem;
    font-weight: 600;
}
.alert-response-text {
    font-size: 0.75rem;
    color: #4b5563;
    margin-top: 0.25rem;
    font-style: italic;
    line-height: 1.375;
}
.dark .alert-response-text {
    color: #9ca3af;
}
.alert-response-meta {
    font-size: 0.625rem;
    color: #9ca3af;
    margin-top: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dark .alert-response-meta {
    color: #6b7280;
}

/* ── Row Highlight for Monday Deferred Sales ── */
.deferred-lunes-row,
.deferred-lunes-row td {
    background-color: rgba(245, 158, 11, 0.08) !important;
}
.dark .deferred-lunes-row,
.dark .deferred-lunes-row td {
    background-color: rgba(245, 158, 11, 0.04) !important;
}

/* ── Multi-Badge Navigation Sidebar styling ── */
.pending-badges-row {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
/* Strip Filament's own badge wrapper when our pbadge children are inside */
.fi-badge:has(.pbadge) {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: inherit !important;
}
.pbadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    line-height: 1;
}
.pbadge-yellow {
    background-color: rgba(251, 191, 36, 0.1) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
}
.pbadge-green {
    background-color: rgba(52, 211, 153, 0.1) !important;
    color: #34d399 !important;
    border: 1px solid rgba(52, 211, 153, 0.3) !important;
}
.pbadge-red {
    background-color: rgba(251, 113, 133, 0.1) !important;
    color: #fb7185 !important;
    border: 1px solid rgba(251, 113, 133, 0.3) !important;
}

/* Indicador de mensajes nuevos en la navegación lateral */

/* ── Custom Filament Notifications (larger and cleaner) ── */
.fi-no-notification {
    max-w-md !important; /* Aumenta el ancho máximo (de 384px a 448px) */
    border-radius: 0.75rem !important;
}
.fi-no-notification .fi-no-notification-title {
    font-size: 0.95rem !important; /* Más grande y legible */
    font-weight: 700 !important;
    line-height: 1.4 !important;
}
.fi-no-notification .fi-no-notification-body {
    font-size: 0.875rem !important; /* Más legible */
    line-height: 1.4 !important;
    margin-top: 0.25rem !important;
}
.fi-no-notification-icon {
    width: 1.75rem !important; /* De 24px a 28px */
    height: 1.75rem !important;
}

/* ── Escritorio de Vendedores ── */
.vendedor-dashboard {
    --vendedor-dashboard-border: rgba(148, 163, 184, 0.14);
    --vendedor-dashboard-muted: #94a3b8;
}
.vendedor-dashboard-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 1rem;
    background:
        radial-gradient(circle at 90% 20%, rgba(52, 211, 153, 0.12), transparent 34%),
        linear-gradient(135deg, rgba(6, 78, 59, 0.35), rgba(15, 23, 42, 0.82));
}
.vendedor-dashboard-eyebrow {
    display: block;
    margin-bottom: 0.2rem;
    color: #6ee7b7;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.vendedor-dashboard-intro p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.95rem;
}
.vendedor-dashboard-intro-icon {
    display: flex;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(110, 231, 183, 0.24);
    border-radius: 0.85rem;
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}
.vendedor-dashboard-intro-icon svg {
    width: 1.4rem;
    height: 1.4rem;
}
.vendedor-dashboard-section {
    padding-top: 0.25rem;
}
.vendedor-dashboard-section + .vendedor-dashboard-section {
    padding-top: 1.1rem;
    border-top: 1px solid var(--vendedor-dashboard-border);
}
.vendedor-dashboard-section-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.vendedor-dashboard-section-heading h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.3;
}
.vendedor-dashboard-section-heading p {
    margin: 0.1rem 0 0;
    color: var(--vendedor-dashboard-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}
.vendedor-dashboard-section-icon {
    display: flex;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}
.vendedor-dashboard-section-icon--urgent {
    background: rgba(245, 158, 11, 0.11);
    color: #fbbf24;
}
.vendedor-dashboard-section-icon--quality {
    background: rgba(56, 189, 248, 0.1);
    color: #7dd3fc;
}
.vendedor-dashboard-section-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}
.vendedor-dashboard-section--promotions {
    padding-bottom: 0.25rem;
}

@media (max-width: 640px) {
    .vendedor-dashboard-intro {
        padding: 1rem;
    }
    .vendedor-dashboard-intro-icon {
        display: none;
    }
    .vendedor-dashboard-section-heading {
        align-items: flex-start;
    }
    .vendedor-dashboard-section-heading h2 {
        font-size: 1rem;
    }
    .vendedor-ventas-hoy-grid,
    .vendedor-devoluciones-metricas,
    .vendedor-comisiones-grid {
        grid-template-columns: 1fr !important;
    }
}

/* â”€â”€ Mensajes nuevos en Solicitudes â”€â”€ */
.ticket-chat-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.dark .ticket-chat-indicator {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}
.ticket-chat-indicator--unread {
    position: relative;
    background: #fef3c7;
    color: #92400e;
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.42);
    animation: ticket-chat-alert 1.25s ease-in-out infinite;
}
.dark .ticket-chat-indicator--unread {
    background: rgba(251, 191, 36, 0.16);
    color: #fde68a;
}
.ticket-chat-indicator__dot {
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;
    border-radius: 9999px;
    background: #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.66);
    animation: ticket-chat-dot 1.25s ease-out infinite;
}
@keyframes ticket-chat-alert {
    50% { opacity: 0.48; }
}
@keyframes ticket-chat-dot {
    70%, 100% { box-shadow: 0 0 0 0.46rem rgba(245, 158, 11, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .ticket-chat-indicator--unread,
    .ticket-chat-indicator__dot { animation: none; }
}

/* â”€â”€ Punto de chat nuevo en el acceso lateral de Solicitudes â”€â”€ */
.fi-sidebar-item-btn[href$="/tickets"] .fi-badge {
    width: 0.5rem !important;
    min-width: 0 !important;
    height: 0.5rem !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 9999px !important;
    background: #fbbf24 !important;
    color: transparent !important;
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.68) !important;
    animation: ticket-navigation-dot 1.25s ease-out infinite;
}
@keyframes ticket-navigation-dot {
    70%, 100% { box-shadow: 0 0 0 0.45rem rgba(251, 191, 36, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .fi-sidebar-item-btn[href$="/tickets"] .fi-badge { animation: none; }
}
