/* ── App shell ── */
.app-body {
  background: var(--bg-dark);
  min-height: 100vh;
}

.auth-body {
  background: var(--bg-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ── Nav ── */
.app-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg-dark);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active {
  color: #fff;
}

.nav-btn {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  background: var(--accent-glow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent);
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s;
}
.nav-btn:hover {
  background: rgba(245, 158, 11, 0.25);
}

.app-nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.user-email {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.logout-btn {
  font-size: 0.8rem;
  color: var(--fg-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.logout-btn:hover { color: #fff; }

/* ── Main content ── */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.page-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-top: 0.25rem;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-bottom: 0.35rem;
}
.breadcrumb a {
  color: var(--fg-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent); }

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn-primary {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }

.btn-outline {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.15s, color 0.15s;
}
.btn-outline:hover {
  border-color: var(--fg-muted);
  color: #fff;
}

.btn-danger {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }

.btn-full { width: 100%; justify-content: center; }

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
}

/* ── Cards / tables ── */
.card-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.card-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-table-header h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.875rem 1.25rem;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.ref-link {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-secondary);
  text-decoration: none;
}
.ref-link:hover { text-decoration: underline; }

.text-muted { color: var(--fg-muted); }
.text-amber { color: var(--accent); }

.actions { white-space: nowrap; }
.action-link {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  margin-right: 1rem;
  transition: color 0.15s;
}
.action-link:hover { color: var(--accent); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}
.empty-sub {
  color: var(--fg-muted);
  max-width: 400px;
  margin: 0 auto 2rem;
  font-size: 0.9rem;
}

/* ── Document download bar ── */
.doc-download-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.doc-download-label {
  font-size: 0.8rem;
  color: var(--fg-dim);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

.doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.875rem;
  transition: border-color 0.15s, color 0.15s;
}
.doc-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.doc-icon { font-size: 1rem; }

/* ── Detail grid ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}
.detail-card-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 0.75rem;
}
.detail-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}
.detail-address {
  font-size: 0.85rem;
  color: var(--fg-muted);
  white-space: pre-line;
  line-height: 1.5;
}
.detail-country {
  font-size: 0.85rem;
  color: var(--fg-dim);
  margin-top: 0.25rem;
}
.detail-label {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.badge {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  background: var(--accent-glow);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent);
  border-radius: 3px;
}

.summary-badges {
  display: flex;
  gap: 1.5rem;
}
.summary-badge {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.badge-label {
  font-size: 0.7rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-val {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.notes-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── Auth card ── */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 1.25rem;
}
.auth-switch a {
  color: var(--accent);
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group--wide { flex: 2; }

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.form-hint {
  font-weight: 400;
  color: var(--fg-dim);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: border-color 0.15s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--fg-dim);
}

.form-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #fca5a5;
  margin-bottom: 1rem;
}

.form-errors {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.form-errors p {
  font-size: 0.875rem;
  color: #fca5a5;
  margin-bottom: 0.25rem;
}
.form-errors p:last-child { margin-bottom: 0; }

/* ── Shipment form ── */
.shipment-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.form-row .form-group {
  flex: 1;
  min-width: 150px;
}

/* ── Line items table ── */
.items-header {
  display: flex;
  gap: 0.5rem;
  padding: 0 0 0.5rem 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.item-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.item-row input,
.item-row select {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  min-width: 0;
}
.item-row input:focus,
.item-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.remove-item-btn {
  background: none;
  border: none;
  color: var(--fg-dim);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
.remove-item-btn:hover { color: #f87171; }

.add-item-btn {
  margin-top: 0.75rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.5rem;
}
