/* LPOS Remote Support — Device Registry dashboard (dark theme, plain CSS, no frameworks) */

:root {
  --bg: #0d1117;
  --bg-soft: #11161f;
  --panel: #161c26;
  --panel-2: #1b2330;
  --border: #263041;
  --text: #e6e9ef;
  --muted: #8b95a8;
  --accent: #4f8cff;
  --accent-strong: #2f6fe0;
  --danger: #ff6b6b;
  --ok: #3ecf8e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- header / footer ---------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark {
  background: var(--accent);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  letter-spacing: .5px;
}
.brand-text { color: var(--muted); font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.whoami { color: var(--muted); font-size: 13px; }
.whoami b { color: var(--text); }

footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 10px 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 22px; }

/* ---------- cards / forms ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.login-card { max-width: 430px; margin: 8vh auto 0; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.login-card form button { margin-top: 12px; }

label { font-size: 13px; color: var(--muted); display: block; margin-top: 10px; }

input, select, textarea {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  margin-top: 4px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.error { color: var(--danger); font-size: 13px; margin: 4px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: wait; opacity: .6; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent-strong); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: rgba(255, 107, 107, .08); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }

.connect-btn { padding: 8px 18px; font-size: 15px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
#search { flex: 1 1 260px; max-width: 420px; margin-top: 0; }
#customer-filter { width: auto; min-width: 180px; margin-top: 0; }
#device-count { margin-left: auto; }

/* ---------- devices table ---------- */
.table-card { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
  position: sticky;
  top: 0;
  background: var(--panel);
}
tbody tr:hover { background: rgba(79, 140, 255, .05); }
tbody tr:last-child td { border-bottom: none; }
td.actions-col { white-space: nowrap; }
td.actions-col .btn + .btn { margin-left: 6px; }
.note-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-cell { font-family: var(--mono); font-size: 14px; }
.empty { text-align: center; padding: 26px; }

/* platform badges */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid transparent;
}
.badge-windows { background: rgba(79, 140, 255, .15); color: #7fb0ff; border-color: rgba(79, 140, 255, .4); }
.badge-android { background: rgba(61, 220, 132, .12); color: #58d68d; border-color: rgba(61, 220, 132, .4); }
.badge-linux   { background: rgba(245, 197, 66, .12); color: #ecc558; border-color: rgba(245, 197, 66, .4); }
.badge-macos   { background: rgba(199, 205, 217, .12); color: #c7cdd9; border-color: rgba(199, 205, 217, .4); }
.badge-unknown { background: rgba(139, 149, 168, .12); color: var(--muted); border-color: rgba(139, 149, 168, .35); }

/* revealed password on the copy button */
.copy-pw.revealed { font-family: var(--mono); color: var(--ok); }

/* ---------- enroll panel ---------- */
.enroll-panel { margin-top: 16px; }
.enroll-panel summary { cursor: pointer; font-weight: 600; }
.enroll-body h3 { margin: 16px 0 6px; font-size: 14px; }
.enroll-body pre { margin-bottom: 8px; }
pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.45;
}
code {
  background: var(--panel-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: .92em;
}

/* ---------- dialog ---------- */
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  width: min(460px, calc(100vw - 40px));
}
dialog::backdrop { background: rgba(4, 8, 14, .7); }
dialog h2 { margin: 0 0 10px; font-size: 17px; }
#edit-form { display: flex; flex-direction: column; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
  z-index: 50;
  max-width: min(90vw, 640px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast.error { border-color: var(--danger); color: var(--danger); }

@media (max-width: 720px) {
  header { padding: 12px 14px; }
  main { padding: 14px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  #search, #customer-filter { max-width: none; }
  #device-count { margin-left: 0; }
}
