/* MAKERSD REMOTE - 포털 UI (매뉴얼 §5 화면 정책) */
* { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 속성은 어떤 display 규칙보다 우선한다 (자리표시자 겹침 방지) */
[hidden] { display: none !important; }

:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e3e7ee;
  --text: #1e2530;
  --muted: #7a8494;
  --brand: #2f6bff;
  --brand-dark: #1f4fd6;
  --ok: #17a05a;
  --busy: #e5484d;
  --off: #4b5563;
  --danger: #e5484d;
  --radius: 12px;
}

html, body { height: 100%; }
body {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- 상단바 ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 22px; height: 56px;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; letter-spacing: .5px; color: var(--text); font-size: 16px; }
.brand span { color: var(--brand); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.nav a.on, .nav a:hover { color: var(--text); background: var(--bg); }
.who { display: flex; align-items: center; gap: 10px; }
.who-name { font-weight: 700; }
.who-role {
  font-size: 11.5px; color: var(--brand); background: #eef3ff;
  padding: 2px 8px; border-radius: 999px; font-weight: 700;
}

/* ---------- 레이아웃 ---------- */
.container { max-width: 1060px; margin: 26px auto; padding: 0 20px; }
.grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px;
}
.card-title { font-weight: 800; font-size: 15px; margin-bottom: 14px; }

/* ---------- 버튼 ---------- */
.btn {
  border: 1px solid transparent; border-radius: 9px;
  padding: 8px 16px; font-weight: 700; font-size: 14px;
  background: #eef1f6; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 12px 26px; font-size: 15.5px; }
.btn-block { width: 100%; }

/* ---------- 상태 카드 (매뉴얼 §5) ---------- */
.status-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.status-text { font-size: 19px; font-weight: 800; }
.status-detail { color: var(--muted); min-height: 22px; margin-bottom: 14px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #c2c9d4; flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(23,160,90,.14); }
.dot-busy { background: var(--busy); box-shadow: 0 0 0 4px rgba(229,72,77,.14); }
.dot-off { background: var(--off); box-shadow: 0 0 0 4px rgba(75,85,99,.14); }
.status-actions { margin-top: 4px; }

.recent-list { list-style: none; }
.recent-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 14px;
}
.recent-list li:last-child { border-bottom: 0; }
.tips { margin-left: 18px; }
.tips li { margin: 6px 0; color: #3d4655; }

/* ---------- 로그인 ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1d2740 0%, #10182b 100%);
}
.login-card {
  width: 360px; background: #fff; border-radius: 16px;
  padding: 34px 32px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-logo { font-size: 22px; font-weight: 900; letter-spacing: .5px; text-align: center; }
.login-logo span { color: var(--brand); }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 700; color: #465063; margin-bottom: 6px; }
.field input, .inline-form input, .inline-form select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; font-size: 14.5px; background: #fbfcfe;
}
.field input:focus, .inline-form input:focus, .inline-form select:focus {
  outline: 2px solid rgba(47,107,255,.35); border-color: var(--brand);
}
.form-error {
  background: #fdecec; color: #b3261e; border: 1px solid #f6c6c4;
  border-radius: 9px; padding: 9px 12px; font-size: 13.5px; margin: 10px 0;
}

/* ---------- 세션 화면 ---------- */
.session-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 12px;
}
.session-info { display: flex; align-items: center; gap: 12px; }
.session-actions { display: flex; align-items: center; gap: 14px; }
.session-frame-wrap {
  position: relative; background: #0d1117;
  border-radius: var(--radius); overflow: hidden;
  height: calc(100vh - 190px); min-height: 480px;
  border: 1px solid var(--line);
}
#guac-frame { width: 100%; height: 100%; border: 0; display: block; background: #0d1117; }
.session-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: #cdd5e0;
}

/* ---------- 테이블/탭 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.badge { font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.badge-on { background: #e7f6ee; color: var(--ok); }
.badge-off { background: #f1f2f4; color: var(--muted); }
.badge-admin { background: #eef3ff; color: var(--brand); }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px;
}
.tab.on { background: var(--text); border-color: var(--text); color: #fff; }

.inline-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; }
.inline-form .btn { flex: none; }
