.cost-calculator {
    max-width: var(--small-width);
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .cost-calculator {
        grid-template-columns: 1fr;
    }
}

.input-section {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 20px;
}

.section-icon {
    font-size: 20px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin: 0;
    flex: 1;
}

.add-material-btn {
    padding: 6px 12px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-material-btn:hover {
    background: #4f46e5;
}

.material-header {
    display: grid;
    grid-template-columns: 150px 100px 100px auto 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.material-header span {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.material-row {
    display: grid;
    grid-template-columns: 150px 100px 100px auto 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.material-row input {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
}

.material-row input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.material-subtotal {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.remove-material-btn {
    padding: 6px;
    background: #f87171;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 28px;
    height: 28px;
}

.remove-material-btn:hover {
    background: #ef4444;
}

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-item label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.form-item input {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-item input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-item input::placeholder {
    color: #94a3b8;
}

.calc-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.results-section {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 24px;
}

.cost-hero {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    margin-bottom: 24px;
}

.cost-label {
    font-size: 14px;
    color: #4338ca;
    font-weight: 500;
    margin-bottom: 12px;
}

.cost-value {
    font-size: 48px;
    font-weight: 700;
    color: #6366f1;
    line-height: 1;
}

.cost-structure {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.cost-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.cost-item.highlight {
    background: #eef2ff;
}

.cost-item-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.cost-item-value {
    font-size: 18px;
    font-weight: 700;
    color: #6366f1;
}

.cost-item.highlight .cost-item-value {
    color: #4f46e5;
}

.cost-breakdown {
    margin-bottom: 24px;
}

.breakdown-item {
    margin-bottom: 16px;
}

.breakdown-item:last-child {
    margin-bottom: 0;
}

.breakdown-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.breakdown-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.breakdown-value {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-right: 8px;
}

.breakdown-percent {
    font-size: 13px;
    color: #6366f1;
    font-weight: 600;
}

.breakdown-bar-container {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.breakdown-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.breakdown-bar.material {
    background: #6366f1;
}

.breakdown-bar.labor {
    background: #8b5cf6;
}

.breakdown-bar.mfg {
    background: #a78bfa;
}

.breakdown-bar.admin {
    background: #c4b5fd;
}

.breakdown-bar.sales {
    background: #ddd6fe;
}

.total-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.summary-label {
    font-size: 14px;
    color: #64748b;
}

.summary-value {
    font-size: 16px;
    font-weight: 700;
    color: #6366f1;
}

@media (max-width: 768px) {
    .cost-calculator {
        padding: 16px;
    }

    .material-row {
        grid-template-columns: 1fr 1fr;
    }

    .material-subtotal {
        grid-column: span 2;
        text-align: left;
    }

    .two-col-grid {
        grid-template-columns: 1fr;
    }

    .cost-structure {
        grid-template-columns: 1fr;
    }

    .cost-value {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .material-row {
        grid-template-columns: 1fr;
    }

    .material-subtotal {
        grid-column: span 1;
    }
}