/* MetaVPN Dashboard — Apple-style light premium UI */

.dash-shell {
  --dash-accent: #007aff;
  --dash-accent-hover: #0066d6;
  --dash-accent-soft: rgba(0, 122, 255, 0.08);
  --dash-surface: #ffffff;
  --dash-bg: #f5f5f7;
  --dash-text: #1d1d1f;
  --dash-muted: #6e6e73;
  --dash-border: rgba(0, 0, 0, 0.06);
  --dash-radius: 16px;
  --dash-radius-lg: 20px;
  --dash-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  --dash-content-width: 52rem;
  --dash-gap: 1rem;
  --dash-btn-h: 2.75rem;
}

/* Layout */
#sidebar {
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.open { transform: translateX(0); }
@media (min-width: 1024px) {
  #sidebar { transform: translateX(0); }
  #main-content { margin-left: 16rem; }
}

@media (max-width: 1023px) {
  #sidebar,
  #sidebar-overlay { display: none !important; }
  #main-content {
    margin-left: 0 !important;
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }
  .dash-shell #menu-toggle,
  .dash-shell .mv-navbar__hamburger { display: none !important; }
  .dash-footer { padding-bottom: 0.5rem; }
}

/* Bottom tab bar (mobile) */
.dash-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--dash-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 1023px) {
  .dash-bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    min-height: 3.625rem;
  }
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.375rem 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--dash-muted);
  border: none;
  background: transparent;
  min-width: 0;
  transition: color 0.2s ease;
}
.bottom-nav-item i {
  font-size: 1.125rem;
  line-height: 1;
}
.bottom-nav-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bottom-nav-item.active {
  color: var(--dash-accent);
  font-weight: 600;
}
.bottom-nav-item:active { opacity: 0.7; }

.dash-main {
  width: 100%;
  max-width: var(--dash-content-width);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
  overflow-x: hidden;
}

.dash-card { max-width: 100%; }

@media (max-width: 639px) {
  .dash-payment-row {
    grid-template-columns: 1fr !important;
    gap: 0.375rem;
  }
  .dash-table-head { display: none !important; }
  .dash-plan-card { padding: 1.25rem 1rem; }
  .dash-stat { min-height: 5.5rem; }
}

.dash-page {
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap);
}
.dash-page.hidden { display: none !important; }

.dash-stack {
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap);
}

.dash-page-head { margin-bottom: 0.25rem; }
.dash-page-head h1 {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.dash-page-head p {
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  color: var(--dash-muted);
}

/* Sidebar */
#sidebar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  font-size: 0.875rem;
  color: var(--dash-muted);
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-align: left;
}
.nav-item i { width: 1.25rem; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--dash-bg); color: var(--dash-text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.12) 0%, rgba(0, 122, 255, 0.06) 100%);
  color: var(--dash-accent);
  font-weight: 600;
  border-color: rgba(0, 122, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.08);
}
.nav-item.active i { color: var(--dash-accent); }

/* Buttons */
.btn-accent,
.btn-accent-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--dash-btn-h);
  padding: 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}
.btn-accent { background: var(--dash-accent); color: #fff; }
.btn-accent:hover { background: var(--dash-accent-hover); }
.btn-accent:active { transform: scale(0.98); }
.btn-accent:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-accent-light { background: var(--dash-accent-soft); color: var(--dash-accent); }
.btn-accent-light:hover { background: rgba(0, 122, 255, 0.14); }

.dash-shell .hidden { display: none !important; }

.dash-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  align-items: stretch;
  width: 100%;
}
.dash-btn-row .btn-accent,
.dash-btn-row .btn-accent-light {
  flex: 1 1 auto;
  min-width: min(100%, 9.5rem);
  max-width: 100%;
}

/* Cards */
.dash-card {
  background: var(--dash-surface);
  border-radius: var(--dash-radius-lg);
  border: 1px solid var(--dash-border);
  box-shadow: var(--dash-shadow);
}
.dash-card--flat { box-shadow: var(--dash-shadow); }

.dash-stat {
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 6.75rem;
}
.dash-stat__icon {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.dash-stat__icon--blue { background: rgba(0, 122, 255, 0.12); color: #007aff; }
.dash-stat__icon--green { background: rgba(52, 199, 89, 0.12); color: #248a3d; }
.dash-stat__icon--purple { background: rgba(175, 82, 222, 0.12); color: #8944ab; }
.dash-stat__icon--orange { background: rgba(255, 149, 0, 0.12); color: #c93400; }
.dash-stat__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dash-muted);
}
.dash-stat__value {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.dash-stat__hint { font-size: 0.75rem; color: var(--dash-muted); margin-top: auto; }

.dash-hero {
  padding: 1.25rem 1.375rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 55%, #f5f5f7 100%);
  position: relative;
  overflow: hidden;
}
.dash-hero__avatar {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  background: #eef0f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dash-muted);
  flex-shrink: 0;
}
.dash-hero__avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dash-hero__avatar i { font-size: 1.25rem; line-height: 1; }

.dash-plan-card {
  padding: 1.5rem 1.375rem;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}
.dash-plan-card__name {
  font-size: clamp(1.625rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dash-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}
@media (min-width: 640px) { .dash-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dash-metric {
  padding: 0.75rem 0.875rem;
  border-radius: 12px;
  background: var(--dash-bg);
  border: 1px solid var(--dash-border);
  text-align: left;
}
.dash-metric__label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dash-muted);
  margin-bottom: 0.2rem;
}
.dash-metric__value { font-size: 0.875rem; font-weight: 600; }

/* Actions */
.dash-action {
  padding: 0.875rem 1rem;
  min-height: 4.25rem;
  border-radius: 14px;
  border: 1px solid var(--dash-border);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dash-action:hover { border-color: rgba(0, 122, 255, 0.35); background: #fafcff; }
.dash-action:disabled { opacity: 0.5; cursor: not-allowed; }
.dash-action__icon {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 11px;
  background: var(--dash-accent-soft);
  color: var(--dash-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-action__title { font-size: 0.875rem; font-weight: 600; display: block; }
.dash-action__desc { font-size: 0.75rem; color: var(--dash-muted); margin-top: 0.1rem; display: block; }

.dash-key-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
}
@media (min-width: 480px) { .dash-key-actions { grid-template-columns: 1fr 1fr; } }

.dash-key-btn {
  min-height: var(--dash-btn-h);
  height: var(--dash-btn-h);
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid var(--dash-border);
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dash-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dash-key-btn:hover { border-color: rgba(0, 122, 255, 0.35); background: #fafcff; }
.dash-key-btn--primary { background: var(--dash-accent); border-color: var(--dash-accent); color: #fff; }
.dash-key-btn--primary:hover { background: var(--dash-accent-hover); }
.dash-key-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* URL + QR */
.dash-key-card { padding: 1rem 1.125rem; border-radius: 14px; border: 1px solid var(--dash-border); background: var(--dash-bg); }
.dash-url-box {
  padding: 0.75rem 0.875rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--dash-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  line-height: 1.55;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-height: 5.5rem;
  overflow-y: auto;
  color: #333;
}

.dash-qr-card {
  padding: 1.25rem;
  border-radius: var(--dash-radius-lg);
  border: 1px solid var(--dash-border);
  background: #fff;
  text-align: center;
}
.dash-qr-card__frame {
  display: inline-flex;
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid var(--dash-border);
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.dash-qr-card__error {
  padding: 1.5rem;
  border-radius: 12px;
  background: #fff5f5;
  border: 1px dashed rgba(255, 59, 48, 0.25);
  color: #c41e14;
  font-size: 0.8125rem;
}

/* Timeline / table */
.dash-timeline-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--dash-border);
}
.dash-timeline-item:last-child { border-bottom: none; }
.dash-timeline-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--dash-accent);
  margin-top: 0.45rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.dash-table-head {
  display: none;
  grid-template-columns: 7.5rem 1fr 5.5rem 5.5rem;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dash-muted);
  border-bottom: 1px solid var(--dash-border);
  background: var(--dash-bg);
}
@media (min-width: 640px) { .dash-table-head { display: grid; } }

.dash-payment-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.375rem 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--dash-border);
  align-items: center;
}
@media (min-width: 640px) {
  .dash-payment-row { grid-template-columns: 7.5rem 1fr 5.5rem 5.5rem; }
}

/* Settings */
.dash-settings-section { padding: 1.375rem 1.5rem; }
.dash-settings-section + .dash-settings-section { border-top: 1px solid var(--dash-border); }
.dash-settings-section__title {
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dash-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dash-form-grid { display: flex; flex-direction: column; gap: 1rem; max-width: 28rem; }
.dash-form-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--dash-border);
  background: var(--dash-bg);
  max-width: 100%;
}
.field-input {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  border-radius: 12px;
  border: 1px solid #d2d2d7;
  font-size: 0.9375rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input:focus { outline: none; border-color: #007AFF; box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15); }
.field-input:disabled { background: #f5f5f7; color: #6e6e73; }
.avatar-lg {
  position: relative;
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  overflow: hidden;
  border: 3px solid #f5f5f7;
  background: #f5f5f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6e6e73;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.avatar-lg:hover { border-color: #007AFF; box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12); }
.avatar-lg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-lg i { font-size: 1.5rem; line-height: 1; }

.dash-alert { padding: 0.75rem 1rem; border-radius: 12px; font-size: 0.875rem; }
.dash-alert--error { background: #fff5f5; color: #c41e14; border: 1px solid rgba(255, 59, 48, 0.15); }
.dash-alert--success { background: #f0fdf4; color: #248a3d; border: 1px solid rgba(52, 199, 89, 0.2); }

/* Empty states */
.dash-empty { padding: 2rem 1.25rem; text-align: center; }
.dash-empty__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.875rem;
  border-radius: 16px;
  background: var(--dash-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--dash-muted);
}
.dash-empty__title { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.dash-empty__text { font-size: 0.8125rem; color: var(--dash-muted); max-width: 18rem; margin: 0 auto; line-height: 1.5; }

/* Pagination */
.dash-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--dash-border);
  flex-wrap: wrap;
}
.dash-pagination.hidden { display: none; }
.dash-pagination__info { font-size: 0.75rem; color: var(--dash-muted); }
.dash-pagination__controls { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.dash-page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--dash-border);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}
.dash-page-btn:hover:not(:disabled) { border-color: rgba(0, 122, 255, 0.4); color: var(--dash-accent); }
.dash-page-btn.active { background: var(--dash-accent); border-color: var(--dash-accent); color: #fff; }
.dash-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Status badges */
.status-active { background: rgba(52, 199, 89, 0.12); color: #248a3d; }
.status-expired { background: rgba(255, 59, 48, 0.12); color: #c41e14; }
.status-trial { background: rgba(0, 122, 255, 0.12); color: #007AFF; }

.dash-traffic-bar { height: 5px; border-radius: 9999px; background: #e8e8ed; overflow: hidden; margin-top: 0.375rem; }
.dash-traffic-bar__fill { height: 100%; border-radius: 9999px; background: linear-gradient(90deg, #007aff, #5ac8fa); transition: width 0.4s ease; }

/* Instructions */
.dash-platform-tabs { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.875rem; }
.dash-platform-tab {
  padding: 0.4375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--dash-border);
  background: #fff;
  color: var(--dash-muted);
  cursor: pointer;
}
.dash-platform-tab.active { background: var(--dash-accent); border-color: var(--dash-accent); color: #fff; }
.dash-instruction-step { display: flex; gap: 0.625rem; padding: 0.5rem 0; }
.dash-instruction-step__num {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: var(--dash-accent-soft);
  color: var(--dash-accent);
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Modal */
.modal-overlay {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.modal-overlay:not(.hidden) { pointer-events: auto; }
.modal-overlay.modal-open { opacity: 1; }
.modal-panel {
  opacity: 0;
  transform: scale(0.97) translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.modal-overlay.modal-open .modal-panel { opacity: 1; transform: scale(1) translateY(0); }
.plan-option {
  width: 100%;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 1.125rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.plan-option:hover { border-color: rgba(0, 122, 255, 0.35); }
.plan-option--selected { border: 2px solid var(--dash-accent); background: rgba(0, 122, 255, 0.04); }

/* Toast */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--dash-border);
}
.toast-item.show { opacity: 1; transform: translateY(0); }

.card-section-head {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--dash-border);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Devices page */
#page-devices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-device-banner {
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.18);
  color: #9a6700;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.dash-device-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.dash-device-stat {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 1rem 1.125rem;
  box-shadow: var(--dash-shadow);
}

.dash-device-stat--muted {
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.dash-device-stat__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--dash-muted);
  margin: 0 0 0.375rem;
}

.dash-device-stat__value {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--dash-text);
  margin: 0;
}

.dash-devices-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .dash-devices-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-device-card {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 1rem 1.125rem;
  box-shadow: var(--dash-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.dash-device-card--inactive {
  opacity: 0.88;
  background: #fafafa;
}

.dash-device-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.dash-device-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: var(--dash-accent-soft);
  color: var(--dash-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.dash-device-card__title {
  flex: 1;
  min-width: 0;
}

.dash-device-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: var(--dash-text);
}

.dash-device-card__platform {
  font-size: 0.75rem;
  color: var(--dash-muted);
  margin: 0.125rem 0 0;
}

.dash-device-status {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.dash-device-status--online {
  background: rgba(52, 199, 89, 0.12);
  color: #248a3d;
}

.dash-device-status--offline {
  background: rgba(142, 142, 147, 0.12);
  color: #636366;
}

.dash-device-status--blocked {
  background: rgba(255, 59, 48, 0.1);
  color: #d70015;
}

.dash-device-status--removed {
  background: rgba(255, 149, 0, 0.12);
  color: #c93400;
}

.dash-device-meta {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.dash-device-meta__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.dash-device-meta__row dt {
  color: var(--dash-muted);
  font-weight: 500;
  margin: 0;
}

.dash-device-meta__row dd {
  margin: 0;
  text-align: right;
  color: var(--dash-text);
  word-break: break-word;
}

.dash-device-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.125rem;
}

.dash-device-action {
  appearance: none;
  border: 1px solid var(--dash-border);
  background: #fff;
  color: var(--dash-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4375rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dash-device-action:hover {
  background: #f5f5f7;
}

.dash-device-action--primary {
  background: var(--dash-accent-soft);
  border-color: rgba(0, 122, 255, 0.15);
  color: var(--dash-accent);
}

.dash-device-action--primary:hover {
  background: rgba(0, 122, 255, 0.12);
}

.dash-device-action--danger {
  color: #d70015;
  border-color: rgba(255, 59, 48, 0.18);
}

.dash-device-action--danger:hover {
  background: rgba(255, 59, 48, 0.06);
}

.dash-device-empty {
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: var(--dash-surface);
  border: 1px dashed var(--dash-border);
  border-radius: var(--dash-radius);
}

.dash-device-empty__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.875rem;
  border-radius: 14px;
  background: var(--dash-accent-soft);
  color: var(--dash-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.dash-device-empty__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
}

.dash-device-empty__text {
  font-size: 0.8125rem;
  color: var(--dash-muted);
  margin: 0 auto;
  max-width: 20rem;
  line-height: 1.5;
}

@media (max-width: 639px) {
  .dash-device-stats {
    gap: 0.625rem;
  }

  .dash-device-stat {
    padding: 0.875rem 1rem;
  }

  .dash-device-stat__value {
    font-size: 1.25rem;
  }

  .dash-device-card {
    border-radius: 18px;
    padding: 0.9375rem 1rem;
  }

  .dash-device-card__actions {
    flex-direction: column;
  }

  .dash-device-action {
    width: 100%;
    text-align: center;
    padding: 0.625rem 0.875rem;
  }
}
