/* -------------------------------------------------------------
 * SolarBiz Sizer - Stylesheet
 * Premium, Responsive CSS with Light/Dark Mode & Print Styles
 * ------------------------------------------------------------- */

/* Google Font Import inside HTML, defining variables here */
:root {
    /* Color Palette - Light Theme */
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --border-color: #e2e8f0;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --color-brand: #1b365d; /* SEAC Logo Blue */
    --color-brand-hover: #11233d;
    --color-brand-light: rgba(27, 54, 93, 0.12);
    
    --color-accent: #e58c0d; /* SEAC Logo Orange */
    --color-accent-hover: #c97b0b;
    --color-accent-light: rgba(229, 140, 13, 0.12);
    
    --color-warning: #e58c0d; /* SEAC Logo Orange */
    --color-warning-light: rgba(229, 140, 13, 0.12);
    
    --color-danger: #ef4444; /* Red */
    --color-danger-light: #fee2e2;

    --color-success: #7cb342; /* SEAC Logo Green */
    --color-success-light: rgba(124, 179, 66, 0.12);

    /* Shadows & Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(16, 185, 129, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout Constants */
    --sidebar-width: 380px;
    --header-height: 70px;
}

/* Dark Theme Variables override */
body.dark-theme {
    --bg-app: #0b0f19;
    --bg-card: #151f32;
    --bg-sidebar: #0f1726;
    --border-color: #1e293b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --color-brand-light: rgba(16, 185, 129, 0.15);
    --color-accent-light: rgba(59, 130, 246, 0.15);
    --color-warning-light: rgba(245, 158, 11, 0.15);
    --color-danger-light: rgba(239, 68, 68, 0.15);
    --color-success-light: rgba(16, 185, 129, 0.15);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

input, select, button {
    font-family: inherit;
    color: inherit;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Helper Utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.p-6 { padding: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* -------------------------------------------------------------
 * Layout Structure
 * ------------------------------------------------------------- */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.header-divider {
    width: 1.5px;
    height: 28px;
    background-color: var(--border-color);
    margin: 0 0.4rem;
}

.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.logo-text h1 span {
    color: var(--color-success);
}
.logo-text p {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-height));
    position: relative;
}

/* -------------------------------------------------------------
 * Buttons & Forms
 * ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--color-brand);
    color: var(--bg-sidebar);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background-color: var(--color-brand-hover);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background-color: var(--color-accent);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-accent:hover {
    background-color: var(--color-accent-hover);
    box-shadow: var(--shadow-md);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all var(--transition-fast);
}
.btn-icon:hover {
    background-color: var(--border-color);
}

/* Theme Toggle Icons */
.icon-sun { display: none; }
.dark-theme .icon-sun { display: block; }
.dark-theme .icon-moon { display: none; }

/* -------------------------------------------------------------
 * Sidebar Panel
 * ------------------------------------------------------------- */
.app-sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    z-index: 90;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}
.sidebar-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

#sizing-form {
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-sidebar);
}

/* Form Sections (Accordion) */
.form-section {
    border-bottom: 1px solid var(--border-color);
}

.section-trigger {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
    user-select: none;
    background-color: transparent;
    transition: background-color var(--transition-fast);
}
.section-trigger:hover {
    background-color: rgba(0, 0, 0, 0.02);
}
.dark-theme .section-trigger:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}
.form-section.expanded .step-num {
    background-color: var(--color-brand);
    color: var(--bg-sidebar);
}

.section-trigger h3 {
    font-size: 0.9rem;
    font-weight: 600;
    flex: 1;
}

.chevron-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}
.form-section.expanded .chevron-icon {
    transform: rotate(180deg);
}

.section-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: none;
}
.form-section.expanded .section-content {
    display: block;
}

/* Form Groups & Inputs */
.form-group {
    margin-bottom: 1.15rem;
}
.form-group:last-child {
    margin-bottom: 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}
.form-grid-2 .form-group {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.785rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

input[type="text"],
input[type="number"],
input[type="email"],
select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-card);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px var(--color-brand-light);
}

input[readonly] {
    opacity: 0.85;
}
input[readonly]:focus {
    border-color: var(--border-color);
    box-shadow: none;
}

.help-text {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* Custom Checkbox Toggle Switch */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-bottom: 0;
}
.toggle-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-color);
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--color-brand);
}
input:checked + .slider:before {
    transform: translateX(20px);
}
.checkbox-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* -------------------------------------------------------------
 * Main Dashboard Panel
 * ------------------------------------------------------------- */
.app-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* KPI Cards Layout */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.15rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-normal);
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpi-icon svg {
    width: 24px;
    height: 24px;
}

.kpi-data {
    flex: 1;
}
.kpi-label {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 0.2rem;
    letter-spacing: -0.5px;
}
.kpi-value small {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.kpi-sub {
    font-size: 0.725rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Colors for specific KPI icons */
.size-icon { background-color: var(--color-brand-light); color: var(--color-brand); }
.prod-icon { background-color: var(--color-warning-light); color: var(--color-warning); }
.self-icon { background-color: var(--color-accent-light); color: var(--color-accent); }
.money-icon { background-color: var(--color-success-light); color: var(--color-success); }

/* Tabs Layout */
.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none; /* Hide standard Firefox scrollbar */
}
.dashboard-tabs::-webkit-scrollbar {
    display: none; /* Hide Chrome/Safari scrollbars */
}

.tab-btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--text-muted);
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--text-main);
}
.tab-btn.active {
    color: var(--color-brand);
    border-bottom-color: var(--color-brand);
}

/* Tab Viewport & Contents */
.tab-viewport {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid layout options for inside tabs */
.grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------
 * Card Styles
 * ------------------------------------------------------------- */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.card-subtitle {
    font-size: 0.785rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Card Header Flex Layout */
.card-header-flex {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.card-header-flex .card-subtitle {
    margin-bottom: 0;
}

/* Toggle buttons (e.g. Seasons selector) */
.toggle-group {
    display: flex;
    background-color: var(--bg-app);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.toggle-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.785rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}
.toggle-btn.active {
    background-color: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

/* Chart Container & Wrappers */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 340px;
    margin-top: 0.5rem;
}

/* Custom visual energy balance (Sintesi Tab) */
.energy-balance-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    justify-content: center;
}

.balance-bar-visual {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.balance-block {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-radius: var(--radius-md);
    position: relative;
}

.balance-block .label {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.85;
}

.balance-block .value {
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

.gen-total {
    background-color: var(--color-success-light);
    color: var(--color-success);
    border-left: 5px solid var(--color-success);
}
.cons-total {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
    border-left: 5px solid var(--color-danger);
}

.flow-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.flow-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    justify-content: space-between;
}

.flow-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.flow-item .flow-name {
    flex: 1;
    color: var(--text-muted);
}

.flow-item strong {
    font-weight: 600;
    color: var(--text-main);
}

.bg-success { background-color: var(--color-success); }
.bg-warning { background-color: var(--color-warning); }
.bg-danger { background-color: var(--color-danger); }
.bg-accent { background-color: var(--color-accent); }

.bg-success-light { background-color: var(--color-success-light); }
.bg-warning-light { background-color: var(--color-warning-light); }
.bg-danger-light { background-color: var(--color-danger-light); }
.bg-accent-light { background-color: var(--color-accent-light); }

/* Sizing Recommendation Detail Styles */
.rec-report {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.badge-status {
    align-self: flex-start;
    padding: 0.35rem 0.75rem;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    background-color: var(--color-brand-light);
    color: var(--color-brand);
}

.report-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-main);
}

.rec-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.rec-detail {
    background-color: var(--bg-app);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.rec-detail .label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0;
}
.rec-detail .value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Economic Overview Card Styles (Overview Tab footer) */
.economic-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
}
.eco-summary-card {
    border-right: 1px solid var(--border-color);
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.eco-summary-card:last-child {
    border-right: none;
    padding-right: 0;
}
.eco-summary-card .label {
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0;
}
.eco-summary-card .value {
    font-size: 1.15rem;
    font-weight: 700;
}

/* Legend info cards (Hourly simulation tab footer) */
.legend-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.legend-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.legend-card .badge {
    align-self: flex-start;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.725rem;
    font-weight: 700;
}
.legend-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Financial Analysis styling */
.financial-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.metric-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.metric-row .label {
    font-size: 0.825rem;
    font-weight: 600;
    margin-bottom: 0;
}
.metric-row .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}
.metric-row .sub {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.section-subtitle {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Simple styling for cashflow table */
.cashflow-summary-table-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.table-simple {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}
.table-simple th {
    background-color: var(--bg-app);
    padding: 0.65rem 0.85rem;
    font-weight: 700;
    text-align: left;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.table-simple td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
}
.table-simple tr:last-child td {
    border-bottom: none;
}
.table-simple tr.highlight-row {
    background-color: var(--color-success-light);
    font-weight: 600;
}
.table-simple tr.highlight-total-row {
    background-color: var(--bg-app);
    font-weight: 700;
    border-top: 1.5px solid var(--border-color);
}

/* Sustainability ESG card lists */
.esg-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
    margin: 1rem 0;
}
.esg-card {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 1.15rem;
    background-color: var(--bg-app);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.esg-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.esg-icon svg {
    width: 22px;
    height: 22px;
}
.esg-info {
    flex: 1;
}
.esg-info .label {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}
.esg-info strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}
.esg-info .sub {
    font-size: 0.675rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.co2-icon { background-color: var(--color-success-light); color: var(--color-success); }
.trees-icon { background-color: var(--color-brand-light); color: var(--color-brand); }
.oil-icon { background-color: var(--color-warning-light); color: var(--color-warning); }

/* ESG Badge and visualization */
.environmental-badge-container {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: var(--bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px solid var(--color-brand-light);
    box-shadow: var(--shadow-sm);
}

.sustainability-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.sustainability-badge svg {
    width: 54px;
    height: 54px;
    color: var(--color-brand);
}

.sustainability-badge .eco-rank {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--color-brand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.green-glow-icon {
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

/* -------------------------------------------------------------
 * Responsive Layout Adaptations
 * ------------------------------------------------------------- */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    #sizing-form {
        max-height: 400px;
        overflow-y: auto;
    }
    .app-main {
        padding: 1.25rem;
    }
}

/* -------------------------------------------------------------
 * Print Specific Layout & CSS
 * ------------------------------------------------------------- */
.print-only {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 15mm;
    }
    body {
        background-color: white !important;
        color: #334155 !important;
        font-size: 9.5pt !important;
        margin: 0;
        padding: 0;
    }
    .app-header,
    .app-layout {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    #print-proposal-template {
        width: 100%;
        max-height: 267mm;
        box-sizing: border-box;
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #1b365d;
        padding-bottom: 12px;
        margin-bottom: 20px;
    }
    
    .print-logo-img {
        height: 48px;
        width: auto;
        object-fit: contain;
    }
    
    .print-header-right {
        text-align: right;
    }
    
    .print-header-right h2 {
        font-size: 13pt;
        font-weight: 800;
        color: #1b365d;
        margin: 0;
        line-height: 1.2;
    }
    
    .print-header-right p {
        font-size: 8.5pt;
        color: #64748b;
        margin: 4px 0 0 0;
    }
    
    .print-company-bar {
        background-color: #f1f5f9;
        border-left: 4px solid #1b365d;
        padding: 8px 12px;
        font-size: 9.5pt;
        margin-bottom: 20px;
        color: #0f172a;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .print-grid-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        margin-bottom: 20px;
    }
    
    .print-column {
        display: flex;
        flex-direction: column;
    }
    
    .print-col-title {
        font-size: 10.5pt;
        font-weight: 700;
        color: #1b365d;
        border-bottom: 2px solid #e2e8f0;
        padding-bottom: 6px;
        margin-bottom: 10px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .print-compact-table {
        width: 100%;
        border-collapse: collapse;
    }
    
    .print-compact-table td {
        padding: 7px 8px;
        border-bottom: 1px solid #f1f5f9;
        font-size: 9pt;
        line-height: 1.3;
    }
    
    .print-compact-table tr.separator-row td {
        background-color: #f8fafc;
        font-weight: 700;
        color: #1b365d;
        text-align: center;
        padding: 8px;
        font-size: 8.5pt;
        border-top: 1.5px solid #cbd5e1;
        border-bottom: 1.5px solid #cbd5e1;
        text-transform: uppercase;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .print-compact-table tr:last-child td {
        border-bottom: none;
    }
    
    .row-icon {
        width: 13px;
        height: 13px;
        margin-right: 7px;
        vertical-align: middle;
        display: inline-block !important;
    }
    .row-icon.color-brand { color: #1b365d !important; }
    .row-icon.color-success { color: #7cb342 !important; }
    .row-icon.color-warning { color: #e58c0d !important; }
    .row-icon.color-danger { color: #ef4444 !important; }
    .row-icon.color-accent { color: #3b82f6 !important; }

    .print-footer {
        border-top: 1px solid #e2e8f0;
        padding-top: 10px;
        text-align: center;
        font-size: 7.5pt;
        color: #94a3b8;
        margin-top: auto;
    }
    
    .print-footer p {
        margin: 0;
    }
}

/* Dark theme overrides for buttons & select labels */
body.dark-theme .btn-primary {
    color: #ffffff;
}
