.admin-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.admin-content {
    min-width: 0;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.admin-toolbar h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.admin-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.admin-table th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-role-badge {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-role-badge.admin {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent);
}

.admin-role-badge.member {
    background: var(--bg-card-hover);
    color: var(--text-muted);
}

.admin-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-status.active {
    color: var(--success);
}

.admin-status.disabled {
    color: var(--danger);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.admin-btn {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.admin-btn-sm {
    font-size: 0.6875rem;
    padding: 0.2rem 0.4rem;
}

.admin-select {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    cursor: pointer;
}

.admin-inline-form {
    display: inline;
}

.admin-pw-form {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
}

.admin-input-sm {
    width: 110px;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.admin-text-muted {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.admin-field {
    margin-bottom: 1rem;
}

.admin-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.admin-field input,
.admin-field textarea {
    width: 100%;
    max-width: 500px;
}

.admin-settings-form {
    max-width: 600px;
}

.admin-news-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8125rem;
}

.admin-news-title:hover {
    color: var(--accent);
}

.admin-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-card-hover);
    color: var(--text-muted);
}

.admin-grade-high {
    background: rgba(66, 165, 245, 0.15);
    color: var(--info);
}

.admin-grade-top {
    background: rgba(255, 171, 0, 0.15);
    color: var(--warning);
}

.admin-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.admin-empty a {
    color: var(--accent);
}

.admin-toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.admin-toggle-switch.active {
    background: var(--accent);
    border-color: var(--accent);
}

.admin-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    transition: transform 0.2s;
}

.admin-toggle-switch.active .admin-toggle-knob {
    transform: translateX(18px);
}

.hidden {
    display: none !important;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    user-select: none;
}

.pagination-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}

.pagination-btn-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-btn-disabled:hover {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border-color: var(--border);
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.375rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.pagination-page:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.pagination-page-active {
    background: var(--accent);
    color: #fff;
}

.pagination-page-active:hover {
    background: var(--accent-hover);
    color: #fff;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    user-select: none;
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .admin-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.375rem 0.5rem;
    }

    .admin-table {
        font-size: 0.75rem;
    }

    .admin-field input,
    .admin-field textarea {
        max-width: 100%;
    }

    .admin-settings-form {
        max-width: 100%;
    }

    .pagination {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}
