:root {
    --page-bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #f1f2f6;
    --border: #dfe6e9;
    --text-main: #2d3436;
    --text-muted: #636e72;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page-bg: #12151a;
        --surface: #1b1f25;
        --surface-2: #22262c;
        --border: #2a2f36;
        --text-main: #e7e9ea;
        --text-muted: #9a9ea3;
    }
}
:root[data-theme="dark"] {
    --page-bg: #12151a;
    --surface: #1b1f25;
    --surface-2: #22262c;
    --border: #2a2f36;
    --text-main: #e7e9ea;
    --text-muted: #9a9ea3;
}
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--page-bg); color: var(--text-main); margin: 0; padding: 20px; display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; transition: background-color 0.15s ease, color 0.15s ease; }
.container { width: 100%; max-width: 1100px; }
.card { background: var(--surface); padding: 24px 28px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 16px; transition: background-color 0.15s ease; }
h2 { text-align: center; color: var(--text-main); margin-top: 0; }
input, select, button { width: 100%; padding: 10px; margin: 8px 0; border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box; background: var(--surface); color: var(--text-main); }
button { background: #0984e3; color: white; border: none; cursor: pointer; font-weight: bold; transition: background 0.3s; }
button:hover { background: #74b9ff; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--surface-2); }
.actions button { padding: 5px 10px; margin-right: 5px; width: auto; font-size: 0.85rem; }
.btn-danger { background: #d63031; }
.btn-danger:hover { background: #ff7675; }
.btn-edit { background: #00b894; }
.btn-edit:hover { background: #55efc4; }
.btn-logout { background: #636e72; width: auto; float: right; padding: 5px 15px; margin-top: -40px; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 999; }
.modal-content { background: var(--surface); color: var(--text-main); padding: 20px; border-radius: 8px; width: 90vw; max-width: 300px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-dot.online { background: #00b894; }
.status-dot.offline { background: #d63031; }

.theme-switch { display: inline-flex; align-items: center; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 3px; gap: 2px; width: auto; }
.theme-switch button { display: inline-flex; align-items: center; flex-shrink: 0; width: auto; white-space: nowrap; background: none; border: none; border-radius: 16px; padding: 5px 11px; font-size: 0.85rem; line-height: 1; cursor: pointer; color: var(--text-muted); margin: 0; font-weight: 500; }
.theme-switch button.active { background: var(--surface); color: var(--text-main); box-shadow: 0 1px 2px rgba(0,0,0,0.08); font-weight: 700; }
.theme-switch button:hover { background: var(--surface); }
.theme-switch .ts-label { margin-left: 5px; }

/* Thanh tab: mỗi tab là một <a> trỏ tới trang riêng (/manager/<path>), không còn ẩn/hiện panel. */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn { display: inline-block; box-sizing: border-box; text-decoration: none; padding: 9px 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text-muted); font-weight: 600; cursor: pointer; font-size: 0.9rem; transition: background 0.15s ease, color 0.15s ease; }
.tab-btn:hover:not(.active) { background: var(--surface); color: var(--text-main); }
.tab-btn.active { background: #0984e3; color: white; border-color: #0984e3; }

@media (max-width: 480px) {
    .theme-switch button { flex-direction: column; gap: 2px; padding: 5px 7px; border-radius: 10px; }
    .theme-switch .ts-icon { font-size: 1rem; }
    .theme-switch .ts-label { margin-left: 0; font-size: 0.6rem; }
}
