/* ================================
   BIMPEX - Bootstrap Enhanced Styles
   ================================ */

:root {
  --primary: #60a5fa;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --info: #22d3ee;
  --light: #f8fafc;
  --dark: #334155;
}

/* ================================
   Global Styles
   ================================ */

body {
  background-color: #f9fafb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* ================================
   Navbar
   ================================ */

.navbar {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: white !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
}

.navbar-brand .brand-icon {
  color: #ffffff;
}

.navbar-brand .brand-text {
  color: #ffffff;
}

.navbar-brand:before {
  content: '';
  font-size: 1.5rem;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8) !important;
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-links i {
  display: inline-block;
}

.nav-icon--dashboard {
  color: #eab308;
}

.nav-icon--clients {
  color: #0ea5e9;
}

.nav-icon--parcels {
  color: #f97316;
}

.nav-icon--departures {
  color: #10b981;
}

.nav-icon--statistics {
  color: #e11d48;
}

.nav-links a:hover {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.2);
}

/* ================================
   Dashboard Cards
   ================================ */

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.dashboard-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: white;
  text-decoration: none;
  color: inherit;
  padding: 2rem;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.dashboard-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.dashboard-card:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.dashboard-card .card-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
}

.dashboard-card .card-icon i {
  display: inline-block;
}

.card-icon--clients i {
  color: #0ea5e9;
}

.card-icon--parcels i {
  color: #f97316;
}

.card-icon--departures i {
  color: #10b981;
}

.card-icon--statistics i {
  color: #e11d48;
}

.dashboard-card .card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #212529;
  margin: 0;
}

/* ================================
   Clients Grid (Compact Display)
   ================================ */

.clients-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 2px solid #bfdbfe;
  border-radius: 0.5rem;
  overflow-x: auto;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.1);
  margin-top: 1.5rem;
}

.clients-grid-header {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr) minmax(0, 1.4fr) 170px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid #bfdbfe;
  color: #334155;
}

.client-grid-row {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr) minmax(0, 1.4fr) 170px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border-bottom: 1px solid #e0f2fe;
  align-items: center;
  transition: all 0.2s ease;
}

.client-grid-row:hover {
  background-color: #f0f9ff;
  border-left: 3px solid #60a5fa;
  padding-left: calc(1rem - 3px);
}

.client-grid-row:last-child {
  border-bottom: none;
}

.client-col-name {
  font-weight: 500;
  color: #334155;
  word-break: break-word;
  min-width: 0;
}

.client-col-phone {
  color: #64748b;
  font-family: monospace;
  min-width: 0;
}

.client-col-country {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #475569;
  font-weight: 500;
  min-width: 0;
}

.client-col-region {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #475569;
  font-weight: 500;
  min-width: 0;
}

.country-name,
.region-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.client-col-country .country-name {
  display: none;
}

.region-emoji {
  font-size: 1rem;
  line-height: 1;
}

.flag-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.flag-icon .flag-svg {
  width: 1.2em;
  height: 0.8em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.client-col-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.whatsapp-link {
  color: #25d366;
}

.clients-empty {
  padding: 2rem;
  text-align: center;
  color: #6c757d;
}

/* ================================
   Parcels Grid (Compact Display)
   ================================ */

.parcels-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 2px solid #bfdbfe;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.1);
  margin-top: 1rem;
}

.parcels-grid-header {
  display: grid;
  grid-template-columns: 0.6fr 1.2fr 1.2fr 1fr 0.8fr 100px;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  font-weight: 600;
  font-size: 0.75rem;
  border-bottom: 2px solid #bfdbfe;
  color: #334155;
}

.parcel-grid-row {
  display: grid;
  grid-template-columns: 0.6fr 1.2fr 1.2fr 1fr 0.8fr 100px;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  background-color: #ffffff;
  border-bottom: 1px solid #e0f2fe;
  align-items: center;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  line-height: 1.2;
}

.parcel-grid-row:hover {
  background-color: #f0f9ff;
  border-left: 3px solid #60a5fa;
  padding-left: calc(1rem - 3px);
}

.parcel-grid-row:last-child {
  border-bottom: none;
}

.parcel-col-id {
  font-weight: 500;
  color: #64748b;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.parcel-col-sender,
.parcel-col-recipient,
.parcel-col-info,
.parcel-col-status,
.parcel-col-actions {
  color: #334155;
  font-size: inherit;
  word-break: break-word;
}

.parcel-col-info {
  color: #64748b;
}

.parcel-col-status {
  text-align: center;
}

.parcel-col-actions {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.parcels-grid .badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.35rem;
}

.parcels-grid .btn-icon {
  padding: 0.2rem;
  font-size: 0.85rem;
}

.qr-scanner-content {
  width: min(92vw, 520px);
}

.qr-video-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.qr-video-wrap #qr-video-feed {
  width: 100%;
  height: 100%;
}

.qr-video-wrap video,
.qr-video-wrap canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-manual-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.qr-manual-row .form-control {
  flex: 1;
}

.qr-error {
  color: #ef4444;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.parcels-empty {
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

/* ================================
   Departures Grid (Compact Display)
   ================================ */

.departures-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 2px solid #bfdbfe;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.1);
  margin-top: 1rem;
}

.departures-grid-header {
  display: grid;
  grid-template-columns: 0.5fr 1fr 0.8fr 1fr 0.8fr 0.6fr 100px;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid #bfdbfe;
  color: #334155;
}

.departure-grid-row {
  display: grid;
  grid-template-columns: 0.5fr 1fr 0.8fr 1fr 0.8fr 0.6fr 100px;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border-bottom: 1px solid #e0f2fe;
  align-items: center;
  transition: all 0.2s ease;
}

.departure-grid-row:hover {
  background-color: #f0f9ff;
  border-left: 3px solid #60a5fa;
  padding-left: calc(1rem - 3px);
}

.departure-grid-row:last-child {
  border-bottom: none;
}

.departure-col-id {
  font-weight: 500;
  color: #64748b;
}

.departure-col-date,
.departure-col-plate {
  color: #64748b;
  font-family: monospace;
  font-size: 0.9rem;
}

.departure-col-driver {
  color: #334155;
}

.departure-col-status {
  text-align: center;
}

.departure-col-parcels {
  text-align: center;
  color: #64748b;
}

.departure-col-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.departures-empty {
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

/* ================================
   Tables
   ================================ */

.data-table {
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-top: 1.5rem;
}

.data-table thead {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.data-table thead th {
  font-weight: 600;
  color: #495057;
  padding: 1rem;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.data-table tbody td {
  padding: 1rem;
  vertical-align: middle;
}

.data-table tbody tr {
  border-bottom: 1px solid #dee2e6;
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
  background-color: #f8f9fa;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

/* ================================
   Buttons
   ================================ */

.btn {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: #60a5fa;
  color: white;
}

.btn-primary:hover {
  background-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

.btn-success {
  background-color: #34d399;
  color: white;
}

.btn-success:hover {
  background-color: #10b981;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.4);
}

.btn-danger {
  background-color: #f87171;
  color: white;
}

.btn-danger:hover {
  background-color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.4);
}

.btn-secondary {
  background-color: #94a3b8;
  color: white;
}

.btn-secondary:hover {
  background-color: #64748b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: all 0.2s ease;
  color: #60a5fa;
}

.btn-icon:hover {
  color: #3b82f6;
  transform: scale(1.15);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* ================================
   Modals
   ================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: min(95vw, 1400px);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  border-bottom: 2px solid #cbd5e1;
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-weight: 600;
  color: #334155;
  font-size: 1.3rem;
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: #334155;
}

.modal-body {
  padding: 2rem;
  background-color: #ffffff;
}

.modal-footer {
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  border-top: 2px solid #cbd5e1;
  border-radius: 0 0 0.75rem 0.75rem;
  padding: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ================================
   Forms
   ================================ */

.form-label {
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  display: block;
}

.form-control,
.form-select {
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem 0.875rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  background-color: #f8fafc;
}

.form-control:focus,
.form-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
  background-color: #ffffff;
  outline: none;
}

.form-control:disabled,
.form-select:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-container {
  margin-top: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ================================
   Articles List (Compact Table Layout)
   ================================ */

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow: hidden;
}

.articles-list.has-custom-type .articles-header {
  grid-template-columns: 0.8fr 0.8fr 100px 100px 70px;
}

.articles-list.has-custom-type .article-row {
  grid-template-columns: 0.8fr 0.8fr 100px 100px 70px;
}

.articles-list:not(.has-custom-type) .articles-header {
  grid-template-columns: 1.5fr 100px 100px 70px;
}

.articles-list:not(.has-custom-type) .article-row {
  grid-template-columns: 1.5fr 100px 100px 70px;
}

.articles-header {
  display: grid;
  padding: 0.75rem;
  background-color: #f8f9fa;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid #dee2e6;
  gap: 0.75rem;
}

.article-row {
  display: grid;
  padding: 0.75rem;
  background-color: white;
  border-bottom: 1px solid #f0f0f0;
  align-items: start;
  gap: 0.75rem;
}

.article-row:last-child {
  border-bottom: none;
}

.article-col-type {
  display: flex;
  flex-direction: column;
}

.article-col-specify {
  display: flex;
  flex-direction: column;
}

.article-col-weight,
.article-col-volume {
  display: flex;
  align-items: flex-start;
}

.article-col-actions {
  display: flex;
  justify-content: center;
  align-items: start;
}

.articles-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-weight: 600;
  color: #334155;
}

.articles-total-value {
  color: #0f766e;
  font-weight: 700;
}

.form-control-sm {
  height: 36px;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
}

/* Article type select with visible dropdown arrow */
.article-type {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 28px;
  cursor: pointer;
  background-color: #f0f9ff;
  border-color: #bae6fd;
}

.article-type:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2360a5fa' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* ================================
   Cards
   ================================ */

.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  border-bottom: 2px solid #cbd5e1;
  border-radius: 0.75rem 0.75rem 0 0;
  font-weight: 600;
  padding: 1rem;
  color: #334155;
}

.card-body {
  padding: 1.5rem;
}

/* ================================
   Page Header
   ================================ */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.page-header .btn {
  white-space: nowrap;
}

/* ================================
   Search Container
   ================================ */

.search-container {
  flex: 1;
  min-width: 250px;
}

.search-container input[type="search"] {
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
  padding: 0.75rem 0.875rem;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
}

.search-container input[type="search"]:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
  outline: none;
}

/* ================================
   Images & Media
   ================================ */

.id-scan-img-detail {
  max-width: 100%;
  max-height: 300px;
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
  object-fit: contain;
  margin-top: 1rem;
}

#id-scan-preview,
video {
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
  background-color: #000;
  max-width: 100%;
}

.camera-view-container {
  position: relative;
  margin-top: 1rem;
  padding: 1rem;
  background-color: #000;
  border-radius: 0.5rem;
  text-align: center;
}

.camera-controls {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

#id-scan-preview-container {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  text-align: center;
}

#id-scan-preview-container.hidden {
  display: none;
}

/* ================================
   Alerts
   ================================ */

.alert {
  border: none;
  border-radius: 0.5rem;
  border-left: 4px solid;
  padding: 1rem;
  margin-bottom: 1rem;
}

.alert-success {
  background-color: #d1e7dd;
  border-left-color: #10b981;
  color: #0f5132;
}

.alert-danger {
  background-color: #f8d7da;
  border-left-color: #ef4444;
  color: #842029;
}

.alert-warning {
  background-color: #fff3cd;
  border-left-color: #ffc107;
  color: #664d03;
}

.alert-info {
  background-color: #cfe2ff;
  border-left-color: #0dcaf0;
  color: #084298;
}

/* ================================
   Details Modal
   ================================ */

.details-modal-content {
  padding: 0;
}

.detail-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #dee2e6;
  font-size: 0.95rem;
  line-height: 1.5;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #495057;
  margin-right: 1rem;
  display: inline-block;
  min-width: 120px;
}

.detail-value {
  color: #212529;
}

/* ================================
   Statistics
   ================================ */

.stats-summary {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 2rem 0;
}

.stat-item {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
  min-width: 150px;
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #3b82f6;
}

.stat-label {
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

/* ================================
   Utilities
   ================================ */

.text-muted {
  color: #6c757d !important;
  font-size: 0.875rem;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.d-block { display: block !important; }
.hidden { display: none !important; }

.container {
  width: min(95vw, 1300px);
  margin: 0 auto;
  padding: 0 1rem;
}

hr {
  border: none;
  border-top: 1px solid #dee2e6;
  margin: 1.5rem 0;
}

/* ================================
   Actions Cell
   ================================ */

.actions-cell {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
}

/* ================================
   Responsive
   ================================ */

@media (max-width: 768px) {
  .navbar {
    padding: 1rem 0.5rem;
  }

  .navbar-brand {
    font-size: 1.4rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header .btn,
  .search-container {
    width: 100%;
  }

  .dashboard {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-card {
    padding: 1.5rem;
    min-height: 150px;
  }

  .data-table {
    font-size: 0.875rem;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 0.75rem 0.5rem;
  }

  .modal-content {
    width: 95%;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .stats-summary {
    flex-direction: column;
  }

  .stat-item {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .navbar-brand {
    font-size: 1.2rem;
  }

  .dashboard-card .card-title {
    font-size: 1.1rem;
  }

  .dashboard-card .card-icon {
    font-size: 2.5rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* ================================
   Print Styles
   ================================ */

@media print {
  .navbar,
  .btn,
  .page-header {
    display: none;
  }
}


#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    color: #2c3e50;
}

/* Navbar */
.navbar {
    background-color: #2c3e50; /* Dark blue-gray */
    color: #ecf0f1; /* Light gray text */
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-family: 'Arial Black', Gadget, sans-serif; 
    font-size: 2rem; 
    font-weight: bold; 
    color: #ecf0f1;
    text-decoration: none;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.nav-links li {
    margin-left: 15px; 
}

.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex; 
    align-items: center; 
    gap: 0.4em; 
}

.nav-links a:hover, .nav-links a.active {
    background-color: #3498db; /* Primary blue */
    color: #fff;
}

/* Page Header for buttons and search */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 1rem; /* Space between button and search */
}

.page-header .btn {
    flex-shrink: 0; /* Prevent button from shrinking */
}


/* Search Container and Input */
.search-container {
    flex-grow: 1; /* Allow search to take available space */
    min-width: 250px; /* Minimum width for search bar */
}

.search-container input[type="search"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-container input[type="search"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}


/* Dashboard Cards */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.dashboard-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px 25px; 
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    min-height: 180px; 
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.card-icon {
    font-size: 3rem;
    color: #3498db; 
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.6rem; 
    margin-bottom: 0; 
    color: #2c3e50;
    text-transform: uppercase; 
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background-color: #3498db; 
    color: white;
    font-weight: 500;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:hover {
    background-color: #f1f1f1;
}

.actions-cell button {
    margin-right: 5px;
}
.actions-cell button:last-child {
    margin-right: 0;
}


/* Status Badges */
.status-pending, .status-scheduled {
    background-color: #f39c12; /* Orange */
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}
.status-in-transit, .status-en-route { 
    background-color: #3498db; /* Blue */
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}
.status-delivered, .status-completed {
    background-color: #2ecc71; /* Green */
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}
.status-cancelled, .status-delayed {
    background-color: #e74c3c; /* Red */
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}


/* Buttons */
.btn {
    padding: 10px 18px;
    font-size: 0.95rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    text-decoration: none;
    display: inline-flex; /* To align icon and text if button has icon */
    align-items: center;
    gap: 0.5em;
    font-weight: 500;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: #3498db; 
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9; 
}

.btn-secondary {
    background-color: #7f8c8d; 
    color: white;
}

.btn-secondary:hover {
    background-color: #6c7a7b;
}

.btn-danger {
    background-color: #e74c3c; 
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b; 
}

.btn-success {
    background-color: #2ecc71; 
    color: white;
}

.btn-success:hover {
    background-color: #27ae60; 
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    color: #3498db;
    line-height: 1; /* Ensure icons align well */
}
.btn-icon:hover {
    color: #2980b9;
}

.btn-icon i {
    color: inherit;
}

.btn-icon .bi-telephone-fill { color: #0ea5e9; }
.btn-icon:hover .bi-telephone-fill { color: #0284c7; }

.btn-icon .bi-info-circle { color: #3b82f6; }
.btn-icon:hover .bi-info-circle { color: #2563eb; }

.btn-icon .bi-pencil { color: #f59e0b; }
.btn-icon:hover .bi-pencil { color: #d97706; }

.btn-icon .bi-trash { color: #ef4444; }
.btn-icon:hover .bi-trash { color: #dc2626; }

.btn-icon .bi-download { color: #6366f1; }
.btn-icon:hover .bi-download { color: #4f46e5; }

.client-col-actions .whatsapp-link,
.client-col-actions .whatsapp-link .bi {
  color: #25d366 !important;
}

.client-col-actions .whatsapp-link:hover,
.client-col-actions .whatsapp-link:hover .bi {
  color: #1ebe57 !important;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}


/* Forms */
.form-container {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%; /* Changed to 100% to use box-sizing */
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box; /* Added for better width management */
}

.form-group input[type="file"] {
    padding: 8px; /* Specific padding for file input */
}


.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ID Scan Specific Styles */
.id-scan-preview-container {
    margin-top: 10px;
    max-width: 200px; /* Limit preview size */
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 4px;
}
.id-scan-preview-container.hidden {
    display: none;
}
#id-scan-preview {
    max-width: 100%;
    height: auto;
    display: block;
}

.id-scan-img-detail {
    max-width: 100%;
    max-height: 200px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-top: 5px;
}


/* Camera View Styles */
.camera-view-container {
    position: fixed; /* Or absolute if modal itself handles fixed positioning */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1005; /* Higher than modal overlay */
    padding: 15px;
    box-sizing: border-box;
}
.client-form-modal-content .camera-view-container { /* If nested in form modal */
    position: absolute;
    border-radius: 8px; /* Match modal */
}


#camera-video-feed {
    max-width: 100%;
    max-height: 70vh; /* Adjust as needed */
    border-radius: 4px;
    border: 2px solid #fff;
    background-color: #000; /* Fallback for empty video */
}
.camera-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}


/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px; 
    box-sizing: border-box;
}

.modal-content {
    background-color: white;
    padding: 20px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: min(95vw, 1200px);
    z-index: 1001;
    max-height: 90vh; 
    overflow-y: auto; 
    position: relative;
}
.client-form-modal-content { /* Specific for client form if needed for camera view */
    /* max-width: 600px; */ /* Example if camera view needs more space */
}


.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.4rem; 
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #888;
}
.modal-close-btn:hover {
    color: #333;
}

/* Client Details Modal Specific Styles */
.details-modal-content {
    padding: 10px 0;
}
.detail-item {
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.5;
    display: flex; 
    flex-wrap: wrap;
    /* align-items: center; -- Removed as flags are gone */
}
.detail-label {
    font-weight: 500;
    color: #555;
    margin-right: 8px;
    flex-shrink: 0; 
}
.detail-value {
    color: #333;
    word-break: break-word; 
    /* display: inline-flex; -- Removed as flags are gone */
    /* align-items: center; -- Removed as flags are gone */
}


/* Statistics Page Specific */
.stats-summary {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background-color: #ecf0f1;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    min-width: 150px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 0.9rem;
    color: #555;
    margin-top: 5px;
}


/* Utility classes */
.text-center {
    text-align: center;
}
.mt-1 { margin-top: 1rem !important; } 
.mb-1 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* Flag Styles Removed */
/* .flag-emoji no longer needed */


/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar-brand {
        margin-bottom: 10px; 
    }
    .nav-links {
        margin-top: 10px;
        flex-direction: column;
        width: 100%;
    }
    .nav-links li {
        margin-left: 0;
        margin-bottom: 5px;
        width: 100%;
    }
    .nav-links a {
        display: block;
        padding: 0.75rem;
        text-align: left; 
    }
    .dashboard {
        grid-template-columns: 1fr; 
    }
    .dashboard-card {
        min-height: 150px; 
        padding: 25px 20px;
    }
    .card-title {
        font-size: 1.4rem; 
    }
    .page-header {
        flex-direction: column; 
        align-items: stretch; 
    }
    .page-header .btn, .page-header .search-container {
        width: 100%;
        margin-bottom: 10px; 
    }
    .search-container {
        min-width: unset; 
    }
    .data-table {
        display: block; 
        overflow-x: auto; 
        white-space: nowrap; 
        font-size: 0.9rem;
    }
    .data-table th, .data-table td {
        padding: 10px 12px;
    }
    .actions-cell button {
        padding: 6px 8px;
        font-size: 1rem; 
    }
    .modal-content {
        padding: 15px;
        max-width: 95%; /* More screen space on mobile for modal */
    }
    .modal-title {
        font-size: 1.2rem;
    }
    .form-actions {
        flex-direction: column; 
    }
    .form-actions button {
        width: 100%;
    }
    .form-actions button:not(:last-child) {
        margin-bottom: 10px;
    }
    .stats-summary {
        flex-direction: column;
        align-items: stretch;
    }
    .stat-item {
        width: auto; 
    }

    #camera-video-feed {
        max-height: 60vh; /* Adjust for smaller screens */
    }
    .camera-view-container {
        padding:10px;
    }

}

@media (max-width: 480px) {
    .card-title {
        font-size: 1.3rem;
    }
    .dashboard-card {
        padding: 20px;
        min-height: 120px; 
    }
    .container {
        width: 95%;
        padding: 15px;
    }
}

/* ================================
   Client Search Autocomplete
   ================================ */
.client-search-wrapper {
  position: relative;
}

.client-search-wrapper .form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  min-height: 1.5rem;
}

.client-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.client-option {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color 0.15s ease-in-out;
  background-color: #fff;
}

.client-option:hover {
  background-color: #f0f0f0;
}

.client-option.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.client-option.disabled::after {
  content: " x";
  color: #dc3545;
  font-weight: 700;
}

.client-option:last-child {
  border-bottom: none;
}

.client-option strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.client-option em {
  font-size: 0.875rem;
  color: #6c757d;
  font-style: normal;
}

/* ================================
   Parcel Form - Button Groups & Layout
   ================================ */

.button-group-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.button-group-flex .btn {
  flex: 1;
  min-width: 110px;
  white-space: normal;
  word-wrap: break-word;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

#parcel-form {
  width: 100%;
}

#parcel-form .form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  min-height: 1.5rem;
}

#parcel-form .row {
  display: flex;
  margin-right: -0.5rem;
  margin-left: -0.5rem;
  flex-wrap: wrap;
}

#parcel-form .row > [class*='col-'] {
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  display: flex;
  flex-direction: column;
}

#parcel-form .row > [class*='col-'] > .form-label {
  order: -1;
}

#parcel-form fieldset {
  overflow-x: hidden;
  overflow-y: visible;
}

#parcel-form fieldset legend {
  margin-bottom: 1rem;
  padding-left: 0;
  padding-right: 0;
}

.delivery-city-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  position: relative;
  z-index: 6;
}

.delivery-city-row .form-select {
  flex: 1;
  min-width: 0;
}

.delivery-city-row .add-city-btn {
  flex: 0 0 48px;
}

.recipient-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  position: relative;
  z-index: 6;
}

.recipient-row .form-control {
  flex: 1;
  min-width: 0;
}

.recipient-row .add-city-btn {
  flex: 0 0 48px;
}

.parcel-delivery-row {
  align-items: stretch;
}

.parcel-delivery-fieldset {
  overflow: visible;
  position: relative;
  z-index: 5;
}

.delivery-detail-field {
  height: 52px;
  min-height: 52px;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

textarea.form-control.delivery-detail-field {
  height: 52px;
  min-height: 52px;
  resize: none;
  line-height: 1.4;
  overflow: hidden;
}

.add-city-btn {
  min-width: 48px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}

.add-city-btn i {
  font-size: 1.1rem;
}

#parcel-articles-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
}

#parcel-articles-container .row {
  margin-left: -0.375rem;
  margin-right: -0.375rem;
}

#parcel-articles-container .row > [class*='col-'] {
  padding-left: 0.375rem;
  padding-right: 0.375rem;
}

/* Responsive adjustments for parcel form */
@media (max-width: 1024px) {
  .modal-content {
    max-width: 95%;
  }

  .button-group-flex .btn {
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
  }
}

@media (max-width: 768px) {
  .modal-content {
    max-width: 100%;
    width: 98%;
    max-height: 95vh;
  }

  .button-group-flex .btn {
    min-width: 90px;
    font-size: 0.75rem;
    padding: 0.5rem 0.5rem;
  }

  #parcel-form .row > [class*='col-'] {
    padding-right: 0.25rem;
    padding-left: 0.25rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-header {
    padding: 1rem;
  }

  #parcel-form fieldset {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  #parcel-form fieldset legend {
    font-size: 0.9rem;
  }
}

/* ================================
   Field Type Color Coding
   ================================ */

/* Client fields - Blue */
#client-form .form-control:focus,
#client-form .form-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.2);
}

/* Parcel fields - Green */
#parcel-form .form-control:focus,
#parcel-form .form-select:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 0.2rem rgba(52, 211, 153, 0.2);
}

/* Departure fields - Orange/Amber */
#departure-form .form-control:focus,
#departure-form .form-select:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 0.2rem rgba(251, 191, 36, 0.2);
}

/* Search fields - Cyan */
.search-container input[type="search"]:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 0.2rem rgba(34, 211, 238, 0.2);
}

/* Sender/Recipient fields - Teal */
#parcel-sender-input:focus,
#parcel-recipient-input:focus,
.parcel-sender-input:focus,
.parcel-recipient-input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.2);
}

/* Weight/Volume fields - Purple */
.article-weight:focus,
.article-volume:focus,
.article-col-weight input:focus,
.article-col-volume input:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 0.2rem rgba(167, 139, 250, 0.2);
}

/* Custom Type field - Rose */
#parcel-form [name*="customType"]:focus,
.parcel-custom-type-input:focus {
  border-color: #f472b6;
  box-shadow: 0 0 0 0.2rem rgba(244, 114, 182, 0.2);
}

/* ================================
   Login
   ================================ */

.login-main {
  padding: 0;
  min-height: 100vh;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 3rem 3.5rem;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #60a5fa 100%);
}

.login-brand:before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
}

.login-brand:after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0));
}

.login-brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-tag {
  background: rgba(255, 255, 255, 0.18);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.login-title {
  margin-top: 2.5rem;
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.login-lead {
  margin-top: 1rem;
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 520px;
  position: relative;
  z-index: 1;
}

.login-highlights {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.login-highlight {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: rgba(15, 23, 42, 0.22);
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-highlight-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.login-highlight-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.login-highlight-text {
  font-size: 0.9rem;
  opacity: 0.9;
}

.login-footnote {
  margin-top: 2.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

.login-form-panel {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
}

.login-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  padding: 2.5rem;
  width: min(420px, 100%);
}

.login-form-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
}

.login-form-header p {
  margin: 0 0 1.6rem;
  color: #64748b;
}

.login-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.login-password-field {
  position: relative;
}

.login-password-field .form-control {
  padding-right: 90px;
}

.login-password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.login-password-toggle:hover {
  background: #cbd5e1;
}

.login-submit {
  width: 100%;
  margin-top: 0.4rem;
}

.login-note {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #ecf0f1;
  font-weight: 500;
}

.nav-role {
  margin-left: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-logout-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ecf0f1;
  border: none;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.nav-logout-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.compact-line {
  display: none;
}

.compact-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-muted {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
}

.compact-flag {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 1024px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 2.5rem;
  }

  .login-form-panel {
    padding: 2.5rem 1.5rem;
  }
}

@media (max-width: 640px) {
  .login-brand {
    padding: 2rem 1.5rem;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-brand-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-tag {
    align-self: flex-start;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: 0.5rem;
  }
}

/* ================================
   Mobile Tables (Card Layout)
   ================================ */

@media (max-width: 768px) {
  .clients-grid,
  .parcels-grid,
  .departures-grid {
    border: none;
    box-shadow: none;
    background: transparent;
    gap: 0.75rem;
  }

  .clients-grid-header,
  .parcels-grid-header,
  .departures-grid-header {
    display: none;
  }

  .client-grid-row,
  .parcel-grid-row,
  .departure-grid-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "line1 line1"
      "line2 actions";
    gap: 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  }

  .client-grid-row:hover,
  .parcel-grid-row:hover,
  .departure-grid-row:hover {
    border-left: 4px solid #60a5fa;
    padding-left: 0.75rem;
  }

  .compact-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
  }

  .client-compact-line.line-1,
  .parcel-compact-line.line-1,
  .departure-compact-line.line-1 {
    grid-area: line1;
    font-weight: 600;
  }

  .client-compact-line.line-2,
  .parcel-compact-line.line-2,
  .departure-compact-line.line-2 {
    grid-area: line2;
  }

  .client-col-name,
  .client-col-country,
  .client-col-phone,
  .parcel-col-id,
  .parcel-col-sender,
  .parcel-col-recipient,
  .parcel-col-info,
  .parcel-col-status,
  .departure-col-id,
  .departure-col-date,
  .departure-col-plate,
  .departure-col-driver,
  .departure-col-status,
  .departure-col-parcels {
    display: none;
  }

  .client-grid-row > .client-col-actions,
  .parcel-grid-row > .parcel-col-actions,
  .departure-grid-row > .departure-col-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    grid-area: actions;
    align-self: center;
  }

  .client-col-actions .btn-icon,
  .parcel-col-actions .btn-icon,
  .departure-col-actions .btn-icon {
    padding: 0.35rem;
    font-size: 1rem;
  }

  .parcel-col-status,
  .departure-col-status,
  .departure-col-parcels {
    text-align: left;
  }
}





