[hidden] { display: none !important; }
.topbar { flex-wrap: wrap; }
.topbar a { color: inherit; }
:root {
  color-scheme: light;
  --ink: #17211a;
  --muted: #637064;
  --line: #d9e1d7;
  --panel: #ffffff;
  --canvas: #f5f7f1;
  --green: #1f7a4d;
  --green-dark: #155f3a;
  --gold: #b7791f;
  --red: #a94336;
  --soft: #e7f2ea;
  --shadow: 0 14px 34px rgba(24, 33, 27, .1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 46px;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

button.secondary {
  background: #edf2eb;
  color: var(--ink);
}

button.danger-button {
  background: var(--red);
  color: #fff;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 46px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-shell,
.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 14px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.transport-list {
  display: grid;
  gap: 12px;
}

.transport-list-item {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(128px, 170px) minmax(0, 1fr) auto;
  justify-items: stretch;
  min-height: 76px;
  padding: 14px;
  text-align: left;
}

.transport-list-item:focus-visible {
  outline: 3px solid rgba(21, 95, 58, 0.25);
  outline-offset: 2px;
}

.transport-code {
  border-radius: 8px;
  background: #fff7d6;
  color: #7a5a00;
  font-size: 18px;
  font-weight: 900;
  padding: 10px;
  text-align: center;
}

.transport-code.cmr {
  background: var(--soft);
  color: var(--green-dark);
}

.transport-summary {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.transport-summary strong {
  font-size: 16px;
}

.summary-line {
  display: grid;
  gap: 3px;
}

.summary-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-line b {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.summary-plates {
  display: grid;
  gap: 6px;
}

.summary-plates b {
  background: var(--soft);
  border-radius: 999px;
  color: var(--green-dark);
  display: block;
  font-size: 13px;
  padding: 5px 8px;
}

.summary-plates span {
  font-weight: 900;
}

.phone-link {
  color: var(--green-dark);
  font-weight: 900;
  text-decoration: none;
}

.phone-link:focus,
.phone-link:hover {
  text-decoration: underline;
}

.transport-summary small {
  color: var(--muted);
  font-size: 13px;
}

.back-button {
  justify-self: start;
}

.transport-card {
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.transport-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.transport-card h2 {
  margin: 0;
  font-size: 19px;
}

.transport-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.badge {
  align-self: start;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  white-space: nowrap;
}

.cmr-number-box {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.cmr-number-box span {
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cmr-number-box strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.cmr-number-box.ready {
  background: var(--soft);
  border-color: #9fcdae;
  color: var(--green-dark);
}

.cmr-number-box.missing {
  background: #fff6d8;
  border-color: #e7c76d;
  color: #73530b;
}

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

.info-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfcfa;
}

.info-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.info-grid strong {
  display: block;
  margin-top: 4px;
}

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

.span-2 {
  grid-column: span 2;
}

.span-4 {
  grid-column: span 4;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.save-status {
  border-radius: 999px;
  background: #eef4ee;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
}

.save-status[data-type="pending"],
.save-status[data-type="saving"] {
  background: #fff7d6;
  color: #7a5a00;
}

.save-status[data-type="saved"] {
  background: var(--soft);
  color: var(--green-dark);
}

.save-status[data-type="error"] {
  background: #fff0ee;
  color: var(--red);
}

.attachment-box {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.attachment-form {
  display: grid;
  grid-template-columns: 150px 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.attachment-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-pill {
  align-items: center;
  background: var(--soft);
  border-radius: 18px;
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 7px 8px 7px 10px;
}

.attachment-list a {
  color: var(--green-dark);
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.attachment-pill button {
  background: #9a3b2e;
  border-radius: 999px;
  min-height: 28px;
  padding: 0 9px;
  width: auto;
}

.complete-box {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.complete-box button {
  width: 100%;
}

.complete-modal-backdrop {
  align-items: center;
  background: rgba(9, 18, 12, .62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 30;
}

.complete-modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 26px 70px rgba(9, 18, 12, .28);
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  width: min(680px, 100%);
}

.complete-modal h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
}

.complete-modal p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
  margin: 0;
}

.complete-summary {
  background: #f7faf4;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px 14px;
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 14px;
}

.complete-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.complete-summary strong {
  overflow-wrap: anywhere;
}

.complete-modal-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1.4fr;
}

.empty,
.error,
.success {
  border-radius: 8px;
  padding: 12px;
  font-weight: 800;
}

.empty {
  background: #fff;
  border: 1px solid var(--line);
}

.error {
  background: #fff0ee;
  color: var(--red);
}

.success {
  background: var(--soft);
  color: var(--green-dark);
}

@media (max-width: 900px) {
  .info-grid,
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-4 {
    grid-column: span 2;
  }

  .attachment-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    flex-direction: column;
  }

  .content {
    padding: 12px;
  }

  .toolbar,
  .transport-list-item,
  .info-grid,
  .field-grid,
  .attachment-form {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-4 {
    grid-column: span 1;
  }

  .transport-card header {
    display: grid;
  }

  .complete-modal {
    padding: 18px;
  }

  .complete-modal h2 {
    font-size: 25px;
  }

  .complete-summary,
  .complete-modal-actions {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
.subscription-notice{padding:14px;margin-bottom:18px;border-left:4px solid #0d5057;background:#e5f1ec;line-height:1.6;font-size:14px;overflow-wrap:anywhere}.subscription-notice a{color:#0d5057;font-weight:700}
