:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #60707f;
  --line: #d9e0e7;
  --surface: #ffffff;
  --background: #f5f7f9;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: #0d1b2a;
  color: white;
}

.sidebar .panel,
.login {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.login {
  display: grid;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #9fb6c5;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 17px;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 12px 0 0;
  color: #d6f5f1;
}

.download-link {
  display: inline-block;
  margin-top: 12px;
  color: #d6f5f1;
  font-weight: 700;
}

.secondary-link {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

.workspace {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.device,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.device {
  padding: 16px;
}

.device-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.device-head p,
dd {
  color: var(--muted);
}

.device-head p {
  margin: 4px 0 0;
}

.device-head span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #d9f99d;
  color: #365314;
  font-size: 12px;
  font-weight: 700;
}

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin: 16px 0;
}

dt,
dd {
  margin: 0;
}

dt {
  font-weight: 700;
}

.inventory-details,
.job-result {
  border-top: 1px solid var(--line);
  margin: 14px 0;
  padding-top: 12px;
}

.inventory-details summary,
.job-result summary {
  cursor: pointer;
  font-weight: 700;
}

.inventory-table,
.job-inventory {
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  margin: 12px 0 0;
}

.inventory-table dd,
.job-inventory dd {
  overflow-wrap: anywhere;
}

.inventory-subsection {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
}

.inventory-subsection summary {
  cursor: pointer;
  font-weight: 700;
}

.table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #eef3f7;
  color: var(--ink);
  font-weight: 700;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.compact {
  padding: 8px 0 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions + .actions {
  margin-top: 8px;
}

.actions-secondary button {
  background: #475569;
}

.actions-secondary button:hover {
  background: #334155;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.panel {
  padding: 16px;
  min-width: 0;
}

.device-list-panel {
  margin-bottom: 18px;
}

.panel-head,
.remote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.device-table-wrap {
  max-height: 260px;
}

.device-row {
  cursor: pointer;
}

.device-row:hover td,
.device-row:focus td {
  background: #f0fdfa;
}

.device-row.active td {
  background: #ccfbf1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pill.online {
  background: #d9f99d;
  color: #365314;
}

.status-pill.offline {
  background: #fee2e2;
  color: #991b1b;
}

.selected-device-panel {
  margin-top: 0;
}

.selected-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.selected-header h2 {
  margin-bottom: 4px;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 16px -16px 0;
  padding: 0 16px;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 38px;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: 0;
  font-weight: 700;
}

.tab-button:hover,
.tab-button.active {
  background: #eef3f7;
  color: var(--ink);
}

.tab-button.active {
  border-color: var(--line);
}

.tab-content {
  padding-top: 16px;
}

.tab-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.tab-section {
  margin-top: 16px;
}

.tab-section:first-child {
  margin-top: 0;
}

.tab-section h3,
.action-group h3 {
  margin-bottom: 8px;
}

.action-group {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.action-group:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.secondary-button {
  background: #475569;
}

.secondary-button:hover {
  background: #334155;
}

.remote-panel {
  margin-top: 18px;
}

.remote-session {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.remote-session:first-child {
  border-top: 0;
}

.remote-screen-wrap {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: auto;
}

.remote-screen {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

.remote-wait {
  color: #d7e1ea;
  padding: 24px;
  text-align: center;
}

.remote-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.remote-tools input {
  flex: 1 1 260px;
}

.list-item {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  overflow-wrap: anywhere;
}

.list-item:first-child {
  border-top: 0;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
  padding: 14px 0;
}

@media (max-width: 820px) {
  .app,
  .split {
    grid-template-columns: 1fr;
  }
}
