/* Default the site to what browser-zoom = 125% would look like. Every rem
   value in this stylesheet scales up 25%. Pixel values (borders, small icons,
   histogram bar widths) stay native — usually desirable. */
html { font-size: 125%; }

/* Design tokens from web_design.pdf */
:root {
    --color-header: #0f2b5b;
    --color-panel-header: #f4a862;
    --color-accent: #f39130;
    --color-accent-light: #fadfbe;
    --color-win: #f39130;
    --color-lose: #e63946;
    --color-draw: #6c757d;
    --color-text: #2b3448;
    --color-panel-bg: #eeeff2;
    --color-card-bg: #ffffff;
    --color-body-bg: #e9ecef;
    --color-star: #f39130;
    --color-star-empty: #cbd5e0;
    --color-success: #38a169;
    --color-danger: #e63946;
}

html, body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'PingFang TC', sans-serif;
    background: var(--color-body-bg);
    color: var(--color-text);
}

/* ─── Header ─── */
.pvp-header {
    background: var(--color-header);
    color: white;
    height: 4.5rem;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.pvp-header .brand {
    display: flex; align-items: center; gap: 1rem;
}
.pvp-header .brand-logo {
    width: 3rem; height: 3rem; border-radius: 50%;
    background: white; display: flex; align-items: center; justify-content: center;
    color: var(--color-header); font-weight: 600; font-size: 0.85rem;
    overflow: hidden;
}
.pvp-header .brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.pvp-header .brand-title {
    font-size: 1.15rem; font-weight: 500;
}
.pvp-header .actions {
    display: flex; align-items: center; gap: 1rem; font-weight: 600;
}
.pvp-header .hamburger {
    background: transparent; border: none; color: white; cursor: pointer;
    padding: 0.35rem 0.5rem; border-radius: 4px; font-size: 1.4rem; line-height: 1;
}
.pvp-header .hamburger:hover { background: rgba(255,255,255,0.1); }

/* ─── Panel ─── */
.pvp-panel {
    background: var(--color-panel-bg);
    border-radius: 12px;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-height: 0;
}
.pvp-panel-header {
    background: var(--color-panel-header);
    color: white;
    font-weight: 700;
    padding: 1rem 1.5rem;
    font-size: 1.35rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 0.75rem;
}
.pvp-panel-header .back-btn {
    position: absolute;
    left: 1rem;
    color: white; background: transparent; border: none;
    font-size: 1.6rem; cursor: pointer; line-height: 1;
    padding: 0.25rem 0.5rem; border-radius: 4px;
}
.pvp-panel-header .back-btn:hover { background: rgba(255,255,255,0.2); }
.pvp-panel-header .save-btn {
    position: absolute;
    right: 1rem;
    color: white; background: transparent; border: none;
    font-weight: 700; font-size: 1rem; cursor: pointer;
    padding: 0.35rem 0.75rem; border-radius: 4px;
}
.pvp-panel-header .save-btn:hover { background: rgba(255,255,255,0.2); }
.pvp-panel-header .save-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pvp-panel-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* ─── Card (rows inside panels) ─── */
.pvp-card {
    background: var(--color-card-bg);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.pvp-card:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.08); }
/* Currently-selected enrollment card. White background with an orange ring
   around it. Using box-shadow (not border) avoids a 2px layout shift when
   selection toggles, and stacks naturally with the base card's drop shadow. */
.pvp-card.selected {
    background: var(--color-card-bg);
    box-shadow: 0 0 0 2px var(--color-accent),
                0 1px 2px rgba(0,0,0,0.04);
}
.pvp-card.selected:hover {
    box-shadow: 0 0 0 2px var(--color-accent),
                0 3px 8px rgba(0,0,0,0.08);
}
/* Non-ongoing enrollment (upcoming / finished) that isn't selected. Neutral
   grey so it recedes visually — clearly distinct from `.selected`, which
   uses an orange ring. `.selected` and `.dimmed` are mutually exclusive in
   dashboard.js (if/else if), so no combined selector is needed. */
.pvp-card.dimmed {
    background: #f1f3f5;
    color: #64748b;
}
.pvp-card-title { font-size: 1.1rem; font-weight: 500; margin-bottom: 0.25rem; }
.pvp-card-sub { font-size: 0.85rem; color: #64748b; }
/* Orange arrow on the right side of a card. Mirrors the header .back-btn
   hover treatment (translucent tinted background) so users get feedback
   that this glyph is a distinct click target, separate from the card body
   which selects. Padding + border-radius create the hit area; using
   `background: transparent` at rest keeps the visual identical to before. */
.pvp-card-arrow {
    color: var(--color-accent);
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: transparent;
    transition: background 0.15s, transform 0.1s;
}
.pvp-card-arrow:hover {
    background: rgba(243, 145, 48, 0.15);
    transform: translateX(2px);
}

/* ─── Add-tile ─── */
.pvp-add-tile {
    background: var(--color-accent-light);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 2rem;
    transition: background 0.15s;
    color: var(--color-accent);
    font-weight: 600;
}
.pvp-add-tile:hover { background: #f4c58a; }

/* ─── Battle button ─── */
.battle-btn {
    background: var(--color-accent);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.75rem 3rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.battle-btn:hover { background: #d97e1a; }
.battle-btn:disabled { background: var(--color-accent-light); color: white; cursor: not-allowed; }

.test-btn {
    background: var(--color-accent);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.35rem 1.25rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}
.test-btn:hover { background: #d97e1a; }
.test-btn:disabled { background: var(--color-accent-light); cursor: not-allowed; opacity: 0.7; }

/* ─── Result badges ─── */
.badge-win  { color: var(--color-win);  font-weight: 700; }
.badge-lose { color: var(--color-lose); font-weight: 700; }
.badge-draw { color: var(--color-draw); font-weight: 700; }
.badge-success { color: var(--color-success); font-weight: 700; }

/* ─── Test log viewer (collapsible, numbered) ─── */
/* Used by testResult.js for stdout / stderr display. The user's update()
   runs once per frame at 60 FPS × 30s → up to 1800 lines of output per
   test, so each log lives inside a collapsible <details> with a
   fixed-height scroll box and a line-number rail. */
.log-details { width: 100%; }
.log-details > summary {
    display: flex; align-items: center; gap: 0.5rem;
    cursor: pointer; list-style: none;
    padding: 0.15rem 0;
    user-select: none;
}
.log-details > summary::-webkit-details-marker { display: none; }
.log-details > summary::before {
    content: '▶'; font-size: 0.7rem; color: #64748b;
    display: inline-block; transition: transform 0.15s;
    width: 0.8rem;
}
.log-details[open] > summary::before { transform: rotate(90deg); }
.log-title { font-weight: 600; }
.log-title-error { color: var(--color-lose); }
.log-meta { color: #94a3b8; font-weight: 400; font-size: 0.85rem; }

.log-viewer {
    margin-top: 0.5rem; width: 100%;
    max-height: 320px; overflow: auto;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.82rem; line-height: 1.4;
    color: #334155;
}
.log-viewer.log-viewer-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.log-row { display: flex; gap: 0.75rem; padding: 0 0.6rem; }
.log-row:hover { background: rgba(0,0,0,0.03); }
.log-viewer-error .log-row:hover { background: rgba(220, 38, 38, 0.06); }
.log-lineno {
    color: #94a3b8; user-select: none;
    text-align: right; flex: 0 0 auto;
    white-space: pre;
}
.log-line {
    white-space: pre;               /* long lines scroll horizontally, no mid-token wrap */
    flex: 1; min-width: 0;
}
.log-empty {
    padding: 1rem; color: #94a3b8; font-style: italic; text-align: center;
    font-family: 'Noto Sans TC', sans-serif;
}

/* ─── Snapshot status pills (code editor snapshot list) ─── */
.pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.2rem 0.65rem; border-radius: 999px;
    font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.pill-testing     { background: #fff4e0; color: #b26b00; }
.pill-success     { background: #dcfce7; color: var(--color-success); }
.pill-user-error  { background: #fde2e4; color: var(--color-lose); }
.pill-infra-error { background: #e2e8f0; color: #475569; }
.pill-testing::before {
    content: ''; width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid #b26b00; border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* ─── Refresh button in panel header (mirrors .save-btn on the right) ─── */
.refresh-btn {
    position: absolute;
    right: 1rem;
    color: white; background: transparent; border: none;
    font-weight: 700; font-size: 1.25rem; cursor: pointer;
    padding: 0.35rem 0.75rem; border-radius: 4px; line-height: 1;
}
.refresh-btn:hover { background: rgba(255,255,255,0.2); }
.refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.refresh-btn.spinning { animation: spin 0.9s linear infinite; }

/* ─── Login form ─── */
.login-input {
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid #cbd5e0; border-radius: 8px; background: white;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}
.login-input:focus { outline: none; border-color: var(--color-header); }
.confirm-btn {
    background: #4a90e2; color: white; padding: 0.6rem 2rem;
    border: none; border-radius: 8px; font-weight: 700; font-size: 1.1rem;
    cursor: pointer;
}
.confirm-btn:hover { background: #3a7fce; }
.confirm-btn:disabled { background: #cbd5e0; cursor: not-allowed; }

/* ─── CodeMirror wrapper ─── */
.cm-wrapper {
    background: #4b4f56;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    min-height: 400px;
    display: flex; flex-direction: column;
}
.cm-wrapper .cm-editor { flex: 1; }
.cm-wrapper .cm-scroller { font-family: 'JetBrains Mono', 'Consolas', monospace; }

/* Autocomplete popup — match the one-dark editor theme */
.cm-tooltip.cm-tooltip-autocomplete {
    background: #21252b;
    border: 1px solid #3b4048;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    color: #abb2bf;
}
.cm-tooltip.cm-tooltip-autocomplete > ul { max-height: 240px; }
.cm-tooltip.cm-tooltip-autocomplete > ul > li {
    padding: 4px 10px;
}
.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] {
    background: #3a3f4b;
    color: #e6e6e6;
}
.cm-completionLabel { color: #e6e6e6; font-weight: 500; }
.cm-completionMatchedText { color: #f39130; text-decoration: none; font-weight: 700; }
.cm-completionDetail {
    color: #7a8290; font-style: normal; margin-left: 0.75em; font-size: 12px;
}
.cm-completionIcon { margin-right: 6px; opacity: 0.8; }
.cm-completionInfo {
    background: #21252b;
    border: 1px solid #3b4048;
    border-radius: 6px;
    padding: 8px 12px;
    color: #cdd0d5;
    max-width: 360px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* ─── Two-column layout ─── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
    height: calc(100vh - 4.5rem);
}
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; height: auto; }
}

/* Right column container used by the competition view to stack two
   .pvp-panels vertically (應戰代碼 + 對戰紀錄). The first panel hugs its
   content; the second panel takes the remaining vertical space and its
   body scrolls internally so long histories don't push the code card out
   of view. `min-height: 0` on the flex items is required for the inner
   .pvp-panel-body's `overflow-y: auto` to engage. */
.two-col-right {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 0;
}
.two-col-right .pvp-panel:first-child { flex: 0 0 auto; }
.two-col-right .pvp-panel:last-child  { flex: 1 1 auto; min-height: 0; }

/* ─── Video placeholder ─── */
.video-container {
    background: #f1f3f5;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    min-height: 400px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 100%;
}
.video-container video { width: 100%; height: 100%; object-fit: contain; background: black; }
.spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--color-accent);
    border-radius: 50%;
    width: 48px; height: 48px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% {transform:rotate(0)} 100% {transform:rotate(360deg)} }

/* ─── Competition view: centered summary cluster ─── */
/* Applied to the left panel body so its content sits as a compact block in
   the middle of the panel instead of piling up at the top. */
.comp-body-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.comp-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

/* ─── Stat pills (win / lose / draw) with animated emojis ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.stat-pill {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--color-card-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: transform 0.15s;
}
.stat-pill:hover { transform: translateY(-2px); }
.stat-win  { border-left: 4px solid var(--color-win); }
.stat-lose { border-left: 4px solid var(--color-lose); }
.stat-draw { border-left: 4px solid var(--color-draw); }
.stat-emoji {
    font-size: 1.75rem; line-height: 1;
    display: inline-block;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08));
    transform-origin: center bottom;
}
.stat-win .stat-emoji  { animation: emoji-jiggle 3s ease-in-out infinite; }
.stat-lose .stat-emoji { animation: emoji-shake 4s ease-in-out infinite; }
.stat-draw .stat-emoji { animation: emoji-pulse 3s ease-in-out infinite; }
.stat-label { font-size: 0.8rem; color: #64748b; font-weight: 600; }
.stat-value { font-size: 1.35rem; font-weight: 800; color: var(--color-text); line-height: 1.1; }

@keyframes emoji-jiggle {
    0%, 90%, 100% { transform: rotate(0); }
    92% { transform: rotate(-12deg); }
    94% { transform: rotate(12deg); }
    96% { transform: rotate(-8deg); }
    98% { transform: rotate(6deg); }
}
@keyframes emoji-shake {
    0%, 85%, 100% { transform: translateX(0); }
    88% { transform: translateX(-2px); }
    91% { transform: translateX(2px); }
    94% { transform: translateX(-1px); }
    97% { transform: translateX(1px); }
}
@keyframes emoji-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

/* ─── Histogram (score distribution) ─── */
.hist-container {
    background: var(--color-card-bg);
    border-radius: 12px;
    padding: 1rem 1rem 0.85rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.hist-title {
    font-size: 0.8rem; color: #64748b; font-weight: 600;
    text-align: center; margin-bottom: 0.6rem;
}
.hist {
    display: flex; align-items: flex-end; gap: 4px;
    height: 80px; justify-content: center; padding: 0;
}
.hist-bar {
    background: var(--color-accent-light); width: 20px; min-height: 6px;
    border-radius: 3px 3px 0 0;
    transition: background 0.2s;
    position: relative;
    overflow: hidden;
}
/* The current user's bar: solid accent color with a diagonal "shine" band
   that sweeps across every 2.4s, plus a soft orange glow. Feels metallic. */
.hist-bar.mine {
    background:
        linear-gradient(105deg,
            transparent 30%,
            rgba(255,255,255,0.7) 45%,
            rgba(255,255,255,0.95) 50%,
            rgba(255,255,255,0.7) 55%,
            transparent 70%
        ) 200% 0 / 200% 100% no-repeat,
        var(--color-accent);
    animation: hist-shine 2.4s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(243, 145, 48, 0.45);
}
@keyframes hist-shine {
    0%   { background-position: 200% 0; }
    100% { background-position: -100% 0; }
}

/* ─── Hamburger menu dropdown ─── */
.menu-dropdown {
    position: absolute;
    top: 4.5rem; right: 1rem;
    background: white; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 8rem;
    z-index: 40;
    padding: 0.5rem 0;
}
.menu-dropdown button {
    display: block; width: 100%; text-align: center; padding: 0.75rem 1.5rem;
    background: transparent; border: none; cursor: pointer; color: var(--color-text);
    font-size: 1rem;
}
.menu-dropdown button:hover { background: #f1f5f9; }

/* ─── Modal ─── */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
    background: white; border-radius: 12px; padding: 1.5rem;
    min-width: 320px; max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal h2 { font-weight: 700; font-size: 1.25rem; margin-bottom: 1rem; }
.modal-actions {
    display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1rem;
}
.modal-actions button {
    padding: 0.5rem 1.25rem; border-radius: 6px; border: none; cursor: pointer;
    font-weight: 600;
}
.modal-actions .cancel { background: #e2e8f0; color: var(--color-text); }
.modal-actions .confirm { background: var(--color-accent); color: white; }

/* ─── Toast ─── */
.toast {
    background: #1e293b; color: white;
    padding: 0.75rem 1.25rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slidein 0.2s ease-out;
}
.toast.error { background: var(--color-danger); }
.toast.success { background: var(--color-success); }
@keyframes slidein { from {opacity:0;transform:translateX(20px)} to {opacity:1;transform:translateX(0)} }

/* ─── Login page hero ─── */
.login-hero {
    background: #f1f3f5;
    display: flex; align-items: center; justify-content: center;
    min-height: 400px; height: 100%;
    color: #94a3b8;
    font-size: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
}
.login-hero img { width: 100%; height: 100%; object-fit: cover; }

.login-form {
    background: var(--color-panel-bg);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    max-width: 400px;
}
.login-form h1 {
    text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem;
}

/* ─── Admin view ─── */
.admin-section-list {
    display: flex; flex-direction: column; gap: 0.5rem;
}
.admin-section-btn {
    display: block; width: 100%; text-align: left;
    background: var(--color-card-bg);
    border: 1px solid transparent;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 1rem; font-weight: 500;
    color: var(--color-text); cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: transform 0.1s, box-shadow 0.1s;
}
.admin-section-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.08); }
.admin-section-btn.active {
    background: var(--color-card-bg);
    box-shadow: 0 0 0 2px var(--color-accent), 0 1px 2px rgba(0,0,0,0.04);
    color: var(--color-accent);
    font-weight: 700;
}

.admin-form {
    display: flex; flex-direction: column;
    gap: 0.9rem;
    max-width: 560px;
}
.admin-field {
    display: flex; flex-direction: column; gap: 0.35rem;
}
.admin-field > span {
    font-size: 0.85rem; color: #64748b; font-weight: 600;
}
.admin-input {
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e0; border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    font-family: inherit;
}
.admin-input:focus { outline: none; border-color: var(--color-accent); }
.admin-textarea {
    min-height: 4.5rem; resize: vertical;
    font-family: 'Noto Sans TC', sans-serif;
}
.admin-readonly {
    padding: 0.35rem 0;
    font-size: 0.95rem;
}
.admin-actions {
    display: flex; justify-content: flex-end; gap: 0.5rem;
    margin-top: 0.5rem;
}
.admin-selected {
    display: flex; align-items: center; gap: 0.5rem;
    min-height: 1.5rem;
}
.admin-picker-wrap { margin-bottom: 1rem; }
.admin-subtitle {
    font-size: 1.05rem; font-weight: 700; margin-bottom: 0.75rem;
    color: var(--color-text);
}
.admin-add-user {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.admin-add-user > span { font-size: 0.85rem; color: #64748b; }
.admin-add-user > div { flex: 1; }
.admin-enroll-list {
    display: flex; flex-direction: column; gap: 0.5rem;
}
.admin-enroll-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--color-card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.admin-enroll-user {
    display: flex; flex-direction: column; gap: 0.15rem;
    font-size: 0.9rem;
}
.admin-enroll-stats {
    font-size: 0.85rem; color: #64748b;
}
.admin-enroll-status {
    display: flex; justify-content: center;
}

/* ─── Search picker (input + dropdown of matching results) ─── */
.search-picker {
    position: relative; width: 100%;
}
.search-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e0; border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--color-accent); }
.search-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: white;
    border: 1px solid #cbd5e0; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 240px; overflow-y: auto;
    z-index: 60;
}
.search-row {
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}
.search-row:last-child { border-bottom: none; }
.search-row:hover { background: #f8fafc; }
.search-hint {
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
}

/* Inline text-style button used inside admin rows */
.link-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--color-header);
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem; border-radius: 4px;
}
.link-btn:hover { background: rgba(15, 43, 91, 0.08); }
.link-btn.danger { color: var(--color-lose); }
.link-btn.danger:hover { background: rgba(230, 57, 70, 0.08); }

/* ─── Utility ─── */
.hidden-el { display: none !important; }
