:root {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #1b2631;
  background: #f4f7f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #192630;
  --muted: #74828d;
  --line: #e4e9eb;
  --teal: #247f79;
  --teal-dark: #14635d;
  --teal-light: #e5f3f1;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 70% 3%, #edf5f3 0, transparent 33rem), #f6f8f9; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.ambient { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(90px); opacity: .18; pointer-events: none; z-index: -1; }
.ambient-one { background: #8ecbc2; top: -240px; right: 10%; }
.ambient-two { background: #e3c7a2; bottom: -300px; left: -180px; opacity: .12; }
.page-shell { width: min(1160px, calc(100% - 64px)); margin: 0 auto; padding: 30px 0 28px; }
.topbar { height: 54px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 64px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; color: #354550; font-weight: 700; font-size: 14px; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px 9px 9px 4px; color: white; font-family: Manrope, sans-serif; font-size: 16px; font-weight: 800; background: linear-gradient(145deg, #329a91, #176861); box-shadow: 0 5px 12px #17686125; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.secure-label, .page-footer span:first-child { display: inline-flex; align-items: center; gap: 8px; color: #64737d; font-size: 12px; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #37a88b; box-shadow: 0 0 0 3px #37a88b1b; }
.icon-button { border: 0; background: transparent; color: #51616d; font-size: 12px; font-weight: 600; cursor: pointer; }
.icon-button span { margin-left: 6px; color: #8b999f; }
.intro-row { display: flex; justify-content: space-between; align-items: end; margin-bottom: 35px; }
.eyebrow { color: #7e8b91; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 13px; }
h1 { font-family: 'Segoe UI', Arial, sans-serif; color: var(--ink); font-size: clamp(34px, 4vw, 46px); line-height: 1.08; letter-spacing: -.055em; margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.intro-copy { margin: 13px 0 0; font-size: 14px; }
.summary-card { min-width: 170px; padding: 17px 20px 14px; border: 1px solid #e5eceb; border-radius: 14px; background: #fbfdfd; box-shadow: 0 9px 26px #283f3c05; }
.summary-label, .summary-foot { display: block; color: #7b898f; font-size: 11px; }
.summary-card strong { display: block; margin: 5px 0 1px; color: #206e68; font-family: 'Segoe UI', Arial, sans-serif; font-size: 26px; letter-spacing: -.04em; }
.workbench { overflow: hidden; border: 1px solid #e4e9ea; border-radius: 17px; background: #fff; box-shadow: 0 18px 55px #2137400a; }
.workbench-head { min-height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px; border-bottom: 1px solid var(--line); gap: 18px; }
.tabs { display: flex; align-items: center; gap: 27px; height: 82px; }
.tab { position: relative; align-self: stretch; border: 0; padding: 0; background: transparent; color: #88949b; font-size: 12px; font-weight: 600; cursor: pointer; }
.tab span { margin-left: 5px; color: #a4afb4; font-family: 'DM Mono', monospace; font-size: 10px; }
.tab.active { color: #226e68; }
.tab.active::after { content: ''; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #27857e; border-radius: 2px 2px 0 0; }
.tab.active span { color: #318c85; }
.searchbox { width: 284px; height: 37px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid #e5eaeb; border-radius: 8px; background: #fafcfc; }
.search-icon { color: #819098; font-size: 21px; line-height: 1; transform: rotate(-20deg); }
.searchbox input { min-width: 0; flex: 1; outline: 0; border: 0; background: transparent; color: #43515a; font-size: 11px; }
.searchbox input::placeholder { color: #a0abb0; }
kbd { padding: 2px 5px; border: 1px solid #e8edef; border-radius: 4px; color: #9aa5a9; font-family: 'DM Mono', monospace; font-size: 9px; white-space: nowrap; }
.table-head, .device-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(130px, .8fr) minmax(115px, .7fr) minmax(105px, .6fr) 145px; align-items: center; column-gap: 16px; padding: 0 25px; }
.table-head { height: 43px; color: #9aa5aa; background: #fbfcfc; font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.device-row { min-height: 76px; border-top: 1px solid #eef1f2; color: #53616b; font-size: 12px; transition: background .16s ease; }
.device-row:hover { background: #fcfdfd; }
.person-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; color: #41736e; background: #eaf4f2; font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; font-weight: 800; }
.person-cell strong { display: block; color: #35444e; font-size: 12px; font-weight: 700; }
.person-cell small { display: block; margin-top: 4px; color: #9aa5aa; font-size: 10px; }
.id-cell { color: #52626a; font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .01em; }
.date-cell { color: #839098; font-size: 11px; }
.status-pill { width: fit-content; border-radius: 20px; padding: 6px 9px; font-size: 10px; font-weight: 600; }
.status-active { color: #2c8074; background: #eaf6f1; }
.status-pending { color: #98753a; background: #fbf4e4; }
.status-disabled { color: #838d93; background: #f0f2f3; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 7px; padding: 0 12px; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .16s, border .16s, transform .16s; }
.button:active { transform: translateY(1px); }
.button-connect { color: white; background: #277d76; box-shadow: 0 4px 10px #277d7620; }
.button-connect:hover { background: #176a64; }
.button-approve { color: #206e68; border-color: #cfe4df; background: #f3faf8; }
.button-approve:hover { border-color: #9ecbc2; background: #e9f5f2; }
.more-button { width: 28px; height: 32px; border: 0; color: #9aa6aa; background: transparent; font-size: 20px; cursor: pointer; letter-spacing: 1px; }
.empty-state { padding: 58px 22px 65px; text-align: center; }
.empty-icon { width: 43px; height: 43px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid #e2eeec; border-radius: 15px; color: #3b8a82; background: #f4faf8; font-size: 22px; }
.empty-state h2 { margin: 0; color: #41505a; font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px; }
.empty-state p { max-width: 380px; margin: 9px auto 0; color: #8c989e; font-size: 12px; line-height: 1.6; }
.loading-state { padding: 35px; color: #8d999f; text-align: center; font-size: 12px; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 3px 0; color: #98a2a7; font-size: 10px; }
.page-footer span:last-child { text-align: right; }
.toast { position: fixed; right: 24px; bottom: 22px; z-index: 2; max-width: calc(100% - 48px); padding: 12px 16px; transform: translateY(10px); border: 1px solid #d5e8e3; border-radius: 9px; color: #256a62; background: #f7fcfa; box-shadow: 0 12px 34px #1b3e3715; opacity: 0; pointer-events: none; font-size: 12px; transition: .2s ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast-error { border-color: #f0d7d1; color: #a5483a; background: #fff9f7; }
.auth-view { min-height: calc(100vh - 58px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.auth-view > .brand-lockup { margin-bottom: 26px; }
.auth-card { width: min(420px, 100%); padding: 32px; border: 1px solid #e3eaea; border-radius: 17px; background: #fff; box-shadow: 0 20px 55px #2137400b; }
.auth-card h1 { font-size: 29px; }
.auth-card > .muted { margin: 11px 0 24px; font-size: 13px; line-height: 1.5; }
.stack { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; color: #586871; font-size: 11px; font-weight: 600; }
.field input { width: 100%; height: 42px; outline: none; border: 1px solid #e0e8e8; border-radius: 8px; padding: 0 11px; color: #2b3a43; background: #fbfdfd; font-size: 13px; }
.field input:focus { border-color: #78b6ad; box-shadow: 0 0 0 3px #4e9d9218; }
.button-primary { width: 100%; height: 43px; margin-top: 3px; color: white; background: #277d76; font-size: 12px; }
.button-primary:hover { background: #176a64; }
.button-primary span { font-size: 15px; }
.error-text { min-height: 17px; margin: -3px 0 0; color: #b34d40; font-size: 11px; }
.auth-footnote { margin: 18px 0 0; padding-top: 15px; border-top: 1px solid #edf0f0; color: #98a3a7; font-size: 10px; line-height: 1.5; }

@media (max-width: 800px) {
  .page-shell { width: min(100% - 36px, 650px); padding-top: 18px; }
  .topbar { margin-bottom: 45px; }
  .intro-row { align-items: start; gap: 20px; }
  .summary-card { min-width: 135px; padding: 13px; }
  .workbench-head { padding: 0 17px; flex-direction: column-reverse; align-items: stretch; gap: 0; }
  .searchbox { width: 100%; margin-top: 16px; }
  .tabs { height: 57px; gap: 20px; }
  .table-head { display: none; }
  .device-row { grid-template-columns: minmax(120px, 1fr) 1fr; row-gap: 10px; padding: 15px 17px; }
  .person-cell { grid-column: 1; grid-row: 1; }
  .id-cell { grid-column: 2; grid-row: 1; justify-self: end; }
  .date-cell { grid-column: 1; grid-row: 2; padding-left: 45px; }
  .status-pill { grid-column: 2; grid-row: 2; justify-self: end; }
  .row-actions { grid-column: 1 / -1; grid-row: 3; justify-content: stretch; }
  .row-actions .button { flex: 1; }
  .more-button { margin-left: auto; }
  .page-footer { flex-direction: column; gap: 8px; }
  .page-footer span:last-child { text-align: left; }
}

@media (max-width: 460px) {
  .page-shell { width: calc(100% - 28px); }
  .intro-row { display: block; }
  .summary-card { display: inline-block; margin-top: 18px; }
  .tabs { gap: 14px; }
  .tab { font-size: 11px; }
  .tab span { margin-left: 2px; }
  .secure-label { font-size: 0; }
  .secure-label .secure-dot { margin-right: 0; }
  .topbar-right { gap: 13px; }
  .auth-card { padding: 25px 21px; }
}
