/* Munco Studio Brand Styling for IP Conversion Simulator */

@font-face {
    font-family: 'PP Agrandir Medium';
    src: url('https://framerusercontent.com/assets/UkNWd71LEiQkPuiR3ooSligP7J0.woff2') format('woff2');
    font-display: swap;
    font-weight: 500;
}

:root {
    --transition-speed: 0.25s;
    --font-heading: 'PP Agrandir Medium', 'Outfit', sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Theme definitions */
.theme-light {
    --bg-main: #f8f8f5;
    --bg-sidebar: #f1f1ee;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --border-color: #d7d7d0;
    
    --text-primary: #171718;
    --text-secondary: #8d8d84;
    
    --color-green: #0d9488; /* Teal-green */
    --color-green-hover: #0f766e;
    --color-green-glow: rgba(13, 148, 136, 0.08);
    
    --color-red: #be123c; /* Elegant deep red */
    --color-red-hover: #9f1239;
    --color-red-glow: rgba(190, 18, 60, 0.08);
    
    --color-amber: #b45309; /* Refined amber */
    --color-amber-glow: rgba(180, 83, 9, 0.08);
    
    --accent-blue: #1e3a8a; /* Deep navy */
    --accent-blue-hover: #172554;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.04);
}

.theme-dark {
    --bg-main: #141415;
    --bg-sidebar: #19191b;
    --bg-card: #1f1f21;
    --bg-input: #171718;
    --border-color: #313134;
    
    --text-primary: #e7e7ea;
    --text-secondary: #8c8c92;
    
    --color-green: #14b8a6; /* Bright teal-green */
    --color-green-hover: #0d9488;
    --color-green-glow: rgba(20, 184, 166, 0.15);
    
    --color-red: #fb7185; /* Soft crimson */
    --color-red-hover: #fda4af;
    --color-red-glow: rgba(251, 113, 133, 0.15);
    
    --color-amber: #fbbf24; /* Soft amber */
    --color-amber-glow: rgba(251, 191, 36, 0.15);
    
    --accent-blue: #3b82f6; /* Modern blue */
    --accent-blue-hover: #60a5fa;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* App Container Layout */
.app-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    min-height: 100vh;
}

/* Sidebar Controls */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.25rem;
}

.logo-img-full {
    height: 26px;
    max-width: 100%;
    object-fit: contain;
    filter: invert(1); /* Invert white logo to black for light theme */
    transition: filter var(--transition-speed) ease;
}

.theme-dark .logo-img-full {
    filter: none; /* Keep white logo for dark theme */
}

.sidebar-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 600;
    padding-left: 0.15rem;
}

/* Tabs inside Sidebar */
.sidebar-tabs {
    display: flex;
    background-color: var(--bg-input);
    padding: 0.2rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    background: none;
    border: 1.5px solid transparent;
    color: var(--text-secondary);
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#btn-scenario1 {
    animation: pulse-green 2.5s infinite;
}

#btn-scenario2 {
    animation: pulse-red 2.5s infinite;
}

.tab-btn.active {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

#btn-scenario1.active {
    background-color: var(--color-green) !important;
    color: #ffffff !important;
    border-color: var(--color-green) !important;
    box-shadow: 0 0 10px var(--color-green-glow) !important;
}

#btn-scenario2.active {
    background-color: var(--color-red) !important;
    color: #ffffff !important;
    border-color: var(--color-red) !important;
    box-shadow: 0 0 10px var(--color-red-glow) !important;
}

/* Control Sections */
.control-sections {
    flex: 1;
}

.control-section {
    display: none;
}

.control-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-title i {
    width: 18px;
    height: 18px;
    color: var(--text-primary);
}

.sub-section-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Stream group boxes */
.stream-group {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
    transition: all 0.25s ease;
}

.stream-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.stream-group-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.stream-group-title-label {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.stream-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
}

.main-badge {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.stream-conditional-fields {
    animation: slideDown 0.25s ease-out;
}

/* Text Input styles */
.text-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease;
}

.text-input:focus {
    border-color: var(--text-primary);
}

/* Input Fields & Groups */
.input-group {
    margin-bottom: 1rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.input-with-slider {
    display: grid;
    grid-template-columns: 65px 1fr;
    gap: 0.5rem;
    align-items: center;
}

.input-with-slider input[type="number"] {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.35rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
}

.input-with-slider input[type="number"]:focus {
    outline: none;
    border-color: var(--text-primary);
}

/* Custom sliders */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    transition: transform 0.1s ease;
    border: 1.5px solid var(--bg-card);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.input-help {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Highlight Input Styling */
.highlight-input {
    border: 1.5px solid var(--text-primary);
}

/* Custom Toggle CSS */
.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.toggle-checkbox {
    appearance: none;
    width: 32px;
    height: 16px;
    background-color: var(--border-color);
    border-radius: 8px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-checkbox:checked {
    background-color: var(--text-primary);
}

.toggle-checkbox::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--bg-card);
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.toggle-checkbox:checked::before {
    transform: translateX(16px);
}

.hidden {
    display: none !important;
}

/* Dropdown/Select */
select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.45rem;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
}

select:focus {
    border-color: var(--text-primary);
}

/* Royalty Rates Grid */
.royalty-rates-editor {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.25rem;
}

.royalty-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.royalty-year-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.2rem;
}

.royalty-year-input label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-bottom: 0.1rem;
    font-weight: 600;
}

.royalty-year-input input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    width: 100%;
    text-align: center;
    outline: none;
}

/* Sidebar Actions */
.sidebar-actions {
    margin-top: auto;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-card);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Main Content Area */
.main-content {
    padding: 2.5rem 3rem;
    height: 100vh;
    overflow-y: auto;
    background-color: var(--bg-main);
    transition: background-color var(--transition-speed) ease;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 2.5rem;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.header-utility-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.header-pretitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    font-weight: 700;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

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

.theme-toggle-btn i {
    width: 16px;
    height: 16px;
}

/* Switch icon display based on theme */
.theme-light .sun-icon { display: none; }
.theme-light .moon-icon { display: block; }
.theme-dark .sun-icon { display: block; }
.theme-dark .moon-icon { display: none; }

.header-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

.header-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color var(--transition-speed) ease;
}

.kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    color: var(--text-secondary);
    opacity: 0.15;
}

.kpi-icon i {
    width: 24px;
    height: 24px;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 2.0rem;
    font-weight: 500;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.kpi-footer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Scenario card-specific colors */
.s1-card {
    border-top: 3px solid var(--color-green);
}
.s1-card .kpi-value {
    color: var(--color-green);
}

.s2-card {
    border-top: 3px solid var(--color-red);
}
.s2-card .kpi-value {
    color: var(--color-red);
}

.verdict-card {
    border-top: 3px solid var(--text-primary);
}

.verdict-card.verdict-s1-better {
    border-top-color: var(--color-green);
}
.verdict-card.verdict-s1-better .kpi-value {
    color: var(--color-green);
}

.verdict-card.verdict-s2-better {
    border-top-color: var(--color-red);
}
.verdict-card.verdict-s2-better .kpi-value {
    color: var(--color-red);
}

/* Help text highlights */
.highlight-green {
    color: var(--color-green);
    font-weight: 700;
}
.highlight-red {
    color: var(--color-red);
    font-weight: 700;
}

/* Dashboard Sections */
.dashboard-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.dashboard-section .section-title {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header .section-title {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    margin-top: -0.25rem;
}

/* Narratives styling */
.summary-narration-section {
    border-left: 3px solid var(--text-primary);
}

.summary-box {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.summary-box p {
    margin-bottom: 1rem;
}

.summary-box p:last-child {
    margin-bottom: 0;
}

.summary-box strong {
    font-weight: 700;
}

.summary-box .verdict-highlight {
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 700;
}

.summary-box .verdict-highlight.green {
    background-color: var(--color-green-glow);
    color: var(--color-green);
    border: 1px solid var(--color-green);
}

.summary-box .verdict-highlight.red {
    background-color: var(--color-red-glow);
    color: var(--color-red);
    border: 1px solid var(--color-red);
}

/* Chart Control buttons */
.chart-toggles {
    display: flex;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 0.2rem;
    border-radius: 6px;
}

.chart-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-toggle-btn.active {
    background-color: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.chart-container {
    height: 380px;
    position: relative;
    width: 100%;
}

/* Tables general design */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

th {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 0.9rem 1rem;
    border-bottom: 1.5px solid var(--border-color);
}

td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(0, 0, 0, 0.01);
}

.theme-dark tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Sub-rows for breakdown styling */
.row-sub-item td:first-child {
    padding-left: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.row-sub-item td {
    background-color: rgba(0, 0, 0, 0.015);
    font-size: 0.8rem;
}

.theme-dark .row-sub-item td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Specific table columns styling */
.col-s1 {
    color: var(--color-green) !important;
}
.col-s1-light {
    color: var(--text-secondary) !important;
    opacity: 0.85;
}
.col-s2 {
    color: var(--color-red) !important;
}
.col-s2-light {
    color: var(--text-secondary) !important;
    opacity: 0.85;
}

.text-green { color: var(--color-green); }
.text-red { color: var(--color-red); }
.text-amber { color: var(--color-amber); }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

/* Comparison Table Specifics */
.comparison-table td {
    padding: 0.9rem 1.1rem;
}

.comparison-table tr.highlight-row td {
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 700;
}

.theme-dark .comparison-table tr.highlight-row td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Breakthrough Table Specifics */
.breakthrough-table th {
    background-color: var(--text-primary);
    color: var(--bg-card);
}

.breakthrough-table td {
    padding: 0.85rem 1rem;
}

.breakthrough-table tr.v-current-equity-highlight td {
    background-color: var(--color-green-glow);
    border-top: 1px solid var(--color-green);
    border-bottom: 1px solid var(--color-green);
}

/* Conclusion Box Alert */
.conclusion-box {
    padding: 1.25rem;
    border-radius: 6px;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.alert-red {
    background-color: var(--color-red-glow);
    border: 1px solid var(--color-red);
    color: var(--text-primary);
    border-left: 4px solid var(--color-red);
}

.alert-green {
    background-color: var(--color-green-glow);
    border: 1px solid var(--color-green);
    color: var(--text-primary);
    border-left: 4px solid var(--color-green);
}

/* Collapsible Projection Details card */
.details-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.details-summary {
    padding: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.05rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.details-summary::-webkit-details-marker {
    display: none;
}

.summary-chevron {
    transition: transform 0.2s ease;
}

.details-card[open] .summary-chevron {
    transform: rotate(180deg);
}

.details-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.01);
    animation: slideDown 0.25s ease-out;
}

.theme-dark .details-content {
    background-color: rgba(255, 255, 255, 0.005);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 1500px; }
}

/* Print Styling for PDF Export */
@media print {
    body {
        background-color: white !important;
        color: #111111 !important;
        font-size: 9pt;
    }

    .theme-light, .theme-dark {
        --bg-main: white !important;
        --bg-card: white !important;
        --text-primary: black !important;
        --text-secondary: #555555 !important;
        --border-color: #bbbbbb !important;
    }

    .app-container {
        display: block !important;
    }

    #print-hide-sidebar, .chart-toggles, .sidebar-actions, .details-summary, .theme-toggle-btn {
        display: none !important;
    }
    
    .details-card {
        border: none !important;
    }
    
    .details-card[open] .details-content, .details-content {
        display: block !important;
        padding: 0 !important;
        border-top: none !important;
        background: none !important;
    }

    .main-content {
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        background: none !important;
    }

    .dashboard-header {
        margin-bottom: 2rem !important;
        border-bottom: 2px solid #000000 !important;
        padding-bottom: 1rem !important;
    }

    .kpi-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
        margin-bottom: 2rem !important;
    }

    .kpi-card {
        background-color: white !important;
        border: 1px solid #999999 !important;
        color: black !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        border-radius: 4px !important;
        padding: 1rem !important;
    }

    .s1-card { border-top: 3px solid #0d9488 !important; }
    .s2-card { border-top: 3px solid #be123c !important; }
    .verdict-card { border-top: 3px solid #000000 !important; }

    .dashboard-section {
        background-color: white !important;
        border: 1px solid #999999 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 1.5rem !important;
        padding: 1.25rem !important;
        border-radius: 4px !important;
    }

    .chart-container {
        height: 260px !important;
    }

    table {
        font-size: 8pt !important;
    }

    th {
        background-color: #eaeaea !important;
        color: black !important;
        border-bottom: 1.5px solid #000000 !important;
        padding: 0.6rem 0.8rem !important;
    }

    td {
        border-bottom: 1px solid #cccccc !important;
        color: black !important;
        padding: 0.5rem 0.8rem !important;
    }

    .row-sub-item td {
        background-color: #fafafa !important;
    }

    .conclusion-box {
        page-break-inside: avoid;
    }

    .alert-red {
        background-color: #fff1f2 !important;
        border: 1.5px solid #be123c !important;
        color: #880828 !important;
        border-left: 4px solid #be123c !important;
    }

    .alert-green {
        background-color: #f0fdf4 !important;
        border: 1.5px solid #16a34a !important;
        color: #14532d !important;
        border-left: 4px solid #16a34a !important;
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content {
        height: auto;
        padding: 1.5rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Password Gate styling */
.password-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-main);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.password-gate.gate-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.password-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.4s ease-out;
}

.logo-img-gate {
    height: 30px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 1.5rem;
    filter: invert(1);
    transition: filter var(--transition-speed) ease;
}

.theme-dark .logo-img-gate {
    filter: none;
}

.gate-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.gate-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.gate-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.gate-input {
    width: 100%;
}

.gate-btn {
    padding: 0.5rem 1.25rem !important;
    font-size: 0.8rem !important;
}

.gate-error {
    font-size: 0.75rem;
    color: var(--color-red);
    margin-top: 0.75rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* App blurring */
.app-container {
    transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container.blurred {
    filter: blur(40px); /* Heavy blur as requested */
    pointer-events: none;
    user-select: none;
}

/* Shaking animation for incorrect password */
.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* BENCHMARKI styles */
.benchmarks-btn {
    width: 100%;
    background-color: var(--bg-card);
    border: 2px solid var(--accent-blue);
    color: var(--text-primary);
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.2s ease;
    animation: pulse-blue 2.5s infinite;
}
.benchmarks-btn:hover {
    background-color: var(--border-color);
    transform: translateY(-1px);
}
.benchmarks-btn.active {
    background-color: var(--text-primary) !important;
    color: var(--bg-card) !important;
    border-color: var(--text-primary) !important;
    box-shadow: var(--shadow-md) !important;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.4);
        border-color: rgba(20, 184, 166, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(20, 184, 166, 0);
        border-color: rgba(20, 184, 166, 0.8);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(20, 184, 166, 0);
        border-color: rgba(20, 184, 166, 0.4);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.4);
        border-color: rgba(251, 113, 133, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(251, 113, 133, 0);
        border-color: rgba(251, 113, 133, 0.8);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(251, 113, 133, 0);
        border-color: rgba(251, 113, 133, 0.4);
    }
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
        border-color: rgba(59, 130, 246, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
        border-color: rgba(59, 130, 246, 0.8);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        border-color: rgba(59, 130, 246, 0.4);
    }
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.search-input-wrapper .search-icon {
    position: absolute;
    left: 0.75rem;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}
.search-input-wrapper .search-input {
    padding-left: 2.25rem;
}

.category-filters {
    display: flex;
    gap: 0.25rem;
    background-color: var(--bg-input);
    padding: 0.2rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.category-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.category-btn.active {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Sub-tabs redesigned as premium card buttons */
.benchmarks-sub-header {
    margin-bottom: 2rem;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 1.5rem;
}
.benchmarks-sub-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    width: 100%;
}
.sub-tab-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    width: 100%;
}
.sub-tab-card:hover {
    transform: translateY(-3px);
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-md);
    background-color: var(--bg-input);
}
.sub-tab-card.active {
    background-color: var(--bg-input);
    font-weight: 600;
}
.sub-tab-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}
.sub-tab-icon {
    width: 46px;
    height: 46px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.sub-tab-icon i {
    width: 22px;
    height: 22px;
}
.sub-tab-card:hover .sub-tab-icon {
    color: var(--text-primary);
    background-color: var(--bg-card);
    border-color: var(--border-color);
}
.sub-tab-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.sub-tab-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}
.sub-tab-card:hover .sub-tab-title {
    color: var(--text-primary);
}
.sub-tab-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    font-weight: 400;
}
.sub-tab-card.active .sub-tab-title {
    color: var(--text-primary);
}

/* Color coordinated sub-tab-cards active states */
/* Market (Blue) */
#btn-sub-market.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}
#btn-sub-market.active::before {
    background-color: var(--accent-blue);
}
#btn-sub-market.active .sub-tab-icon {
    background-color: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--accent-blue);
}
.theme-dark #btn-sub-market.active .sub-tab-icon {
    color: #60a5fa;
}

/* Case Study (Amber) */
#btn-sub-case.active {
    border-color: var(--color-amber);
    box-shadow: 0 0 20px var(--color-amber-glow);
}
#btn-sub-case.active::before {
    background-color: var(--color-amber);
}
#btn-sub-case.active .sub-tab-icon {
    background-color: var(--color-amber-glow);
    border-color: rgba(251, 191, 36, 0.25);
    color: var(--color-amber);
}

/* Risk (Red) */
#btn-sub-risk.active {
    border-color: var(--color-red);
    box-shadow: 0 0 20px var(--color-red-glow);
}
#btn-sub-risk.active::before {
    background-color: var(--color-red);
}
#btn-sub-risk.active .sub-tab-icon {
    background-color: var(--color-red-glow);
    border-color: rgba(251, 113, 133, 0.25);
    color: var(--color-red);
}

/* Risk Badge Styling */
.pill-danger {
    background-color: var(--color-red-glow);
    color: var(--color-red);
    border: 1px solid rgba(251, 113, 133, 0.3);
}
.theme-light .pill-danger {
    border-color: rgba(190, 18, 60, 0.2);
}


/* View Header */
.view-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}
.view-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}
.view-toggles {
    display: flex;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.2rem;
    border-radius: 6px;
}
.view-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
}
.view-toggle-btn.active {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Company Cards Grid */
.company-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.company-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.company-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.company-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}
.company-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
}
.company-valuation-badge {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-green);
}
.company-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.company-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.pill-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.pill-category {
    background-color: var(--bg-sidebar);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.pill-industry {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.theme-dark .pill-industry {
    color: #60a5fa;
}
.pill-country {
    background-color: rgba(20, 184, 166, 0.1);
    color: var(--color-green);
    border: 1px solid rgba(20, 184, 166, 0.2);
}
.company-field {
    font-size: 0.85rem;
    color: var(--text-primary);
}
.company-field-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 0.35rem;
}
.company-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
}

/* Case Study specific layouts */
.case-header {
    margin-bottom: 2rem;
}
.case-main-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.temet-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}
.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.meta-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}
.meta-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.case-study-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}
@media (max-width: 1024px) {
    .case-study-grid {
        grid-template-columns: 1fr;
    }
}
.case-column {
    display: flex;
    flex-direction: column;
}
.case-section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.case-section-title i {
    width: 20px;
    height: 20px;
}

/* Timeline */
.vertical-timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2.5px solid var(--border-color);
    margin-left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.timeline-event {
    position: relative;
}
.timeline-badge {
    position: absolute;
    left: calc(-2rem - 13px);
    top: 2px;
    background-color: var(--text-primary);
    color: var(--bg-card);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    text-align: center;
    width: 62px;
    box-shadow: var(--shadow-sm);
}
.timeline-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.timeline-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}
.timeline-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.timeline-lesson {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: var(--bg-sidebar);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--color-green);
}

.case-metrics-table td {
    padding: 0.75rem;
}
.lessons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 600px) {
    .lessons-grid {
        grid-template-columns: 1fr;
    }
}
.lesson-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}
.lesson-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-primary);
}
.lesson-num {
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.15;
}
.lesson-card .lesson-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}
.lesson-card .lesson-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.benchmarks-kpi-grid .stat-card {
    border-top: 3px solid var(--border-color);
}
.benchmarks-kpi-grid .stat-card:nth-child(2) {
    border-top-color: var(--accent-blue);
}
.benchmarks-kpi-grid .stat-card:nth-child(2) .kpi-value {
    color: var(--accent-blue);
}
.theme-dark .benchmarks-kpi-grid .stat-card:nth-child(2) .kpi-value {
    color: #60a5fa;
}
.benchmarks-kpi-grid .stat-card:nth-child(3) {
    border-top-color: var(--color-green);
}
.benchmarks-kpi-grid .stat-card:nth-child(3) .kpi-value {
    color: var(--color-green);
}

