﻿:root {
  --bg: #070b13;
  --bg-soft: #11182a;
  --card: rgba(18, 24, 38, 0.86);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef4ff;
  --muted: rgba(238, 244, 255, 0.65);
  --accent: #0aa3ff;
  --danger: #ff5c76;
  --ok: #13d989;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: radial-gradient(1200px 700px at 20% -10%, #182746 0%, var(--bg) 60%); color: var(--text); font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; }

.topbar {
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 12, 20, 0.75);
}

.logo { font-weight: 800; letter-spacing: 1px; }
.admin-user { font-size: 13px; color: var(--muted); }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }

.sidebar {
  border-right: 1px solid var(--line);
  padding: 14px;
  background: rgba(10, 15, 26, 0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(10, 163, 255, 0.2);
  border-color: rgba(10, 163, 255, 0.5);
}

.content { padding: 18px; overflow: auto; }
.page { display: none; }
.page.active { display: block; }

h2 { margin: 0 0 14px 0; font-size: 24px; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

input:focus, select:focus {
  outline: none;
  border-color: rgba(10, 163, 255, 0.8);
}

.btn-primary, .btn-ghost {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  border-color: rgba(10, 163, 255, 0.8);
  color: #fff;
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-danger {
  border-color: rgba(255, 92, 118, 0.5);
  color: #ffbac4;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  background: var(--card);
}

table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid rgba(255, 255, 255, 0.06); padding: 10px 12px; text-align: left; font-size: 14px; }
th { color: var(--muted); font-size: 12px; letter-spacing: 0.4px; }
tr:last-child td { border-bottom: none; }

.badge {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 12px;
  display: inline-block;
}

.badge-ok { color: #9ef4cf; border-color: rgba(19, 217, 137, 0.6); }
.badge-stop { color: #ffbac4; border-color: rgba(255, 92, 118, 0.6); }

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mono { font-family: Consolas, Monaco, monospace; }
.hint { color: var(--muted); margin-bottom: 10px; font-size: 13px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}

.modal.show { display: flex; }

.modal-card {
  width: min(560px, 100%);
  background: #121a2b;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-card h3 { margin: 0 0 2px 0; }
.modal-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-row { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; }
.check-row input { width: auto; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    overflow: auto;
  }
  .tab-btn { flex: 0 0 auto; }
  .toolbar { flex-direction: column; }
  .grid-two { grid-template-columns: 1fr; }
}
