body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 0;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

h1, h2, h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

button {
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

input, select, textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
}

.auth-card {
    max-width: 400px;
    margin: 100px auto;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f9f9f9;
}

.error-msg {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.success-msg {
    color: #28a745;
    margin-top: 15px;
    font-size: 0.9em;
    font-weight: 600;
}

.toggle-auth {
    text-align: center;
    margin-top: 15px;
}

.toggle-auth button {
    background: none;
    color: #007bff;
    padding: 0;
    text-decoration: underline;
}

.toggle-auth button:hover {
    background: none;
    color: #0056b3;
}

/* ─── Tabs ─────────────────────────────────────────────── */
.tabs-container {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
    font-size: 15px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #333;
    background-color: #f8f9fa;
}

.tab-btn.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ─── Price preview ──────────────────────────────────── */
.price-preview-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.price-summary {
    margin-top: 15px;
    text-align: right;
    font-size: 1.05em;
}

.price-summary .total-line {
    font-size: 1.2em;
    font-weight: 700;
    color: #28a745;
}

.price-summary .discount-line {
    color: #dc3545;
}

/* ─── Tariff tables ──────────────────────────────────── */
.tariff-section {
    margin-bottom: 25px;
}

.tariff-section h3 {
    margin-bottom: 10px;
    color: #007bff;
}

/* ─── Action buttons ─────────────────────────────────── */
.btn-sm {
    font-size: 0.8em;
    padding: 5px 10px;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.actions-cell {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .tabs-container {
        flex-wrap: wrap;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Editable Tariff Prices ─────────────────────────── */
.editable-price {
    cursor: pointer;
    border-bottom: 1px dashed #007bff;
    padding: 2px 4px;
}

.editable-price:hover {
    background-color: #e8f0fe;
    color: #007bff;
}

.badge-invoiced {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.8rem;
    background-color: #28a745;
    color: #fff;
    border-radius: 4px;
}
