:root {
  --bg: #0f1420;
  --panel: #171e2e;
  --panel-2: #1f2941;
  --line: #2a3450;
  --text: #e7ecf5;
  --muted: #8a97b1;
  --accent: #4c8dff;
  --danger: #ff5c6c;
  --ok: #35d07f;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin-top: 8px; font-size: 13px; }
button { cursor: pointer; font: inherit; }

/* Login */
.login-wrap { height: 100%; display: grid; place-items: center; }
.login-card {
  width: 320px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 12px;
}
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: .3px; }
.login-card p { margin: 0 0 8px; }
.login-card input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 11px 12px; font: inherit;
}
.login-card button {
  background: var(--accent); border: 0; color: #fff; border-radius: 8px;
  padding: 11px; font-weight: 600;
}

/* App layout */
.app { height: 100%; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.brand { padding: 16px 18px; font-weight: 700; letter-spacing: .3px; border-bottom: 1px solid var(--line); }
.sidebar-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .8px;
}
.badge { background: var(--panel-2); border-radius: 20px; padding: 1px 9px; color: var(--text); }
.agent-list { list-style: none; margin: 0; padding: 0 8px; overflow: auto; flex: 1; }
.agent-item {
  padding: 11px 12px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.agent-item:hover { background: var(--panel-2); }
.agent-item.active { background: var(--panel-2); outline: 1px solid var(--accent); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.dot.off { background: var(--muted); }
.agent-name { font-weight: 600; }
.agent-sub { color: var(--muted); font-size: 12px; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.link { background: none; border: 0; color: var(--accent); }

/* Main */
.main { min-width: 0; display: flex; flex-direction: column; }
.empty { flex: 1; display: grid; place-items: center; color: var(--muted); }
.session { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap;
}
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.status { font-size: 12px; color: var(--muted); margin-left: 10px; }
.status.live { color: var(--ok); }
.tab { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 12px; }
.tab.active { border-color: var(--accent); color: #fff; }
.chk { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.danger { background: var(--danger); border: 0; color: #fff; border-radius: 8px; padding: 7px 12px; }

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: #05070c; overflow: auto; }
#screen { max-width: 100%; max-height: 100%; image-rendering: auto; background: #000; outline: none; }
.screen-info { display: flex; gap: 18px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; }

/* File browser */
.fb-bar { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.fb-bar input[type=text] { flex: 1; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; }
.fb-bar button, .upload-btn {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 12px;
}
.upload-btn { cursor: pointer; }
.fb-progress { padding: 6px 16px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.fb-table { width: 100%; border-collapse: collapse; }
.fb-table th, .fb-table td { text-align: left; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.fb-table th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--panel); }
.fb-row { cursor: default; }
.fb-row.dir .fb-name { cursor: pointer; color: var(--accent); }
.fb-actions button { background: none; border: 0; color: var(--accent); }
