/* retoor <retoor@molodetz.nl> */

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

.admin-content {
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.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-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.admin-tabs[data-overflow-tabs] {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
}

.admin-tabs[data-overflow-tabs] .overflow-tabs-more {
    background: none;
    border: none;
    box-shadow: none;
    cursor: pointer;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-tabs[data-overflow-tabs] .overflow-tabs-more:hover {
    color: var(--text-primary);
    border-color: transparent;
    background: none;
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.admin-tab:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.admin-tab.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.admin-tab-count {
    font-size: 0.6875rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--bg-card-hover);
    color: var(--text-muted);
}

.admin-table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    white-space: nowrap;
}

.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(var(--accent-rgb), 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;
}

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

.admin-btn-sm {
    font-size: 0.6875rem;
    padding: 0.25rem 0.375rem;
}

.admin-btn-primary {
    background: var(--accent);
    color: var(--on-accent);
    border-color: transparent;
}

.admin-btn-primary:hover {
    background: var(--accent-hover);
    color: var(--on-accent);
}

.admin-btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: transparent;
}

.admin-btn-danger:hover {
    background: var(--danger);
    color: var(--white);
    opacity: 0.85;
}

.admin-select {
    font-size: 0.75rem;
    padding: 0.25rem 0.375rem;
    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.25rem 0.375rem;
    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;
    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);
}

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

.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;
    text-decoration: none;
    user-select: none;
}

.pagination-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
    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;
}

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

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

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

.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 (hover: none) and (pointer: coarse) {
    .admin-select,
    .admin-btn-sm,
    .admin-btn {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .admin-content {
        padding: 1rem;
    }

    .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;
    }
}

@media (max-width: 360px) {
    .admin-table th,
    .admin-table td {
        padding: 0.25rem 0.375rem;
    }

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

    .admin-btn {
        font-size: 0.6875rem;
        padding: 0.25rem 0.375rem;
    }
}

.admin-btn-danger-text {
    color: var(--danger);
}

.admin-news-col-title {
    width: 30%;
}

.admin-news-status-cell {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.admin-news-status-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-news-img-cell {
    text-align: center;
    font-size: 0.8125rem;
}

.admin-news-img-empty {
    opacity: 0.2;
}

.admin-news-date-cell {
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-settings-intro {
    margin-bottom: 1rem;
}

.admin-settings-group-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

.admin-settings-group-title-spaced {
    margin-top: 1.5rem;
}

.admin-settings-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.admin-settings-num {
    max-width: 120px;
}

.admin-settings-select {
    max-width: 160px;
}

.admin-settings-select-wide {
    max-width: 220px;
}

.admin-settings-code {
    width: 100%;
    font-family: monospace;
    font-size: 0.8125rem;
}
