.admin-nav {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-top: 0;
    border-radius: 0;
}

.nav-btn:hover { color: var(--text); background: transparent; }

.nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-section {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.controls label { flex: 0 0 260px; color: var(--muted); font-size: 0.9rem; }
.controls select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 4px; margin-top: 0.25rem; }

button.primary { background: var(--primary); color: white; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

th {
    background: var(--bg);
    font-weight: 500;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

tr:hover td { background: var(--bg); }

td .badge {
    background: var(--bg);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--muted);
    margin-right: 0.25rem;
}

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-inner {
    background: var(--card);
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 { margin: 0; font-size: 1.1rem; font-weight: 500; }

.modal-header button.close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.modal form label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.modal form input,
.modal form select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 0.25rem;
    font-size: 1rem;
    color: var(--text);
    background: var(--card);
}

.modal form .actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1em;
}

.role-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 0.25rem;
}

.role-SuperAdmin { background: #ffe0b3; color: #663c00; }
.role-OrgAdmin   { background: #d4edda; color: #155724; }
.role-Tenant     { background: #d0e3f7; color: #004a99; }