/* MWipe customer app — view styles layered on top of styles.css.
   Owned by AppViews. New overview, configurator build panel, eraser quota
   card, team, billing, agents, audit, account and guides surfaces. */

/* ------------------------------------------------------------------ overview -- */

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  margin-bottom: 24px;
  overflow: hidden;
}

.status-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value"
    "icon note";
  column-gap: 12px;
  align-items: start;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
  min-height: 108px;
}

.status-card:last-child {
  border-right: 0;
}

.status-icon {
  grid-area: icon;
  display: inline-flex;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.status-icon .icon {
  width: 18px;
  height: 18px;
}

.status-label {
  grid-area: label;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.status-value {
  grid-area: value;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.status-note {
  grid-area: note;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.status-card.is-ok .status-value { color: var(--ok); }
.status-card.is-run .status-value { color: var(--electric); }
.status-card.is-bad .status-value { color: var(--danger); }
.status-card.is-warn .status-value { color: var(--warn); }
.status-card.is-idle .status-value { color: var(--muted-foreground); }

.status-value.mono {
  font-family: var(--font-mono);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.overview-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.overview-main > .panel {
  margin-bottom: 0;
}

.overview-grid {
  margin-bottom: 24px;
}

.overview-grid > .panel {
  margin-bottom: 0;
}

/* live wipe panel ------------------------------------------------------- */

.wipe-panel-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.platter-stage {
  flex: 0 0 auto;
}

.wipe-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.wipe-job-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.wipe-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.wipe-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wipe-metric-label {
  font-size: 12px;
  color: var(--muted-foreground);
}

.wipe-metric-value {
  font-size: 14px;
  color: var(--foreground);
}

.wipe-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wipe-progress .bar {
  flex: 1;
}

.wipe-progress-value {
  font-size: 13px;
  color: var(--muted-foreground);
}

.wipe-others {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wipe-others-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.wipe-other {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 1.4fr) 44px;
  gap: 12px;
  align-items: center;
}

.wipe-other:hover .wipe-other-name {
  color: var(--white);
}

.wipe-other-name {
  font-size: 13px;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wipe-other-value {
  font-size: 12px;
  color: var(--muted-foreground);
  text-align: right;
}

/* connected devices ----------------------------------------------------- */

.connected-list {
  display: flex;
  flex-direction: column;
}

.connected-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
}

.connected-row:hover {
  background: var(--muted-half);
}

.connected-row.is-selected {
  background: var(--electric-soft);
}

.connected-row:last-child {
  border-bottom: 0;
}

.connected-ident {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.connected-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.connected-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.connected-erase {
  width: 100%;
}

.connected-hint {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------- configurator -- */

.build-form {
  margin-bottom: 16px;
}

.build-actions {
  margin-bottom: 16px;
}

.build-status-idle {
  font-size: 13px;
  color: var(--muted-foreground);
}

.build-status-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--ink-2);
}

.build-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.build-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.build-status-error {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.build-log {
  margin-top: 10px;
}

.build-log summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted-foreground);
}

.build-log pre {
  margin-top: 8px;
  padding: 12px;
  background: var(--ink-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  overflow: auto;
  max-height: 260px;
  color: var(--text);
  white-space: pre-wrap;
}

.build-download {
  margin-top: 12px;
}

/* ------------------------------------------------------------------- eraser -- */

.entitlements-check {
  margin: 4px 0;
}

.entitlement-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--ink-2);
}

.entitlement-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.entitlement-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.entitlement-value {
  font-size: 16px;
  color: var(--foreground);
}

.entitlement-track {
  height: 8px;
  background: var(--secondary);
  border-radius: 999px;
  overflow: hidden;
}

.entitlement-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.entitlement-fill.is-ok { background: var(--grad-brand); }
.entitlement-fill.is-bad { background: var(--danger); }

.entitlement-foot {
  margin-top: 10px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.entitlement-foot .is-ok { color: var(--ok); }
.entitlement-foot .is-bad { color: var(--danger); }

/* ------------------------------------------------------------------- billing -- */

.subscription-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  margin-bottom: 24px;
}

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

.subscription-plan {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  display: block;
}

.subscription-period {
  font-size: 13px;
  color: var(--muted-foreground);
}

.subscription-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--warn);
}

.subscription-estimate {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: var(--muted-foreground);
}

.subscription-estimate .mono {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

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

.meters {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.meter-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
}

.meter-value {
  font-size: 13px;
  color: var(--muted-foreground);
}

.meter-track {
  height: 8px;
  background: var(--secondary);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
}

.meter-fill.is-ok { background: var(--grad-brand); }
.meter-fill.is-warn { background: var(--warn); }
.meter-fill.is-bad { background: var(--danger); }
.meter-fill.is-unlimited { background: var(--line-strong); }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card.is-current {
  border-color: var(--electric);
  box-shadow: var(--glow);
}

.plan-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.plan-price {
  font-size: 14px;
  color: var(--teal);
}

.plan-desc {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.plan-limits,
.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}

.plan-limits li::before {
  content: "— ";
  color: var(--muted-foreground);
}

.plan-features li::before {
  content: "✓ ";
  color: var(--ok);
}

.plan-actions {
  margin-top: auto;
}

.plan-current {
  font-size: 13px;
  color: var(--ok);
}

/* ------------------------------------------------------------------- guides -- */

.guide-video {
  display: flex;
}

.tutorial-video {
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: var(--ink-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  counter-reset: guide;
}

.guide-step {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.guide-step:last-child {
  border-bottom: 0;
}

.guide-step-index {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}

.guide-step-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.guide-step-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.guide-step-note {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ------------------------------------------------------------ stale rules -- */
/* licenses.js and users.js are removed; keep their leftovers inert so no
   orphaned selectors survive a future Brand pass. */

.licence-summary,
.role-legend,
.seat-assign {
  display: none;
}

/* ------------------------------------------------------------- responsive -- */

@media (max-width: 1024px) {
  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-card:nth-child(2) {
    border-right: 0;
  }

  .status-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .overview-main {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 640px) {
  .status-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-card {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .status-card:last-child {
    border-bottom: 0;
  }

  .wipe-panel-body {
    flex-direction: column;
  }

  .wipe-other {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .wipe-other-bar {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entitlement-fill,
  .meter-fill {
    transition: none;
  }
}
