@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:      #f8f7f4;
  --surface: #ffffff;
  --border:  #e8e6e1;
  --border2: #d1cdc5;
  --text:    #1a1916;
  --text2:   #6b6760;
  --text3:   #a09d96;
  --accent:  #1a1916;
  --radius:  14px;
  --radius-s:8px;
  --shadow:  0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.tm-wrap {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding: 2rem 1rem;
}
.tm-wrap--wide { max-width: 1040px; margin: 0 auto; }

/* ── Box / Card ── */
.tm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.tm-box--narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.tm-box--form   { border-top: 3px solid var(--accent); }
.tm-box-title {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

/* ── Brand ── */
.tm-brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 1.75rem;
}

/* ── Headings ── */
.tm-heading {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: .35rem;
}
.tm-sub {
  font-size: .9rem;
  color: var(--text3);
  margin-bottom: 1.75rem;
}

/* ── Portal header ── */
.tm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.tm-hello   { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.tm-company { font-size: .85rem; color: var(--text3); margin-top: .2rem; }
.tm-header-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* ── Form elements ── */
.tm-form { display: flex; flex-direction: column; gap: 1rem; }
.tm-field { display: flex; flex-direction: column; gap: .35rem; }
.tm-field label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text2);
  letter-spacing: .02em;
}
.tm-req { color: #dc2626; }

.tm-field input,
.tm-field select,
.tm-field textarea {
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-s);
  padding: .7rem .9rem;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  appearance: none;
}
.tm-field input:focus,
.tm-field select:focus,
.tm-field textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26,25,22,.07);
}
.tm-field textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.tm-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6760' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

.tm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Buttons ── */
.tm-btn {
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  font-weight: 500;
  padding: .72rem 1.4rem;
  border-radius: var(--radius-s);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  text-decoration: none;
  white-space: nowrap;
  background: var(--accent);
  color: #fff;
}
.tm-btn:hover       { background: #333; }
.tm-btn:disabled    { opacity: .5; cursor: not-allowed; }
.tm-btn--full       { width: 100%; margin-top: .25rem; }
.tm-btn--outline    { background: var(--surface); color: var(--text); border-color: var(--border2); }
.tm-btn--outline:hover { background: var(--bg); border-color: var(--text); }
.tm-btn--ghost      { background: transparent; color: var(--text2); border-color: transparent; }
.tm-btn--ghost:hover{ background: var(--bg); color: var(--text); }
.tm-btn--sm         { font-size: .78rem; padding: .35rem .85rem; }

/* ── Messages ── */
.tm-msg {
  padding: .85rem 1rem;
  border-radius: var(--radius-s);
  font-size: .875rem;
  line-height: 1.5;
  border: 1px solid transparent;
  margin-bottom: .25rem;
}
.tm-msg--success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.tm-msg--error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.tm-error { color: #991b1b; }

/* ── Table ── */
.tm-table-scroll { overflow-x: auto; margin: 0 -2.25rem; padding: 0 2.25rem; }
.tm-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 680px; }
.tm-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
}
.tm-table td { padding: .85rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tm-table tbody tr:last-child td { border-bottom: none; }
.tm-table tbody tr:hover { background: var(--bg); }

/* Action cell — multiple buttons stacked vertically on small actions */
.tm-actions-cell {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  align-items: flex-start;
  white-space: nowrap;
}

/* Inline pill (e.g. "✓ Documents Submitted" status indicator) */
.tm-pill {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 6px;
  white-space: nowrap;
}
.tm-pill--teal { background: #f0fdfa; color: #115e59; border: 1px solid #99f6e4; }

/* ── Badges ── */
.tm-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .2rem .65rem;
  border-radius: 999px;
}
.tm-badge--orange { background: #fef9ec; color: #92400e; border: 1px solid #fde68a; }
.tm-badge--blue   { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.tm-badge--green  { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.tm-badge--purple { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.tm-badge--teal   { background: #f0fdfa; color: #134e4a; border: 1px solid #99f6e4; }
.tm-badge--red    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Misc ── */
.tm-ref    { font-family: 'SF Mono','Fira Code',monospace; font-size: .8rem; background: var(--bg); padding: .15rem .45rem; border-radius: 4px; border: 1px solid var(--border); }
.tm-route  { color: var(--text2); max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-muted  { color: var(--text3); font-size: .85rem; }
.tm-foot   { text-align: center; font-size: .875rem; color: var(--text2); margin-top: .5rem; }
.tm-foot a { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.tm-hidden { display: none; }
.tm-actions{ display: flex; gap: .75rem; justify-content: flex-end; margin-top: .5rem; }

/* ── Summary (confirm page) ── */
.tm-summary { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; }
.tm-summary-row { display: flex; justify-content: space-between; align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.tm-summary-row:last-child { border-bottom: none; }
.tm-summary-row span:first-child { color: var(--text2); font-weight: 500; }
.tm-summary-row--rate { padding-top: .75rem; }
.tm-rate { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }

/* ── Upload zone ── */
.tm-upload {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-s);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--bg);
  position: relative;
}
.tm-upload:hover, .tm-upload.over { border-color: var(--accent); background: rgba(26,25,22,.02); }
.tm-upload-icon { font-size: 1.75rem; margin-bottom: .5rem; color: var(--text3); }
.tm-upload p   { font-size: .9rem; color: var(--text2); }

/* ════════════════════════════════════════════════════
   COMPREHENSIVE DETAILS PANEL (v2.14.0)
   Customer-side full-shipment view. Designed to surface
   the same info admin sees on their own bookings.
════════════════════════════════════════════════════ */
.tm-details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 1.5rem 1.75rem;
  margin: .5rem 0;
}
.tm-details-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.tm-details-section + .tm-details-section { margin-top: 1.5rem; }
.tm-details-section-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .02em;
  margin-bottom: .9rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.tm-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}
.tm-details-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .65rem .85rem;
}
.tm-details-field--wide { grid-column: 1 / -1; }
.tm-details-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
}
.tm-details-value {
  font-size: .9rem;
  color: var(--text);
  word-break: break-word;
  line-height: 1.45;
}
.tm-details-rate {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e40af;
  letter-spacing: -.01em;
}
.tm-details-mono {
  font-family: 'SF Mono','Fira Code',Menlo,monospace;
  font-size: .85rem;
  letter-spacing: .02em;
}

.tm-details-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.tm-details-photo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem;
  text-align: center;
}
.tm-details-photo-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: .55rem;
}
.tm-details-photo img {
  max-width: 100%;
  max-height: 140px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
}

@media(max-width:640px){
  .tm-box        { padding: 1.5rem; }
  .tm-row2       { grid-template-columns: 1fr; }
  .tm-header     { flex-direction: column; align-items: flex-start; }
  .tm-table-scroll { margin: 0 -1.5rem; padding: 0 1.5rem; }
  .tm-heading    { font-size: 1.4rem; }
  .tm-details    { padding: 1.1rem 1.1rem; }
  .tm-details-grid { grid-template-columns: 1fr; }
}
