/* ═══════════════════════════════════════════════════════════
   TRUCK FROTAS — Phone Mockups CSS
   Frames de iPhone renderizados 100% em CSS + HTML
   Fundo transparente nativo · Design System tokens
═══════════════════════════════════════════════════════════ */

/* ─── PHONE FRAME ──────────────────────────────────────── */

.phone {
  display: inline-flex;
  position: relative;
  flex-shrink: 0;
}

.phone--sm  { --phone-w: 220px; --screen-h: 420px; }
.phone--md  { --phone-w: 268px; --screen-h: 538px; }
.phone--lg  { --phone-w: 300px; --screen-h: 600px; }

.phone__shell {
  width: var(--phone-w);
  background: linear-gradient(160deg, #1C2A40 0%, #0D1520 60%, #0A1018 100%);
  border: 1.5px solid #2A3A58;
  border-radius: 46px;
  padding: 14px;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 40px 80px rgba(0,0,0,0.8),
    0 0 0 1px rgba(0,0,0,0.4),
    0 0 48px rgba(71,98,255,0.12);
}

/* Botão power (direita) */
.phone__shell::after {
  content: '';
  position: absolute;
  right: -3.5px;
  top: 110px;
  width: 3px;
  height: 64px;
  background: linear-gradient(to right, #1C2A40, #0D1520);
  border: 1px solid #2A3A58;
  border-left: none;
  border-radius: 0 4px 4px 0;
}

/* Botões de volume (esquerda) */
.phone__shell::before {
  content: '';
  position: absolute;
  left: -3.5px;
  top: 88px;
  width: 3px;
  height: 36px;
  background: linear-gradient(to left, #1C2A40, #0D1520);
  border: 1px solid #2A3A58;
  border-right: none;
  border-radius: 4px 0 0 4px;
  box-shadow:
    0 50px 0 #1C2A40,
    0 49px 0 #2A3A58,
    0 50px 0 #1C2A40,
    0 86px 0 #1C2A40,
    0 85px 0 #2A3A58;
}

/* Tela */
.phone__screen {
  background: #080C18;
  border-radius: 34px;
  overflow: hidden;
  height: var(--screen-h);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Dynamic Island */
.phone__island {
  width: 88px;
  height: 26px;
  background: #000;
  border-radius: 20px;
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}

/* ─── STATUS BAR ───────────────────────────────────────── */

.app-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px 0;
  height: 44px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.app-status__time {
  font-size: 13px;
  font-weight: 600;
  color: #F0F4FF;
  letter-spacing: -0.01em;
}

.app-status__icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #F0F4FF;
}

/* ─── APP BAR ──────────────────────────────────────────── */

.app-bar {
  display: flex;
  align-items: center;
  padding: 8px 16px 6px;
  gap: 8px;
  flex-shrink: 0;
  min-height: 44px;
}

.app-bar__back {
  color: #6B82FF;
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
  display: flex;
  align-items: center;
  margin-right: 2px;
}

.app-bar__title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #F0F4FF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-bar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4762FF, #2539B8);
  border: 1.5px solid rgba(71,98,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ─── SEARCH + FILTER ROW ──────────────────────────────── */

.app-filters {
  display: flex;
  gap: 5px;
  padding: 2px 12px 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.app-filter {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  background: #1E2A3D;
  border: 1px solid #253248;
  color: #94A3B8;
  white-space: nowrap;
  flex-shrink: 0;
}

.app-filter--active {
  background: #4762FF;
  border-color: #4762FF;
  color: #fff;
}

.app-search {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #1E2A3D;
  border: 1px solid #253248;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  flex-shrink: 0;
}

/* ─── SCROLLABLE CONTENT AREA ──────────────────────────── */

.app-content {
  flex: 1;
  overflow: hidden;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.app-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  padding: 4px 2px 2px;
  flex-shrink: 0;
}

/* ─── CHECKLIST ITEMS ──────────────────────────────────── */

.check-item {
  display: flex;
  gap: 9px;
  padding: 10px 11px;
  background: #1E2A3D;
  border: 1px solid #253248;
  border-radius: 11px;
  align-items: flex-start;
  flex-shrink: 0;
}

.check-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-icon--ok      { background: rgba(34,197,94,0.14); color: #22C55E; }
.check-icon--warn    { background: rgba(245,158,11,0.14); color: #F59E0B; }
.check-icon--pending { background: #182033; color: #64748B; }

.check-info { flex: 1; min-width: 0; }

.check-info__title {
  font-size: 11px;
  font-weight: 600;
  color: #F0F4FF;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.check-info__sub {
  font-size: 10px;
  color: #64748B;
}

.check-badge {
  align-self: flex-start;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ─── GENERIC APP CARD ─────────────────────────────────── */

.app-card {
  background: #1E2A3D;
  border: 1px solid #253248;
  border-radius: 11px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.app-card--ok   { border-left: 3px solid #22C55E; }
.app-card--warn { border-left: 3px solid #F59E0B; }
.app-card--crit { border-left: 3px solid #EF4444; }
.app-card--info { border-left: 3px solid #4762FF; }

.app-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.app-card__id {
  font-size: 13px;
  font-weight: 700;
  color: #F0F4FF;
  letter-spacing: 0.02em;
}

.app-card__sub {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 400;
}

.app-card__date {
  font-size: 9px;
  color: #64748B;
}

.app-card__title {
  font-size: 10px;
  font-weight: 500;
  color: #94A3B8;
}

/* ─── STATUS BADGE ─────────────────────────────────────── */

.app-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.app-badge--ok   { background: rgba(34,197,94,0.14);  color: #22C55E; border: 1px solid rgba(34,197,94,0.3);  }
.app-badge--warn { background: rgba(245,158,11,0.14); color: #F59E0B; border: 1px solid rgba(245,158,11,0.3); }
.app-badge--crit { background: rgba(239,68,68,0.14);  color: #EF4444; border: 1px solid rgba(239,68,68,0.3);  }
.app-badge--info { background: rgba(71,98,255,0.14);  color: #6B82FF; border: 1px solid rgba(71,98,255,0.3);  }
.app-badge--mute { background: rgba(100,116,139,0.14);color: #94A3B8; border: 1px solid rgba(100,116,139,0.3);}

/* ─── PRIORITY SELECTOR ────────────────────────────────── */

.priority-row {
  display: flex;
  gap: 5px;
}

.priority-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 4px 5px;
  border-radius: 9px;
  border: 1px solid #253248;
  background: #182033;
}

.priority-item--sel {
  border-color: #4762FF;
  background: rgba(71,98,255,0.1);
}

.priority-item__label {
  font-size: 9px;
  font-weight: 500;
  color: #64748B;
}

.priority-item--sel .priority-item__label { color: #6B82FF; }

.priority-radio {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid #3D4F6A;
  background: transparent;
}

.priority-radio--sel {
  border-color: #4762FF;
  background: #4762FF;
  box-shadow: 0 0 0 2.5px rgba(71,98,255,0.25);
}

/* ─── OS STATS (aberto / fechado) ──────────────────────── */

.os-stats {
  display: flex;
  border: 1px solid #253248;
  border-radius: 8px;
  overflow: hidden;
}

.os-stat {
  flex: 1;
  text-align: center;
  padding: 5px 4px;
}

.os-stat + .os-stat { border-left: 1px solid #253248; }

.os-stat__label {
  font-size: 9px;
  color: #64748B;
  display: block;
  margin-bottom: 1px;
}

.os-stat__value {
  font-size: 16px;
  font-weight: 700;
  color: #F0F4FF;
  display: block;
}

.os-action {
  font-size: 10px;
  font-weight: 600;
  color: #6B82FF;
  text-align: center;
}

/* ─── TIRE ITEMS ───────────────────────────────────────── */

.tire-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 11px;
  background: #1E2A3D;
  border: 1px solid #253248;
  border-radius: 11px;
  flex-shrink: 0;
}

.tire-item--applied { border-left: 3px solid #4762FF; }
.tire-item--discard { border-left: 3px solid #EF4444; }

.tire-thumb {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: #182033;
  border: 1px solid #253248;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #3D4F6A;
}

.tire-info {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
}

.tire-field__label {
  font-size: 7.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748B;
  display: block;
  margin-bottom: 1px;
}

.tire-field__value {
  font-size: 10.5px;
  font-weight: 600;
  color: #F0F4FF;
  display: block;
}

/* ─── PREVENTIVA ITEMS ─────────────────────────────────── */

.prev-item {
  padding: 10px 11px;
  background: #1E2A3D;
  border: 1px solid #253248;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.prev-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prev-item__id {
  font-size: 13px;
  font-weight: 700;
  color: #F0F4FF;
}

.prev-item__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 10px;
}

.prev-field__label {
  font-size: 7.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748B;
  display: block;
}

.prev-field__value {
  font-size: 10px;
  color: #94A3B8;
  display: block;
}

.prev-item__plan {
  font-size: 9.5px;
  font-weight: 500;
  color: #6B82FF;
  padding: 3px 8px;
  background: rgba(71,98,255,0.1);
  border-radius: 20px;
  align-self: flex-start;
  border: 1px solid rgba(71,98,255,0.2);
}

.prev-item__km {
  display: flex;
  gap: 10px;
  font-size: 9px;
  color: #64748B;
}

.prev-item__km strong { color: #94A3B8; font-weight: 500; }
.prev-item__km .km-next { color: #F59E0B; }

/* ─── KPI CARDS (dashboard) ────────────────────────────── */

.kpi-row {
  display: flex;
  gap: 7px;
  padding: 0 10px 6px;
  flex-shrink: 0;
}

.kpi-card {
  flex: 1;
  border-radius: 10px;
  padding: 10px 10px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-card--crit  { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.22); }
.kpi-card--ok    { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.22); }
.kpi-card--brand { background: rgba(71,98,255,0.12);  border: 1px solid rgba(71,98,255,0.22); }

.kpi-card__number {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  display: block;
}

.kpi-card--crit  .kpi-card__number { color: #EF4444; }
.kpi-card--ok    .kpi-card__number { color: #22C55E; }
.kpi-card--brand .kpi-card__number { color: #6B82FF; }

.kpi-card__label {
  font-size: 9px;
  color: #94A3B8;
  line-height: 1.35;
  margin-top: 3px;
  display: block;
}

.kpi-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon--crit  { background: rgba(239,68,68,0.2);  color: #EF4444; }
.kpi-icon--ok    { background: rgba(34,197,94,0.2);  color: #22C55E; }

/* ─── PIE CHART ────────────────────────────────────────── */

.chart-section {
  padding: 0 10px 8px;
  flex-shrink: 0;
}

.chart-title {
  font-size: 11px;
  font-weight: 600;
  color: #F0F4FF;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title span { color: #64748B; }

.chart-layout {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pie-chart {
  width: 78px; height: 78px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(
    #EAB308   0deg   2.1deg,
    #EF4444   2.1deg 89.8deg,
    #3B82F6  89.8deg 152.2deg,
    #22C55E 152.2deg 360deg
  );
  box-shadow:
    0 0 0 4px #080C18,
    0 0 16px rgba(0,0,0,0.4);
  position: relative;
}

/* Donut hole */
.pie-chart::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  background: #080C18;
  border-radius: 50%;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: #94A3B8;
  white-space: nowrap;
}

.legend-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── BAR CHART (mini) ─────────────────────────────────── */

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 48px;
  padding: 0 10px 6px;
  flex-shrink: 0;
}

.bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
}

.bar--green { background: rgba(34,197,94,0.6); }
.bar--blue  { background: rgba(71,98,255,0.6); }
.bar--red   { background: rgba(239,68,68,0.6); }
.bar--yellow{ background: rgba(234,179,8,0.6); }

/* ─── BOTTOM NAV ───────────────────────────────────────── */

.app-bottom-nav {
  display: flex;
  background: #0F1626;
  border-top: 1px solid #182033;
  padding: 6px 0 8px;
  flex-shrink: 0;
  margin-top: auto;
}

.app-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 2px 0;
  font-size: 9px;
  font-weight: 500;
  color: #64748B;
}

.app-nav-item--active { color: #4762FF; }

/* ─── FAB ──────────────────────────────────────────────── */

.app-fab {
  position: absolute;
  bottom: 60px;
  right: 12px;
  height: 36px;
  padding: 0 12px;
  background: #4762FF;
  color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(71,98,255,0.45);
  z-index: 10;
  white-space: nowrap;
}

/* ─── DIVIDER ──────────────────────────────────────────── */

.app-divider {
  height: 1px;
  background: #182033;
  margin: 0 10px;
  flex-shrink: 0;
}

/* ─── DUAL PHONE LAYOUT ────────────────────────────────── */

.phones-dual {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* Sobreposição sem gap negativo (evita inconsistência entre navegadores) */
.phones-dual .phone:last-child {
  margin-left: -24px;
}

.phones-dual .phone:first-child {
  transform: translateX(16px) rotate(-4deg);
  z-index: 1;
  filter:
    drop-shadow(-8px 32px 48px rgba(0,0,0,0.7))
    drop-shadow(0 0 24px rgba(71,98,255,0.1));
}

.phones-dual .phone:last-child {
  transform: translateX(-16px) rotate(3deg);
  z-index: 2;
  filter:
    drop-shadow(8px 32px 48px rgba(0,0,0,0.7))
    drop-shadow(0 0 32px rgba(71,98,255,0.2));
}

/*
 * Tablet/celular: empilha (evita dois frames finos lado a lado) e usa as MESMAS
 * dimensões do hero (.phone--lg) para proporção visual consistente.
 */
@media (max-width: 768px) {
  .phones-dual {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .phones-dual .phone:last-child {
    margin-left: 0;
  }

  .phones-dual .phone:first-child,
  .phones-dual .phone:last-child {
    transform: none;
  }

  .phones-dual .phone--sm {
    --phone-w: 300px;
    --screen-h: 600px;
  }
}

@media (max-width: 600px) {
  .phones-dual .phone--sm {
    --phone-w: 260px;
    --screen-h: 520px;
  }
}

/* ─── SCREEN GRADIENT OVERLAY (depth) ─────────────────── */

.phone__screen-overlay {
  position: absolute;
  inset: 0;
  border-radius: 34px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.03) 0%,
    transparent 30%,
    transparent 70%,
    rgba(0,0,0,0.15) 100%
  );
  pointer-events: none;
  z-index: 5;
}

/* ─── RESPONSIVE ADJUSTMENTS ───────────────────────────── */

@media (max-width: 600px) {
  .phone--lg { --phone-w: 260px; --screen-h: 520px; }
  .phone--md { --phone-w: 230px; --screen-h: 460px; }
}
