/* ════════════════════════════════════════════════
   M75 管理後台 /dashboard/admin/
   底色、色票、導覽列、頁尾、.g-btn 沿用 /dashboard/dashboard.css；toast／確認框沿用 fin.css。
   版面原則：不包框、不做卡片牆，靠字級、字重、1px 細線與留白分層；狀態一律有文字，不只靠顏色。
   數字用 Barlow Semi Condensed 等寬數字。斷點：1000px（伺服器表改直排）、760px（一般表格改直排）。
   ════════════════════════════════════════════════ */
.adm-main {
  position: relative; z-index: 2;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1rem, 3vw, 2rem) 4rem;
  font-family: 'Noto Sans TC', sans-serif;
}
.adm-main .g-btn { font-family: 'Noto Sans TC', sans-serif; font-weight: 500; letter-spacing: 0.02em; }
.num, .srv-fps, .adm-count, .srv-updated, .dos-tiles dd {
  font-family: 'Barlow Semi Condensed', 'Noto Sans TC', sans-serif; font-variant-numeric: tabular-nums;
}
.adm-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── 頁首 ─── */
.adm-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.2rem 1rem;
  margin-bottom: 1.4rem;
}
.adm-back {
  grid-column: 1 / -1; justify-self: start;
  color: var(--hud-blue); text-decoration: none; font-size: 0.92rem;
}
.adm-back:hover { color: #fff; text-decoration: underline; }
.adm-back:focus-visible, .adm-main a:focus-visible { outline: 2px solid var(--hud-blue); outline-offset: 2px; }
.adm-head h1 { margin: 0; font-size: clamp(1.45rem, 3.5vw, 1.8rem); font-weight: 700; color: #fff; line-height: 1.3; }
.adm-who { margin: 0; font-size: 0.86rem; color: #8ea3b8; text-align: right; }

/* ─── 登入牆／權限不足／連線失敗 ─── */
.adm-gate { max-width: 40rem; padding: 1rem 0 2rem; }
.adm-gate h2 { margin: 0 0 0.4rem; font-size: 1.2rem; color: #fff; }
.adm-gate p { margin: 0 0 1.1rem; color: #a7bacb; }
.adm-gate a.g-btn { display: inline-block; text-decoration: none; }

/* ─── 分頁 ─── */
.adm-tabs {
  display: flex; border-bottom: 1px solid var(--glass-border); margin-bottom: 1.4rem;
  overflow-x: auto; scrollbar-width: none;
}
.adm-tabs button {
  flex: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 0.65rem 1.1rem; cursor: pointer; white-space: nowrap;
  font: 500 1rem 'Noto Sans TC', sans-serif; color: #8ea3b8;
}
.adm-tabs button:hover { color: #fff; }
.adm-tabs button[aria-selected="true"] { color: #fff; font-weight: 700; border-bottom-color: var(--hud-blue); }
.adm-tabs button:focus-visible, .adm-panel:focus-visible { outline: 2px solid var(--hud-blue); outline-offset: -2px; }

/* ─── 共用：段落、提示、輸入 ─── */
.adm-sec { padding: 1.3rem 0; border-top: 1px solid var(--glass-border); }
.adm-sec:first-child { border-top: 0; padding-top: 0; }
.adm-sec h2 { margin: 0 0 0.7rem; font-size: 1.05rem; font-weight: 700; color: #fff; }
.adm-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.adm-sec-head h2, .adm-sec-head .adm-hint { margin: 0; }
.adm-sec-head.is-sub { margin: 1.4rem 0 0.4rem; }
.adm-sec-head h3 { margin: 0; font-size: 0.95rem; font-weight: 500; color: #c8d8e8; }
.adm-count { font-weight: 500; color: #8ea3b8; margin-left: 0.3rem; }
.adm-hint { margin: 0.4rem 0 0; font-size: 0.84rem; color: #8ea3b8; line-height: 1.6; }
.adm-empty { margin: 0; padding: 0.8rem 0; font-size: 0.9rem; color: #8ea3b8; }
.adm-empty.is-error { color: #ffb3bd; }
.adm-result {
  margin: 0.7rem 0 0; padding: 0.55rem 0.8rem; font-size: 0.9rem; line-height: 1.55;
  border-left: 3px solid var(--hud-blue); background: rgba(0,207,255,0.06); color: #cfe6f5;
}
.adm-result.is-error { border-left-color: var(--hud-red); background: rgba(232,19,44,0.08); color: #ffb3bd; }
.adm-alert {
  display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; margin: 0 0 1rem; padding: 0.65rem 0.9rem;
  border-left: 3px solid var(--hud-red); background: rgba(232,19,44,0.08); color: #ffc7ce; font-size: 0.92rem;
}
.adm-alert b { color: #fff; }
.adm-alert.is-warn { border-left-color: var(--hud-amber); background: rgba(245,166,35,0.08); color: #f0d9b0; }

.adm-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; }
.adm-row > .adm-input { flex: 1 1 220px; }
.adm-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: #8ea3b8; }
.adm-field.is-grow { flex: 1 1 240px; }
.adm-field.is-days { flex: 0 0 6.5rem; }
.adm-input {
  min-width: 0; width: 100%; padding: 0.55rem 0.75rem;
  font: 1rem 'Noto Sans TC', sans-serif; color: #eaf3fb;
  background: var(--panel-mid); border: 1px solid var(--glass-border); border-radius: 0;
}
.adm-input::placeholder { color: #6f8296; }
.adm-input:focus-visible { outline: 2px solid var(--hud-blue); outline-offset: 0; border-color: var(--hud-blue); }

/* 開關：checkbox role="switch"；開／關除了顏色還有圓點位置 */
.adm-switch { display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer; color: #dbe8f4; font-size: 0.9rem; }
.adm-switch input {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0; cursor: pointer;
  width: 38px; height: 20px; border: 1px solid #5c6f82; border-radius: 10px; background: var(--panel-mid);
  transition: background 0.15s, border-color 0.15s;
}
.adm-switch input::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #8ea3b8; transition: transform 0.15s;
}
.adm-switch input:checked { border-color: var(--hud-blue); background: rgba(0,207,255,0.28); }
.adm-switch input:checked::before { transform: translateX(18px); background: #fff; }
.adm-switch input:disabled { opacity: 0.5; cursor: progress; }
.adm-switch input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.adm-switch.is-main { font-size: 1.02rem; font-weight: 700; color: #fff; }

.adm-seg { display: inline-flex; border: 1px solid var(--glass-border); }
.adm-seg button {
  background: none; border: 0; padding: 0.3rem 0.85rem; cursor: pointer;
  font: 500 0.86rem 'Noto Sans TC', sans-serif; color: #9fb3c8;
}
.adm-seg button + button { border-left: 1px solid var(--glass-border); }
.adm-seg button[aria-pressed="true"] { color: #fff; background: rgba(0,207,255,0.16); }
.adm-seg button:focus-visible { outline: 2px solid var(--hud-blue); outline-offset: -2px; }

/* ─── 伺服器 ─── */
.srv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem 2rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.srv-global { max-width: 44rem; }
.srv-global .adm-hint { margin-top: 0.3rem; }
.srv-updated { margin: 0.2rem 0 0; font-size: 0.86rem; color: #6f8296; }
.srv-tools { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.srv-tools .adm-hint { margin: 0; }

.srv-table, .adm-table { width: 100%; border-collapse: collapse; }
.srv-table thead th, .adm-table thead th {
  text-align: left; font-size: 0.78rem; font-weight: 500; color: #8ea3b8;
  padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--glass-border); white-space: nowrap;
}
.srv-table th.num, .srv-table td.num { text-align: right; }
.srv-table tbody.srv > tr:first-child > * {
  padding: 0.75rem 0.6rem; vertical-align: middle; text-align: left;
  border-bottom: 1px solid rgba(0,207,255,0.12);
}
.srv-table tbody.srv > tr:first-child > td.num { text-align: right; }
.srv-name { font-weight: 400; min-width: 7rem; }
.srv-name b { display: block; font: 600 1.15rem 'Barlow Semi Condensed', sans-serif; color: #fff; line-height: 1.2; }
.srv-name span { display: block; font-size: 0.86rem; color: #c8d8e8; }
.srv-name small { display: block; font-size: 0.72rem; color: #6f8296; word-break: break-all; }
.srv-state { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.srv-state::before { content: ''; width: 9px; height: 9px; flex: none; background: currentColor; }
.srv-state[data-state="running"] { color: var(--hud-green); }
.srv-state[data-state="starting"] { color: var(--hud-amber); }
.srv-state[data-state="no_response"] { color: #ff5a6e; }
.srv-state[data-state="down"] { color: #a7bacb; }
.srv-state[data-state="down"]::before { background: none; border: 2px solid currentColor; box-sizing: border-box; }
.srv-state[data-state="unknown"] { color: #6f8296; font-weight: 500; }
.srv-state[data-state="unknown"]::before { background: none; border: 1px dashed currentColor; box-sizing: border-box; }
.srv-uptime, .srv-wall, .srv-wd-note, .srv-chart-empty { display: block; font-size: 0.74rem; color: #6f8296; }
.srv-fps { font-size: 1.4rem; font-weight: 600; color: #fff; line-height: 1.1; }
.srv-wall { font-family: 'Barlow Semi Condensed', sans-serif; }
.srv-players, .srv-hb { font-size: 1rem; color: #dbe8f4; white-space: nowrap; }
.srv-trend { width: 26%; min-width: 180px; }
.srv-chart { position: relative; height: 54px; }
.srv-chart-empty { margin-top: -2.2rem; height: 2.2rem; text-align: center; }
.srv-auto { white-space: nowrap; }
.srv-wd-note { margin-top: 0.25rem; white-space: normal; color: #c9a86a; }
.srv-act-cell { text-align: right; white-space: nowrap; }
.srv-act { min-width: 5.5em; }
.srv-warn td {
  padding: 0.5rem 0.8rem; font-size: 0.88rem; color: #f0d9b0;
  border-left: 3px solid var(--hud-amber); background: rgba(245,166,35,0.08);
  border-bottom: 1px solid rgba(0,207,255,0.12);
}
.adm-confirm-warn { color: #ff8a98; font-weight: 700; }

@media (max-width: 1000px) {
  .srv-table thead { display: none; }
  .srv-table, .srv-table tbody.srv, .srv-table tr, .srv-table td, .srv-table th { display: block; }
  .srv-table tbody.srv { border-bottom: 1px solid var(--glass-border); padding: 0.9rem 0; }
  .srv-table tbody.srv > tr:first-child {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem 1rem; align-items: start;
  }
  .srv-table tbody.srv > tr:first-child > *,
  .srv-table tbody.srv > tr:first-child > td.num { padding: 0; border: 0; text-align: left; }
  .srv-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.74rem; color: #6f8296; font-weight: 400; margin-bottom: 0.1rem; }
  .srv-name, .srv-trend { grid-column: 1 / -1; width: auto; min-width: 0; }
  .srv-name b, .srv-name span { display: inline; margin-right: 0.5rem; }
  .srv-auto { grid-column: span 2; white-space: normal; }
  .srv-act-cell { grid-column: span 2; align-self: end; }
  .srv-act { width: 100%; }
  .srv-chart { height: 64px; }
  .srv-warn td { margin-top: 0.7rem; border-bottom: 0; }
}
@media (max-width: 600px) {
  .srv-table tbody.srv > tr:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .srv-auto, .srv-act-cell { grid-column: span 1; }
  .srv-tools { align-items: flex-start; }
}

/* ─── 一般表格（封禁、操作紀錄、玩家檔案）─── */
.adm-table td { padding: 0.5rem 0.6rem; font-size: 0.88rem; color: #dbe8f4; border-bottom: 1px solid rgba(0,207,255,0.08); vertical-align: top; overflow-wrap: anywhere; }
.adm-table td small { color: #6f8296; }
.adm-table tr.is-fail td { color: #ffb3bd; }
.ban-table .is-perm { color: var(--hud-amber); font-weight: 700; }
.ban-table .ban-act { text-align: right; white-space: nowrap; vertical-align: middle; }
@media (max-width: 760px) {
  .adm-table thead { display: none; }
  .adm-table, .adm-table tbody, .adm-table tr, .adm-table td { display: block; }
  .adm-table tr { padding: 0.6rem 0; border-bottom: 1px solid var(--glass-border); }
  .adm-table td { border: 0; padding: 0.12rem 0; }
  .adm-table td[data-label] { position: relative; padding-left: 7.2em; }
  .adm-table td[data-label]::before {
    content: attr(data-label); position: absolute; left: 0; top: 0.2rem; width: 6.6em;
    color: #6f8296; font-size: 0.8rem; line-height: 1.5;
  }
  .ban-table .ban-act { text-align: left; padding-top: 0.4rem; }
}

/* ─── 候選／在線名單 ─── */
.adm-cands { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.adm-cands.is-scroll { max-height: 22rem; overflow-y: auto; }
.adm-cand {
  display: flex; flex-direction: column; gap: 0.1rem; width: 100%; text-align: left; cursor: pointer;
  padding: 0.5rem 0.6rem; background: none; border: 0; border-bottom: 1px solid rgba(0,207,255,0.1);
  font-family: 'Noto Sans TC', sans-serif; color: #dbe8f4;
}
.adm-cand:not(:disabled):hover { background: rgba(0,207,255,0.07); }
.adm-cand:focus-visible { outline: 2px solid var(--hud-blue); outline-offset: -2px; }
.adm-cand:disabled { opacity: 0.5; cursor: not-allowed; }
.cand-name { font-weight: 700; font-size: 0.96rem; color: #fff; overflow-wrap: anywhere; }
.cand-meta { font-size: 0.8rem; color: #8ea3b8; overflow-wrap: anywhere; }
.adm-flag { font-style: normal; font-weight: 500; font-size: 0.78rem; color: #8ea3b8; margin-left: 0.4rem; }
.adm-flag.is-warn { color: var(--hud-amber); }
.adm-flag.is-bad { color: #ff5a6e; font-weight: 700; }

/* ─── 玩家檔案 ─── */
.dossier { padding-top: 1.3rem; border-top: 1px solid var(--glass-border); }
.dos-head h3 { margin: 0 0 0.2rem; font-size: 1.35rem; color: #fff; overflow-wrap: anywhere; }
.dos-head p { margin: 0; font-size: 0.86rem; color: #a7bacb; overflow-wrap: anywhere; }
.dos-head code, .dossier code { color: var(--hud-blue); font-size: 0.84rem; word-break: break-all; }
.dos-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.8rem 1.2rem;
  margin: 1rem 0; padding: 0.8rem 0; border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border);
}
.dos-tiles dt { font-size: 0.76rem; color: #8ea3b8; }
.dos-tiles dd { margin: 0; font-size: 1.35rem; font-weight: 600; color: #fff; line-height: 1.2; }
.dossier h4 { margin: 1.4rem 0 0.3rem; font-size: 0.95rem; color: #c8d8e8; }
.dos-hours { display: flex; align-items: flex-end; gap: 2px; height: 3rem; margin-top: 0.4rem; border-bottom: 1px solid var(--glass-border); }
.dos-hours span { flex: 1; background: var(--hud-blue); opacity: 0.7; }
.dos-hours-axis { display: flex; justify-content: space-between; font: 0.72rem 'Barlow Semi Condensed', sans-serif; color: #6f8296; }
.dos-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.dos-tabs { display: flex; flex-wrap: wrap; margin: 1.6rem 0 0.4rem; border-bottom: 1px solid var(--glass-border); }
.dos-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
  padding: 0.5rem 0.9rem; font: 500 0.92rem 'Noto Sans TC', sans-serif; color: #8ea3b8;
}
.dos-tab span { font-family: 'Barlow Semi Condensed', sans-serif; color: #6f8296; margin-left: 0.2rem; }
.dos-tab[aria-pressed="true"] { color: #fff; font-weight: 700; border-bottom-color: var(--hud-blue); }
.dos-tab:focus-visible { outline: 2px solid var(--hud-blue); outline-offset: -2px; }
.dos-link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--hud-blue); text-decoration: underline; font: inherit; }
.dos-link:focus-visible { outline: 2px solid var(--hud-blue); outline-offset: 1px; }
@media (max-width: 760px) {
  .dos-cols { grid-template-columns: 1fr; }
  .adm-tabs button { padding: 0.6rem 0.75rem; font-size: 0.95rem; }
  .adm-head { grid-template-columns: 1fr; }
  .adm-who { text-align: left; }
}
