/* clients.css — styles specific to the Clients page (client.html):
   the device card grid and the Configure sidebar drawer. */

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 340px));
  gap: 18px;
  margin-bottom: 26px;
  justify-content: start;
}
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.client-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.client-card:hover { transform: translateY(-2px); border-color: #2e3d5c; }

.client-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.device-ic {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.device-title { flex: 1; min-width: 0; }
.device-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-os { font-size: 12px; color: var(--muted); margin-top: 2px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-dot.is-online { background: var(--green); box-shadow: 0 0 0 4px var(--green-glow); }
.status-dot.is-offline { background: var(--muted); }

.client-meta { margin: 0 0 16px; display: grid; gap: 10px; }
.meta-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.meta-row dt { color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.meta-row dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-row dd.mono {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px; color: var(--green); font-weight: 500;
  direction: rtl; text-align: right; /* keep the end of long IPv6 addresses visible */
}
.meta-row dd.ok { color: var(--green); }
.meta-row dd.muted { color: var(--muted); }
.meta-row dd .dash { color: var(--muted); font-weight: 400; }
.meta-row dd.mono:has(.dash) { direction: ltr; color: var(--muted); }

.config-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.config-btn:hover { background: var(--surface-2); border-color: var(--green); color: var(--green); }

/* ---- Configure sidebar (drawer) ---- */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 8, 16, 0.6);
  backdrop-filter: blur(2px);
  z-index: 40;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0;
  height: 100vh; width: 480px; max-width: 94vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: hidden;
}
.drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer--wide { width: 520px; }

.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.drawer-title { display: flex; align-items: center; gap: 12px; }
.drawer-ic {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 11px; font-size: 20px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.28);
}
.drawer-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.drawer-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.drawer-close {
  background: var(--bg-2); color: var(--muted);
  border: 1px solid var(--border); border-radius: 9px;
  width: 34px; height: 34px; font-size: 15px; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease; flex-shrink: 0;
}
.drawer-close:hover { color: var(--red); border-color: var(--red); }

.drawer-layout { display: flex; flex: 1; min-height: 0; }

.drawer-menu {
  width: 140px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-2);
}
.menu-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: 9px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 600; text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item.is-active { background: rgba(74,222,128,0.12); color: var(--green); }
.menu-ic { font-size: 15px; }

.drawer-content { flex: 1; overflow-y: auto; padding: 18px 20px 28px; min-width: 0; }
.drawer-section { display: none; }
.drawer-section.is-active { display: block; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h3 { margin: 0; font-size: 16px; font-weight: 700; }

.loc-meta { display: grid; gap: 10px; margin-bottom: 22px; }
.loc-meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.loc-meta-row span { color: var(--muted); }
.loc-meta-row b { font-weight: 700; }
.history-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; }

/* Screen section consent block */
.screen-consent { text-align: center; padding: 10px; display: grid; gap: 10px; justify-items: center; }
.consent-ic { font-size: 40px; opacity: 0.7; }
.muted-text { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0; }
.screen-consent .cam-btn { max-width: 260px; opacity: 0.6; cursor: not-allowed; }

@media (max-width: 520px) {
  .drawer-menu { width: 108px; }
}
