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

/* ---- CORES DA LOGO JS TRANSPORTES ---- */
:root {
  --primary:        #0c2240;   /* azul marinho médio */
  --primary-light:  #1565c0;   /* azul médio — botões, links, destaques */
  --primary-dark:   #060e1c;   /* azul quase preto — sidebar, gradientes */
  --accent:         #f97316;   /* laranja — CTAs, badges de destaque */
  --accent-light:   #fb923c;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #38bdf8;   /* azul claro informativo */
  --dark:           #060e1c;
  --light:          #f1f5f9;
  --white:          #ffffff;
  --gray-50:        #f9fafb;
  --gray-100:       #f8fafc;
  --gray-200:       #e2e8f0;
  --gray-300:       #cbd5e1;
  --gray-400:       #94a3b8;
  --gray-500:       #64748b;
  --gray-600:       #475569;
  --gray-700:       #334155;
  --gray-800:       #1e293b;
  --sidebar-w:      250px;
  --header-h:       64px;
  --radius:         8px;
  --radius-lg:      12px;
  --radius-xl:      16px;
  --shadow:         0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition:     all .2s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; opacity: .4; }

/* ---- LAYOUT ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark) 0%, #0a1a32 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  overflow-y: auto;
  border-right: 1px solid rgba(21,101,192,.2);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-logo-img-wrap {
  width: 164px;
  height: 52px;
  background: white;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  flex-shrink: 0;
}
.sidebar-logo-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
/* Fallback texto — só aparece via JS (onerror) */
.sidebar-logo-fallback {
  display: none;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary);
  white-space: nowrap;
}
.sidebar-logo-fallback span { color: var(--accent); }

.sidebar-user {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary-light), #0d47a1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  color: white; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.15);
}
.sidebar-user .user-info .user-name {
  font-size: 13px; font-weight: 600; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}
.sidebar-user .user-info .user-type {
  font-size: 11px; color: var(--accent-light);
  font-weight: 500;
}

.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  padding: 14px 20px 5px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
  font-size: 13px; font-weight: 500;
}
.nav-item:hover {
  background: rgba(21,101,192,.2);
  color: white;
  border-left-color: var(--primary-light);
}
.nav-item.active {
  background: rgba(21,101,192,.25);
  color: white;
  border-left-color: var(--accent);
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item .nav-label { font-size: 13px; font-weight: 500; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 0;
  transition: var(--transition);
}
.sidebar-footer a:hover { color: white; }

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--header-h);
  background: white;
  border-bottom: 2px solid var(--gray-200);
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(6,14,28,.06);
}
.topbar-toggle {
  display: none;
  background: none; border: none;
  font-size: 20px; cursor: pointer; color: var(--gray-600);
}
.topbar-breadcrumb {
  flex: 1;
  font-size: 13px;
  color: var(--gray-500);
}
.topbar-breadcrumb strong { color: var(--gray-800); }
.topbar-breadcrumb a { color: var(--primary-light); text-decoration: none; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  width: 36px; height: 36px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray-600);
  text-decoration: none; position: relative;
  transition: var(--transition);
  font-size: 15px;
}
.topbar-btn:hover { background: #e8f0fe; color: var(--primary-light); border-color: var(--primary-light); }
.topbar-btn .badge-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid white;
}

/* ---- PAGE CONTENT ---- */
.page-content {
  padding: 24px;
  flex: 1;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-size: 22px; font-weight: 700;
  color: var(--gray-800);
}
.page-subtitle {
  font-size: 13px; color: var(--gray-500);
  margin-top: 2px;
}

/* ---- CARDS ---- */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, #f8fafc 0%, white 100%);
}
.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--gray-800);
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--primary-light); }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary-light);
  border-radius: 4px 0 0 4px;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: var(--primary-light); }
.stat-icon.green  { background: #d1fae5; color: var(--success); }
.stat-icon.orange { background: #ffedd5; color: var(--accent); }
.stat-icon.red    { background: #fee2e2; color: var(--danger); }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-info .stat-label { font-size: 12px; color: var(--gray-500); font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }
.stat-info .stat-value { font-size: 28px; font-weight: 800; color: var(--gray-800); line-height: 1.2; }
.stat-info .stat-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ---- FREIGHT CARDS ---- */
.freight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.freight-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
}
.freight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.freight-card-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  display: flex; align-items: center; justify-content: space-between;
}
.freight-card-header .freight-id { font-size: 11px; opacity: .6; }
.freight-card-body { padding: 16px; }
.freight-route {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.freight-route .city {
  flex: 1;
  font-size: 13px; font-weight: 600; color: var(--gray-800);
}
.freight-route .city span { display: block; font-size: 11px; font-weight: 400; color: var(--gray-500); }
.freight-route .arrow {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; flex-shrink: 0;
}
.freight-details {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.freight-detail-item { font-size: 12px; }
.freight-detail-item .label { color: var(--gray-400); display: block; }
.freight-detail-item .value { color: var(--gray-700); font-weight: 500; }
.freight-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.freight-value { font-size: 18px; font-weight: 700; color: var(--success); }
.freight-value small { font-size: 11px; font-weight: 400; color: var(--gray-400); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .3px;
}
.badge-open        { background: #dbeafe; color: #1d4ed8; }
.badge-negotiating { background: #fef3c7; color: #b45309; }
.badge-accepted    { background: #d1fae5; color: #065f46; }
.badge-transit     { background: #ede9fe; color: #5b21b6; }
.badge-completed   { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.badge-cancelled   { background: #fee2e2; color: #991b1b; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  text-decoration: none; transition: var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-primary { background: var(--primary-light); color: white; }
.btn-primary:hover { background: #0d47a1; box-shadow: 0 4px 12px rgba(21,101,192,.3); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #ea6c10; box-shadow: 0 4px 12px rgba(249,115,22,.3); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }
.btn-secondary { background: var(--gray-500); color: white; }
.btn-secondary:hover { background: var(--gray-600); }
.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn-outline-primary { background: transparent; border: 1px solid var(--primary-light); color: var(--primary-light); }
.btn-outline-primary:hover { background: var(--primary-light); color: white; }
.btn-icon { padding: 7px; min-width: 34px; justify-content: center; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--gray-600); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .5px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px; color: var(--gray-800);
  background: white;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(21,101,192,.1);
}
.form-control::placeholder { color: var(--gray-400); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.form-control.error { border-color: var(--danger); }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }

.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); flex: 1; border-right: none; }
.input-group .input-addon {
  padding: 9px 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--gray-500); font-size: 14px;
  display: flex; align-items: center;
}

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: linear-gradient(90deg, #f0f5ff 0%, var(--gray-100) 100%);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--primary);
  border-bottom: 2px solid var(--gray-200);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
tbody tr:hover td { background: #f5f8ff; }
tbody tr:last-child td { border-bottom: none; }

/* ---- ALERTS / FLASH ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-danger   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning  { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }
.alert-info     { background: #e0f2fe; color: #0c4a6e; border-left: 4px solid var(--info); }

/* ---- MAP ---- */
#freight-map { height: 300px; border-radius: var(--radius); overflow: hidden; }
.leaflet-container { font-family: 'Inter', sans-serif !important; }

/* ---- CHAT ---- */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--header-h) - 48px);
  gap: 0;
}
.chat-list {
  background: white;
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.chat-list-header {
  padding: 16px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px; font-weight: 600; color: var(--gray-800);
  position: sticky; top: 0; background: white; z-index: 2;
}
.chat-list-item {
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none; color: inherit;
}
.chat-list-item:hover { background: #f0f5ff; }
.chat-list-item.active { background: #e8f0fe; border-left-color: var(--primary-light); }
.chat-list-item.unread .chat-preview { font-weight: 600; }
.chat-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.chat-list-meta { flex: 1; min-width: 0; }
.chat-list-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.chat-preview { font-size: 12px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-time { font-size: 11px; color: var(--gray-400); }

.chat-window {
  display: flex; flex-direction: column;
  background: #f0f4fb;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  overflow: hidden;
}
.chat-window-header {
  padding: 14px 20px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 12px;
}
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-msg { display: flex; gap: 8px; max-width: 70%; }
.chat-msg.sent { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px; line-height: 1.5;
  position: relative;
}
.chat-msg.received .chat-bubble {
  background: white; color: var(--gray-800);
  border-radius: 4px 12px 12px 12px;
  box-shadow: var(--shadow);
}
.chat-msg.sent .chat-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 12px 4px 12px 12px;
}
.chat-time { font-size: 10px; opacity: .6; margin-top: 3px; text-align: right; }
.chat-input-area {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--gray-200);
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input-area textarea {
  flex: 1; resize: none;
  min-height: 40px; max-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
}
.chat-input-area textarea:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(21,101,192,.1); }

/* ---- PAGINATION ---- */
.pagination {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap; margin-top: 20px;
}
.page-btn {
  min-width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer; text-decoration: none;
  color: var(--gray-700);
  transition: var(--transition);
  background: white;
}
.page-btn:hover { background: #e8f0fe; color: var(--primary-light); border-color: var(--primary-light); }
.page-btn.active { background: var(--primary-light); color: white; border-color: var(--primary-light); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ---- FILTERS ---- */
.filter-bar {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filter-group { flex: 1; min-width: 140px; }
.filter-group label { margin-bottom: 4px; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; opacity: .5; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(6,14,28,.6);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px rgba(6,14,28,.3);
  max-width: 520px; width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95) translateY(10px);
  transition: transform .25s, opacity .25s;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, #f5f8ff 0%, white 100%);
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--gray-800); display: flex; align-items: center; gap: 8px; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--gray-400); transition: var(--transition); }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--gray-100);
}

/* ---- DETAIL SECTIONS ---- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.detail-item .detail-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--gray-400); margin-bottom: 4px;
}
.detail-item .detail-value {
  font-size: 15px; font-weight: 500; color: var(--gray-800);
}
.detail-item .detail-value.big {
  font-size: 22px; font-weight: 700; color: var(--success);
}

/* ---- CONTACT BOX ---- */
.contact-box {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(21,101,192,.3);
}
.contact-box h3 { font-size: 16px; margin-bottom: 8px; }
.contact-box p { font-size: 13px; opacity: .8; margin-bottom: 16px; }
.contact-phone {
  font-size: 24px; font-weight: 700;
  letter-spacing: 1px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* ---- SUPPORT ---- */
.ticket-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none; color: inherit;
  transition: var(--transition);
}
.ticket-item:hover { color: var(--primary-light); }
.ticket-item:last-child { border-bottom: none; }
.ticket-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

/* ---- OFFER CARDS ---- */
.offer-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: white;
  margin-bottom: 12px;
  transition: var(--transition);
}
.offer-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.offer-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.offer-driver { display: flex; align-items: center; gap: 10px; }
.offer-driver .driver-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 700;
}
.offer-value { font-size: 22px; font-weight: 700; color: var(--success); }

/* ---- NOTIFICATIONS DROPDOWN ---- */
.notif-dropdown {
  position: absolute; top: 44px; right: 0;
  width: 320px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px; font-weight: 600;
  display: flex; justify-content: space-between;
  background: linear-gradient(90deg, #f0f5ff, white);
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 12px;
  cursor: pointer; transition: var(--transition);
}
.notif-item:hover { background: var(--gray-100); }
.notif-item.unread { background: #f0f5ff; border-left: 3px solid var(--primary-light); }
.notif-item:last-child { border-bottom: none; }
.notif-title { font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.notif-msg { color: var(--gray-500); }
.notif-time { color: var(--gray-400); font-size: 11px; margin-top: 2px; }

/* ---- STEPS / PROGRESS ---- */
.steps-row {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 24px;
}
.step-item {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; position: relative;
}
.step-item::before {
  content: '';
  position: absolute; top: 14px; left: -50%; right: 50%;
  height: 2px; background: var(--gray-200); z-index: 0;
}
.step-item:first-child::before { display: none; }
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  z-index: 1; position: relative;
  color: var(--gray-500);
}
.step-item.done .step-dot { background: var(--success); color: white; }
.step-item.active .step-dot { background: var(--primary-light); color: white; box-shadow: 0 0 0 4px rgba(21,101,192,.2); }
.step-label { font-size: 11px; font-weight: 500; color: var(--gray-400); margin-top: 4px; }
.step-item.active .step-label, .step-item.done .step-label { color: var(--gray-700); }

/* ---- DIVIDERS ---- */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }

/* ---- PUBLIC / LANDING ---- */
.landing {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, #0d3b6e 100%);
  position: relative;
  overflow: hidden;
}
.landing::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231565c0' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.landing-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px;
  position: relative; z-index: 1;
}
.landing-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.landing-logo-img-wrap {
  height: 46px;
  width: 148px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  padding: 5px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.22);
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-logo-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.landing-logo-text {
  display: none;
  font-size: 22px; font-weight: 800;
  color: white; letter-spacing: 2px;
}
.landing-logo-text span { color: var(--accent); }
.landing-nav { display: flex; gap: 16px; align-items: center; }
.landing-nav a { color: rgba(255,255,255,.8); text-decoration: none; font-size: 14px; font-weight: 500; }
.landing-nav a:hover { color: white; }
.landing-hero {
  padding: 80px 40px 60px;
  text-align: center;
  position: relative; z-index: 1;
}
.landing-hero h1 {
  font-size: 52px; font-weight: 800;
  color: white; line-height: 1.2;
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.landing-hero h1 span { color: var(--accent-light); }
.landing-hero p {
  font-size: 18px; color: rgba(255,255,255,.75);
  max-width: 600px; margin: 0 auto 32px;
}
.landing-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-features {
  background: white;
  padding: 60px 40px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px; max-width: 1100px; margin: 0 auto;
}
.feature-item {
  text-align: center; padding: 28px 20px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.feature-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.feature-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: white; margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(21,101,192,.25);
}
.feature-item h3 { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 8px; }
.feature-item p { font-size: 13px; color: var(--gray-500); }

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, #0d3b6e 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative;
}
.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231565c0' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.auth-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(6,14,28,.35);
  width: 100%; max-width: 460px;
  overflow: hidden;
  position: relative; z-index: 1;
}
.auth-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 32px;
  text-align: center;
  border-bottom: 3px solid var(--accent);
}
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.auth-logo-img-wrap {
  width: 200px;
  height: 64px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
}
.auth-logo-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Fallback texto quando logo não carrega */
.auth-logo-text {
  display: none;
  font-size: 28px; font-weight: 800;
  color: white; letter-spacing: 3px;
}
.auth-logo-text span { color: var(--accent-light); }
.auth-subtitle { font-size: 13px; color: rgba(255,255,255,.65); margin-top: 4px; }
.auth-body { padding: 28px 32px 32px; }
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 10px;
  text-align: center; cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.auth-tab.active { color: var(--primary-light); border-bottom-color: var(--primary-light); }
.type-selector { display: flex; gap: 8px; margin-bottom: 16px; }
.type-btn {
  flex: 1; padding: 10px 8px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center; cursor: pointer;
  transition: var(--transition);
}
.type-btn:hover { border-color: var(--primary-light); background: #f0f5ff; }
.type-btn.active { border-color: var(--primary-light); background: #e8f0fe; }
.type-btn i { display: block; font-size: 22px; color: var(--primary-light); margin-bottom: 4px; }
.type-btn span { font-size: 12px; font-weight: 600; color: var(--gray-700); }

/* ---- FREIGHT STATUS TIMELINE ---- */
.freight-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0 4px;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  min-width: 80px;
}
.timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  z-index: 1; position: relative;
  border: 2px solid var(--gray-200);
  transition: var(--transition);
}
.timeline-step.done .timeline-dot {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.timeline-step.active .timeline-dot {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: white;
  box-shadow: 0 0 0 5px rgba(21,101,192,.15);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 5px rgba(21,101,192,.15); }
  50%       { box-shadow: 0 0 0 8px rgba(21,101,192,.08); }
}
.timeline-line {
  position: absolute;
  top: 18px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.timeline-line.done { background: var(--success); }
.timeline-label {
  font-size: 11px; font-weight: 600;
  color: var(--gray-400);
  margin-top: 8px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.timeline-step.active .timeline-label { color: var(--primary-light); }
.timeline-step.done  .timeline-label  { color: var(--success); }
.timeline-sub {
  font-size: 11px; color: var(--gray-500);
  margin-top: 3px; text-align: center;
  max-width: 100px;
  line-height: 1.3;
}

/* ---- PROFILE TABS ---- */
.profile-tab {
  padding: 10px 18px;
  font-size: 13px; font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  display: flex; align-items: center; gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}
.profile-tab:hover { color: var(--primary-light); }
.profile-tab.active { color: var(--primary-light); border-bottom-color: var(--primary-light); }

/* ---- STAT CARD accent bar color ---- */
.stat-card::before { background: var(--accent-left, var(--primary-light)); }

/* ---- SMOOTH FADE-IN for page content ---- */
.page-content { animation: fadeUp .25s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- ALERT BANNER (dismissible) ---- */
.alert { position: relative; }
.alert-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none;
  font-size: 16px; cursor: pointer; opacity: .5;
  color: inherit; padding: 0;
  transition: opacity .2s;
}
.alert-close:hover { opacity: 1; }

/* ---- TABLE ROW HIGHLIGHT for pending ---- */
tr.row-warning td { background: #fffbeb !important; }
tr.row-success td { background: #f0fdf4 !important; }

/* ---- UTILITIES ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-gray { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sep { color: var(--gray-300); }

/* ---- TOAST / ALERT ANIMATIONS ---- */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- URGENT FREIGHT CARD ---- */
.freight-card-urgent {
  border: 1.5px solid var(--warning) !important;
}
.freight-card-urgent .freight-card-header {
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}

/* ---- OFFER ROW ---- */
.offer-row { transition: background .15s; }
.offer-row:hover { background: var(--gray-50); }

/* ---- DRIVER AVATAR ---- */
.driver-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}

/* ---- FILTER CHIP / ACTIVE BADGE ---- */
.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-light); color: white;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.filter-chip .remove {
  cursor: pointer; opacity: .7; margin-left: 2px;
}
.filter-chip .remove:hover { opacity: 1; }

/* ---- PAGE FADE UP ANIMATION ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content { animation: fadeUp .3s ease; }

/* ---- PROFILE TABS ---- */
.profile-tabs {
  display: flex; gap: 2px;
  background: var(--gray-100);
  padding: 4px; border-radius: var(--radius-lg);
  margin-bottom: 20px; flex-wrap: wrap;
}
.profile-tab {
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: var(--gray-500); cursor: pointer;
  text-decoration: none; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.profile-tab:hover { background: white; color: var(--primary); }
.profile-tab.active {
  background: white; color: var(--primary);
  box-shadow: var(--shadow); font-weight: 600;
}

/* ---- FREIGHT STATUS TIMELINE ---- */
.freight-timeline {
  display: flex; align-items: flex-start;
  gap: 0; width: 100%;
  padding: 20px 0; position: relative;
}
.timeline-step {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; position: relative; min-width: 80px;
}
.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px; left: 50%; width: 100%; height: 2px;
  background: var(--gray-200); z-index: 0;
}
.timeline-step.done:not(:last-child)::after { background: var(--success); }
.timeline-step.active:not(:last-child)::after { background: var(--primary-light); }

.timeline-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; z-index: 1; position: relative;
  background: var(--gray-200); color: var(--gray-400);
  transition: var(--transition);
}
.timeline-step.done  .timeline-dot { background: var(--success); color: white; }
.timeline-step.active .timeline-dot {
  background: var(--primary-light); color: white;
  box-shadow: 0 0 0 4px rgba(21,101,192,.2);
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(21,101,192,.2); }
  50%       { box-shadow: 0 0 0 8px rgba(21,101,192,.08); }
}
.timeline-label {
  font-size: 11px; font-weight: 600; text-align: center;
  margin-top: 8px; color: var(--gray-500);
}
.timeline-step.done   .timeline-label { color: var(--success); }
.timeline-step.active .timeline-label { color: var(--primary); }
.timeline-sub { font-size: 10px; color: var(--gray-400); text-align: center; margin-top: 2px; }

/* ---- PROGRESS BAR ---- */
.progress-bar-wrap {
  background: var(--gray-200); border-radius: 99px;
  overflow: hidden; height: 8px;
}
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  transition: width .5s ease;
}

/* ---- CHAT TYPING INDICATOR ---- */
.typing-indicator {
  display: flex; gap: 4px; align-items: center; padding: 8px 12px;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gray-400);
  animation: typing-bounce .8s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar-toggle { display: flex; }
  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(6,14,28,.6);
    z-index: 99;
    display: none;
  }
  .sidebar-overlay.open { display: block; }
}
@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .freight-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 32px; }
  .landing-header { padding: 16px 20px; }
  .landing-hero { padding: 40px 20px; }
  .landing-features { padding: 40px 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .notif-dropdown { width: 280px; right: -60px; }
  .freight-timeline { gap: 0; }
  .timeline-step { min-width: 60px; }
  .timeline-label { font-size: 9px; }
  .timeline-sub { display: none; }
  .profile-tab { padding: 8px 12px; font-size: 12px; }
  .dfr-meta { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 26px; }
  .auth-card { border-radius: var(--radius-lg); }
  .auth-body { padding: 20px; }
}
