html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    scroll-behavior: smooth;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b; /* #666666 equivalentish */

    /* Typography System */
    --font-family-base: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    
    --font-size-h1: 28px;     /* Desktop Title */
    --font-size-h1-mobile: 24px;
    --font-size-subtitle: 15px;
    --font-size-body: 14px;
    --font-size-small: 13px;
    --font-size-btn: 14px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --letter-spacing-tight: -0.2px;
    --letter-spacing-wide: 0.1px;

    --line-height-base: 1.5;
    --line-height-tight: 1.4;
}

@media (max-width: 768px) {
    :root {
        --font-size-h1: var(--font-size-h1-mobile);
        --font-size-subtitle: 14px;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
}

/* Page Titles & Subtitles */
.page-title {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
}

.page-subtitle {
    font-size: var(--font-size-subtitle);
    font-weight: var(--font-weight-normal);
    color: #666666; /* Specific request */
    line-height: var(--line-height-base);
}

a {
    text-decoration: none;
}

/* Utilities */
.text-primary-custom { color: var(--primary-color) !important; }
.bg-primary-custom { background-color: var(--primary-color) !important; }
.text-accent { color: var(--accent-color) !important; }

/* Buttons */
.btn {
    font-size: var(--font-size-btn);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-wide);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    /* font-weight: 600;  Removed to use base btn style */
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

/* Hero Section (Landing Page) */
.landing-hero-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Inputs */
.form-control {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Blazor Defaults */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Loading Spinner (Componente interno) */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 0.75rem;
    min-height: 200px;
}

.spinner-svg {
    width: 3rem;
    height: 3rem;
    animation: rotate 2s linear infinite;
    transform-origin: center center;
}

.spinner-circle {
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    fill: none;
    animation: dash 1.5s ease-in-out infinite;
    stroke-linecap: round;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 200;
        stroke-dashoffset: -35px;
    }
    100% {
        stroke-dasharray: 90, 200;
        stroke-dashoffset: -124px;
    }
}

/* Custom Soft Grid - Refactored */
.custom-soft-grid {
    --bs-table-bg: #ffffff;
    --bs-table-striped-bg: #f8fafc;
    --bs-table-hover-bg: #f1f5f9;
    background: #ffffff;
    border: 1px solid #E0E0E0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.custom-soft-grid thead th {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-tight);
}

.custom-soft-grid tbody td {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-tight);
}

.custom-soft-grid th,
.custom-soft-grid td {
    white-space: nowrap;
}

/* Grid Search Input Improvements */
.custom-soft-grid thead input.form-control {
    background-color: #fff;
    border: 1px solid #ced4da;
    font-size: 0.85rem;
    height: 32px; /* Compact height */
    padding: 4px 8px;
    border-radius: 4px;
}

.custom-soft-grid thead input.form-control:focus {
    background-color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.custom-soft-grid thead select.form-select {
    font-size: 0.85rem;
    height: 32px;
}

/* =========================================
   BLAZOR LOADING PROGRESS (Fix Blob Negro)
   ========================================= */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--primary-color, #1b6ec2);
    stroke-dasharray: calc(3.141 * 100% * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Cargando...");
}
