/* ——— Контейнер ——— */
.container {
    display: flex;
    width: 1200px;
    margin: 0 auto;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.header h1 {
    font-size: 1.5rem;
    color: #222;
}


/* ——— Cards ——— */
.card {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border: 2px solid #a6c6e5;
}
.card h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #2c3e50;
    font-weight: 600;
}
.card p {
    color: #555;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* ——— Buttons ——— */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-outline-danger{
    background: #e74c3c;
}
.btn-outline-danger:hover{
    background: #b63d30;
}
.btn-primary {
    background: #3498db;
    color: white;
}
.btn-primary:hover {
    background: #2980b9;
}
.btn-success {
    background: #2ecc71;
    color: white;
}
.btn-success:hover {
    background: #27ae60;
}
.btn-danger {
    background: #e74c3c;
    color: white;
    width: 28px;
    height: 28px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
}
.btn-danger:hover {
    background: #c0392b;
}
button.btn-remove {
    padding: 3px 8px;
    background: #b00;
    font-size: 18px;
    border-radius: 5px;
}
span.pl {
    font-weight: bold;
    color: #007bff;
}

/* ——— Forms ——— */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #666;
}
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* ——— Estimate Table ——— */
#estimate-table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
}
#estimate-table th,
#estimate-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
#estimate-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
}
#estimate-table input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
}
#estimate-table .unit-input { width: 70px; }
#estimate-table .qty-input,
#estimate-table .price-input { width: 100px; }

#estimate-table .action-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
}
#estimate-table .action-btn:hover {
    background: #f0f0f0;
}

.sum-cell {
    text-align: right;
    font-weight: 500;
    color: #2d3748;
}
tfoot td {
    padding-top: 12px;
    border: none;
}
#total-sum {
    font-weight: 700;
    color: #3498db;
    font-size: 1.1rem;
}
tr.item-row.work {
    border-left:6px solid #64ff9f;
}
tr.item-row.material {
    border-left:6px solid #a0a0a0;
}
tr.section-header {
    border-left:12px solid #007bff;
}

/* ——— Export ——— */
.export-section {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    justify-content: center;
    flex-wrap: wrap;
}
.export-section .btn {
    min-width: 160px;
}

/* ——— My Estimates ——— */
#my-estimates ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#my-estimates li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #4a5568;
}
#my-estimates a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    margin-right: 8px;
}
#my-estimates a:hover {
    text-decoration: underline;
}

/* ——— Suggestions ——— */
.suggestions {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    width: 460px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.suggestion-item {
    padding: 5px 15px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 20px;
}
.suggestion-item:hover,
.suggestion-item:focus {
    background: #ebf4ff;
    outline: none;
}

/* ——— Utils ——— */
.flex {
    display: flex;
    align-items: stretch;
    gap: 20px;
}
.flex section{
    flex:1;
}
.flex div{
    flex:1;
}
span.flex {
    gap: 8px;
    justify-content: end;
    align-items: center;
}

/* ——— Responsive ——— */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        width: 100%;
        padding: 0 16px;
    }
    .main-content {
        padding: 16px 0;
    }
    #estimate-table thead {
        display: none;
    }
    #estimate-table tr {
        display: block;
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid #eee;
    }
    #estimate-table td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
    }
    #estimate-table td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #4a5568;
        flex: 0 0 100px;
    }
    #estimate-table .sum-cell::before {
        content: "Сумма: ";
    }
    .export-section {
        flex-direction: column;
        align-items: stretch;
    }
    .export-section .btn {
        width: 100%;
        justify-content: center;
    }
}