#admin-wrapper {
    padding: 20px;
}

/* ── Page header ─────────────────────────── */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.admin-page-title {
    margin: 0 0 4px 0;
    font-size: 1em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: white;
}

.admin-page-sub {
    margin: 0;
    font-size: 0.72em;
    color: #5a7a9a;
    letter-spacing: 1px;
}

/* ── Search ──────────────────────────────── */
.admin-search-wrap {
    position: relative;
}

.admin-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #3a4a5a;
    font-size: 0.78em;
    pointer-events: none;
}

.admin-search {
    background-color: #0e1720;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 6px;
    color: #e8e3ec;
    padding: 8px 12px 8px 32px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.82em;
    outline: none;
    width: 220px;
    transition: border-color 0.3s;
}

.admin-search:focus {
    border-color: #d5ad32;
}

.admin-search::placeholder {
    color: #3a4a5a;
}

/* ── Table ───────────────────────────────── */
.admin-table-wrap {
    background-color: #152535;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 0 rgba(0,0,0,.2);
}

.admin-table-header {
    background-color: #0e1720;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.6em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #4a5a6a;
}

.admin-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid rgba(0,0,0,.18);
    transition: background-color 0.2s;
}

.admin-user-row:hover {
    background-color: rgba(255,255,255,.018);
}

/* Columns */
.acol-player { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.acol-rank   { min-width: 130px; display: flex; align-items: center; gap: 7px; }
.acol-set    { min-width: 200px; }
.acol-action { min-width: 70px; display: flex; justify-content: flex-end; }

/* Player cell */
.admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.admin-username {
    font-size: 0.85em;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-username:hover {
    opacity: 0.75;
    text-decoration: none;
}

/* Current rank cell */
.rank-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rank-label {
    font-size: 0.72em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Rank selector */
.rank-update-form {
    display: contents;
}

.rank-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-select {
    background-color: #0e1720;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 6px;
    color: #e8e3ec;
    padding: 6px 10px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.78em;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
    appearance: none;
    -webkit-appearance: none;
    width: 140px;
}

.rank-select:focus {
    border-color: #d5ad32;
}

.rank-select option {
    background-color: #0e1720;
    color: #e8e3ec;
}

.rank-select option:disabled {
    color: #3a4a5a;
    cursor: not-allowed;
}

.select-color-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.25s;
}

/* Save button */
.btn-rank-save {
    background-color: #d5ad32;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.65em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.19), inset 0 0 0 2px rgba(255,255,255,.19);
    white-space: nowrap;
}

.btn-rank-save:hover:not(:disabled) {
    background-color: #cba62f;
}

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

/* Empty search result */
.admin-no-results {
    padding: 30px;
    text-align: center;
    font-size: 0.78em;
    color: #3a4a5a;
    letter-spacing: 1px;
}

@media (max-width: 680px) {
    .acol-rank  { display: none; }
    .admin-table-header .acol-rank { display: none; }
    .acol-set   { min-width: 150px; }
    .rank-select { width: 110px; }
    .admin-search { width: 160px; }
}

/* Admin sub-navigation */
.admin-subnav {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.admin-subnav-link {
    padding: 8px 16px;
    border-radius: 6px;
    background-color: #0e1720;
    color: #6a7d8f;
    font-size: 0.66em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.admin-subnav-link:hover { color: #c5d2dd; }
.admin-subnav-link.active {
    background-color: #d5ad32;
    color: #1a1206;
}

/* Account-help column */
.acol-pw { min-width: 220px; flex: 0 0 auto; }
.pw-reset-form { margin: 0; }
.pw-input {
    width: 100%;
    background-color: #0b141c;
    border: 1px solid #1e3344;
    border-radius: 6px;
    padding: 7px 10px;
    color: #e6edf3;
    font-family: 'Raleway', sans-serif;
    font-size: 0.8em;
}
.pw-input:focus { outline: none; border-color: #d5ad32; }

/* Flash messages */
.admin-flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-flash.success { background: #0d2a1a; color: #3cb87a; border: 1px solid #1c5238; }
.admin-flash.error   { background: #2a0d0d; color: #e0807e; border: 1px solid #5a2424; }

@media (max-width: 680px) {
    .acol-pw { min-width: 150px; }
}

/* ── Short links ─────────────────────────── */
.link-create {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    background-color: #152535;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 0 rgba(0,0,0,.2);
}
.link-field { display: flex; flex-direction: column; gap: 6px; }
.link-field-grow { flex: 1 1 220px; min-width: 180px; }
.link-label {
    font-size: 0.6em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #4a5a6a;
    margin: 0;
}
.link-opt { color: #3a4a5a; letter-spacing: 1px; }
.link-slug-input {
    display: flex;
    align-items: stretch;
    background-color: #0e1720;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 6px;
    overflow: hidden;
}
.link-slug-input:focus-within { border-color: #d5ad32; }
.link-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background-color: #0b141c;
    color: #5a7a9a;
    font-size: 0.8em;
    font-weight: 700;
    white-space: nowrap;
}
.link-input {
    background-color: #0e1720;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 6px;
    color: #e8e3ec;
    padding: 8px 10px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.82em;
    outline: none;
    width: 100%;
    transition: border-color 0.3s;
}
.link-slug-input .link-input { border: none; border-radius: 0; }
.link-input:focus { border-color: #d5ad32; }
.link-input::placeholder { color: #3a4a5a; }
.link-create-btn { height: 35px; }
.link-hint {
    font-size: 0.74em;
    color: #5a7a9a;
    letter-spacing: 0.4px;
    margin: 0 0 20px 2px;
}
.link-hint code, .link-target-cell {
    background-color: #0b141c;
    border-radius: 4px;
    padding: 1px 6px;
    color: #c5b06a;
    font-size: 0.92em;
}

/* Table columns */
.lcol-slug   { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lcol-target { flex: 1.3; min-width: 0; overflow: hidden; }
.lcol-clicks { min-width: 70px; color: #8fa3b5; font-size: 0.82em; font-weight: 700; }
.lcol-action { min-width: 50px; display: flex; justify-content: flex-end; }
.link-slug-cell {
    font-size: 0.86em;
    font-weight: 800;
    color: #d5ad32;
    text-decoration: none;
    letter-spacing: 0.4px;
}
.link-slug-cell:hover { color: #e6c350; text-decoration: none; }
.link-note { font-size: 0.7em; color: #5a7a9a; letter-spacing: 0.4px; }
.link-target-cell {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.btn-link-delete {
    background: none;
    border: 1px solid #5a2424;
    color: #c0706e;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.78em;
    transition: background-color 0.2s, color 0.2s;
}
.btn-link-delete:hover { background-color: #2a0d0d; color: #e0807e; }

@media (max-width: 680px) {
    .lcol-target { display: none; }
    .admin-table-header .lcol-target { display: none; }
}
