/* ── PWA / Mobile Nexo JobTrack ─────────────────────────────── */

:root {
  --mobile-accent: #0abf8f;
  --mobile-dark: #0a1628;
  --mobile-nav-h: 4.25rem;
  --mobile-header-h: 3.25rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

.mobile-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
  padding-top: var(--safe-top);
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--mobile-header-h);
  background: var(--mobile-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.mobile-header .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.mobile-header .brand img {
  height: 28px;
}

.mobile-header .clock {
  font-size: .85rem;
  opacity: .85;
}

.mobile-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem calc(var(--mobile-nav-h) + var(--safe-bottom) + 1rem);
  -webkit-overflow-scrolling: touch;
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: calc(var(--mobile-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid #dee2e6;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  text-decoration: none;
  color: #6c757d;
  font-size: .68rem;
  font-weight: 500;
  padding: .35rem 0;
  min-height: 48px;
  transition: color .15s;
}

.mobile-bottom-nav a i {
  font-size: 1.35rem;
}

.mobile-bottom-nav a.active {
  color: var(--mobile-accent);
}

/* Cartes action */
.m-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  border: none;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .12s, box-shadow .12s;
}

.m-card:active {
  transform: scale(.98);
}

.m-card-action {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.m-card-action .icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.m-card-action h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 .15rem;
}

.m-card-action p {
  font-size: .8rem;
  color: #6c757d;
  margin: 0;
}

/* Tarifs */
.rate-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: .65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}

.rate-card .rate-name {
  font-weight: 600;
  font-size: .95rem;
}

.rate-card .rate-desc {
  font-size: .78rem;
  color: #6c757d;
  margin-top: .1rem;
}

.rate-card .rate-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mobile-accent);
  white-space: nowrap;
}

/* Formulaires tactiles */
.m-form .form-label {
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: .35rem;
}

.m-form .form-control,
.m-form .form-select {
  min-height: 48px;
  font-size: 1rem;
  border-radius: 10px;
}

.m-form textarea.form-control {
  min-height: 80px;
}

.m-btn {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  width: 100%;
}

.m-btn-primary {
  background: var(--mobile-accent);
  border-color: var(--mobile-accent);
  color: #fff;
}

.m-btn-primary:hover,
.m-btn-primary:focus {
  background: #09a87d;
  border-color: #09a87d;
  color: #fff;
}

/* Facturation — entrées */
.entry-card {
  background: #fff;
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .5rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  box-shadow: 0 1px 5px rgba(0,0,0,.05);
}

.entry-card input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: .15rem;
  flex-shrink: 0;
}

.entry-card .entry-meta {
  flex: 1;
  min-width: 0;
}

.entry-card .entry-date {
  font-size: .75rem;
  color: #6c757d;
}

.entry-card .entry-desc {
  font-size: .88rem;
  margin: .1rem 0;
}

.entry-card .entry-amount {
  font-weight: 700;
  color: var(--mobile-dark);
  white-space: nowrap;
}

/* Steps indicator */
.m-steps {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.m-steps .step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #dee2e6;
}

.m-steps .step.done { background: var(--mobile-accent); }
.m-steps .step.active { background: var(--mobile-accent); opacity: .6; }

/* Client picker */
.client-chip {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .5rem;
  box-shadow: 0 1px 5px rgba(0,0,0,.05);
  transition: border-color .15s;
}

.client-chip.selected {
  border-color: var(--mobile-accent);
  background: #f0fdf9;
}

.client-chip .client-name {
  font-weight: 600;
}

.client-chip .client-city {
  font-size: .78rem;
  color: #6c757d;
}

/* Récap facture */
.invoice-summary {
  background: var(--mobile-dark);
  color: #fff;
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.invoice-summary .total {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--mobile-accent);
}

.install-banner {
  background: linear-gradient(135deg, #0a1628, #1a3a5c);
  color: #fff;
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.install-banner button {
  background: var(--mobile-accent);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: .5rem 1rem;
  border-radius: 8px;
  white-space: nowrap;
}

/* Masquer sidebar desktop sur routes mobile */
body.mobile-route .sidebar,
body.mobile-route .top-row {
  display: none !important;
}

body.mobile-route main {
  width: 100% !important;
}

body.mobile-route .page {
  flex-direction: column;
}

@media (min-width: 768px) {
  .mobile-content {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
  .mobile-bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
}
