* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 30px 20px;
}

.main-card {
    width: 100%;
    max-width: 1100px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.section-block {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-solicitare {
    grid-column: span 5;
    margin-top: 4px;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
}

input[type="text"],
input[type="email"],
input[type="date"],
select, 
textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    color: #334155;
    outline: none;
    transition: all 0.2s ease;
	text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="date"],
select {
    height: 38px;
}

textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

input[readonly], select:disabled {
    background-color: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
    border-style: dashed;
}

.input-action-group {
    display: flex;
    gap: 6px;
}

.input-action-group input {
    flex: 1;
}

#regenereaza {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

#regenereaza:hover { 
    background-color: #eff6ff; 
    border-color: #bfdbfe;
    color: #3b82f6;
}

.table-responsive {
    width: 100%;
}

.articole-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.articole-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 10px 8px;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: bottom;
}

.th-doua-randuri {
    white-space: normal !important; 
    line-height: 1.2;
    font-size: 12px;
}

.articole-table td {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.articole-table tr:last-child td {
    border-bottom: none;
}

.articole-table input, 
.articole-table select {
    height: 34px;
    padding: 4px 8px;
    font-size: 13px;
}

.input-centrat {
    text-align: center;
    font-weight: bold;
    color: #1e293b !important;
}

.btn-icon-sterge {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b; 
    cursor: pointer;
    font-size: 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; 
    width: 34px;
    height: 34px;
}

.btn-icon-sterge:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

.table-actions {
    margin-top: 14px;
    margin-bottom: 20px; 
    display: flex;
    justify-content: flex-start;
}

.btn-adauga {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-adauga:hover { background-color: #059669; }

.valabilitate-table {
    width: 100%;
    max-width: 400px; 
    border-collapse: collapse;
    font-size: 13px;
}

.valabilitate-table td {
    padding: 4px 0;
}

.valabilitate-table td:first-child {
    width: 90px;
    font-weight: 600;
    color: #475569;
}

.comments-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.btn-export { background-color: #475569; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-export:hover { background-color: #334155; }

.btn-trimite { 
    background-color: #3b82f6; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 13px; 
    font-weight: 600; 
    display: none;
}
.btn-trimite:hover { background-color: #2563eb; }

.btn-reset { background-color: #ef4444; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-reset:hover { background-color: #dc2626; }

@media (max-width: 950px) {
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .form-group-solicitare { grid-column: span 2; }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .main-card {
        padding: 16px;
        gap: 20px;
        max-width: 100%;
        overflow: hidden;
    }

    .form-grid { 
        grid-template-columns: 1fr; 
    }
    .form-group-solicitare { 
        grid-column: span 1; 
    }

    .table-responsive {
        width: 100%;
        overflow-x: visible;
        border: none;
    }

    .articole-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    .articole-table thead {
        display: none !important;
    }

    .articole-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .articole-table tr {
        display: block !important;
        width: 100% !important;
        background: #f8fafc;
        border: 1px solid #cbd5e1 !important;
        border-radius: 8px;
        padding: 14px;
        margin-bottom: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        box-sizing: border-box;
    }

    .articole-table td {
        display: block !important;
        width: 100% !important;
        border: none !important;
        padding: 6px 0 !important;
        box-sizing: border-box;
        text-align: left;
    }

    .articole-table td.row-index {
        font-weight: 700;
        font-size: 14px;
        color: #3b82f6;
        border-bottom: 1px dashed #e2e8f0 !important;
        padding-bottom: 6px !important;
        margin-bottom: 8px;
    }
    .articole-table td.row-index::before {
        content: "# " !important;
    }

    .articole-table td:nth-child(2)::before { content: "Denumire articol:"; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #475569; display: block; }
    .articole-table td:nth-child(3)::before { content: "Cantitate:"; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #475569; display: block; }
    .articole-table td:nth-child(4)::before { content: "Discount %:"; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #475569; display: block; }
    .articole-table td:nth-child(5)::before { content: "Mențiuni:"; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #475569; display: block; }
    .articole-table td:nth-child(6)::before { content: "Solicitare:"; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #475569; display: block; }
    .articole-table td:nth-child(7)::before { content: "Bonus exemption mark:"; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #475569; display: block; }
    .articole-table td:nth-child(8)::before { content: "Turnover exemption mark:"; font-weight: 600; font-size: 12px; margin-bottom: 4px; color: #475569; display: block; }

    .input-centrat {
        text-align: left;
    }

    .btn-icon-sterge {
        width: 100% !important;
        margin-top: 8px;
        background-color: #fff;
        justify-content: center;
    }

    .valabilitate-table {
        max-width: 100%;
    }
    .valabilitate-table td {
        display: block;
        width: 100%;
        padding: 6px 0;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions button {
        width: 100% !important;
        height: 42px;
    }
	.btn-trimite {
        display: block !important;
        width: 100% !important;
        height: 42px;
	}
}