@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════
   ATLANTIS CLOUD — Design System v2.0
   Premium Enterprise UI — Light & Dark Mode
═══════════════════════════════════════════════════════════ */

/* ══ LIGHT MODE (default) ═════════════════════════════════ */
:root,
[data-theme="light"] {
    /* Brand */
    --atl-blue:        #2563EB;
    --atl-blue-light:  #3B82F6;
    --atl-blue-dark:   #1D4ED8;
    --atl-indigo:      #4F46E5;
    --atl-violet:      #7C3AED;
    --atl-cyan:        #06B6D4;

    /* Semantic */
    --atl-success:     #10B981;
    --atl-warning:     #F59E0B;
    --atl-danger:      #EF4444;
    --atl-info:        #3B82F6;

    /* Surfaces */
    --atl-bg:          #F1F5F9;
    --atl-surface-0:   #FFFFFF;
    --atl-surface-1:   #F8FAFC;
    --atl-surface-2:   #F1F5F9;
    --atl-border:      rgba(15, 23, 42, 0.07);
    --atl-border-soft: rgba(15, 23, 42, 0.04);

    /* Text */
    --atl-text-1:  #0F172A;
    --atl-text-2:  #475569;
    --atl-text-3:  #94A3B8;

    /* Sidebar (adapts to light/dark) */
    --sidebar-bg:      var(--mud-palette-drawer-background);
    --sidebar-text:    var(--mud-palette-text-primary);
    --sidebar-muted:   var(--mud-palette-text-secondary);
    --sidebar-hover:   rgba(37,99,235,0.08);
    --sidebar-active:  rgba(37,99,235,0.12);
    --sidebar-border:  var(--mud-palette-lines-default);

    /* AppBar */
    --appbar-bg:    rgba(255,255,255,0.92);
    --appbar-border: rgba(15,23,42,0.07);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm: 0 2px 8px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md: 0 4px 16px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.04);
    --shadow-lg: 0 12px 40px rgba(15,23,42,0.10), 0 4px 12px rgba(15,23,42,0.05);
    --shadow-xl: 0 24px 64px rgba(15,23,42,0.12), 0 8px 24px rgba(15,23,42,0.06);

    /* Body gradient overlays */
    --bg-gradient-1: rgba(37, 99, 235, 0.06);
    --bg-gradient-2: rgba(79, 70, 229, 0.04);

    /* Toggle icon */
    --theme-icon: '🌙';
}

/* ══ DARK MODE ════════════════════════════════════════════ */
[data-theme="dark"] {
    /* Brand (slightly lighter for dark bg) */
    --atl-blue:        #3B82F6;
    --atl-blue-light:  #60A5FA;
    --atl-blue-dark:   #2563EB;
    --atl-indigo:      #6366F1;
    --atl-violet:      #8B5CF6;
    --atl-cyan:        #22D3EE;

    /* Semantic */
    --atl-success:     #34D399;
    --atl-warning:     #FCD34D;
    --atl-danger:      #F87171;
    --atl-info:        #60A5FA;

    /* Surfaces */
    --atl-bg:          #020617;
    --atl-surface-0:   #0F172A;
    --atl-surface-1:   #1E293B;
    --atl-surface-2:   #1E293B;
    --atl-border:      rgba(255,255,255,0.06);
    --atl-border-soft: rgba(255,255,255,0.03);

    /* Text */
    --atl-text-1:  #F1F5F9;
    --atl-text-2:  #94A3B8;
    --atl-text-3:  #475569;

    /* Sidebar (dark: deeper layer) */
    --sidebar-bg:      var(--mud-palette-drawer-background);
    --sidebar-text:    var(--mud-palette-text-primary);
    --sidebar-muted:   var(--mud-palette-text-secondary);
    --sidebar-hover:   rgba(255,255,255,0.06);
    --sidebar-active:  rgba(59,130,246,0.18);
    --sidebar-border:  var(--mud-palette-lines-default);

    /* AppBar */
    --appbar-bg:    rgba(15,23,42,0.92);
    --appbar-border: rgba(255,255,255,0.06);

    /* Shadows (softer in dark) */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.3);
    --shadow-xl: 0 24px 64px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.35);

    /* Body gradient overlays */
    --bg-gradient-1: rgba(37, 99, 235, 0.08);
    --bg-gradient-2: rgba(79, 70, 229, 0.06);

    /* Toggle icon */
    --theme-icon: '☀️';

    color-scheme: dark;
}

/* ══ Motion & Radii constants ═════════════════════════════ */
:root {
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast:    140ms;
    --dur-base:    220ms;
    --dur-slow:    380ms;

    --radius-sm:   6px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-2xl:  32px;
    --radius-full: 9999px;

    --glow-blue:   0 0 0 1px rgba(37,99,235,0.2), 0 4px 24px rgba(37,99,235,0.15);
}

/* ══ Theme Transition ═════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    transition: background-color var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
}
/* Exclude transforms and opacity from bulk transition */
.atlantis-card, .atl-module-card, .kpi-card, .nav-item-custom {
    transition: transform var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out),
                background-color var(--dur-base) var(--ease-out),
                color var(--dur-fast) var(--ease-out) !important;
}

/* ══ Base Reset & Typography ══════════════════════════════ */
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
    background-color: var(--atl-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 0% -10%, var(--bg-gradient-1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 110%, var(--bg-gradient-2) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--atl-text-1);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1:focus { outline: none; }

/* ══ Scrollbar ════════════════════════════════════════════ */
::-webkit-scrollbar          { width: 5px; height: 5px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: rgba(128,128,128,0.2); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.35); }

/* ══ AppBar Premium ═══════════════════════════════════════ */
.atl-appbar {
    background: var(--appbar-bg) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid var(--appbar-border) !important;
    box-shadow: var(--shadow-sm) !important;
}

.atl-appbar-logo {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    color: var(--atl-text-1);
}
.atl-appbar-logo .logo-accent {
    background: linear-gradient(135deg, var(--atl-blue) 0%, var(--atl-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 400;
}

/* ══ Theme Toggle Button ══════════════════════════════════ */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--atl-border);
    background: var(--atl-surface-1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur-base) var(--ease-out);
    color: var(--atl-text-2);
    font-size: 1rem;
}
.theme-toggle-btn:hover {
    border-color: rgba(37,99,235,0.3);
    background: rgba(37,99,235,0.06);
    color: var(--atl-blue);
    transform: scale(1.05);
}

/* ══ Sede Chip ════════════════════════════════════════════ */
.atl-sede-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: var(--radius-full);
    padding: 4px 14px 4px 10px;
}
.atl-sede-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--atl-blue);
}

/* ══ Sidebar Dark Premium ═════════════════════════════════ */
.atl-sidebar {
    background: var(--sidebar-bg) !important;
    border-right: none !important;
    margin: 10px 0 10px 10px !important;
    height: calc(100vh - 20px) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden;
    position: relative;
}
.atl-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(37,99,235,0.25) 40%, rgba(79,70,229,0.25) 60%, transparent 100%);
    pointer-events: none;
}

/* ══ Module Badge ═════════════════════════════════════════ */
.atl-module-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(37,99,235,0.18) 0%, rgba(79,70,229,0.18) 100%);
    border: 1px solid rgba(37,99,235,0.2);
    border-radius: var(--radius-md);
    padding: 6px 14px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #93C5FD;
}
.atl-module-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #60A5FA;
    box-shadow: 0 0 6px #60A5FA;
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ══ Nav Items Sidebar ════════════════════════════════════ */
.nav-item-custom {
    margin: 2px 4px !important;
    border-radius: var(--radius-md) !important;
    color: var(--sidebar-text) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    border-left: 3px solid transparent !important;
}
.nav-item-custom .mud-nav-link-icon,
.nav-item-custom .mud-nav-link-icon-start {
    color: var(--sidebar-muted) !important;
    transition: color var(--dur-base) var(--ease-out) !important;
    margin-right: 4px !important;
    margin-inline-end: 4px !important;
    width: 20px !important;
    min-width: 20px !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
}
.nav-item-custom:hover {
    background: var(--sidebar-hover) !important;
    color: var(--atl-blue) !important;
    transform: translateX(3px);
}
.nav-item-custom:hover .mud-nav-link-icon,
.nav-item-custom:hover .mud-nav-link-icon-start {
    color: var(--atl-blue) !important;
}

.nav-item-active {
    background: var(--sidebar-active) !important;
    color: var(--atl-blue) !important;
    font-weight: 600 !important;
    border-left: 3px solid var(--atl-blue) !important;
}
.nav-item-active .mud-nav-link-icon,
.nav-item-active .mud-nav-link-icon-start {
    color: var(--atl-blue) !important;
}

/* ══ Nav Groups ═══════════════════════════════════════════ */
.nav-group-custom .mud-nav-group-header {
    margin: 2px 4px !important;
    border-radius: var(--radius-md) !important;
    color: var(--sidebar-text) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out) !important;
    border-left: 3px solid transparent !important;
}
.nav-group-custom .mud-nav-group-header .mud-nav-link-icon,
.nav-group-custom .mud-nav-group-header .mud-nav-link-icon-start {
    color: var(--sidebar-muted) !important;
    transition: color var(--dur-base) var(--ease-out) !important;
    margin-right: 4px !important;
    width: 20px !important;
    min-width: 20px !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
}
.nav-group-custom:hover .mud-nav-group-header {
    color: var(--atl-blue) !important;
    background: var(--sidebar-hover) !important;
    transform: translateX(3px);
}
.nav-group-custom:hover .mud-nav-group-header .mud-nav-link-icon,
.nav-group-custom:hover .mud-nav-group-header .mud-nav-link-icon-start {
    color: var(--atl-blue) !important;
}
.nav-group-custom .mud-nav-group-header.mud-nav-group-open {
    color: var(--atl-blue) !important;
    background: var(--sidebar-active) !important;
}
.nav-group-custom .mud-nav-group-header.mud-nav-group-open .mud-nav-link-icon,
.nav-group-custom .mud-nav-group-header.mud-nav-group-open .mud-nav-link-icon-start {
    color: var(--atl-blue) !important;
}
.nav-group-custom .mud-nav-link {
    padding-left: 16px !important;
    font-size: 0.83rem !important;
    color: var(--sidebar-text) !important;
}
.nav-group-custom .mud-nav-group-children {
    padding-left: 0px !important;
}
.nav-group-custom .mud-nav-link:hover {
    color: var(--atl-blue) !important;
    text-decoration: none !important;
}

.sidebar-divider {
    margin: 8px 16px;
    height: 1px;
    background: var(--sidebar-border);
    border: none;
    display: block;
}

/* ══ Cards ════════════════════════════════════════════════ */
.atlantis-card {
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--atl-border) !important;
    background: var(--atl-surface-0) !important;
}
.atlantis-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg) !important;
    border-color: rgba(37, 99, 235, 0.2) !important;
}
.atlantis-card.atl-table-container:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--atl-border) !important;
}

/* ══ DataGrid & Tables Premium Styling ═════════════════════ */
.atl-table {
    border: 1px solid var(--atl-border) !important;
    border-radius: var(--radius-md) !important;
    background: var(--atl-surface-0) !important;
}

.atl-table .mud-table-container {
    border-radius: 0 !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.atl-table .mud-table-root {
    min-width: 1200px !important;
}

/* 1. Header color difference */
.atl-table .mud-table-head {
    background-color: #E6ECF4 !important;
}

.atl-table .mud-table-head .mud-table-cell {
    color: var(--atl-text-1) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.8px;
    padding: 12px 16px !important;
    border-bottom: 2px solid var(--atl-border) !important;
    border-right: 1px solid var(--atl-border-soft) !important;
}

.atl-table .mud-table-head .mud-table-cell:last-child {
    border-right: none !important;
}

/* 2. Reduce row height */
.atl-table .mud-table-body .mud-table-row {
    height: 44px !important;
    transition: background-color var(--dur-fast) var(--ease-out);
}

.atl-table .mud-table-body .mud-table-row:hover {
    background-color: var(--atl-surface-1) !important;
}

/* 3. Colocar bordes en de 1px solid en el grid para delimitar la data */
.atl-table .mud-table-body .mud-table-cell {
    border-bottom: 1px solid var(--atl-border-soft) !important;
    border-right: 1px solid var(--atl-border-soft) !important;
    padding: 6px 16px !important;
    font-size: 0.875rem;
    color: var(--atl-text-2);
}

.atl-table .mud-table-body .mud-table-cell:last-child {
    border-right: none !important;
}

.atl-table .mud-table-container {
    border-radius: 0 !important;
}

/* Dark mode specific for tables */
[data-theme="dark"] .atl-table .mud-table-head {
    background-color: rgba(255,255,255,0.03) !important;
}

/* ══ KPI Cards ════════════════════════════════════════════ */
.kpi-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--atl-border) !important;
    background: var(--atl-surface-0) !important;
    cursor: default;
}
.kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    border-radius: var(--radius-lg);
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md) !important; }
.kpi-card:hover::before { opacity: 1; }

.kpi-card-blue::before   { background: radial-gradient(ellipse at top left, rgba(37,99,235,0.05) 0%, transparent 70%); }
.kpi-card-indigo::before { background: radial-gradient(ellipse at top left, rgba(79,70,229,0.05) 0%, transparent 70%); }
.kpi-card-red::before    { background: radial-gradient(ellipse at top left, rgba(239,68,68,0.05) 0%, transparent 70%); }
.kpi-card-green::before  { background: radial-gradient(ellipse at top left, rgba(16,185,129,0.05) 0%, transparent 70%); }

.kpi-accent { display: block; height: 3px; border-radius: 0 0 var(--radius-full) var(--radius-full); }
.kpi-accent-blue   { background: linear-gradient(90deg, var(--atl-blue) 0%, var(--atl-blue-light) 100%); }
.kpi-accent-indigo { background: linear-gradient(90deg, var(--atl-indigo) 0%, var(--atl-violet) 100%); }
.kpi-accent-red    { background: linear-gradient(90deg, var(--atl-danger) 0%, #F87171 100%); }
.kpi-accent-green  { background: linear-gradient(90deg, var(--atl-success) 0%, #34D399 100%); }

.kpi-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-icon-blue   { background: rgba(37,99,235,0.1); }
.kpi-icon-indigo { background: rgba(79,70,229,0.1); }
.kpi-icon-red    { background: rgba(239,68,68,0.1); }
.kpi-icon-green  { background: rgba(16,185,129,0.1); }

/* ══ Module Selector ══════════════════════════════════════ */
.module-icon-bg {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--dur-base) var(--ease-spring);
}
.atlantis-card:hover .module-icon-bg {
    transform: scale(1.08) rotate(-3deg);
}

.atl-module-popup-header {
    padding: 20px;
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 40%, #4F46E5 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.atl-module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--atl-border-soft);
    cursor: pointer;
    min-height: 90px;
    gap: 6px;
    background: var(--atl-surface-1);
}
.atl-module-card:hover {
    border-color: rgba(37,99,235,0.3);
    background: rgba(37,99,235,0.06);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.atl-module-card.active {
    border-color: rgba(37,99,235,0.4);
    background: rgba(37,99,235,0.1);
    box-shadow: var(--glow-blue);
}

/* ══ Color Utilities ══════════════════════════════════════ */
.bg-primary-light   { background: rgba(37,99,235,0.08);  color: var(--atl-blue); }
.bg-secondary-light { background: rgba(79,70,229,0.08);  color: var(--atl-indigo); }
.bg-success-light   { background: rgba(16,185,129,0.08); color: var(--atl-success); }
.bg-info-light      { background: rgba(37,99,235,0.08);  color: var(--atl-blue); }
.bg-blue-soft       { background: rgba(37,99,235,0.08);  color: var(--atl-blue); }
.bg-indigo-soft     { background: rgba(79,70,229,0.08);  color: var(--atl-indigo); }
.bg-green-soft      { background: rgba(16,185,129,0.08); color: var(--atl-success); }
.bg-red-soft        { background: rgba(239,68,68,0.08);  color: var(--atl-danger); }
.bg-amber-soft      { background: rgba(245,158,11,0.08); color: var(--atl-warning); }

.text-gradient-blue {
    background: linear-gradient(135deg, var(--atl-blue) 0%, var(--atl-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══ Badges ═══════════════════════════════════════════════ */
.atl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}
.atl-badge-success { background: rgba(16,185,129,0.12); color: var(--atl-success); border: 1px solid rgba(16,185,129,0.2); }
.atl-badge-danger  { background: rgba(239,68,68,0.12);  color: var(--atl-danger);  border: 1px solid rgba(239,68,68,0.2); }
.atl-badge-warning { background: rgba(245,158,11,0.12); color: var(--atl-warning); border: 1px solid rgba(245,158,11,0.2); }
.atl-badge-blue    { background: rgba(37,99,235,0.12);  color: var(--atl-blue);    border: 1px solid rgba(37,99,235,0.2); }

/* Solid Status Badges */
.atl-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    background-color: #64748B;
    color: #FFFFFF !important;
    line-height: 1;
}
.atl-status-badge.status-alta,
.atl-status-badge.status-error {
    background-color: var(--atl-danger) !important;
}
.atl-status-badge.status-warning,
.atl-status-badge.status-proceso,
.atl-status-badge.status-espera {
    background-color: var(--atl-warning) !important;
}
.atl-status-badge.status-baja {
    background-color: var(--atl-info) !important;
}
.atl-status-badge.status-abierto {
    background-color: var(--atl-success) !important;
}
.atl-status-badge.status-blue {
    background-color: #2563EB !important;
}
.atl-status-badge.status-purple {
    background-color: #9333EA !important;
}
.atl-status-badge.status-orange {
    background-color: #EA580C !important;
}
.atl-status-badge.status-cyan {
    background-color: #0891B2 !important;
}
.atl-status-badge.status-violet,
.atl-status-badge.status-ope {
    background-color: #7C3AED !important;
}
.atl-status-badge.status-def,
.atl-status-badge.status-cerrado {
    background-color: #64748B !important;
}

/* ══ Activity Items ═══════════════════════════════════════ */
.atl-activity-item {
    position: relative;
    padding: 10px 12px;
    border-radius: var(--radius-md);
}
.atl-activity-item:hover { background: var(--atl-surface-1); }
.atl-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

/* ══ Status Online ════════════════════════════════════════ */
.status-online {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--atl-success);
}
.status-online::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--atl-success);
    box-shadow: 0 0 0 2px rgba(16,185,129,0.2);
    animation: blink 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ══ Chart Placeholder ════════════════════════════════════ */
.chart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 280px;
    background: var(--atl-surface-1);
    border-radius: var(--radius-md);
    border: 1px dashed var(--atl-border);
    gap: 8px;
}

/* ══ Section Header ═══════════════════════════════════════ */
.section-header-line {
    width: 3px;
    height: 20px;
    border-radius: var(--radius-full);
    background: linear-gradient(180deg, var(--atl-blue) 0%, var(--atl-indigo) 100%);
    flex-shrink: 0;
}

/* ══ Login Page — Split Layout ════════════════════════════ */
.atl-login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ── Left panel (branding) ─────────────────────────────── */
.atl-login-panel-left {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 52px;
    background: linear-gradient(145deg, #1D4ED8 0%, #2563EB 45%, #4338CA 100%);
    overflow: hidden;
    color: white;
}

/* Decorative blurred circles */
.atl-login-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.atl-login-deco--1 {
    width: 420px; height: 420px;
    top: -140px; left: -100px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
}
.atl-login-deco--2 {
    width: 320px; height: 320px;
    bottom: -80px; right: -80px;
    background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 70%);
}
.atl-login-deco--3 {
    width: 180px; height: 180px;
    top: 50%; right: 12%;
    transform: translateY(-50%);
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
}

.atl-login-brand {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.atl-login-logo-left {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.30);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.atl-login-brand-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0 0 6px;
    color: white;
}

.atl-login-brand-sub {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255,255,255,0.80);
    margin: 0 0 4px;
}

.atl-login-brand-org {
    font-size: 0.78rem;
    font-weight: 400;
    color: rgba(255,255,255,0.55);
    margin: 0 0 28px;
}

.atl-login-brand-divider {
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.40);
    margin-bottom: 24px;
}

.atl-login-brand-desc {
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.75);
    margin: 0 0 32px;
    max-width: 400px;
}

.atl-login-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.atl-login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.84rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.atl-login-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.atl-login-left-footer {
    position: relative;
    z-index: 1;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.40);
    margin: 0;
}

/* ── Right panel (form) ────────────────────────────────── */
.atl-login-panel-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 52px;
    background: #F8FAFC;
}

.atl-login-mobile-header {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.atl-login-form-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
}

.atl-login-form-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 6px;
    letter-spacing: -0.4px;
}

.atl-login-form-subtitle {
    font-size: 0.875rem;
    color: #64748B;
    margin: 0;
    font-weight: 400;
}

/* ── Form field labels ─────────────────────────────────── */
.atl-login-field {
    margin-bottom: 18px;
}

.atl-login-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.atl-login-input .mud-input-outlined .mud-input-outlined-border {
    border-color: #E2E8F0 !important;
    border-radius: 10px !important;
}

/* ── Login button ──────────────────────────────────────── */
.atl-login-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #2563EB 0%, #4338CA 100%);
    color: white;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 16px rgba(37,99,235,0.30);
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    margin-top: 8px;
}
.atl-login-btn:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.40);
}
.atl-login-btn:active:not(:disabled) {
    transform: translateY(0);
}
.atl-login-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Error alert ───────────────────────────────────────── */
.atl-login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    color: #B91C1C;
    font-size: 0.83rem;
    font-weight: 500;
}

/* ── Forgot password link ──────────────────────────────── */
.atl-login-forgot {
    color: #94A3B8;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.atl-login-forgot:hover { color: #2563EB; }

/* ── Right footer ──────────────────────────────────────── */
.atl-login-right-footer {
    text-align: center;
    color: #CBD5E1;
    font-size: 0.72rem;
    margin: 0;
}

/* ── Logo (mobile-only) ────────────────────────────────── */
.atl-login-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--atl-blue) 0%, var(--atl-indigo) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37,99,235,0.30);
}

/* ══ User Menu ════════════════════════════════════════════ */
.atl-user-header {
    padding: 20px;
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 40%, #4F46E5 100%);
    display: flex;
    align-items: center;
    gap: 14px;
}
.atl-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--atl-blue) 0%, var(--atl-indigo) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* ══ Notification Dot ═════════════════════════════════════ */
.atl-notif-btn { position: relative; }
.atl-notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--atl-danger);
    border: 2px solid var(--atl-surface-0);
}

/* ══ Form Validation ══════════════════════════════════════ */
.valid.modified:not([type=checkbox]) { outline: 1.5px solid var(--atl-success); }
.invalid                              { outline: 1.5px solid var(--atl-danger); }
.validation-message                   { color: var(--atl-danger); font-size: 0.8rem; }

/* ══ Blazor Error Boundary ════════════════════════════════ */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjQwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3LjgyOSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "Ha ocurrido un error."; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ══ MudSelect / MudAutocomplete — Premium Dropdown ══════ */
/* Usar PopoverClass="atl-select-popover" en los componentes */
.atl-select-popover {
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08) !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    overflow: hidden !important;
}

.atl-select-popover .mud-list {
    padding: 6px 0 !important;
}

.atl-select-popover .mud-list-item {
    border-radius: 0 !important;
    padding: 10px 16px !important;
    min-height: 42px !important;
    font-size: 0.875rem !important;
    transition: background 0.15s ease !important;
}

.atl-select-popover .mud-list-item:hover,
.atl-select-popover .mud-list-item-clickable:hover {
    background: rgba(21, 101, 192, 0.07) !important;
}

.atl-select-popover .mud-selected-item {
    background: rgba(21, 101, 192, 0.10) !important;
    color: #1565C0 !important;
    font-weight: 600 !important;
}

/* Dark mode */
[data-theme="dark"] .atl-select-popover {
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .atl-select-popover .mud-list-item:hover,
[data-theme="dark"] .atl-select-popover .mud-list-item-clickable:hover {
    background: rgba(96, 165, 250, 0.10) !important;
}

[data-theme="dark"] .atl-select-popover .mud-selected-item {
    background: rgba(59, 130, 246, 0.18) !important;
    color: #60A5FA !important;
}

/* ══ Responsive ═══════════════════════════════════════════ */

/* Tablet: colapsar panel izquierdo a header compacto arriba */
@media (max-width: 960px) {
    .atl-login-split {
        grid-template-columns: 1fr;
    }
    .atl-login-panel-left {
        display: none;
    }
    .atl-login-panel-right {
        padding: 40px 36px;
        background: #F8FAFC;
        min-height: 100vh;
    }
    .atl-login-mobile-header {
        display: flex;
    }
    .atl-login-right-footer {
        display: block;
        margin-top: 32px;
    }
}

/* Mobile: reducir padding */
@media (max-width: 600px) {
    .atl-sidebar { margin: 0 !important; border-radius: 0 !important; height: 100vh !important; }
    .atl-login-panel-right {
        padding: 28px 20px;
    }
    .atl-login-form-title {
        font-size: 1.35rem;
    }
}

/* Botón de actualizar premium */
.atl-btn-refresh {
    border-radius: 20px !important;
    font-weight: 600 !important;
    padding: 6px 20px !important;
    border-width: 1.5px !important;
    transition: all 0.2s ease-in-out !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
}

/* ══ ApexCharts Premium Adaptability (Light/Dark Mode) ═════ */
.apexcharts-title-text {
    fill: var(--atl-text-1) !important;
    font-weight: 700 !important;
    font-family: 'Inter', sans-serif !important;
}
.apexcharts-text, 
.apexcharts-xaxis-label, 
.apexcharts-yaxis-label {
    fill: var(--atl-text-2) !important;
    font-family: 'Inter', sans-serif !important;
}
.apexcharts-legend-text {
    color: var(--atl-text-2) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
}
.apexcharts-tooltip {
    background: var(--atl-surface-0) !important;
    border: 1px solid var(--atl-border) !important;
    box-shadow: var(--shadow-md) !important;
}
.apexcharts-tooltip * {
    color: var(--atl-text-1) !important;
}
.apexcharts-tooltip-title {
    background: var(--atl-surface-1) !important;
    border-bottom: 1px solid var(--atl-border) !important;
    color: var(--atl-text-1) !important;
    font-weight: 600 !important;
}
.apexcharts-grid-borders line,
.apexcharts-grid line {
    stroke: var(--atl-border-soft) !important;
}

/* Dark Mode overrides */
[data-theme="dark"] .apexcharts-title-text {
    fill: #F1F5F9 !important;
}
[data-theme="dark"] .apexcharts-text, 
[data-theme="dark"] .apexcharts-xaxis-label, 
[data-theme="dark"] .apexcharts-yaxis-label {
    fill: #94A3B8 !important;
}
[data-theme="dark"] .apexcharts-legend-text {
    color: #CBD5E1 !important;
}
[data-theme="dark"] .apexcharts-tooltip {
    background: #1E293B !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .apexcharts-tooltip * {
    color: #F1F5F9 !important;
}
[data-theme="dark"] .apexcharts-tooltip-title {
    background: #0F172A !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    color: #F1F5F9 !important;
}
[data-theme="dark"] .apexcharts-grid-borders line,
[data-theme="dark"] .apexcharts-grid line {
    stroke: rgba(255, 255, 255, 0.08) !important;
}

/* ══ Full Width Table Grid Overrides ══════════════════════ */
.atl-table-container {
    width: 100% !important;
}
.atl-table,
.mud-data-grid {
    width: 100% !important;
}
.mud-table-container {
    width: 100% !important;
}
.mud-table-root {
    width: 100% !important;
    min-width: 100% !important;
    display: table !important;
}



