@import url('colors.css');

/* ===== Global ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Content ===== */
.content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* ✅ Allow natural content flow - no height restrictions */
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.content-title {font-weight: 700; color: #2d3748; }


body {
  display: flex;
   min-height: 100vh;  
  background: var(--color-bg-light);
  color: #333;
  /* overflow: hidden; /* stop body scroll */
}

.table-scroll table {
  width: 100%;
  table-layout: auto; /* Columns take width based on content */
}

.table-scroll th, .table-scroll td {
  white-space: nowrap; /* Prevent text wrapping */
  padding: 8px 12px;
  text-align: left;
}

/* text of table */

.sub-text {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: #6c757d;
  margin-top: 3px;
  max-width: 150px; /* optional, adjust as needed */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-text-full {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: #6c757d;
  margin-top: 3px;
  max-width: 150px; /* optional, adjust as needed */
  white-space: nowrap;
}

.text {
  font-weight: 500;       /* medium weight */
  font-size: 14px;        /* control the font size */
  line-height: 1.3;       /* control spacing between lines if wrapped */
  margin-bottom: 4px;     /* space between city and address */
  color: #2d3748;         /* optional: dark grey for city */
}

.address-container {
  display: inline-block;        /* shrink to fit content */
  max-width: 200px;             /* maximum width */
  padding: 2px 6px;             /* smaller inner spacing */
  font-size: 12px;               /* smaller font */
  color: #fff;                  /* text color */
  background-color: #727F9F;    /* background color */
  border-radius: 4px;           /* rounded corners */
  white-space: nowrap;          /* prevent text wrap */
  overflow: hidden;             /* hide overflow text */
  text-overflow: ellipsis;      /* show “…” if text is too long */
}

.status-container {
  display: inline-block;        /* shrink to fit content */
  max-width: 200px;             /* maximum width */
  padding: 2px 6px;             /* smaller inner spacing */
  font-weight: 500;       /* medium weight */
  font-size: 13px;              /* smaller font */              /* text color */
  border-radius: 4px;           /* rounded corners */
  white-space: nowrap;          /* prevent text wrap */
  overflow: hidden;             /* hide overflow text */
  text-overflow: ellipsis;      /* show “…” if text is too long */
}

.count-container {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background-color: var(--color-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  color: white;
}

.circle-green {
  background-color: #28a745; /* green */
}

.circle-red {
  background-color: #dc3545; /* red */
}

.circle-yellow {
  background-color: #ffc107; /* yellow */
  color: #000; /* black text for contrast */
}

/* Status colors */
.status-livre { background-color: #48bb78; color: #fff;}      /* green */
.status-Paied { background-color: #48bb78; color: #fff;}      /* green */
.status-Not-Paied { background-color: #0000; color: #000;}      /* green */
.status-retourne { background-color: #c53030; color: #fff;}   /* dark red */
.status-en-cours { background-color: #4299e1; color: #fff;}   /* blue */
.status-injoignable { background-color: #f56565; color: #fff;} /* red */
.status-reporte { background-color: #9f7aea; color: #fff;}    /* violet */
.status-annule { background-color: #c53030; color: #fff;}     /* dark red */
.status-refuse { background-color: #f56565; color: #fff;}     /* red */
.status-demande-retour { background-color: #667eea; color: #fff;} /* purple */
.status-relance { background-color: #9f7aea; color: #fff;}    /* violet */
.status-Non-Reçu { background-color: #718096; color: #fff;} /* gray */
.status-Reçu { background-color: #38b2ac; color: #fff;}    /* teal */

/* button on table style */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px; /* space between rows */
}

.btn-row {
  display: flex;
  gap: 6px; /* space between buttons */
}

.action-buttons button {
  width: 26px;       /* button width */
  height: 26px;      /* button height */
  font-size: 12px;   /* icon size */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-btn { background-color: #17a2b8; }    /* blue */
.delete-btn { background-color: #dc3545; }  /* red */
.return-btn { background-color: #6c757d; }    /* grey */
.info-btn { background-color: #747474; } /* yellow  f06c60*/

.tool-btn {
  background-color: #f0f0f0; /* light gray background */
  border: none;
  border-radius: 5px;
  padding: 6px 10px;
  cursor: pointer;
  margin-right: 5px;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}

.tool-btn i {
  pointer-events: none; /* make sure icon doesn't block clicks */
}

/* Hover effects */
.tool-btn:hover {
  background-color: #007bff; /* blue on hover */
  color: white;
}

/* Optional: different color for PDF */
.tool-btn.pdf:hover {
  background-color: #dc3545; /* red for PDF */
}

/* Optional: different color for XLS */
.tool-btn.xls:hover {
  background-color: #28a745; /* green for XLS */
}

.tool-btn.print10:hover {
  background-color: #a112f3; /* orange/yellow */
}

.tool-btn.delete {
  color: #cf2828; 
}

.tool-btn.delete:hover {
  background-color: #cf2828; 
  color: #fff;
}

.trash-icon {
  color: rgb(192, 14, 14);       /* make the icon visible */
}

.add-order-btn.no-underline {
    text-decoration: none; /* removes underline */
    display: inline-flex; /* keeps icon and text aligned */
    align-items: center;
}


/* ####### Ticket Style ###### */

/* ####### End Ticket Style ###### */


/* ===== Content ===== */
.content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content-header {
  display: flex;          /* make it a flex row */
  align-items: center;    /* vertically center */
  justify-content: space-between; /* push buttons to the right */
  gap: 20px;              /* optional spacing */
}

/* Header buttons container */
.header-buttons {
  display: flex;
  gap: 12px;            /* space between buttons */
  margin-left: auto;     /* pushes the buttons to the right */
}

/* Add Order Button (existing style) */
.add-order-btn {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: #fff;
  padding: 7px 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: all 0.2s;
}

.add-order-btn:hover {
  transform: translateY(-2px);
}

/* Back Button */
.back-btn {
  background: #d7dbe0;
  color: #495057;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.back-btn:hover {
  transform: translateY(-2px);
  background: #d6d6d6;
}


/* Make checkbox look nice */
input[type="checkbox"] {
  accent-color: var(--color-primary); /* modern browsers (Chrome, Edge, Firefox) */
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* For older browsers that don't support accent-color */
input[type="checkbox"]:checked {
  background-color: var(--color-primary);
  border-color: #007bff;
}

.multi-select-dropdown {
  position: relative; /* keep toggle aligned */
}

.multi-select-dropdown .dropdown-toggle {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}


.multi-select-dropdown .dropdown-menu {
  position: fixed; /* <-- change from absolute to fixed */
  top: auto;       /* we’ll set dynamically in JS */
  left: auto;      /* we’ll set dynamically in JS */
  width: 200px;    /* optional fixed width */
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  display: none;
  z-index: 9999;
  padding: 8px;
}

.multi-select-dropdown.active .dropdown-menu {
  display: block;
}

.multi-select-dropdown .dropdown-menu label {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
}

.multi-select-dropdown .dropdown-menu input {
  margin-right: 8px;
}



/* Filter Button */
.filter-btn {
  background: #d7dbe0;
  color: #495057;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.filter-btn:hover {
  transform: translateY(-2px);
  background: #d6d6d6;
}

/* Filter Modal */
.filter-modal {
  position: fixed;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none; 
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.filter-modal.active {
  display: flex;
}

.filter-modal-content {
  background: #fff;
  padding: 0;
  border-radius: 12px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.filter-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #495057;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #6c757d;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s;
}

.close-btn:hover {
  background: #e9ecef;
  color: #495057;
}

/* Updated filter form with proper grid */
.filter-form {
  padding: 30px;
  position: relative;
}

.filter-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

/* Make commentaire span full width */
.form-group.commentaire {
  grid-column: span 3;
}

.form-group.commentaire textarea {
  padding: 12px 15px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical; /* user can resize vertically only */
  min-height: 60px;
  max-height: 200px;
}

/* Top-right small dialog */
.top-right-dialog {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  padding: 15px;
  display: none; /* hidden by default */
  z-index: 5000;
  animation: slideIn 0.3s ease-out;
  font-family: sans-serif;
}

.top-right-dialog .dialog-content p {
  margin-bottom: 12px;
  font-weight: 500;
  font-size: 14px;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-buttons .apply-btn {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.dialog-buttons .action-yes {
  background-color: #dc3545;
  color: #fff;
  border: none;
}

.dialog-buttons .action-no {
  background-color: #6c757d;
  color: #fff;
  border: none;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
  }

.filter-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  padding: 12px 15px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  background: #fff;
  color: #495057;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #f49d1a;
  box-shadow: 0 0 0 3px rgba(224, 88, 39, 0.1);
}

.form-group select {
  cursor: pointer;
}

/* Apply button - centered below the grid */
.apply-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  width: fit-content;
}

.apply-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

/* ===== Table ===== */
.table-container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 0 18px 2px var(--color-shadow);
  border: 1px solid #f1f3f4;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* keep horizontal scroll just for table */
.table-scroll {
  overflow-x: auto;   /* horizontal scroll */
  overflow-y: hidden; /* no vertical scroll inside table */
}



table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1200px; /* keeps big tables scrollable */
  table-layout: auto; /* let columns expand naturally */
}

/* striped rows */
tbody tr:nth-child(even) {
  background: var(--color-bg-light);
}
tbody tr:nth-child(odd) {
  background: #ffffff;
}

thead th, tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f4;
  text-align: left;
  white-space: nowrap;
}

thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  border-bottom: 2px solid #e9ecef;
  color: #495057;
  background: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 2;
}

tbody tr:hover { background: #e9ecef; transition: 0.2s; }

/* import-colis.css */

/* Container */
.content {
  padding: 20px;
}

.content-header {
  margin-bottom: 20px;
}

.content-title {
  font-size: 28px;
  margin-bottom: 5px;
}

.content-subtitle {
  font-size: 16px;
  color: #555;
}


/* Close Button */
.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* Save Orders Button */
.save-btn-container {
  margin-top: 15px;
  text-align: right;
}



/* ===== Footer Pagination ===== */
.table-footer {
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border-top: 1px solid #f1f3f4;
  flex-shrink: 0;
}

.rows-selector { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  font-size: 14px; 
}

.rows-selector select {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  background: #fff;
}

.status-container {
    cursor: pointer; /* Show hand cursor on hover */
}

.status-container:hover {
    background-color: var(--color-primary); /* Light highlight on hover */
    color: #fff;
    transition: background-color 0.2s;
}

/* Make modal table fit modal width */
/* Make modal content take needed width, not fixed */
#LogStatusModal .filter-modal-content {
    width: auto;           /* let content define width */
    max-width: 75%;        /* max width so it fits viewport */
    min-width: 300px;      /* optional: prevent too small */
    overflow-x: visible;   /* no horizontal scroll */
}

/* Table should fit modal, wrap text */
#LogStatusModal .table {
    width: 100%;           /* expand to modal width */
    table-layout: auto;    /* let columns size naturally */
    border-collapse: collapse;
}

/* Table headers and cells */
#LogStatusModal .table th,
#LogStatusModal .table td {
    white-space: normal;      /* allow wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 8px;
    vertical-align: top;
    text-align: left;    
}


/* Optional: style headers */
#LogStatusModal .table thead th {
    background-color: #f0f0f0;
    text-align: left;
}

/* Optional: make modal body scroll vertically if too tall */
#LogStatusModal #modal-log-body {
    max-height: 60vh; /* adjust height */
    overflow-y: auto;
    padding: 10px 0;
}



.pagination button {
  padding: 6px 10px;
  margin-left: 2px;
  margin-right: 2px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  min-width: 32px;
  text-align: center;
}

.pagination button.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.pagination button.arrow {
  font-weight: bold;
  font-size: 14px;
}

.pagination button:hover:not(.active) {
  background: #cfcfcf;
}


/* Modal overlay */
.modal.fade {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  overflow: auto;
}

/* Modal container */
.modal-dialog {
  background: #fff;
  border-radius: 10px;
  max-width: 800px;
  width: 90%;
  margin: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

/* Modal header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #dee2e6;
}

/* Close button */
.btn-close {
  background: none;
  border: none;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
}

/* Modal body */
.modal-body {
  padding: 20px;
  overflow-x: auto; /* for tables */
}

/* Scrollable table inside modal */
.modal-body table {
  width: 100%;
  border-collapse: collapse;
}

.modal-body table th,
.modal-body table td {
  padding: 8px;
  border: 1px solid #dee2e6;
  text-align: center;
}


/* ===== Scrollbar Custom ===== */
.main::-webkit-scrollbar {
  width: 8px;
}
.main::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.main::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}
.main::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

/* ===== RESPONSIVE MEDIA QUERIES ===== */
/* Tablet/Laptop (max-width: 900px) → 2 columns */
@media screen and (max-width: 900px) {
  .filter-form-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .filter-modal-content {
    width: 95%;
    max-width: 600px;
  }
  
  .filter-form {
    padding: 20px;
  }
}

/* Mobile (max-width: 600px) → 1 column */
@media screen and (max-width: 600px) {
  
  .action-buttons {
    flex-direction: row;  /* single row for all buttons */
    flex-wrap: wrap;      /* allow wrapping if too many buttons */
    gap: 6px;
  }

  .btn-row {
    display: contents; /* remove individual rows so all buttons flow in one line */
  }

  .action-buttons button {
    width: 35px;  /* keep them small circles */
    height: 35px;
    font-size: 14px; /* slightly larger icon */
  }

  .filter-form-grid {
    grid-template-columns: 1fr !important;
  }
  
  .filter-modal-content {
    width: 95%;
    max-width: 400px;
  }
  
  .filter-form {
    padding: 15px;
  }
  
  .filter-header {
    padding: 15px 20px;
  }
  
  .content-header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .header-buttons {
    margin-left: 0;
    justify-content: right;
  }
}

/* Modal Base */
.facture-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 5000;
}


/* Modal Content */
.facture-modal-content {
  background: #fff;
  border-radius: 12px;
  width: 480px;
  max-width: 90%;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Header */
.facture-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.facture-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #555;
}

/* Form */
.facture-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 6px;
  color: #444;
}

.form-group input,
.form-group select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* Button */
.generate-btn {
  margin-top: 20px;
  width: 100%;
  background:  var(--color-primary);
  color: white;
  padding: 10px 0;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.generate-btn:hover {
  background: var(--color-primary-dark);
}

.add-order-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

.time-text {
  color: #9E9E9E;
  font-size: 12px;
}

/* wornning text order.html */
.table-info-line {
  background: #ffffff;
  border-left: 4px solid #ff9914;
  padding: 6px 14px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-demo {
  display: flex;
  gap: 6px;
}

.status-btn {
  padding: 5px 12px;
  border-radius: 20px;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
}

/* Encours = blue */
.status-en-cours {
  background-color: #007bff;
}

/* Livré = green */
.status-livre {
  background-color: #28a745;
}

.drop-item{
    padding:10px 14px;
    cursor:pointer;
    font-size:14px;
}
.drop-item:hover{
    background:#f3f3f3;
}

/* scan-reception.html > drop down btn */
.more-btn{
    width:34px;
    height:34px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#f49d1a;
    border:none;
    border-radius:4px;
    cursor:pointer;
    color:#fff;
    font-size:16px;
    transition:all .2s ease;
    box-shadow:0 2px 6px rgba(0,0,0,.15);
}

.more-btn:hover{
    background:#c94c20;
    transform:translateY(-1px);
}

.more-btn:active{
    transform:scale(.96);
}

.more-btn i{
    pointer-events:none;
}


/* scan-reception.html > icon drop down */
.drop-item {
    display:flex;
    align-items:center;
    padding:10px 14px;
    cursor:pointer;
    font-size:14px;
    color:#333;
    transition:background .2s;
}

.drop-item i {
    margin-right:8px;
    color:#555;
}

.drop-item:hover {
    background:#f3f3f3;
}

/* scan-reception.html > select livreur modal */
.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:10000;
}

.modal-box{
    width:380px;
    background:#fff;
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 8px 25px rgba(0,0,0,.2);
}

.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:14px 16px;
    border-bottom:1px solid #eee;
}

.modal-header h3{
    margin:0;
    font-size:16px;
}

.modal-header button{
    border:none;
    background:none;
    font-size:22px;
    cursor:pointer;
}

#livreurSearch{
    width:calc(100% - 20px);
    margin:10px;
    padding:8px 10px;
    border:1px solid #ddd;
    border-radius:6px;
}

#livreursList{
    max-height:300px;
    overflow-y:auto;
}

.livreur-item{
    padding:12px 14px;
    border-bottom:1px solid #f0f0f0;
    cursor:pointer;
}

.livreur-item:hover{
    background:#f7f7f7;
}

.livreur-item strong{
    display:block;
    font-size:14px;
}

.livreur-item small{
    color:#777;
}



.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-box {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-header button:hover {
    color: #333;
}

#livreurSearch {
    margin: 15px 20px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: calc(100% - 40px);
    box-sizing: border-box;
}

#livreurSearch:focus {
    outline: none;
    border-color: #f49d1a;
}

#livreursList {
    flex: 1;
    overflow-y: auto;
    margin: 0 20px 20px;
    border: 1px solid #eee;
    border-radius: 6px;
    max-height: 400px;
}

.drop-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.drop-item:hover {
    background: #f5f5f5;
}

.drop-item:not(:last-child) {
    border-bottom: 1px solid #eee;
}

#changeLivreurBtn:hover {
    background: #5a6268;
}

#confirmAssignBtn:hover {
    background: #218838;
}

#confirmAssignBtn:disabled {
    background: #94d3a2;
    cursor: not-allowed;
}


.lang-switch button {
  background: none;
  border: none;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 8px;
}

body.rtl {
  direction: rtl;
}

body.rtl .drawer {
  right: 0;
  left: auto;
}

body.rtl .topbar {
  flex-direction: row-reverse;
}

/* Drawer overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 998;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile/Tablet drawer */
@media (max-width: 1024px) {
  .drawer {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
  }
  
  .drawer.open {
    transform: translateX(0);
  }
}

/* Hide topbar when drawer is open on mobile/tablet */
@media (max-width: 1024px) {
  .drawer.open ~ .main .topbar {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
}

/* Default collapsed */
.address-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Expanded row */
.order-row.expanded .address-cell {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}
