/* ── Admin page ── */
.admin-container {
    height: 100vh;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.admin-toolbar h2 {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a1a;
}

.btn-add-user {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #dc4c3e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.87em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-add-user:hover {
    background: #c7382a;
}

/* ── Message banner ── */
.admin-message {
    margin: 12px 24px 0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9em;
}

.admin-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.admin-message.error {
    background: #fbe9e7;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ── User form panel ── */
.user-form-panel {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.user-form-panel h3 {
    font-size: 1em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.form-field {
    flex: 1;
}

.form-field label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #dc4c3e;
    box-shadow: 0 0 0 2px rgba(220, 76, 62, 0.12);
}

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

.btn-cancel {
    padding: 8px 20px;
    background: #fff;
    color: #6b6b6b;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.87em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.btn-cancel:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.user-form-panel .btn-submit {
    padding: 8px 20px;
    background: #dc4c3e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.87em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.user-form-panel .btn-submit:hover {
    background: #c7382a;
}

/* ── Main table area ── */
.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.admin-table-wrap {
    overflow-x: auto;
}

#users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87em;
}

#users-table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b6b6b;
    border-bottom: 2px solid #eee;
    padding: 10px 24px;
    text-align: left;
}

#users-table td {
    padding: 10px 24px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

#users-table tbody tr:hover td {
    background: #fafafa;
}

/* ── Role badges in table ── */
.role-badge {
    display: inline-block;
    font-size: 0.78em;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-badge.role-sme {
    background: #f0f0f0;
    color: #6b6b6b;
}

.role-badge.role-manager {
    background: #e8f0fe;
    color: #1a73e8;
}

.role-badge.role-admin {
    background: #fce8e6;
    color: #c62828;
}

/* ── Action buttons ── */
.action-btns {
    display: flex;
    gap: 4px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    color: #6b6b6b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-action:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.btn-action.delete:hover {
    background: #fbe9e7;
    color: #c62828;
    border-color: #ffcdd2;
}

/* ── Loading ── */
.admin-loading {
    text-align: center;
    padding: 40px 24px;
    color: #999;
    font-size: 0.9em;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    #users-table th,
    #users-table td {
        padding: 8px 14px;
    }

    .admin-toolbar {
        padding: 12px 14px;
    }

    .user-form-panel {
        padding: 16px 14px;
    }
}
