.admin-body { min-width: 320px; }
.admin-header { width: min(calc(100% - 40px), 1480px); height: 80px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.admin-main { width: min(calc(100% - 40px), 1480px); padding: 44px 0 90px; }
.admin-toolbar, .card-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.admin-toolbar { margin-bottom: 28px; }
.admin-toolbar h1, .login-card h1 { font-size: clamp(42px, 7vw, 78px); line-height: .9; }
.table-tabs { display: flex; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.table-tabs a { padding: 10px 18px; border-radius: 10px; color: var(--muted); font-weight: 700; }
.table-tabs a.active { color: white; background: linear-gradient(135deg, var(--violet), var(--pink)); }
.admin-card { margin-bottom: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: rgba(16, 12, 22, .82); backdrop-filter: blur(22px); }
.login-shell { width: min(calc(100% - 32px), 470px); min-height: 100vh; display: grid; place-items: center; margin-inline: auto; }
.login-card { width: 100%; display: grid; gap: 18px; padding: 32px; }
.login-card h1 { margin-bottom: 10px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
input, select { width: 100%; min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--text); background: rgba(255,255,255,.055); font: inherit; }
input:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(123,97,255,.15); }
button, .primary-button, .secondary-button { border: 0; border-radius: 11px; padding: 11px 16px; color: white; font: inherit; font-weight: 750; cursor: pointer; }
.primary-button { background: linear-gradient(135deg, var(--violet), var(--pink)); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); }
.quiet-link { color: var(--muted); text-align: center; }
.notice { padding: 13px 16px; border: 1px solid; border-radius: 13px; }
.notice.success { color: #8af0b1; border-color: rgba(79,227,138,.28); background: rgba(79,227,138,.08); }
.notice.error { color: #ffaaa8; border-color: rgba(255,85,82,.3); background: rgba(255,85,82,.08); }
.list-controls { display: grid; grid-template-columns: minmax(240px, 1fr) 140px auto; gap: 10px; }
.row-count { color: var(--muted); font-size: 13px; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; }
.admin-table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 13px; }
.admin-table th, .admin-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { position: sticky; top: 0; color: var(--muted); background: #17111e; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.sortable-column > span:first-child { vertical-align: middle; }
.sort-arrows { display: inline-flex; gap: 1px; margin-left: 5px; vertical-align: middle; }
.sort-arrows a { display: grid; width: 17px; height: 19px; place-items: center; border-radius: 5px; color: #6f6877; font-size: 13px; line-height: 1; transition: color .16s ease, background .16s ease, transform .16s ease; }
.sort-arrows a:hover, .sort-arrows a:focus-visible { color: white; background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.sort-arrows a.active { color: var(--pink); background: rgba(242, 61, 209, .12); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: var(--surface); }
.admin-table td small { display: block; margin-top: 4px; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 14px; }
.actions > a { color: var(--cyan); font-weight: 700; }
.delete-form { display: flex; align-items: center; gap: 7px; }
.delete-form label { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; }
.delete-form input { width: auto; }
.delete-form button { padding: 6px 8px; color: #ff8d8b; border: 1px solid rgba(255,85,82,.25); background: rgba(255,85,82,.08); font-size: 11px; }
.apple-match-form button { padding: 6px 8px; color: #c8b8ff; border: 1px solid rgba(123,97,255,.3); background: rgba(123,97,255,.1); font-size: 11px; white-space: nowrap; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 20px; color: var(--muted); }
.pagination a { color: var(--cyan); }
.edit-card { border-color: rgba(123,97,255,.35); }
.card-heading { margin-bottom: 22px; }
.card-heading h2 { font-size: 30px; }
.edit-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: 8px; }
.password-card { padding-block: 18px; }
.password-card summary { cursor: pointer; color: var(--text); font-weight: 750; }
.password-card summary::marker { color: var(--pink); }
.password-form { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)) auto; align-items: end; gap: 14px; margin-top: 20px; }
.password-form p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }

@media (max-width: 800px) {
    .admin-header, .admin-main { width: min(calc(100% - 24px), 1480px); }
    .admin-toolbar { align-items: stretch; flex-direction: column; }
    .table-tabs a { flex: 1; text-align: center; }
    .list-controls { grid-template-columns: 1fr; }
    .edit-grid { grid-template-columns: 1fr; }
    .password-form { grid-template-columns: 1fr; }
    .admin-card { padding: 15px; border-radius: 17px; }
}
