/* ============================================================
   RUBY SHIPPING PORTAL — portal.css
   Maritime Design Theme | Space Grotesk + Inter
   ============================================================ */

/* --- Reset & Variables --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #0F1F3D;
  --navy-mid: #1A3260;
  --navy-light: #254880;
  --gold: #C9A84C;
  --gold-light: #DFC07A;
  --gold-dark: #A8882E;
  --surface: #F8F8F6;
  --surface-low: #F0F0ED;
  --surface-mid: #E8E8E4;
  --surface-high: #DDDDD8;
  --white: #FFFFFF;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --error: #DC2626;
  --error-bg: #FEE2E2;
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --warning: #D97706;
  --warning-bg: #FEF3C7;
  --info: #2563EB;
  --info-bg: #DBEAFE;
  --border: #E5E7EB;
  --border-mid: #D1D5DB;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: 0.18s ease;
}

/* --- Typography --- */
body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

a {
  color: var(--navy);
  text-decoration: none;
}
a:hover { color: var(--gold); }

/* --- Navigation --- */
.portal-nav {
  display: flex;
  align-items: center;
  background: var(--white);
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.brand-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--navy);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  position: relative;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--navy);
  background: var(--surface-low);
}

.nav-link.active {
  color: var(--navy);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.nav-bell {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--transition);
  position: relative;
}

.nav-bell:hover { background: var(--surface-low); }

.nav-bell .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.nav-user-info {
  text-align: right;
  line-height: 1.3;
}

.nav-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.nav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
}
.nav-logout:hover { background: var(--surface-low); color: var(--navy); }

/* --- Layout --- */
.portal-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-header-left { flex: 1; }
.page-title { font-size: 1.75rem; color: var(--navy); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; gap: 12px; align-items: center; }

.two-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* --- Summary Cards --- */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.summary-card:hover { box-shadow: var(--shadow); }

.summary-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.summary-card-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.summary-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.summary-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: rgba(15,31,61,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  margin-bottom: 12px;
}

.summary-card-icon.gold {
  background: rgba(201,168,76,0.15);
  color: var(--gold-dark);
}

.summary-card-icon.success {
  background: var(--success-bg);
  color: var(--success);
}

.summary-card-icon.error {
  background: var(--error-bg);
  color: var(--error);
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 24px; }
/* Inside a grid, gap handles spacing — override the consecutive-sibling margin
   so right-column cards align with the top of left-column cards. */
.detail-grid > .card + .card,
.two-col > .card + .card,
.summary-cards > .card + .card { margin-top: 0; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* --- Data Table --- */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.data-table thead th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 6px 12px;
  text-align: left;
  white-space: nowrap;
}

.data-table tbody tr {
  background: var(--white);
  transition: box-shadow var(--transition);
}

.data-table tbody tr:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.data-table tbody td {
  padding: 12px;
  vertical-align: middle;
}

.data-table tbody td:first-child {
  font-weight: 600;
  color: var(--navy);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding-left: 16px;
}

.data-table tbody td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-draft {
  background: var(--surface-mid);
  color: var(--text-secondary);
}

.badge-pending,
.badge-pending_approval {
  background: rgba(201,168,76,0.2);
  color: var(--gold-dark);
}

.badge-approved {
  background: rgba(22,163,74,0.15);
  color: var(--success);
}

.badge-active,
.badge-cro_issued {
  background: rgba(15,31,61,0.12);
  color: var(--navy);
}

.badge-completed {
  background: rgba(22,163,74,0.15);
  color: var(--success);
}

.badge-cancelled {
  background: rgba(220,38,38,0.1);
  color: var(--error);
}

.badge-urgent {
  background: var(--error);
  color: var(--white);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-issued {
  background: rgba(37,99,235,0.12);
  color: var(--info);
}

.badge-paid {
  background: var(--success-bg);
  color: var(--success);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(15,31,61,0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(15,31,61,0.35);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(201,168,76,0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}

.btn-ghost:hover {
  background: var(--surface-low);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(220,38,38,0.2);
}

.btn-danger:hover {
  background: var(--error);
  color: var(--white);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-track {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-track:hover {
  background: var(--navy);
  color: var(--white);
}

/* --- Notifications --- */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--surface-low);
  border-radius: var(--radius);
  transition: background var(--transition);
}

.notification-item:hover { background: var(--surface-mid); }

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.notification-icon.success {
  background: var(--success-bg);
  color: var(--success);
}

.notification-icon.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.notification-icon.error {
  background: var(--error-bg);
  color: var(--error);
}

.notification-icon.info {
  background: var(--info-bg);
  color: var(--info);
}

.notification-body { flex: 1; min-width: 0; }

.notification-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Stepper --- */
.stepper {
  display: flex;
  align-items: flex-start;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px 24px 20px;
  border: 1px solid var(--border);
  margin-bottom: 28px;
  gap: 0;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 0;
  text-align: center;
  padding: 0 4px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--border-mid);
  background: var(--white);
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
  z-index: 1;
}

.step.completed .step-dot {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.step.active .step-dot {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.15);
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.35;
  word-break: break-word;
}

.step.completed .step-label { color: var(--navy); }
.step.active .step-label { color: var(--gold-dark); }

/* Connector line between dots — drawn as ::after on each non-last step,
   absolutely positioned so it never collides with labels. */
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;            /* vertical-center of the 32px dot (16-1 for line height) */
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step.completed:not(:last-child)::after {
  background: var(--navy);
}

/* Legacy step-line div from existing markup is now invisible — pseudo-element draws the line */
.step-line { display: none; }

/* --- Detail Cards --- */
.detail-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-row {
  margin-bottom: 14px;
}

.detail-row:last-child { margin-bottom: 0; }

/* --- Financial Card --- */
.finance-card {
  background: var(--navy);
  border-radius: var(--radius-md);
  padding: 24px;
  color: var(--white);
  border: none;
}

.finance-card .card-title { color: var(--white); }
.finance-card .detail-label { color: rgba(255,255,255,0.5); }
.finance-card .detail-value { color: var(--white); }

.finance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.finance-item:last-of-type { border-bottom: none; }

.finance-item-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.finance-item-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.finance-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.2);
  margin: 12px 0;
}

.finance-total {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-top: 8px;
}

.finance-total-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Timeline --- */
.timeline {
  padding-left: 20px;
  border-left: 2px solid var(--border);
  position: relative;
}

.timeline-item {
  position: relative;
  padding-left: 20px;
  padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -29px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-mid);
  background: var(--white);
  transition: all var(--transition);
}

.timeline-item.active .timeline-dot {
  background: var(--gold);
  border-color: var(--gold);
}

.timeline-item.completed .timeline-dot {
  background: var(--navy);
  border-color: var(--navy);
}

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.timeline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface-low);
  border: none;
  border-bottom: 2px solid var(--border-mid);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color var(--transition), background var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: rgba(201,168,76,0.06);
  border-bottom-color: var(--gold);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Voyage Selector --- */
.voyage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.voyage-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-low);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.voyage-option:hover {
  background: var(--surface-mid);
  border-color: var(--border-mid);
}

.voyage-option.selected {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold);
}

.voyage-option input[type="radio"] {
  accent-color: var(--gold);
}

.voyage-option-vessel {
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
}

.voyage-option-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.voyage-option-slots {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
}

/* --- Booking Summary Sidebar --- */
.booking-summary {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border);
  position: sticky;
  top: 80px;
}

.booking-summary-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}

.summary-line-label {
  font-size: 12px;
  color: var(--text-muted);
}

.summary-line-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.quote-notice {
  background: var(--warning-bg);
  border: 1px solid rgba(217,119,6,0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 16px 0;
  font-size: 12px;
  color: var(--warning);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* --- Footer --- */
.portal-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  background: var(--white);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 40px;
}

/* ============================================================
   TRACKING (PUBLIC)
   ============================================================ */

.tracking-hero {
  text-align: center;
  padding: 40px 0 32px;
}

.tracking-container-id {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
  line-height: 1;
}

.tracking-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.tracking-meta-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.tracking-meta-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
}

.tracking-meta-card-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.tracking-meta-card-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

/* The public tracking page's fake vessel map lived here — a graticule, a
   centred `sailing` glyph and two corner-pinned port badges, none of it
   data-driven. Removed with its markup 2026-09-15: Ruby has no AIS feed, and
   the page is unauthenticated. The route is now stated as labelled ports in
   templates/public/tracking.html. These rules had exactly one consumer. */

.tracking-search {
  max-width: 500px;
  margin: 40px auto;
  text-align: center;
}

.tracking-search-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.tracking-search-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.tracking-search-row .form-input {
  flex: 1;
  border-radius: var(--radius);
  border: 1px solid var(--border-mid);
  border-bottom: 2px solid var(--border-mid);
}

/* ============================================================
   INVOICE VERIFY (PUBLIC)
   ============================================================ */

.verify-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 24px;
}

.verify-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.verify-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}

.verify-icon.valid {
  background: rgba(201,168,76,0.15);
  color: var(--gold-dark);
}

.verify-icon.invalid {
  background: var(--error-bg);
  color: var(--error);
}

.verify-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.verify-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.verify-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 28px;
}

.verify-details {
  background: var(--surface-low);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: left;
  margin-bottom: 24px;
}

.verify-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.verify-detail-row + .verify-detail-row {
  border-top: 1px solid var(--border);
}

.verify-detail-label {
  font-size: 12px;
  color: var(--text-muted);
}

.verify-detail-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.verify-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  margin: 16px 0 8px;
}

.verify-hash {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  background: var(--surface-mid);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 20px;
}

.verify-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 28px;
}

.verify-contact {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--navy);
  text-transform: uppercase;
  text-decoration: none;
}

.verify-contact:hover { color: var(--gold-dark); }

/* ============================================================
   DEPOT PORTAL
   ============================================================ */

.depot-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.depot-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.cro-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.cro-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface-low);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.cro-number {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}

.cro-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.cro-card-body { padding: 0; }

.container-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

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

.container-number {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
}

.container-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,31,61,0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close:hover { background: var(--surface-low); color: var(--text-primary); }

.modal-tag {
  display: inline-flex;
  background: var(--navy);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   UTILITY
   ============================================================ */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.text-muted { color: var(--text-muted); font-size: 12px; }
.text-navy { color: var(--navy); }
.text-gold { color: var(--gold-dark); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.font-mono { font-family: monospace; }
.w-full { width: 100%; }

/* Section spacing */
.section-gap { margin-bottom: 28px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .material-symbols-outlined { font-size: 48px; opacity: 0.3; }
.empty-state p { margin-top: 8px; font-size: 13px; }

/* ========== Choices.js theme overrides ========== */
.choices { margin-bottom: 0; font-family: 'Inter', sans-serif; }
.choices__inner {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  min-height: 40px;
}
.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.choices__list--dropdown,
.choices__list[aria-expanded] {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(15,31,61,0.08);
}
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: rgba(201,168,76,0.12);
  color: var(--navy);
}
.choices__placeholder { color: var(--text-muted); opacity: 1; }
.choices__input { background: transparent; }

/* ========== Modal (used for Add Entity, etc.) ========== */
.portal-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,31,61,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 20px;
}
.portal-modal {
  background: var(--white); border-radius: 12px; padding: 24px 28px;
  max-width: 500px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.portal-modal-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  color: var(--navy); font-size: 18px; margin: 0 0 6px;
}
.portal-modal-sub { color: var(--text-muted); font-size: 12px; margin-bottom: 20px; }
.portal-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--surface-alt); }

/* ========== Cargo row (multi-line booking) ========== */
.cargo-row {
  display: grid; grid-template-columns: 1.2fr 1.2fr 0.8fr 1fr 36px;
  gap: 10px; align-items: end; padding: 10px 0;
  border-bottom: 1px dashed var(--surface-alt);
}
.cargo-row:last-child { border-bottom: none; }
.cargo-row .form-group { margin-bottom: 0; }
.cargo-remove-btn {
  width: 36px; height: 38px; border: 1px solid var(--border);
  background: var(--white); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.cargo-remove-btn:hover { background: rgba(220,38,38,0.08); color: #DC2626; border-color: #FECACA; }
.cargo-add-btn {
  background: transparent; border: 1.5px dashed var(--border);
  color: var(--text-secondary); padding: 10px 16px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  cursor: pointer; width: 100%; margin-top: 8px;
  transition: all 0.15s;
}
.cargo-add-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.04); }

/* ========== Step disclosure ========== */
.disclosure-step[aria-hidden="true"] { display: none; }
.disclosure-hint {
  text-align: center; padding: 28px 16px;
  color: var(--text-muted); font-size: 13px;
  background: var(--surface-low); border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}
.disclosure-hint .material-symbols-outlined { font-size: 32px; opacity: 0.4; display: block; margin: 0 auto 8px; }


[x-cloak] { display: none !important; }


/* Highlight the inline "+ Add new" option in entity selects */
.choices__list--dropdown .rsl-choice-add,
.choices__list[aria-expanded] .rsl-choice-add {
  border-top: 1px solid var(--surface-alt);
  color: var(--gold-dark);
  font-weight: 600;
}
.choices__list--dropdown .rsl-choice-add.is-highlighted,
.choices__list[aria-expanded] .rsl-choice-add.is-highlighted {
  background: rgba(201,168,76,0.18);
  color: var(--navy);
}

.nav-user-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background var(--transition);
}
.nav-user-link:hover { background: var(--surface-low); color: inherit; }

/* ========== Flash messages ========== */
.portal-flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.portal-flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px; font-size: 13px;
  border: 1px solid;
}
.portal-flash-success { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.portal-flash-error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.portal-flash-warning { background: #FEF3C7; border-color: #FDE68A; color: #854D0E; }
.portal-flash-info { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }

/* ========== Status banners ========== */
.status-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; margin-bottom: 16px;
  border-left: 3px solid; border-radius: 0 8px 8px 0;
  font-size: 13px; line-height: 1.5;
}
.status-banner .material-symbols-outlined { font-size: 22px; flex-shrink: 0; }
.status-banner-info { background: rgba(37,99,235,0.06); border-color: #2563EB; color: #1E3A8A; }
.status-banner-gold { background: rgba(201,168,76,0.12); border-color: var(--gold); color: var(--navy); }
.status-banner-success { background: rgba(22,163,74,0.08); border-color: #16A34A; color: #14532D; }
.status-banner-warning { background: rgba(217,119,6,0.08); border-color: #D97706; color: #78350F; }
.status-banner-error { background: rgba(220,38,38,0.08); border-color: #DC2626; color: #7F1D1D; }

/* ========== Responsive (portal shipped desktop-only) ========== */
/* Tablet & phone: wrap the nav, collapse the card grids, and keep wide
   tables/content inside their box so the page never scrolls horizontally. */
@media (max-width: 900px) {
  .portal-nav { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px 16px; }
  .nav-links { order: 3; flex: 0 0 100%; flex-wrap: wrap; gap: 2px; }
  .nav-right { margin-left: auto; }

  .portal-main { padding: 20px 16px; overflow-x: auto; }
  .two-col, .detail-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .cargo-row { grid-template-columns: 1fr 1fr; }

  /* A wide table scrolls inside its own card rather than the page. */
  .card { overflow-x: auto; }
  .page-header { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .summary-cards { grid-template-columns: 1fr; }
  .cargo-row { grid-template-columns: 1fr; }
  .nav-user-info { display: none; }   /* keep the avatar; drop the name/role text */
  .page-header { flex-direction: column; align-items: flex-start; }
}
