/* ═══════════════════════════════════════════════════════
   FaenaSegura26 - Premium UI Global Styles
   World-class design system built on MudBlazor
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─── */
:root {
    --fs-primary: #1e40af;
    --fs-primary-light: #3b82f6;
    --fs-secondary: #00d4aa;
    --fs-secondary-light: #34d399;
    --fs-accent: #8b5cf6;
    --fs-surface: #ffffff;
    --fs-background: #f8fafc;
    --fs-card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --fs-card-shadow-hover: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --fs-card-radius: 16px;
    --fs-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --fs-gradient-primary: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    --fs-gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    --fs-gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --fs-gradient-warning: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --fs-gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

/* ─── Global Typography ─── */
body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--fs-background);
    color: #1e293b;
}

/* ─── Premium Card Styles ─── */
.fs-card {
    background: var(--fs-surface);
    border-radius: var(--fs-card-radius);
    box-shadow: var(--fs-card-shadow);
    transition: var(--fs-transition);
    border: 1px solid rgba(0,0,0,0.04);
}
.fs-card:hover {
    box-shadow: var(--fs-card-shadow-hover);
    transform: translateY(-2px);
}
.fs-card-static {
    background: var(--fs-surface);
    border-radius: var(--fs-card-radius);
    box-shadow: var(--fs-card-shadow);
    border: 1px solid rgba(0,0,0,0.04);
}

/* ─── KPI Card ─── */
.fs-kpi-card {
    background: var(--fs-surface);
    border-radius: var(--fs-card-radius);
    box-shadow: var(--fs-card-shadow);
    padding: 1.25rem;
    border-top: 4px solid var(--fs-primary);
    transition: var(--fs-transition);
    position: relative;
    overflow: hidden;
}
.fs-kpi-card:hover {
    box-shadow: var(--fs-card-shadow-hover);
    transform: translateY(-2px);
}
.fs-kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(20px, -20px);
}
.fs-kpi-card.fs-kpi-primary { border-top-color: var(--fs-primary); }
.fs-kpi-card.fs-kpi-primary::after { background: var(--fs-primary); }
.fs-kpi-card.fs-kpi-success { border-top-color: #059669; }
.fs-kpi-card.fs-kpi-success::after { background: #059669; }
.fs-kpi-card.fs-kpi-warning { border-top-color: #d97706; }
.fs-kpi-card.fs-kpi-warning::after { background: #d97706; }
.fs-kpi-card.fs-kpi-danger { border-top-color: #dc2626; }
.fs-kpi-card.fs-kpi-danger::after { background: #dc2626; }
.fs-kpi-card.fs-kpi-info { border-top-color: #0891b2; }
.fs-kpi-card.fs-kpi-info::after { background: #0891b2; }
.fs-kpi-card.fs-kpi-accent { border-top-color: #8b5cf6; }
.fs-kpi-card.fs-kpi-accent::after { background: #8b5cf6; }

.fs-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0.5rem 0 0.25rem;
    letter-spacing: -0.025em;
}
.fs-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}
.fs-kpi-sub {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* ─── Page Header ─── */
.fs-page-header {
    background: var(--fs-gradient-dark);
    border-radius: var(--fs-card-radius);
    padding: 2rem 2.5rem;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.fs-page-header::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: rgba(0,212,170,0.08);
    border-radius: 50%;
}
.fs-page-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: 80px;
    width: 150px;
    height: 150px;
    background: rgba(139,92,246,0.06);
    border-radius: 50%;
}
.fs-page-header h1,
.fs-page-header .fs-page-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 1;
}
.fs-page-header p,
.fs-page-header .fs-page-subtitle {
    color: #a0a0b0;
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* ─── Status Badges ─── */
.fs-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.fs-badge-success { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.fs-badge-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.fs-badge-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.fs-badge-info { background: #ecfeff; color: #0891b2; border: 1px solid #a5f3fc; }
.fs-badge-primary { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.fs-badge-neutral { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* ─── Empty State ─── */
.fs-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}
.fs-empty-state .fs-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}
.fs-empty-state .fs-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 0.5rem;
}
.fs-empty-state .fs-empty-text {
    font-size: 0.85rem;
    color: #94a3b8;
    max-width: 300px;
    margin: 0 auto;
}

/* ─── Gradient Buttons ─── */
.fs-btn-gradient {
    background: var(--fs-gradient-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--fs-transition);
    box-shadow: 0 2px 8px rgba(30,64,175,0.25);
}
.fs-btn-gradient:hover {
    box-shadow: 0 4px 16px rgba(30,64,175,0.35);
    transform: translateY(-1px);
}

/* ─── Table Enhancements ─── */
.mud-table-head .mud-table-cell {
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #64748b !important;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}
.mud-table-row:hover {
    background: #f0f9ff !important;
}
.mud-table-row {
    transition: background 0.15s ease;
}

/* ─── MudBlazor Overrides ─── */
.mud-appbar {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}
.mud-drawer {
    border-right: 1px solid rgba(0,0,0,0.06) !important;
}
.mud-paper {
    border-radius: var(--fs-card-radius) !important;
}
.mud-button-filled {
    border-radius: 10px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}
.mud-button-outlined {
    border-radius: 10px !important;
    text-transform: none !important;
    font-weight: 600 !important;
}
.mud-textfield {
    border-radius: 10px !important;
}
.mud-chip {
    border-radius: 8px !important;
}
.mud-alert {
    border-radius: 12px !important;
}
.mud-tabs .mud-tab {
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

/* ─── Animations ─── */
@keyframes fs-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.fs-animate-in {
    animation: fs-fadeIn 0.3s ease-out;
}
.fs-animate-in-delay-1 { animation-delay: 0.05s; animation-fill-mode: both; }
.fs-animate-in-delay-2 { animation-delay: 0.1s; animation-fill-mode: both; }
.fs-animate-in-delay-3 { animation-delay: 0.15s; animation-fill-mode: both; }

/* ─── Responsive ─── */
@media (max-width: 960px) {
    .fs-page-header { padding: 1.5rem; }
    .fs-page-header .fs-page-title { font-size: 1.3rem; }
    .fs-kpi-value { font-size: 1.5rem; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
