:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8f9fc;
  --line: #e7ebf2;
  --text: #202b3d;
  --muted: #8290a3;
  --brand: #4b68e8;
  --brand-deep: #3c55c8;
  --brand-soft: #eef2ff;
  --success: #1f9b75;
  --danger: #e25a6a;
  --sidebar: #19253b;
  --sidebar-active: #4b68e8;
  --shadow: 0 2px 8px rgba(26, 42, 76, 0.035);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

button:focus-visible {
  outline: 3px solid rgba(75, 104, 232, 0.45);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}

.login-shell {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 430px);
  gap: 28px;
  align-items: stretch;
}

.login-hero,
.login-card,
.panel-card,
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-hero {
  border-radius: 20px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-badge {
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
}

.login-hero h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.15;
}

.login-hero p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.login-hero-card {
  margin-top: auto;
  border-radius: 28px;
  padding: 22px;
  background: var(--panel-soft);
  border: 1px solid rgba(79, 124, 255, 0.12);
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: center;
}

.hero-illustration {
  width: 100%;
  max-width: 240px;
  justify-self: center;
}

.hero-tip-list {
  display: grid;
  gap: 14px;
}

.hero-tip {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 10px 24px rgba(79, 124, 255, 0.08);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-card-head h2 {
  margin: 0 0 4px;
  font-size: 28px;
}

.login-card-head p {
  margin: 0;
  color: var(--muted);
}

.login-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.login-form,
.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(79, 124, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.12);
}

.field input[readonly],
.field input:disabled {
  background: #f3f6fb;
  color: #6b7b8f;
  cursor: not-allowed;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.voice-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  border-radius: 9px;
  padding: 0 18px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.ghost-button {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-button {
  background: rgba(226, 90, 106, 0.12);
  color: #c03d4d;
}

.login-submit {
  margin-top: 4px;
}

.login-demo {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 14px;
}

.login-demo strong {
  color: var(--text);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  background: var(--sidebar);
  color: #aab6cb;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 38px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.sidebar-logo svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.sidebar-title {
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.4px;
  font-weight: 700;
}

.sidebar-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}

.sidebar-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: 14px;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-item[data-tab="device-detail"]:not(.active) {
  opacity: 0.86;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  text-align: center;
  opacity: 0.9;
}

.nav-icon svg,
.stat-icon svg,
.icon-button svg,
.search-input-wrap svg,
.device-row-icon svg,
.sidebar-logout svg,
.device-open-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.session-card {
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.session-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}

.session-user {
  margin-top: 6px;
  font-size: 14px;
  color: #eaf0fc;
  font-weight: 700;
}

.session-meta {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.6;
}

.sidebar-logout {
  background: transparent;
  color: #aab6cb;
  border-color: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar-logout svg {
  width: 16px;
  height: 16px;
}

.main-panel {
  min-width: 0;
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 4px 2px;
}

.page-crumb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.page-header h1 {
  margin: 9px 0 6px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.7px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: none;
}

.message-bar {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  background: #fff4d7;
  color: #8b6500;
  border: 1px solid rgba(139, 101, 0, 0.14);
}

.tab-panel {
  display: none;
  gap: 22px;
}

.tab-panel.active {
  display: grid;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 30px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -1px;
}

.stat-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.stat-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  padding: 10px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.stat-online .stat-icon {
  color: var(--success);
  background: #eaf7f2;
}

.stat-offline .stat-icon {
  color: #8795a8;
  background: #f0f3f8;
}

.content-grid {
  display: grid;
  gap: 20px;
}

.workspace-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.workspace-tip {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 10px 24px rgba(15, 31, 66, 0.08);
}

.device-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.device-nav-panel {
  position: sticky;
  top: 28px;
}

.device-detail-stack {
  display: grid;
  gap: 20px;
}

.content-grid.two-column {
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
}

.panel-card {
  border-radius: 16px;
  padding: 22px;
}

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

.panel-tools {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.search-field {
  min-width: min(320px, 100%);
}

.device-status-field {
  display: grid;
  gap: 0;
}

.device-filter-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.device-status-filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f2f4f8;
  border-radius: 9px;
  flex-wrap: wrap;
}

.device-filter-button {
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.device-filter-button:hover,
.device-filter-button.active {
  border-color: #e5e9f2;
  background: #fff;
  color: var(--brand);
}

.device-filter-button:focus-visible,
.list-item.clickable:focus-visible {
  outline: 3px solid rgba(79, 124, 255, 0.55);
  outline-offset: 3px;
}

.device-open-button {
  padding: 8px 12px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 7px;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-size: 12px;
}

.device-open-button svg {
  width: 14px;
  height: 14px;
}

.device-open-button:hover {
  background: var(--brand-deep);
}

.device-overview-panel .panel-tools {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.device-search-field {
  flex: 1;
  max-width: 370px;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap svg {
  position: absolute;
  top: 12px;
  left: 13px;
  width: 18px;
  height: 18px;
  color: #9aa6b7;
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 40px;
  font-size: 12px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  padding-inline: 12px;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.device-result-count {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #f1f4f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
}

.device-list-head,
.list-item.device-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.7fr) 80px minmax(100px, 0.8fr) minmax(130px, 1fr) 112px;
  gap: 16px;
  align-items: center;
}

.device-list-head {
  margin-bottom: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #f7f9fc;
  color: #8d99ab;
  font-size: 11px;
}

.device-list-head span:last-child {
  text-align: right;
}

.device-overview-panel .device-scroll-area {
  max-height: 530px;
  padding-right: 0;
}

.device-overview-panel .list-stack {
  gap: 8px;
}

.list-item.device-row {
  padding: 15px 16px;
  border: 1px solid #edf0f5;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.device-overview-panel .list-item.device-row:hover {
  background: #fafbff;
  border-color: #dce3f6;
}

.device-overview-panel .list-item.device-row.active {
  border-color: #cdd8fb;
  background: #fcfdff;
  box-shadow: inset 3px 0 var(--brand);
}

.device-row-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.device-row-icon {
  width: 36px;
  height: 40px;
  padding: 9px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #f0f3fb;
  color: #7c8ba8;
}

.device-row.active .device-row-icon {
  background: #eaf0ff;
  color: var(--brand);
}

.device-row-identity > div:last-child {
  min-width: 0;
}

.device-row .item-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.device-row-id,
.device-binding-code {
  margin-top: 5px;
  color: #8d99ab;
  font: 11px Consolas, "SFMono-Regular", monospace;
  overflow-wrap: anywhere;
}

.device-last-seen {
  display: grid;
  gap: 5px;
  color: #65738b;
  font-size: 12px;
}

.device-last-seen span {
  font-size: 11px;
  color: #98a3b4;
}

.device-binding {
  min-width: 0;
  font-size: 12px;
  color: #758297;
}

.device-binding.is-bound {
  color: #536b8a;
}

.device-row-actions {
  display: flex;
  justify-content: flex-end;
}

.device-row .status-chip {
  min-width: 0;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.device-row .status-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.device-row .status-chip.online {
  background: #eaf7f1;
  color: #229574;
}

.device-row .status-chip.offline {
  background: #f0f2f6;
  color: #97a1b1;
}

.device-provision-panel {
  border-top: 4px solid var(--brand);
}

.provision-form {
  grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 0.8fr) auto;
  align-items: end;
}

.provision-submit {
  display: flex;
  align-items: end;
}

.provision-submit .primary-button {
  min-width: 132px;
}

.provision-result {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

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

.provision-result-head h3 {
  margin: 0;
  font-size: 18px;
}

.provision-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
}

.provision-result-grid div {
  min-width: 0;
}

.provision-result-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.provision-result-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.device-scroll-area {
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.device-scroll-area::-webkit-scrollbar {
  width: 8px;
}

.device-scroll-area::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(47, 67, 95, 0.18);
}

.inline-field {
  min-width: 210px;
}

.inline-field span {
  margin-bottom: 2px;
}

.device-filter-field select {
  min-width: 210px;
}

.panel-head h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.list-item.clickable {
  cursor: pointer;
}

.list-item.clickable:hover,
.list-item.clickable.active {
  border-color: rgba(79, 124, 255, 0.32);
  background: var(--brand-soft);
}

.item-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.item-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-title {
  font-size: 16px;
  font-weight: 700;
}

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

.item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.video-item {
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.video-item-body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.video-preview-shell {
  min-width: 0;
}

.video-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 150px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101828;
  display: block;
  object-fit: contain;
}

.video-preview.empty-state {
  min-height: 128px;
  color: #d7e1ef;
  border-style: dashed;
}

.voice-result {
  min-height: 160px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.voice-result audio {
  width: 100%;
}

.vision-camera-shell {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #101828;
  margin-bottom: 16px;
}

.vision-camera-preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.vision-upload-frame-shell {
  position: relative;
  margin-top: 16px;
}

.vision-monitor-shell {
  position: relative;
  margin-top: 14px;
}

.vision-frame-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(215, 225, 239, 0.72);
  font-weight: 800;
}

.vision-camera-preview[src] + .vision-frame-placeholder {
  display: none;
}

.device-camera-field {
  margin-top: 18px;
}

.vision-test-row {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.vision-sample-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.vision-action {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--panel-soft);
}

.vision-action.matched {
  border-color: rgba(39, 177, 125, 0.28);
  background: #eef8f3;
}

.vision-action-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.vision-action-value {
  margin-top: 6px;
  font-size: 32px;
  font-weight: 850;
  color: var(--text);
}

.voice-segments {
  display: grid;
  gap: 12px;
}

.voice-segment {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.scene-highlight {
  width: fit-content;
  margin-bottom: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.14);
  color: #3b63d1;
  font-size: 12px;
  font-weight: 800;
}

.slot-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.slot-video-group {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid rgba(79, 124, 255, 0.28);
  border-radius: 16px;
  background: rgba(79, 124, 255, 0.045);
}

.slot-video-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.slot-video-group-head h3,
.slot-video-group-head p {
  margin: 0;
}

.slot-video-group-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.slot-video-group-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.slot-video-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .slot-video-group-head {
    display: grid;
  }

  .slot-video-group-actions {
    justify-content: flex-start;
  }
}

.slot-video-card {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-soft);
  display: grid;
  align-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: default;
  color: inherit;
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.slot-video-main {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.slot-count-reset {
  min-height: 28px;
  justify-self: end;
  padding: 0 9px;
  border: 1px solid rgba(79, 124, 255, 0.28);
  border-radius: 8px;
  background: #fff;
  color: #3b63d1;
  font-size: 12px;
  font-weight: 750;
}

.slot-count-reset:hover {
  border-color: rgba(79, 124, 255, 0.55);
  background: rgba(79, 124, 255, 0.08);
}

.slot-video-card.filled {
  border-color: rgba(79, 124, 255, 0.35);
  background: rgba(79, 124, 255, 0.07);
}

.slot-video-card:hover,
.slot-video-card.active {
  border-color: #24a7ff;
  box-shadow: 0 0 0 3px rgba(36, 167, 255, 0.13);
  transform: translateY(-1px);
}

.slot-video-name {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
}

.slot-video-heading {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.slot-video-description {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.slot-video-statuses {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

.small-button {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
}

.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.idle,
.status-chip.pending,
.status-chip.ready {
  background: rgba(255, 177, 66, 0.16);
  color: #b86f00;
}

.status-chip.active,
.status-chip.done,
.status-chip.downloaded,
.status-chip.sd-present,
.status-chip.enabled {
  background: rgba(39, 177, 125, 0.14);
  color: #1f8e64;
}

.status-chip.processing,
.status-chip.queued,
.status-chip.basic {
  background: rgba(79, 124, 255, 0.14);
  color: #3b63d1;
}

.status-chip.disabled,
.status-chip.cancelled,
.status-chip.sd-missing {
  background: rgba(226, 90, 106, 0.14);
  color: #bf4453;
}

.status-chip.bound {
  background: rgba(39, 177, 125, 0.14);
  color: #1f8e64;
}

.status-chip.unbound {
  background: rgba(255, 177, 66, 0.16);
  color: #b86f00;
}

.status-chip.online {
  background: rgba(39, 177, 125, 0.16);
  color: #16724f;
}

.status-chip.admin {
  background: rgba(111, 77, 255, 0.14);
  color: #6046d8;
}

.status-chip.current-user {
  background: rgba(79, 124, 255, 0.14);
  color: #3b63d1;
}

.status-chip.offline {
  background: rgba(120, 132, 153, 0.16);
  color: #667085;
}

.status-chip.replaced {
  background: rgba(120, 132, 153, 0.16);
  color: #667085;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.compact-grid {
  margin-top: 16px;
}

.full-span {
  grid-column: 1 / -1;
}

.field-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.audio-trim-panel {
  padding: 14px 16px;
  border: 1px solid rgba(79, 124, 255, 0.2);
  border-radius: 14px;
  background: #f7f9ff;
  display: grid;
  gap: 12px;
}

.audio-trim-heading,
.audio-trim-values {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.audio-trim-heading strong {
  font-size: 13px;
}

.audio-trim-heading span,
.audio-trim-values span {
  color: var(--muted);
  font-size: 12px;
}

.audio-trim-values strong {
  color: var(--text);
}

.dual-range {
  position: relative;
  height: 32px;
}

.dual-range-track {
  position: absolute;
  inset: 13px 0 auto;
  height: 6px;
  border-radius: 999px;
  background: #dce4f3;
  overflow: hidden;
}

.dual-range-selection {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #75a8ff);
}

.dual-range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 3px solid #fff;
  border-radius: 50%;
  appearance: none;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(33, 69, 150, 0.3);
  cursor: grab;
  pointer-events: auto;
}

.dual-range input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent;
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(33, 69, 150, 0.3);
  cursor: grab;
  pointer-events: auto;
}

.audio-trim-preview {
  justify-self: start;
  min-height: 36px;
}

.media-audio-preview {
  width: 100%;
  height: 36px;
}

.media-version-editor {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.media-version-editor summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.media-version-editor-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.user-item {
  gap: 14px;
}

.admin-create-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.admin-user-card {
  background: #fbfcff;
}







.device-summary {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 14px;
}

.upload-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.form-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-status.error {
  color: var(--danger);
}












.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  text-align: center;
  padding: 20px;
}

@media (max-width: 1180px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero-card {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar-title,
  .sidebar-subtitle,
  .nav-item span:last-child,
  .session-card {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .sidebar-brand {
    justify-content: center;
  }
}

@media (max-width: 980px) {
  .main-panel {
    padding: 20px;
  }

  .device-workspace,
  .video-item,
  .content-grid.two-column,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .device-nav-panel {
    position: static;
  }

  .provision-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .device-list-head {
    display: none;
  }

  .list-item.device-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .device-row-status,
  .device-binding {
    text-align: right;
  }

  .device-row-actions {
    grid-column: 1 / -1;
  }

  .sidebar {
    padding-inline: 12px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    padding: 12px 14px;
    gap: 12px;
    height: auto;
    position: static;
    overflow: visible;
    flex-direction: row;
    align-items: center;
  }

  .sidebar-brand {
    padding: 0;
  }

  .sidebar-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .sidebar-nav {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 4px;
    overflow-x: auto;
  }

  .nav-item {
    width: 34px;
    height: 36px;
    min-height: 36px;
    flex-shrink: 0;
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .sidebar-logout {
    width: 32px;
    min-height: 34px;
    padding: 0;
  }

  .sidebar-logout span,
  .page-header .page-actions {
    display: none;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .voice-picker {
    grid-template-columns: 1fr;
  }

  .provision-result-grid {
    grid-template-columns: 1fr;
  }

  .panel-tools,
  .inline-field {
    width: 100%;
  }

  .button-row {
    flex-direction: column;
  }

  .main-panel {
    height: auto;
    overflow: visible;
    padding: 22px 14px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .stat-icon,
  .stat-note {
    display: none;
  }

  .stat-value {
    font-size: 26px;
  }

  .panel-card {
    padding: 18px 14px;
  }

  .device-search-field {
    min-width: 100%;
    max-width: none;
  }

  .device-status-field,
  .device-status-filters {
    width: 100%;
  }

  .device-filter-button {
    flex: 1;
  }
}
