/* app.css - supplementary to base.html inline styles.
   Do not redefine variables or font imports from base.html. */

/* ---- mobile nav: stack on narrow screens ---- */
@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    height: auto;
    padding: 14px 0;
  }

  .nav {
    gap: 14px;
    flex-wrap: wrap;
  }
}

/* ---- admin table: horizontal scroll on mobile ---- */
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 700px) {
  .admin-table th,
  .admin-table td {
    padding: 8px 8px;
    font-size: 15px;
  }
}

/* ---- filing tabs: wrap on narrow screens ---- */
@media (max-width: 600px) {
  .filing-tabs {
    flex-wrap: wrap;
    padding: 0 10px;
  }

  .filing-tab {
    padding: 8px 14px 10px;
    font-size: 11px;
  }
}

/* ---- ledger tally: single column on phones ---- */
@media (max-width: 500px) {
  .ledger-tally {
    grid-template-columns: 1fr;
  }

  .tally-row {
    border-right: none;
    border-bottom: 1px solid var(--twine);
  }

  .tally-row:last-child {
    border-bottom: none;
  }
}

/* ---- main content padding tighter on mobile ---- */
@media (max-width: 480px) {
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---- parcel slip head: stack seal below on small screens ---- */
@media (max-width: 480px) {
  .slip-head {
    grid-template-columns: 1fr;
  }

  .seal {
    margin-top: 12px;
  }
}

/* ---- declaration form: full width on mobile ---- */
@media (max-width: 520px) {
  .declaration {
    margin: 12px auto 0;
  }

  .decl-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* ---- login parcel: tighter margin on mobile ---- */
@media (max-width: 520px) {
  .parcel {
    margin: 16px auto 0;
  }

  .parcel .actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* ---- map: enforce height even if Leaflet tries to override ---- */
#map {
  height: 380px;
  min-height: 380px;
}

/* ---- status badges: ensure inline-block stays tight in table cells ---- */
.status-preparing,
.status-in_transit,
.status-customs,
.status-delivered {
  white-space: nowrap;
}

/* ---- empty state: block display so it stacks correctly ---- */
.empty-state {
  display: block;
}

/* ---- btn-primary / btn-danger used as <a> tags: fix vertical alignment ---- */
a.btn-primary,
a.btn-danger {
  vertical-align: middle;
  line-height: 1.2;
}

/* ---- form-error and form-success: keep readable on small screens ---- */
@media (max-width: 480px) {
  .form-error,
  .form-success {
    font-size: 16px;
  }
}
