/**
 * Maestro Calculator - Turyag Branded V3
 */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Inter:wght@400;500;600;700;800&display=swap');

.maestro-calc-container.dashboard-v2 {
    --brand-red: #eb2128;
    --bg-light: #ffffff;
    --card-bg: #f8fafc;
    --border-stroke: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;

    background: var(--bg-light);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    max-width: 1450px;
    /* Expanded for full 11-column high-res visibility */
    margin: 40px auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-stroke);
    display: flex;
    /* Switch to flex for better column stability */
    flex-wrap: wrap;
}

/* Header Section */
.maestro-dashboard-header {
    width: 100%;
    background: linear-gradient(135deg, rgba(235, 33, 40, 0.06) 0%, rgba(235, 33, 40, 0.01) 50%, transparent 100%);
    padding: 30px 40px;
    border-bottom: 1px solid var(--border-stroke);
}

.header-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    max-width: 1370px;
    /* Matches expanded container internal width */
    margin: 0 auto;
}

.header-text-area {
    flex: 1;
    text-align: left;
}

.header-image-area {
    flex-shrink: 0;
    width: 200px;
}

.header-image-area img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.15));
}

.brand-badge {
    display: inline-block;
    background: var(--brand-red);
    color: white;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
    color: #1e293b;
    line-height: 1.1;
    padding: 5px 0;
    /* Heading padding adjustment */
}

.dashboard-title .script-text {
    font-family: 'Dancing Script', cursive;
    color: var(--brand-red);
    font-size: 3rem;
    margin: 0 4px;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    /* Ultra-narrow sidebar */
    background: var(--border-stroke);
    gap: 1px;
    width: 100%;
}

.dashboard-column {
    background: var(--bg-light);
    padding: 20px;
    /* Reduced padding for more space */
    min-width: 0;
    /* CRITICAL: Prevents children from pushing container width */
    overflow: hidden;
    /* Contains all relative absolute children */
}

/* Sidebar Inputs */
.inputs-sidebar {
    background: #fdfdfd;
}

.usage-card {
    margin-top: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f1f5f9;
}

.usage-card h3 {
    white-space: nowrap;
    font-size: 0.81rem !important;
    letter-spacing: -0.03em;
    gap: 4px !important;
    /* Reduced from 8px */
}

.usage-card h3 svg {
    flex-shrink: 0;
    width: 16px !important;
    /* Slightly smaller icon */
    height: 16px !important;
}

/* Advantages Section in Sidebar */
.advantages-sidebar-section {
    margin-top: 30px;
}

.adv-title {
    font-size: 0.9rem !important;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.adv-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: flex-start;
}

.adv-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.3s ease;
}

.adv-item:hover .adv-icon {
    border-color: var(--brand-red);
    color: var(--brand-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.1);
}

.adv-text strong {
    display: block;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 4px;
    font-weight: 700;
}

.adv-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.input-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-input-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-wrapper label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.input-wrapper input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-stroke);
    border-radius: 10px;
    padding: 10px 14px;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.highlight-input input {
    border-color: rgba(225, 29, 72, 0.2);
    background: rgba(225, 29, 72, 0.02);
}

/* Usage Control */
.usage-control {
    text-align: center;
}

.usage-value-display {
    margin-bottom: 15px;
}

.usage-value-display span {
    font-size: 3rem;
    font-weight: 800;
    color: var(--brand-red);
}

.usage-value-display small {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.modern-slider {
    width: 100%;
    height: 6px;
    border-radius: 10px;
    background: #e2e8f0;
    appearance: none;
    cursor: pointer;
    margin-bottom: 15px;
}

.modern-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--brand-red);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.usage-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.usage-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ffffff;
    border: 1.5px solid var(--border-stroke);
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.usage-btn:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: rgba(225, 29, 72, 0.05);
    transform: translateY(-2px);
}

.usage-btn:active {
    transform: translateY(0);
}

.usage-direct-input {
    background: #ffffff;
    border: 1px solid var(--border-stroke);
    color: #1e293b;
    text-align: center;
    width: 70px;
    height: 40px;
    border-radius: 10px;
    padding: 4px;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Remove Arrows/Spinners */
.usage-direct-input::-webkit-outer-spin-button,
.usage-direct-input::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.usage-direct-input[type=number] {
    -moz-appearance: textfield;
}

/* Stats Area */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* Balanced for 780px column */
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

.stat-box {
    background: #ffffff;
    border: 1px solid var(--border-stroke);
    padding: 24px 20px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
    min-height: 140px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.main-stat {
    background: linear-gradient(135deg, var(--brand-red) 0%, #991b1b 100%);
    border: none;
    color: white;
}

.main-stat .stat-label,
.main-stat .stat-value,
.main-stat .stat-note {
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.main-stat .stat-value {
    color: white;
}

.stat-note {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
    opacity: 0.8;
    color: var(--text-muted);
}

/* Cost Progression Row - Excel Style */
.cost-progression-card {
    background: #ffffff;
    border: 1px solid var(--border-stroke);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    /* Force respect of parent width */
}

.progression-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-stroke);
    padding: 12px 20px;
}

.progression-header h4 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.05em;
}

.progression-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    /* Purely fluid grid */
    background: #fef2f2;
    border-top: 1px solid var(--border-stroke);
    overflow: hidden;
    /* Prevent internal scroll if possible */
}

.progression-grid::-webkit-scrollbar {
    height: 6px;
}

.progression-grid::-webkit-scrollbar-track {
    background: transparent;
}

.progression-grid::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.progression-step {
    padding: 10px 2px;
    /* Ultra-tight padding */
    text-align: center;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Tighter gap */
}

.progression-step:last-child {
    border-right: none;
}

.progression-step.active {
    background: #fee2e2;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.step-label {
    font-size: 0.7rem;
    /* Restored font size */
    font-weight: 700;
    color: #94a3b8;
}

.step-value {
    font-size: 0.75rem;
    /* Ultra-compact font */
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
    letter-spacing: -0.02em;
    /* Tighter tracking */
}

.progression-step.active .step-label,
.progression-step.active .step-value {
    color: var(--brand-red);
}

@media (max-width: 1024px) {
    .progression-grid {
        overflow-x: auto;
        display: flex;
        /* Kept flex for mobile if needed, though grid-auto works too */
    }

    .progression-step {
        flex: 0 0 110px;
    }
}

/* Dashboard Cards */
.dashboard-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-stroke);
}

.dashboard-card .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
}

.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 550px;
    /* Slightly reduced min-width */
}

#results-table th {
    text-align: left;
    padding: 12px 10px;
    /* Restored padding */
    color: var(--text-muted);
    font-size: 0.75rem;
    /* Restored font size */
    font-weight: 700;
    border-bottom: 2px solid var(--border-stroke);
    white-space: nowrap;
}

#results-table td {
    padding: 14px 10px;
    /* Restored padding */
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    /* Slightly larger for impact */
    white-space: nowrap;
}

/* Specific column adjustments */
#results-table th:first-child,
#results-table td:first-child {
    width: 80px;
    /* Narrower for the Oran column */
    text-align: center;
    color: #eb2128;
    font-weight: 700;
}

.highlight-row {
    background: rgba(225, 29, 72, 0.03);
}

.highlight-row td {
    color: var(--brand-red);
    font-weight: 700;
}

/* Chart */
.chart-container {
    height: 300px;
}

/* Resource Section Refinement */
.resource-footer-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    background: #f8fafc;
    padding: 30px;
}

.resource-info {
    flex: 1;
    min-width: 300px;
}

.dashboard-card .card-header h3,
.input-card h3 {
    font-size: 0.9rem;
    /* Reduced from 1rem */
    font-weight: 700;
    margin-bottom: 15px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-card h3 svg,
.card-header h3 svg,
.resource-info h3 svg {
    color: var(--brand-red);
    /* Using the brand red for contours */
    flex-shrink: 0;
}

.resource-info h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-info p {
    margin: 0;
}

.resource-action-buttons {
    display: flex;
    gap: 12px;
}

.cta-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none !important;
}

.catalog-cta {
    background: var(--brand-red);
    color: white !important;
}

.presentation-cta {
    background: #ffffff;
    color: #1e293b !important;
    border: 1px solid var(--border-stroke);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}


/* Mobile */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .dashboard-title .script-text {
        font-size: 2.5rem;
    }
}