/* public/css/dashboard-unified.css */
/* Sistema de diseño unificado para todos los dashboards */
/* AHORA USA VARIABLES DE theme.css */

/* ===================================
   VARIABLES CSS - REFERENCIA A THEME.CSS
   =================================== */

:root {
    /* Colores primarios - ahora usan las variables del tema */
    --dash-primary: var(--color-primary, #1a1a1a);
    --dash-primary-hover: var(--color-primary-hover, #333333);

    /* Gradientes de rol - Ahora usa color neutro */
    --gradient-empresa: var(--color-primary);
    --gradient-team: var(--color-primary);
    --gradient-cliente: var(--color-primary);
    --gradient-superadmin: var(--color-primary);

    /* Sombras - usa las del tema */
    --dash-shadow-sm: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
    --dash-shadow: var(--shadow-md, 0 1px 3px rgba(0, 0, 0, 0.05));
    --dash-shadow-lg: var(--shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.08));
    --dash-shadow-glow: none;

    /* Timing */
    --dash-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dash-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===================================
   COMPONENTES BASE
   =================================== */

/* Stats Cards - Usa variables del tema */
.dash-stat-card {
    background: var(--bg-card, white);
    border-radius: var(--radius-xl, 1.25rem);
    padding: 1.25rem;
    border: 1px solid var(--border-color, rgba(229, 231, 235, 0.8));
    transition: all 0.3s var(--dash-ease);
    position: relative;
    overflow: hidden;
}

.dash-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary, #1a1a1a);
    opacity: 0;
    transition: opacity 0.3s var(--dash-ease);
}

.dash-stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-muted, #999999);
}

.dash-stat-card:hover::before {
    opacity: 1;
}

.dark .dash-stat-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* Stat Icon Container */
.dash-stat-icon {
    padding: 0.625rem;
    border-radius: 0.75rem;
    display: inline-flex;
    transition: transform 0.3s var(--dash-bounce);
}

.dash-stat-card:hover .dash-stat-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Color Variants for Icons - Usando color primario del branding */
.dash-icon-indigo,
.dash-icon-purple,
.dash-icon-blue,
.dash-icon-emerald,
.dash-icon-amber,
.dash-icon-rose {
    background: var(--color-primary-light, #f5f5f5);
    color: var(--color-primary, #1a1a1a);
}

.dark .dash-icon-indigo,
.dark .dash-icon-purple,
.dark .dash-icon-blue,
.dark .dash-icon-emerald,
.dark .dash-icon-amber,
.dark .dash-icon-rose {
    background: var(--color-primary, #1a1a1a);
    color: var(--text-inverse, #ffffff);
}

/* ===================================
   WELCOME BANNERS - Tema V5 con Branding
   =================================== */

.dash-welcome-banner {
    position: relative;
    border-radius: var(--radius-xl, 1.5rem);
    padding: 1.5rem 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    /* Usa el gradiente del branding */
    background: linear-gradient(135deg, var(--color-gradient-from, var(--color-primary, #1a1a1a)) 0%, var(--color-gradient-to, var(--color-primary-dark, #1a1a1a)) 100%) !important;
    color: var(--text-inverse, white) !important;
}

.dash-welcome-banner::before,
.dash-welcome-banner::after {
    display: none;
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* ===================================
   WIDGET CARDS
   =================================== */

.dash-widget {
    background: white;
    border-radius: 1.25rem;
    border: 1px solid rgba(229, 231, 235, 0.8);
    overflow: hidden;
    transition: box-shadow 0.3s var(--dash-ease);
}

.dash-widget:hover {
    box-shadow: var(--dash-shadow-glow);
}

.dark .dash-widget {
    background: rgb(31 41 55);
    border-color: rgba(75, 85, 99, 0.5);
}

.dash-widget-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark .dash-widget-header {
    border-color: rgba(75, 85, 99, 0.5);
}

.dash-widget-body {
    padding: 1rem;
    max-height: 280px;
    overflow-y: auto;
}

/* Custom scrollbar for widgets */
.dash-widget-body::-webkit-scrollbar {
    width: 4px;
}

.dash-widget-body::-webkit-scrollbar-track {
    background: transparent;
}

.dash-widget-body::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
}

.dash-widget-body::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* ===================================
   LIST ITEMS
   =================================== */

.dash-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.2s var(--dash-ease);
    cursor: pointer;
}

.dash-list-item:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

.dark .dash-list-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* ===================================
   DATE BADGES (for events/calendar)
   =================================== */

.dash-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s var(--dash-ease);
}

.dash-list-item:hover .dash-date-badge {
    transform: scale(1.1);
}

/* ===================================
   TASK CHECKBOX
   =================================== */

.dash-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid rgb(209 213 219);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--dash-ease);
    cursor: pointer;
    flex-shrink: 0;
}

.dash-checkbox:hover {
    border-color: rgb(99 102 241);
    background: rgba(99, 102, 241, 0.1);
}

.dash-checkbox.completed {
    background: rgb(16 185 129);
    border-color: rgb(16 185 129);
}

.dash-checkbox svg {
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s var(--dash-bounce);
}

.dash-checkbox:hover svg,
.dash-checkbox.completed svg {
    opacity: 1;
    transform: scale(1);
}

/* ===================================
   PROGRESS BARS
   =================================== */

.dash-progress {
    height: 0.5rem;
    background: rgba(229, 231, 235, 0.8);
    border-radius: 9999px;
    overflow: hidden;
}

.dark .dash-progress {
    background: rgba(75, 85, 99, 0.5);
}

.dash-progress-bar {
    height: 100%;
    background: var(--gradient-empresa);
    border-radius: 9999px;
    transition: width 0.5s var(--dash-ease);
    position: relative;
}

.dash-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ===================================
   BADGES / TAGS
   =================================== */

.dash-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform 0.2s var(--dash-ease);
}

.dash-badge:hover {
    transform: scale(1.05);
}

.dash-badge-indigo {
    background: rgba(99, 102, 241, 0.1);
    color: rgb(99 102 241);
}

.dash-badge-emerald {
    background: rgba(16, 185, 129, 0.1);
    color: rgb(16 185 129);
}

.dash-badge-amber {
    background: rgba(245, 158, 11, 0.1);
    color: rgb(245 158 11);
}

.dash-badge-rose {
    background: rgba(244, 63, 94, 0.1);
    color: rgb(244 63 94);
}

/* ===================================
   EMPTY STATES
   =================================== */

.dash-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: rgb(156 163 175);
}

.dash-empty svg {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    opacity: 0.5;
}

.dash-empty p {
    font-size: 0.875rem;
}

.dash-empty a {
    color: rgb(99 102 241);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: inline-block;
}

.dash-empty a:hover {
    text-decoration: underline;
}

/* ===================================
   ANIMATIONS
   =================================== */

/* Fade in up animation for cards */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dash-animate-in {
    animation: fade-in-up 0.4s var(--dash-ease) forwards;
}

.dash-animate-in:nth-child(1) {
    animation-delay: 0ms;
}

.dash-animate-in:nth-child(2) {
    animation-delay: 50ms;
}

.dash-animate-in:nth-child(3) {
    animation-delay: 100ms;
}

.dash-animate-in:nth-child(4) {
    animation-delay: 150ms;
}

.dash-animate-in:nth-child(5) {
    animation-delay: 200ms;
}

.dash-animate-in:nth-child(6) {
    animation-delay: 250ms;
}

/* Pulse animation for urgent items */
@keyframes pulse-soft {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.dash-pulse {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* Hover glow effect */
.dash-glow {
    transition: box-shadow 0.3s var(--dash-ease);
}

.dash-glow:hover {
    box-shadow: 0 0 20px color-mix(in srgb, var(--color-primary, #1a1a1a) 20%, transparent);
}

/* ===================================
   TABLES
   =================================== */

.dash-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.dash-table thead tr {
    background: rgba(249, 250, 251, 0.8);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(107 114 128);
}

.dark .dash-table thead tr {
    background: rgba(55, 65, 81, 0.5);
    color: rgb(156 163 175);
}

.dash-table th {
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.dash-table tbody tr {
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    transition: background 0.2s var(--dash-ease);
}

.dark .dash-table tbody tr {
    border-color: rgba(75, 85, 99, 0.3);
}

.dash-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.dark .dash-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.dash-table td {
    padding: 1rem 1.5rem;
}

/* Avatar in tables */
.dash-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    background: var(--gradient-empresa);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s var(--dash-ease);
}

tr:hover .dash-avatar {
    transform: scale(1.1);
}

/* ===================================
   QUICK ACTIONS BUTTONS
   =================================== */

.dash-action-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: rgb(156 163 175);
    transition: all 0.2s var(--dash-ease);
}

.dash-action-btn:hover {
    color: rgb(99 102 241);
    background: rgba(99, 102, 241, 0.1);
}

.dash-action-btn.danger:hover {
    color: rgb(244 63 94);
    background: rgba(244, 63, 94, 0.1);
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 768px) {
    .dash-welcome-banner {
        padding: 1.25rem 1.5rem;
        border-radius: 1rem;
    }

    .dash-stat-card {
        padding: 1rem;
    }

    .dash-widget-header {
        padding: 1rem;
    }

    .dash-widget-body {
        padding: 0.75rem;
    }
}