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

body {
  background: #061f2d;
  color: #c8dde8;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-size: 13px;
  min-height: 100vh;
}

.shell {
  max-width: 1300px;
  margin: 0 auto;
  padding: 16px 20px;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1a3a4a;
}

.title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #9ec8df;
}

.tailnet-label {
  font-size: 11px;
  color: #4a7a8a;
  flex: 1;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── Buttons ── */
.btn-icon {
  background: transparent;
  border: 1px solid #2a4a5a;
  color: #9ec8df;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 14px;
}

.btn-onboard {
  background: transparent;
  border: 2px solid #f4a300;
  color: #f4a300;
  border-radius: 7px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.btn-save   { background: transparent; border: 2px solid #2a8; color: #2a8; border-radius: 7px; padding: 6px 16px; cursor: pointer; font-weight: 700; }
.btn-cancel { background: transparent; border: 2px solid #445; color: #778; border-radius: 7px; padding: 6px 14px; cursor: pointer; }
.btn-gen    { background: transparent; border: 2px solid #f4a300; color: #f4a300; border-radius: 7px; padding: 7px 16px; cursor: pointer; font-weight: 700; }

.btn-row-edit {
  background: transparent;
  border: 1px solid #2a4a5a;
  color: #9ec8df;
  border-radius: 5px;
  padding: 3px 9px;
  cursor: pointer;
  font-size: 11px;
}

.btn-row-link {
  display: inline-block;
  text-decoration: none;
  background: transparent;
  border: 1px solid #1a6a4a;
  color: #2a8;
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
}

button:hover, a:hover { opacity: 0.75; }

/* ── Controls ── */
.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.search-input {
  width: 100%;
  background: #0a2535;
  border: 2px solid #1a3a4a;
  border-radius: 8px;
  color: #f4f4f4;
  padding: 8px 28px 8px 12px;
  font-size: 13px;
  outline: none;
}
.search-input:focus { border-color: #f4a300; }

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #4a7a8a;
  cursor: pointer;
  visibility: hidden;
  font-size: 12px;
}

.filter-tabs { display: flex; gap: 4px; }

.tab {
  background: transparent;
  border: 1px solid #2a4a5a;
  color: #4a8a9a;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.tab.active { border-color: #9ec8df; color: #9ec8df; background: #0a2535; }

.stats   { color: #4a7a8a; font-size: 12px; }
.sync-label { color: #335566; font-size: 11px; margin-left: auto; }

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid #1a3a4a;
  border-radius: 10px;
  background: #080e14;
}

.dev-table {
  width: 100%;
  border-collapse: collapse;
}

.dev-table thead th {
  background: #0a2535;
  color: #4a8a9a;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #1a3a4a;
  white-space: nowrap;
}

.dev-table tbody tr {
  border-bottom: 1px solid #0f2535;
  transition: background 0.1s;
}
.dev-table tbody tr:hover { background: #0d2a3a; }
.dev-table tbody tr:last-child { border-bottom: none; }
.row-off { opacity: 0.55; }

.dev-table td {
  padding: 9px 12px;
  vertical-align: middle;
}

.col-st   { width: 24px; }
.col-host { min-width: 140px; }
.col-client, .col-loc { min-width: 120px; }
.col-ip   { min-width: 130px; }
.col-os   { min-width: 70px; }
.col-seen { min-width: 100px; }
.col-act  { width: 200px; white-space: nowrap; }

.hostname { color: #f0f4f8; font-weight: 700; font-size: 13px; }
.mono     { font-family: monospace; color: #4a8a9a; font-size: 12px; }
.dim      { color: #335566; font-size: 11px; }

/* ── Status dots ── */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  vertical-align: middle;
}
.dot-on  { background: #22cc88; box-shadow: 0 0 5px #22cc88; }
.dot-off { background: #445; }

/* ── Tags ── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  padding: 2px 7px;
}
.tag-name { background: #0f2f50; color: #7bbddf; }
.tag-loc  { background: #2a1800; color: #f4a300; }

.os-badge {
  font-size: 10px;
  color: #4a7a8a;
  border: 1px solid #1a3a4a;
  border-radius: 4px;
  padding: 1px 5px;
}

/* ── States ── */
.loading, .empty-msg {
  text-align: center;
  padding: 32px;
  color: #4a7a8a;
  font-size: 13px;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.pag-btn {
  background: transparent;
  border: 1px solid #1a3a4a;
  color: #9ec8df;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  min-width: 32px;
}
.pag-btn:disabled { opacity: 0.3; cursor: default; }
.pag-btn.pag-active { border-color: #f4a300; color: #f4a300; font-weight: 700; }
.pag-ellipsis { color: #4a7a8a; padding: 0 4px; }
.pag-info { color: #335566; font-size: 11px; margin-left: 8px; }

/* ── Notice ── */
.notice {
  background: #1a3a4a;
  border-radius: 8px;
  padding: 14px 18px;
  color: #9ec8df;
  margin-bottom: 14px;
}
.notice a { color: #f4a300; }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-box {
  background: #0a2535;
  border: 2px solid #1a3a4a;
  border-radius: 14px;
  padding: 26px;
  width: min(440px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-title {
  font-size: 15px;
  font-weight: 900;
  color: #9ec8df;
  letter-spacing: 1px;
}

.modal-label {
  font-size: 11px;
  font-weight: 700;
  color: #4a8a9a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-input {
  width: 100%;
  background: #061f2d;
  border: 2px solid #1a3a4a;
  border-radius: 7px;
  color: #f4f4f4;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.modal-input:focus { border-color: #f4a300; }
.modal-textarea { min-height: 72px; resize: vertical; }

.modal-actions { display: flex; gap: 10px; margin-top: 4px; }

/* ── Onboard ── */
.onboard-step {
  font-size: 12px;
  color: #9ec8df;
  font-weight: 700;
  margin-top: 4px;
}

.key-box {
  background: #061f2d;
  border: 2px solid #f4a300;
  border-radius: 7px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 12px;
  color: #f4a300;
  word-break: break-all;
  cursor: pointer;
}

.install-cmd {
  background: #061f2d;
  border: 1px solid #1a3a4a;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 12px;
  color: #9ec8df;
  white-space: pre-wrap;
  cursor: pointer;
}

/* ── Pending approvals ── */
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #f4a300;
}

.pending-count {
  font-size: 11px;
  color: #f4a300;
  background: #3a1a00;
  border-radius: 10px;
  padding: 1px 8px;
  font-weight: 700;
}

.pending-list {
  border: 1px solid #3a2a00;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}

.pend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #1a2a1a;
  flex-wrap: wrap;
}
.pend-row:last-child { border-bottom: none; }
.pend-row:hover { background: #0d1f10; }

.pend-badge {
  font-size: 10px;
  font-weight: 700;
  border-radius: 5px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.pend-waiting  { background: #3a2a00; color: #f4a300; }
.pend-approved { background: #0a2a1a; color: #22cc88; }
.pend-conn     { background: #0a2535; color: #9ec8df; }
.pend-rej      { background: #2a0a0a; color: #cc4444; }

.pend-host { font-weight: 700; color: #f0f4f8; min-width: 150px; }
.pend-gpu  { font-family: monospace; font-size: 11px; flex: 1; }
.pend-ip   { font-family: monospace; font-size: 11px; min-width: 120px; }
.pend-time { font-size: 11px; min-width: 80px; }

.pend-actions { display: flex; gap: 6px; margin-left: auto; }

.btn-approve-sm {
  background: transparent;
  border: 1px solid #22cc88;
  color: #22cc88;
  border-radius: 5px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.btn-reject-sm {
  background: transparent;
  border: 1px solid #554;
  color: #778;
  border-radius: 5px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 11px;
}

.btn-approve {
  background: transparent;
  border: 2px solid #22cc88;
  color: #22cc88;
  border-radius: 7px;
  padding: 7px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

.modal-sub {
  font-size: 13px;
  color: #f0f4f8;
  font-weight: 700;
}

/* ── Setup ── */
.setup-box {
  max-width: 500px;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-label {
  font-size: 12px;
  font-weight: 700;
  color: #9ec8df;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.setup-hint {
  font-weight: 400;
  color: #4a7a8a;
  font-size: 11px;
  line-height: 1.5;
}

/* ── Admin nav (clients / sites pages) ── */
.top-nav {
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-brand {
  font-weight: 700;
  font-size: .95rem;
  color: #9ec8df;
  text-decoration: none;
  margin-right: .5rem;
}
.nav-link {
  font-size: .85rem;
  color: #888;
  text-decoration: none;
  padding: .3rem .7rem;
  border-radius: 5px;
}
.nav-link.active, .nav-link:hover { color: #e0e0e0; background: #2a2a2a; }

.content {
  max-width: 1200px;
  margin: 1.8rem auto;
  padding: 0 1.5rem;
}

.btn-primary {
  background: #5b9bd5;
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: .45rem 1rem;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
}
.btn-primary:hover { background: #4a87c0; opacity:1; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .87rem;
}
.data-table th {
  background: #1a1a1a;
  padding: .6rem .9rem;
  text-align: left;
  border-bottom: 1px solid #333;
  color: #888;
  font-weight: 500;
}
.data-table td {
  padding: .6rem .9rem;
  border-bottom: 1px solid #222;
}
.data-table tr:hover td { background: #1a1a1a; }

/* topbar nav buttons */
.btn-nav {
  background: transparent;
  border: 1px solid #2a4a5a;
  color: #9ec8df;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
}
.btn-nav:hover { opacity: 0.75; }
