
/* WS3_ADMIN_DEVICES_V1 */

/* Only the administrator's Devices & Sessions page */
body[data-admin-role="1"].ws3-admin-devices-page {
  --device-panel:#14272a;
  --device-border:#36554b;
  --device-muted:#a8c2b5;
}

/* Page structure */
body.ws3-admin-devices-page .content {
  min-width:0;
}

body.ws3-admin-devices-page .content > h1 {
  font-size:clamp(27px,3vw,36px);
  font-weight:750;
  letter-spacing:-.7px;
  margin-bottom:9px;
}

body.ws3-admin-devices-page .content > p {
  color:var(--device-muted);
  line-height:1.6;
  max-width:850px;
}

/* Panels */
body.ws3-admin-devices-page .content .card,
body.ws3-admin-devices-page .content .panel,
body.ws3-admin-devices-page .content .form-card {
  background:var(--device-panel) !important;
  border:1px solid var(--device-border) !important;
  border-radius:16px !important;
  box-shadow:none !important;
  max-width:100%;
  min-width:0;
}

body.ws3-admin-devices-page .content .card {
  padding:20px;
}

/* Overview cards */
body.ws3-admin-devices-page .stats,
body.ws3-admin-devices-page .ws-stats {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:13px;
  margin:19px 0 25px;
}

body.ws3-admin-devices-page .stat,
body.ws3-admin-devices-page .ws-stat {
  min-width:0;
  min-height:108px;
  padding:20px;
  background:#182e2d !important;
  border:1px solid #38574c !important;
  border-radius:14px !important;
}

body.ws3-admin-devices-page .stat strong,
body.ws3-admin-devices-page .ws-stat strong {
  display:block;
  color:#e7f9ee;
  font-size:clamp(24px,2.5vw,34px);
  font-weight:750;
  font-variant-numeric:tabular-nums;
}

body.ws3-admin-devices-page .stat span,
body.ws3-admin-devices-page .ws-stat span {
  color:#b0cbbd;
  font-size:12px;
}

/* Filters */
body.ws3-admin-devices-page form[method="get"] {
  display:flex;
  align-items:flex-end;
  flex-wrap:wrap;
  gap:12px;
  max-width:100%;
}

body.ws3-admin-devices-page form[method="get"] label {
  color:#bcd4c7;
  font-size:12px;
  font-weight:650;
}

body.ws3-admin-devices-page form[method="get"] select,
body.ws3-admin-devices-page form[method="get"] input {
  min-height:40px;
  max-width:100%;
  padding:9px 11px;
  background:#102326 !important;
  border:1px solid #45695c !important;
  border-radius:9px;
  color:#eff9f2 !important;
}

body.ws3-admin-devices-page form[method="get"] button {
  min-height:40px;
  padding:9px 17px;
}

/* Device tables */
body.ws3-admin-devices-page .content table {
  width:100%;
  border-collapse:collapse;
  margin:0;
  font-size:12px;
  color:#e6f4eb;
}

body.ws3-admin-devices-page .content th {
  background:#1c3632 !important;
  padding:13px 12px !important;
  color:#acc8ba !important;
  font-size:10px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.6px;
  white-space:nowrap;
}

body.ws3-admin-devices-page .content td {
  padding:13px 12px !important;
  line-height:1.5;
  vertical-align:middle;
  border-bottom:1px solid #304d44 !important;
}

body.ws3-admin-devices-page .content tbody tr:hover td {
  background:#1b3431 !important;
}

body.ws3-admin-devices-page .content
:is(.table-wrap,.table-responsive,.ws-table-wrap,.table-container) {
  width:100%;
  max-width:100%;
  overflow-x:auto;
  scrollbar-width:thin;
  scrollbar-color:#517a69 transparent;
}

/* Actions */
body.ws3-admin-devices-page .content
:is(button,.button,.link-button) {
  border-radius:9px;
  font-weight:650;
}

body.ws3-admin-devices-page .content td form {
  display:inline-flex;
  align-items:center;
  margin:2px;
}

body.ws3-admin-devices-page .content td button {
  min-height:33px;
  padding:7px 11px;
  font-size:11px;
  white-space:nowrap;
}

body.ws3-admin-devices-page .content
:is(a,button,input,select):focus-visible {
  outline:2px solid #a6e8cd;
  outline-offset:2px;
}

/* Status badges, preserving semantic state colours */
body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge) {
  display:inline-flex;
  align-items:center;
  border-radius:30px;
  padding:5px 10px;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}

body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge)
:is(.active,.online,.enabled) {
  color:#b9f5d6;
}

body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge).active,
body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge).online,
body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge).enabled {
  color:#b9f5d6 !important;
  background:#22503c !important;
}

body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge).offline,
body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge).stale,
body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge).disabled {
  color:#f1d392 !important;
  background:#46391f !important;
}

body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge).revoked,
body.ws3-admin-devices-page
:is(.badge,.status,.ws-pill,.status-badge).disconnected {
  color:#f6b8bb !important;
  background:#492c32 !important;
}

/* Pagination */
body.ws3-admin-devices-page
:is(.pagination,.pager,.ws-pager) {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  margin-top:18px;
  max-width:100%;
}

/* Tablets */
@media(max-width:1050px) {
  body.ws3-admin-devices-page
  :is(.stats,.ws-stats) {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* Phones */
@media(max-width:760px) {
  body.ws3-admin-devices-page .content {
    padding:19px 12px 50px !important;
  }

  body.ws3-admin-devices-page
  :is(.stats,.ws-stats) {
    gap:9px;
  }

  body.ws3-admin-devices-page
  :is(.stat,.ws-stat) {
    padding:14px;
    min-height:88px;
  }

  body.ws3-admin-devices-page .content .card {
    padding:13px !important;
  }

  body.ws3-admin-devices-page form[method="get"] {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:11px;
  }

  body.ws3-admin-devices-page
  form[method="get"] :is(input,select,button) {
    width:100%;
    min-width:0;
  }

  body.ws3-admin-devices-page
  .content table {
    font-size:11px;
  }

  body.ws3-admin-devices-page
  .content th,
  body.ws3-admin-devices-page
  .content td {
    padding:10px !important;
  }
}

@media(max-width:390px) {
  body.ws3-admin-devices-page
  :is(.stats,.ws-stats) {
    grid-template-columns:minmax(0,1fr);
  }
}
