/* ==========================================================================
   DESIGN TOKENS & SYSTEM VARIABLES
   ========================================================================== */
:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Theme: Dark (Default) */
    --bg-primary: #080c14;
    --bg-secondary: #0f1626;
    --bg-glass: rgba(15, 22, 38, 0.7);
    --bg-glass-hover: rgba(20, 30, 50, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-light: rgba(255, 255, 255, 0.04);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Brand & Accents */
    --accent: #6366f1; /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.15);
    
    --color-nube: #06b6d4; /* Cyan */
    --color-drp: #a855f7; /* Purple */
    
    --color-presupuesto-total: #6366f1;
    --color-aws-total: #3b82f6; /* AWS Blue */
    --color-onprem-total: #f97316; /* On-Premise Orange */
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    
    /* Layout & Spaces */
    --header-height: 70px;
    --footer-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    /* Theme: Light */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-glass-hover: rgba(255, 255, 255, 0.9);
    --border-glass: rgba(15, 23, 42, 0.08);
    --border-glass-light: rgba(15, 23, 42, 0.04);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.08);
    
    --color-nube: #0891b2;
    --color-drp: #9333ea;
    
    --color-presupuesto-total: #4f46e5;
    --color-aws-total: #2563eb;
    --color-onprem-total: #ea580c;
    
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 32px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 48px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   RESET & CORE BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden; /* Lock browser scroll for slides app feel */
    transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
    display: grid;
    grid-template-rows: var(--header-height) 1fr var(--footer-height);
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-glass);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.35rem;
}

.logo-icon {
    color: var(--accent);
}

.badge {
    font-size: 0.65rem;
    font-family: var(--font-body);
    font-weight: 500;
    background-color: var(--border-glass);
    color: var(--text-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 0.35rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Segmented Control for Mode Selector */
.segmented-control {
    display: flex;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-glass);
    padding: 2px;
    border-radius: var(--radius-md);
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: var(--transition-fast);
}

.control-btn:hover {
    color: var(--text-primary);
}

.control-btn.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-glass-light);
}

.control-btn .icon {
    opacity: 0.7;
}

.control-btn.active .icon {
    opacity: 1;
    color: var(--accent);
}

/* Toggle Switch Styling */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 1px solid var(--border-glass);
    border-right: 1px solid var(--border-glass);
    padding: 0 1.25rem;
    height: 35px;
}

.toggle-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-glass);
    transition: .3s;
    border: 1px solid var(--border-glass);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--success);
    border-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: white;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-glass-light);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ==========================================================================
   MAIN CONTENT AREA (VIEWPORT MANAGER)
   ========================================================================== */
.main-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   PRESENTATION ENGINE (SLIDES VIEWPORT)
   ========================================================================== */
.slides-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, var(--bg-secondary) 0%, var(--bg-primary) 90%);
}

.slide-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98) translateY(10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
}

.slide-section.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    z-index: 2;
}

.slide-content {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Slide Grids */
.slide-grid-2 {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
    align-items: center;
    height: 100%;
}

.full-width-slide {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.slide-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
}

.slide-header-inline h2 {
    font-size: 2rem;
}

.slide-header-inline p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
    text-align: right;
}

/* Slide Typography elements */
.slide-number {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.slide-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.slide-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

/* Cover Slide specific design */
.cover-slide {
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    position: relative;
    max-height: 650px;
}

.cover-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0,0,0,0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

.cover-header {
    z-index: 1;
}

.cover-header .pre-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 0.75rem;
    display: block;
}

.cover-header h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cover-header .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 750px;
    margin: 0 auto;
}

.cover-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 900px;
    z-index: 1;
}

.feature-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: left;
    transition: var(--transition-normal);
}

.feature-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cover-actions {
    display: flex;
    gap: 1rem;
    z-index: 1;
}

/* Micro-animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0; /* starts at 0 and animates */
}

/* Glassmorphism containers */
.chart-container-glass {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 380px;
    position: relative;
    overflow: hidden;
}

.chart-container-glass h3 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent);
    padding-left: 0.75rem;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Buttons */
.primary-btn {
    background: var(--accent);
    color: white;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    transition: var(--transition-fast);
}

.primary-btn:hover {
    background: #5053e1;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-arrow {
    transition: transform var(--transition-fast);
}

.primary-btn:hover .btn-arrow {
    transform: translateX(4px);
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.85rem 1.75rem;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.secondary-btn:hover {
    background: var(--border-glass-light);
    border-color: var(--text-secondary);
}

/* KPI lists and cost breakdowns */
.kpi-vertical-list, .cost-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.kpi-card-mini {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.kpi-card-mini:hover {
    background: var(--bg-glass-hover);
    transform: translateX(4px);
}

.kpi-card-mini .kpi-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-card-mini.cloud-budget-color .kpi-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--color-nube);
}
.kpi-card-mini.drp-budget-color .kpi-icon {
    background: rgba(168, 85, 247, 0.1);
    color: var(--color-drp);
}
.kpi-card-mini.total-budget-color .kpi-icon {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

.kpi-card-mini.highlight {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.kpi-info h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-info .kpi-val {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.kpi-info .kpi-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-glass-light);
}

.breakdown-item .item-name {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.breakdown-item .item-value {
    font-weight: 600;
    color: var(--text-primary);
}

.breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    padding-top: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.breakdown-total.highlight {
    border-top: 1px solid var(--accent);
    color: var(--color-aws-total);
}

.breakdown-total.onprem-highlight {
    border-top: 1px solid var(--color-onprem-total);
    color: var(--color-onprem-total);
}

.breakdown-total .total-value {
    font-family: var(--font-heading);
    font-size: 1.45rem;
}

.item-subdetail {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-bubble {
    font-size: 0.75rem;
    cursor: help;
    background: var(--border-glass);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.alert-box {
    margin-top: 1.25rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.alert-box.note {
    background: var(--warning-bg);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--text-primary);
}

.alert-box.success {
    background: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--text-primary);
}

/* Slide 5 specifics */
.card-feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.simple-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.simple-card h4 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    color: var(--accent);
}

.simple-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Slide 6 specifics */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-box.aws-accent {
    border-color: var(--color-aws-total);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.kpi-box.onprem-accent {
    border-color: var(--color-onprem-total);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.1);
}

.kpi-box .kpi-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.kpi-box .kpi-num {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.kpi-box .kpi-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.green-text {
    color: var(--success) !important;
    font-weight: 500;
}

.text-center {
    text-align: center;
}

/* ==========================================================================
   DYNAMIC CHART SCALING AND DRAWING (SVG CHARTS)
   ========================================================================== */
.svg-chart-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 250px;
    height: 100%;
}

.chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Tooltip standard dynamic styling */
.chart-tooltip {
    position: absolute;
    background: rgba(8, 12, 20, 0.95);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity var(--transition-fast);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-body);
}

/* SVG Chart paths, animations, dots, interactivity */
.chart-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.chart-area {
    opacity: 0.15;
    transition: opacity var(--transition-fast);
}

.chart-grid-line {
    stroke: var(--border-glass-light);
    stroke-width: 1;
}

.chart-axis-line {
    stroke: var(--border-glass);
    stroke-width: 1.5;
}

.chart-axis-text {
    font-family: var(--font-body);
    font-size: 10px;
    fill: var(--text-muted);
}

.chart-interactive-dot {
    cursor: pointer;
    transition: r 0.2s ease, fill 0.2s ease;
}

.chart-interactive-dot:hover {
    r: 6px;
    fill: var(--text-primary) !important;
}

/* SVG Donut / Pie chart details */
.donut-segment {
    transform-origin: center;
    transition: stroke-width 0.3s ease, stroke-dashoffset 1s ease;
}

.donut-segment:hover {
    stroke-width: 24;
}

.donut-center-text {
    font-family: var(--font-heading);
    fill: var(--text-primary);
    text-anchor: middle;
}

.donut-center-sub {
    font-family: var(--font-body);
    fill: var(--text-muted);
    font-size: 10px;
    text-anchor: middle;
}

/* SVG Bar chart details */
.chart-bar {
    transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1), y 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.chart-bar:hover {
    opacity: 0.85;
}

/* ==========================================================================
   INTERACTIVE TABLE
   ========================================================================== */
.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    flex-grow: 1;
}

.card-glass {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: right;
    min-width: 1000px;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-glass-light);
    white-space: nowrap;
}

.data-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table th:first-child, .data-table td:first-child {
    text-align: left;
    font-weight: 500;
    position: sticky;
    left: 0;
    background-color: var(--bg-secondary);
    z-index: 3;
    border-right: 1px solid var(--border-glass);
    min-width: 200px;
}

.data-table tr:hover td {
    background-color: var(--bg-glass-hover);
}

.data-table tr.row-group-header td {
    background-color: rgba(99, 102, 241, 0.04);
    font-weight: 600;
    color: var(--accent);
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

.data-table tr.total-row td {
    font-weight: 700;
    border-top: 1px solid var(--border-glass);
    border-bottom: 2px double var(--border-glass);
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tr.total-row td:first-child {
    background-color: var(--bg-secondary);
}

.data-table .cell-empty {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.4;
}

.data-table .cell-highlight-blue {
    color: #3b82f6;
    font-weight: 500;
}

.data-table .cell-inconsistency {
    position: relative;
    cursor: help;
}

.data-table .cell-inconsistency::after {
    content: "";
    position: absolute;
    bottom: 2px;
    right: 2px;
    border-width: 3px;
    border-style: solid;
    border-color: transparent var(--warning) var(--warning) transparent;
}

.data-table tr.selected td {
    background-color: rgba(99, 102, 241, 0.15) !important;
}

.table-footnote {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   DASHBOARD VIEWPORT STYLING
   ========================================================================== */
.dashboard-viewport {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    background-color: var(--bg-primary);
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    max-width: 1300px;
    margin: 0 auto;
}

/* Row 1: KPIs */
.kpi-dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.shadow-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.shadow-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.12);
}

.kpi-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--text-muted);
}

.kpi-card.aws-card::before {
    background-color: var(--color-aws-total);
}

.kpi-card.onprem-card::before {
    background-color: var(--color-onprem-total);
}

.kpi-card.diff-card::before {
    background-color: var(--accent-cyan);
}

.kpi-card-header {
    display: flex;
    justify-content: justify;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.kpi-card-header span:first-child {
    flex-grow: 1;
}

.kpi-card-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.kpi-card-footer {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.saving-badge {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.saving-badge.green {
    background-color: var(--success-bg);
    color: var(--success);
}

.warning-badge {
    color: var(--color-onprem-total);
    font-weight: 500;
}

/* Row 2: Charts */
.dashboard-charts-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}

.chart-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}

.chart-card-header {
    margin-bottom: 1.25rem;
}

.chart-card-header h3 {
    font-size: 1.1rem;
    border-left: 3px solid var(--accent);
    padding-left: 0.75rem;
}

.chart-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.chart-card-body {
    flex-grow: 1;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-legend-center {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Row 3: Insights */
.dashboard-insights-row {
    width: 100%;
}

.insight-card {
    padding: 1.75rem;
}

.insight-card h3 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-card h3 .icon {
    color: var(--accent);
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.insight-point {
    display: flex;
    gap: 1rem;
}

.point-num {
    background-color: var(--accent-glow);
    color: var(--accent);
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid var(--border-glass);
}

.point-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.point-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.9rem;
}

/* Row 4: Table */
.dashboard-table-row {
    width: 100%;
}

.table-card {
    padding: 1.75rem;
}

.table-card-header {
    margin-bottom: 1rem;
}

.table-card-body {
    width: 100%;
}

/* ==========================================================================
   FOOTER & NAVIGATOR
   ========================================================================== */
.app-footer {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-glass);
    z-index: 10;
    padding: 0.5rem 2rem 0;
    position: relative;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-glass-light);
    border-color: var(--text-secondary);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slide-dots {
    display: flex;
    gap: 0.65rem;
}

.slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border-glass);
    cursor: pointer;
    transition: var(--transition-fast);
}

.slide-dot:hover {
    background-color: var(--text-muted);
}

.slide-dot.active {
    background-color: var(--accent);
    transform: scale(1.3);
    box-shadow: 0 0 8px var(--accent);
}

/* Bottom elements of footer */
.slide-progress-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--border-glass-light);
}

.slide-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-cyan) 100%);
    transition: width var(--transition-normal);
}

.footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding-bottom: 0.35rem;
    border-top: 1px solid var(--border-glass-light);
    padding-top: 0.25rem;
}

.footer-separator {
    margin: 0 0.5rem;
}

.footer-help {
    font-style: italic;
}

/* ==========================================================================
   RESPONSIVENESS (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1100px) {
    .slide-grid-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .slide-content {
        max-height: 100%;
        justify-content: flex-start;
        overflow-y: auto;
        padding-bottom: 2rem;
    }
    
    .slide-section {
        padding: 1.5rem;
    }
    
    .slide-text h2 {
        font-size: 1.75rem;
    }
    
    .chart-container-glass {
        min-height: 250px;
        padding: 1.25rem;
    }
    
    .dashboard-charts-row {
        grid-template-columns: 1fr;
    }
    
    .cover-header h1 {
        font-size: 2.5rem;
    }
    
    .cover-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto; /* allow natural scrolling on small mobile screens */
    }
    
    .app-container {
        grid-template-rows: auto auto auto;
        height: auto;
    }
    
    .app-header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        height: auto;
    }
    
    .header-controls {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .toggle-container {
        border-left: none;
        border-right: none;
        padding: 0;
    }
    
    .slide-section {
        position: relative;
        display: none;
        height: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    
    .slide-section.active {
        display: block;
    }
    
    .app-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        padding-bottom: 0.5rem;
    }
    
    .main-content {
        height: auto;
        padding-bottom: 120px; /* offset footer */
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PRINT STYLES (PDF EXPORT FRIENDLY)
   ========================================================================== */
@media print {
    body {
        background: white !important;
        color: black !important;
        overflow: visible !important;
    }
    
    .app-container {
        display: block !important;
        height: auto !important;
        width: auto !important;
    }
    
    .app-header, .app-footer, .segmented-control, .theme-toggle-btn, .toggle-container {
        display: none !important;
    }
    
    .slides-viewport {
        background: none !important;
    }
    
    .slide-section {
        position: relative !important;
        display: block !important;
        page-break-after: always !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        padding: 2cm !important;
        height: 100vh !important;
    }
    
    .chart-container-glass, .kpi-card-mini, .feature-card, .simple-card, .kpi-box {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .slide-text h2, h1, h2, h3, h4 {
        color: black !important;
        background: none !important;
        -webkit-text-fill-color: initial !important;
    }
    
    .slide-desc, .kpi-info h4, .kpi-info .kpi-detail, .breakdown-item, .table-footnote, .footer-info {
        color: #333 !important;
    }
    
    .chart-svg text {
        fill: #333 !important;
    }
    
    .chart-axis-line, .chart-grid-line {
        stroke: #ccc !important;
    }
}
