

/* ============================================================
   BILLING MODULE
   ============================================================ */

.billing-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.billing-period-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.billing-period-select select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.billing-report-header {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #374151;
}

/* Billing Report Table */
.billing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 24px;
}

.billing-table th {
    background: #1a1a2e;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.billing-table th:not(:first-child),
.billing-table td:not(:first-child) {
    text-align: right;
}

.billing-table tbody tr:hover {
    background: #f0f9ff;
}

.billing-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.billing-table tfoot td {
    padding: 12px 12px;
    border-top: 2px solid #1a1a2e;
    background: #f8fafc;
}

.billing-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.billing-total {
    font-weight: 700;
    color: #1a1a2e;
}

.billing-model-cell {
    font-size: 12px;
    min-width: 140px;
}

/* Billing Badges */
.billing-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
    vertical-align: middle;
    white-space: nowrap;
}

.badge-min {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-cap {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.badge-scope {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

/* Billing Model Pill */
.billing-model-pill {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}

/* Billing Config Table */
.billing-config-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.billing-config-table th {
    background: #f8fafc;
    color: #374151;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #e2e8f0;
}

.billing-config-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.billing-config-table tbody tr:hover {
    background: #f8fafc;
}

/* Billing Edit Modal */
#billingEditModal .modal-content {
    max-width: 580px;
}

#billingFieldTiers textarea {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.field-hint {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
    font-style: italic;
}

/* Modal Overlay */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal.hidden { display: none !important; }
.hidden { display: none !important; }
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close {
    background: none; border: none;
    font-size: 24px; cursor: pointer; color: #666; line-height: 1;
}
.modal-close:hover { color: #333; }

/* ===== ADMIN MODULE STYLES (from original) ===== */
.admin-section { background: white; border-radius: 12px; padding: 25px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.admin-section h3 { margin: 0 0 20px 0; font-size: 18px; color: #333; }
.admin-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.admin-tab { padding: 10px 20px; border: 2px solid #e0e0e0; border-radius: 8px; background: white; cursor: pointer; font-size: 14px; font-weight: 500; color: #666; transition: all 0.2s; }
.admin-tab.active { border-color: #8DC63F; color: #8DC63F; background: #f0fff0; }
.admin-tab:hover { border-color: #8DC63F; color: #8DC63F; }
.admin-view { }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 15px; }
.form-group label { font-size: 13px; font-weight: 600; color: #555; }
.form-group input, .form-group select, .form-group textarea { padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; width: 100%; box-sizing: border-box; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #8DC63F; box-shadow: 0 0 0 2px rgba(141,198,63,0.1); }
.btn { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: #8DC63F; color: white; }
.btn-primary:hover { background: #6BA82E; }
.btn-secondary { background: #f5f5f5; color: #333; border: 1px solid #ddd; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-icon { background: none; border: 1px solid #ddd; border-radius: 6px; padding: 5px 8px; cursor: pointer; font-size: 14px; }
.btn-icon:hover { background: #f5f5f5; }
.role-badge { padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.role-admin { background: #fce4ec; color: #c62828; }
.role-team_lead { background: #e3f2fd; color: #1565c0; }
.role-member { background: #e8f5e9; color: #2e7d32; }
.table-wrapper { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: #f8f9fa; padding: 12px 15px; text-align: left; font-size: 13px; color: #666; border-bottom: 2px solid #e0e0e0; white-space: nowrap; }
.admin-table td { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.admin-table tr:hover td { background: #fafafa; }
.error-message { background: #ffebee; color: #c62828; padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; display: none; }
.success-message { background: #e8f5e9; color: #2e7d32; padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; display: none; }
.error-message.show, .success-message.show { display: block; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eee; }
