@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* ============================================
   1. IMPORTS & CORE SETUP
   ============================================ */
html,
body {
    font-family: 'Inter', sans-serif;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

/* ============================================
   2. THEME VARIABLES (SYSTEM)
   ============================================ */

/* Variables para tema claro (por defecto) */
:root,
body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-border: #e5e7eb;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #64748bff;
    --border-color: #dee2e6;
    --link-color: #006bb7;
    --link-hover: #004a80;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    /* Colores corporativos */
    --corp-color-primary: #0072CE;
    --corp-color-secondary: #E4002B;
    --corp-color-tertiary: #A7A8AA;
    /* Iconos */
    --icon-money: #6CC24A;
    --icon-invoice: #00A3E0;
    --icon-AEAT: #F46A25;
    /* Radzen colors */
    --rz-primary: #0072CE !important;
    --rz-secondary: #0072CE !important;
    --rz-tertiary: #A7A8AA !important;
    --rz-datepicker-calendar-selected-hover-background-color: var(--rz-primary) !important;
    --rz-datepicker-calendar-selected-background: var(--rz-primary) !important;
    --rz-datepicker-calendar-selected-hover-border-color: var(--rz-primary) !important;
    --rz-datepicker-calendar-selected-hover-text-color: var(--rz-primary) !important;
    --rz-datatable-tfoot-bg-color: #E8E8FA !important;
    --label-color: #475569;
    /* Radzen series colors */
    --rd-serie-1: #0072CE;
    --rd-serie-2: #E4002B;
    --rd-serie-3: #A7A8AA;
    --rd-serie-4: #00A3E0;
    --rd-serie-5: #003A8F;
    --rd-serie-6: #F46A25;
    --rd-serie-7: #6CC24A;
    --rd-serie-8: #00B2A9;
    --rd-serie-9: #FFC72C;
    --rd-serie-10: #8E44AD;
    --rd-serie-11: #5B6770;
    /* Nota: duplicado en original, mantenido por si caso */
}

/* Variables para tema oscuro */
body.dark-theme {
    --bg-primary: #1a1d23;
    --bg-secondary: #22252b;
    --bg-tertiary: #2a2d35;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --text-muted: #6c757d;
    --border-color: #3a3d45;
    --link-color: #4da3ff;
    --link-hover: #80bfff;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

/* Aplicar variables a elementos globales */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Custom Scrollbar overrides included in Global UI */
}

/* Global Icon Color */
.rz-icon,
.material-icons {
    color: var(--corp-color-primary) !important;
}

.rz-state-active {
    background-color: #2196f3 !important;
    border-color: #2196f3 !important;
    color: white !important;
}

/* ============================================
   3. LAYOUT STRUCTURE
   ============================================ */

/* Body & App Container */
body {
    /* background-color: #f8fafc !important; Light gray background for depth - commented in original */
    color: #334155;
}

.app-body {
    flex: 1;
}

/* Topbar / Header */
.topbar {
    background: #ffffff !important;
    color: #333 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 1rem;
}

.rz-header {
    z-index: 1000;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rz-header.autohide {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
}

.rz-header.autohide.visible {
    transform: translateY(0);
}

/* Área de detección para mostrar la barra si está oculta */
.header-trigger {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    z-index: 999;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle:hover {
    transform: scale(1.05);
}

/* Sidebar (Menu) */
.rz-sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.rz-panel-menu {
    background-color: transparent !important;
}

.rz-panel-menu .rz-navigation-item-link {
    color: #64748b !important;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    margin: 0.2rem 0.5rem;
}

.rz-panel-menu .rz-navigation-item-link:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    transform: translateX(4px);
}

.rz-panel-menu .rz-navigation-item-link.rz-state-selected {
    background-color: #eff6ff !important;
    /* Light blue bg */
    color: #2563eb !important;
    /* Blue text */
    font-weight: 600;
}

.rz-panel-menu .rz-navigation-item-icon {
    color: inherit !important;
}

/* Footer */
.app-footer {
    text-align: center;
    /* padding: 1rem; */
    color: #94a3b8;
    font-size: 0.875rem;
    /* background-color: #f8fafc;
    border-top: 1px solid #e2e8f0; */
}

/* ============================================
   4. GLOBAL UI ELEMENTS
   ============================================ */

/* Links */
a,
.btn-link {
    color: #006bb7;
}

a {
    color: var(--link-color);
}

a:hover {
    color: var(--link-hover);
}

/* Buttons (Standard Bootstrap/Radzen overrides) */
.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Form Controls & Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Error Boundary */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI9NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N7oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   5. RADZEN CUSTOM COMPONENTS
   ============================================ */

/* General Card & Labels */
.rz-card {
    box-shadow: none !important;
    border: 1px solid var(--bg-border) !important;
}

.rz-label {
    font-weight: 600 !important;
    color: var(--label-color) !important;
    display: block !important;
    margin-bottom: 0.5rem !important;
}

/* DataGrid overrides */
.rz-datatable {
    border: 1px solid var(--bg-border) !important;
}

.rz-data-grid {
    border-radius: 4px !important;
}

.rz-grid-table tfoot,
.rz-grid-table tfoot td {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 1 !important;
    background-color: var(--rz-datatable-tfoot-bg-color) !important;
}

.rz-datatable-tfoot {
    background-color: var(--rz-datatable-tfoot-bg-color) !important;
}

/* Weekend Rows */
.rz-datatable-data tr.weekend-row td {
    background-color: #f1f5f9 !important;
    color: #94a3b8;
}

/* Buttons */
.rz-button {
    border-radius: 4px !important;
    font-weight: 600 !important;
    transition: transform 0.1s ease !important;
    height: 40px !important;
}

/* Lookup search button flat global */
.rz-lookup-search .rz-button {
    border: none !important;
    box-shadow: none !important;
}

/* Fix for RadzenNumeric spinner buttons */
.rz-numeric .rz-button,
.rz-spinner-button,
.rz-spinner-button-up,
.rz-spinner-button-down {
    height: 50% !important;
    min-height: 0 !important;
    /* Reset other potential conflicts */
    line-height: normal !important;
}

.rz-button:active:not(.rz-datepicker-trigger):not(.rz-spinner-button) {
    transform: scale(0.90);
}

/* Dropdown */
.rz-dropdown.premium-input {
    padding: 0 !important;
    height: 38px !important;
    line-height: 36px !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    align-items: center;
    display: flex !important;
}

.rz-dropdown.premium-input .rz-dropdown-label {
    padding: 0 0.6rem !important;
    line-height: 36px !important;
    color: #334155 !important;
    flex-grow: 1;
    overflow: hidden;
    /* Extra overrides from original file for non-!important context */
    height: 100%;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
}

.rz-dropdown.premium-input .rz-dropdown-arrow {
    margin-right: 0.4rem;
}

.rz-dropdown.premium-input:focus-within {
    border-color: #3b82f6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

/* DatePicker (Calendar) */
/* .rz-calendar.premium-input {
    padding: 0 !important;
    height: 38px !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center;
    overflow: hidden;
} */

/* .rz-calendar.premium-input input.rz-inputtext {
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    color: #334155 !important;
    padding: 0 0.6rem !important;
    height: 100% !important;
    line-height: 36px !important;
    box-shadow: none !important;
    flex-grow: 1;
    width: auto !important;
} */

/* .rz-calendar.premium-input input.rz-inputtext:focus {
    outline: none !important;
    box-shadow: none !important;
} */

/* ============================================
   9. MENU IMPROVEMENTS (NESTED ITEMS)
   ============================================ */

/* Nivel 2 (Submenú) - Aumentar indentación */
.rz-panel-menu .rz-navigation-item .rz-navigation-menu .rz-navigation-item .rz-navigation-item-link {
    padding-left: 2.5rem !important;
    background-color: rgba(0, 0, 0, 0.015) !important;
}

/* Nivel 3 (Sub-submenú) - Mayor indentación */
.rz-panel-menu .rz-navigation-item .rz-navigation-menu .rz-navigation-item .rz-navigation-menu .rz-navigation-item .rz-navigation-item-link {
    padding-left: 4rem !important;
    font-size: 0.9em !important;
    background-color: rgba(0, 0, 0, 0.03) !important;
}

/* Ajuste visual del icono para submenús */
.rz-panel-menu .rz-navigation-item .rz-navigation-menu .rz-navigation-item .rz-navigation-item-link .rz-navigation-item-icon {
    font-size: 1.1rem !important;
    margin-right: 0.5rem !important;
    opacity: 0.8;
}

/* Borde izquierdo sutil para guiar la vista en subniveles */
.rz-panel-menu .rz-navigation-item .rz-navigation-menu {
    border-left: 3px solid rgba(0, 0, 0, 0.05);
    margin-left: 1.5rem;
}

/* .rz-calendar.premium-input .rz-datepicker-trigger {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0.5rem !important;
    margin: 0 !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1;
} */

/* .rz-datepicker-trigger {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.rz-datepicker-popup {
    z-index: 10000 !important;
} */

/* .rz-calendar.premium-input:focus-within {
    border-color: #3b82f6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
} */

/* Badges */
.rz-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.35em 0.75em !important;
    /* ajusta según tu diseño */
    font-size: 0.85rem;
    /* opcional, si quieres que encaje bien */
}

.rz-badge-success {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.rz-badge-warning {
    background-color: #fef9c3 !important;
    color: #854d0e !important;
}

.rz-badge-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.rz-badge-info {
    background-color: #e0f2fe !important;
    color: #075985 !important;
}

/* Charts Series */
.rz-series-0,
.rz-series-item-0 {
    stroke: var(--rd-serie-1) !important;
    fill: var(--rd-serie-1) !important;
}

.rz-series-1,
.rz-series-item-1 {
    stroke: var(--rd-serie-2) !important;
    fill: var(--rd-serie-2) !important;
}

.rz-series-2,
.rz-series-item-2 {
    stroke: var(--rd-serie-3) !important;
    fill: var(--rd-serie-3) !important;
}

.rz-series-3,
.rz-series-item-3 {
    stroke: var(--rd-serie-4) !important;
    fill: var(--rd-serie-4) !important;
}

.rz-series-4,
.rz-series-item-4 {
    stroke: var(--rd-serie-5) !important;
    fill: var(--rd-serie-5) !important;
}

/* Notifications */
.rz-notification-container,
div[class*="notification-container"],
div[class*="rz-notification"] {
    top: auto !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    z-index: 9999 !important;
}

/* ============================================
   6. PREMIUM UI SYSTEM (CUSTOM THEME)
   ============================================ */

/* Toolbars */
.premium-toolbar {
    background: #ffffff;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.premium-pill-nav {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
}

/* Cards */
.premium-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.premium-card,
.product-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--bg-border);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    border-color: var(--rz-primary);
    cursor: pointer;
}

.premium-card-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.premium-card-sub {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.premium-card-value {
    color: #0f172a;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Premium Inputs */
.premium-input {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.4rem 0.6rem;
    font-family: 'Inter', monospace;
    color: #334155;
    background: #f8fafc;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    height: 38px;
}

.premium-input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Premium Badges */
.premium-badge {
    background: var(--corp-color-primary);
    color: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Premium Grids */
.premium-grid.rz-datatable {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    border: none !important;
    overflow: hidden;
    background: #ffffff;
}

.premium-grid .rz-datatable-thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1.25rem 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.premium-grid .rz-datatable-data td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.95rem;
    vertical-align: middle;
}

.premium-grid .rz-datatable-row:hover td {
    background-color: #f0f9ff !important;
}

.premium-grid input[type="time"] {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.4rem 0.6rem;
    font-family: 'Inter', monospace;
    color: #334155;
    background: #f8fafc;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 110px;
}

.premium-grid input[type="time"]:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-600 {
    animation-delay: 0.6s;
}

/* Gradient Buttons */
.btn-gradient-pink {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    transition: all 0.3s ease !important;
}

.btn-gradient-pink:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
    filter: brightness(1.1);
}

.btn-gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease !important;
}

.btn-gradient-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    filter: brightness(1.1);
}

/* ============================================
   7. AUTH PAGES (LOGIN/REGISTER)
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.auth-container::before,
.auth-container::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
}

.auth-container::before {
    background: #3b82f6;
    top: -100px;
    right: -100px;
    animation: float 10s infinite ease-in-out alternate;
}

.auth-container::after {
    bottom: -100px;
    left: -100px;
    animation: float 15s infinite ease-in-out alternate-reverse;
}

/* Hide notification and profile menu arrows */
.notification-menu .rz-navigation-item-icon-children,
.profile-menu .rz-navigation-item-icon-children {
    display: none !important;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(50px, 50px) rotate(10deg);
    }
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
    animation: float 12s infinite ease-in-out alternate-reverse;
}

.auth-blob-blue {
    width: 500px;
    height: 500px;
    background: #3b82f6;
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

.auth-blob-pink {
    width: 400px;
    height: 400px;
    background: #ec4899;
    top: -50px;
    right: -50px;
    animation-delay: -8s;
}

.auth-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 3rem;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-card:hover {
    transform: translateY(-5px);
}

.auth-logo {
    max-width: 480px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.auth-title {
    font-size: 1.85rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #172554 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.auth-input-group {
    margin-bottom: 1.5rem;
}

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    transition: all 0.2s ease;
    color: #1e293b;
}

.auth-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.auth-btn {
    width: 100%;
    padding: 0.875rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    margin-top: 1rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: #64748b;
}

/* ============================================
   8. FEATURE SPECIFIC STYLES
   ============================================ */

/* Registro Horas - Filter Section */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.filter-title {
    display: flex;
    flex-direction: column;
}

.filter-main-title {
    font-weight: 700;
    color: var(--text-primary, #334155);
    font-size: 1.1rem;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    bottom: 5px;
    color: var(--text-secondary, #94a3b8);
}

.premium-search-input.rz-textbox {
    padding-left: 2.5rem !important;
    height: 48px;
    font-size: 1rem;
    border-radius: 4px;
    width: 100%;
}

/* Partners Banner */
.selected-partner-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--rz-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
}

.partner-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 4px !important;
}

.partner-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.partner-nif {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-clear-selection {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: none !important;
}

.btn-clear-selection:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Matches Grid */
.matches-container {
    margin-top: 1rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e2e8f0);
    overflow: hidden;
    z-index: 10;
    position: relative;
}

.matches-header {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
}

.matches-grid {
    border: none !important;
    box-shadow: none !important;
}

/* Dialog Utility Classes */
.no-padding-dialog .rz-dialog-content {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100% !important;
    overflow: hidden !important;
}

/* Ensure the wrapper inside takes full height */
.no-padding-dialog .rz-dialog-content>.preview-dialog-container {
    flex: 1;
    height: 100%;
}

/* Global Dialog Close Button Standard */
.rz-dialog-titlebar-close,
.rz-dialog-close,
.preview-action-btn.rz-button {
    transition: all 0.2s ease !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: unset !important;
    text-decoration: none !important;
}

.preview-action-btn.rz-button {
    background-color: transparent !important;
    color: #333 !important;
    box-shadow: none !important;
    border: none !important;
}

.rz-dialog-titlebar-close:hover,
.rz-dialog-close:hover,
.preview-action-btn.rz-button:hover {
    color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-radius: 50% !important;
    transform: scale(1.1);
}



.rz-dialog-titlebar-close .rzi,
.rz-dialog-close .rzi,
.rz-dialog-titlebar-close .rz-button-icon-left,
.rz-dialog-close .rz-button-icon-left,
.preview-action-btn.rz-button .rz-button-icon-left {
    font-size: 20px !important;
    margin: 0 !important;
    color: #333 !important;
}

/* Force the icon color change on hover - DEFINED LAST TO WIN */
.rz-dialog-titlebar-close:hover .rzi,
.rz-dialog-close:hover .rzi,
.rz-dialog-titlebar-close:hover .rz-button-icon-left,
.rz-dialog-close:hover .rz-button-icon-left,
.preview-action-btn.rz-button:hover .rz-button-icon-left {
    color: #dc3545 !important;
}

/* Partner Dialog Status Borders */
/* Active partner border removed by user request */

.partner-dialog-suspicious .rz-dialog-content {
    border: 4px solid var(--rz-warning) !important;
}

.partner-dialog-cancelled .rz-dialog-content,
.partner-dialog-inactive .rz-dialog-content {
    border: 4px solid var(--rz-danger) !important;
}

/* Wizard Steps Colors Override */
.wizard-steps .rz-steps-item.rz-state-highlight .rz-steps-number,
.wizard-steps .rz-steps-item.rz-state-highlight:hover .rz-steps-number {
    background-color: var(--corp-color-primary) !important;
    border-color: var(--corp-color-primary) !important;
    color: #ffffff !important;
}

.wizard-steps .rz-steps-item.rz-state-highlight .rz-steps-title,
.wizard-steps .rz-steps-item.rz-state-highlight:hover .rz-steps-title {
    color: var(--corp-color-primary) !important;
}

/* Wizard Steps Hover Color Override */
.wizard-steps .rz-steps-item:hover .rz-steps-title {
    color: var(--corp-color-primary) !important;
}

/* ===========================
   Flecha personalizada Radzen
   =========================== */

/* Oculta los íconos predeterminados */
span.rz-row-toggler.rzi-chevron-circle-down::before,
span.rz-row-toggler.rzi-chevron-circle-right::before {
    display: none !important;
    content: none !important;
}

/* Estilo base del toggler */
span.rz-row-toggler {
    display: inline-block !important;
    width: 16px;
    height: 16px;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease, background-image 0.3s ease;
}

.rz-datatable .rzi-chevron-circle-right {
    background-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2080%2080%22%20xmlns%3D%22http://www.w3.org/2000/svg%22%3E%3Cpolygon%20points%3D%2240,20 60,40 40,60 30,60 50,40 30,20%22%20fill%3D%22%23EA002A%22/%3E%3Cpolygon%20points%3D%2280,40 60,20 45,20 65,40 45,60 60,60%22%20fill%3D%22%230071CE%22/%3E%3C/svg%3E");
}

.rz-datatable .rzi-chevron-circle-down {
    background-image: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2080%2080%22%20xmlns%3D%22http://www.w3.org/2000/svg%22%3E%3Cpolygon%20points%3D%2240,20 60,40 40,60 30,60 50,40 30,20%22%20fill%3D%22%23EA002A%22/%3E%3Cpolygon%20points%3D%2280,40 60,20 45,20 65,40 45,60 60,60%22%20fill%3D%22%230071CE%22/%3E%3C/svg%3E");
    rotate: 90deg;
    margin-left: 10px;
    margin-bottom: 10px;
}

/* Sticky right column for RadzenDataGrid */
.sticky-right-col {
    position: sticky !important;
    right: 0 !important;
    z-index: 5 !important;
    background-color: #f8fafc !important;
    border-left: 1px solid #e2e8f0 !important;
}

.sticky-right-cell {
    position: sticky !important;
    right: 0 !important;
    z-index: 4 !important;
    background-color: #ffffff !important;
    border-left: 1px solid #f1f5f9 !important;
}

/* Dark theme support */
body.dark-theme .sticky-right-col {
    background-color: #22252b !important;
    border-left-color: #3a3d45 !important;
}

body.dark-theme .sticky-right-cell {
    background-color: #1a1d23 !important;
    border-left-color: #3a3d45 !important;
}

/* ============================================
   ABSENCE CALENDAR OVERRIDES
   ============================================ */
/* Target the title circle using the user's specific selector + variables */
.rz-year-view .rz-slot .rz-slot-title.rz-has-appointments {
    border-radius: 50% !important;
    width: 2.2rem !important;
    height: 2.2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: auto !important;
    color: var(--rz-scheduler-event-color, white) !important;
    background-color: var(--rz-scheduler-event-background-color, #2196F3) !important;
    font-weight: bold !important;
    z-index: 2;
}

/* Today highlight: Blue box */
.rz-year-view .rz-slot.today-marker {
    border: 2px solid #2196F3 !important;
    box-sizing: border-box !important;
    background-color: transparent !important;
    /* Ensure no background */
}

/* Ensure slots have no background color by default */
.rz-year-view .rz-slot {
    background-color: transparent !important;
}

/* ============================================
   HR AUDIT DIALOG STYLES
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.header-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    margin-right: 0.25rem;
}

.header-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--rz-text-color);
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.comparison-card {
    background: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--bg-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.time-comparison, .field-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-val, .field-val {
    color: #0f172a;
    font-weight: 700;
    font-size: 1.1rem;
}

.dialog-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bg-border);
}

.dialog-section-title i, .dialog-section-title .rz-icon {
    color: var(--rz-primary);
    font-size: 1.25rem;
}

.dialog-section-title span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}