:root { --bg: #0b1015; --card: #121821; --text: #e9eef5; --muted: #a9b5c7; --accent: #4cc9f0; --accent2: #b5179e; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; background: var(--bg); color: var(--text); }
.container { max-width: 1200px; margin: 40px auto; padding: 0 16px; overflow: visible; }
h1 { font-weight: 700; letter-spacing: .3px; margin-bottom: 30px; }
h2 { font-weight: 600; margin-bottom: 20px; color: var(--text); }
h3 { font-weight: 500; margin-bottom: 10px; color: var(--text); }

/* Header styles */
.header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 40px; 
  flex-wrap: wrap; 
  gap: 20px; 
  padding: 30px 0; 
  border-bottom: 2px solid #1f2632; 
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.05), rgba(181, 23, 158, 0.05));
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 40px;
}
.header h1 { 
  margin-bottom: 0; 
  font-size: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Card styles */
.card { background: var(--card); padding: 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform 0.2s ease, box-shadow 0.2s ease; overflow: visible; }
.card:hover { transform: translateY(-2px); box-shadow: 0 15px 40px rgba(0,0,0,.5); }

/* Grid layouts */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* Card links */
.card-link { text-decoration: none; color: inherit; }
.card-link:hover { text-decoration: none; }

/* Main content section */
.main-content { margin-top: 20px; }
.main-content h2 { 
  font-size: 24px; 
  margin-bottom: 25px; 
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid #1f2632;
}

/* Card content */
.card-icon { font-size: 48px; text-align: center; margin-bottom: 15px; }
.card h2 { text-align: center; margin-bottom: 10px; font-size: 18px; }
.card p { text-align: center; color: var(--muted); margin-bottom: 0; }

/* Consignee folders section */
.consignee-grid { margin-top: 20px; }
.consignee-grid h2 { 
  font-size: 24px; 
  margin-bottom: 25px; 
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid #1f2632;
}

/* Folder cards */
.folder-card { 
  background: var(--card); 
  padding: 25px; 
  border-radius: 12px; 
  box-shadow: 0 10px 30px rgba(0,0,0,.4); 
  transition: transform 0.2s ease, box-shadow 0.2s ease; 
  border: 1px solid #1f2632;
}
.folder-card:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 20px 50px rgba(0,0,0,.6); 
  border-color: var(--accent);
}
.folder-icon { font-size: 36px; text-align: center; margin-bottom: 20px; }
.folder-card h3 { 
  text-align: center; 
  margin-bottom: 12px; 
  font-size: 18px; 
  font-weight: 600;
  color: var(--text);
}
.folder-address { 
  text-align: center; 
  color: var(--muted); 
  font-size: 14px; 
  margin-bottom: 20px; 
  line-height: 1.4;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.folder-actions { display: flex; gap: 10px; justify-content: center; }

/* Usage badge for document count */
.usage-badge {
  display: block;
  background: #FFC85B;
  color: #000;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin: 10px 15px 15px auto;
  text-align: center;
  min-width: 60px;
}

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 64px; margin-bottom: 20px; }
.empty-state h3 { margin-bottom: 10px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }

/* Form styles */
fieldset { border: 1px solid #1f2632; border-radius: 10px; margin: 16px 0; padding: 12px; }
legend { padding: 0 8px; color: var(--muted); }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--muted); }
input, textarea, select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #202736; background: #0e1420; color: var(--text); }
.actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Button styles */
button, .button { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; border: 0; padding: 10px 16px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; transition: opacity 0.2s ease; }
button:hover, .button:hover { opacity: 0.9; }
.button.small { padding: 8px 12px; font-size: 14px; }
.secondary { background: transparent; color: var(--muted); border: 1px solid #1f2632; }
.secondary:hover { background: #1f2632; color: var(--text); }

/* Documents header with filters */
.documents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.documents-header h2 {
  margin: 0;
}

.documents-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  padding: 8px 16px 8px 40px;
  border: 1px solid #1f2632;
  background: #0e1420;
  color: var(--text);
  border-radius: 6px;
  font-size: 14px;
  width: 250px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.2);
}

.search-input::placeholder {
  color: var(--muted);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid #1f2632;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(76, 201, 240, 0.1);
  color: var(--accent);
  border-color: var(--accent);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border-color: transparent;
}

/* Documents table */
.documents-table { 
  margin-top: 20px; 
  background: var(--card); 
  border-radius: 12px; 
  overflow: visible;
  border: 1px solid #1f2632;
}

.table-header { 
  display: grid; 
  grid-template-columns: 80px 1fr 200px 120px 2fr 200px; 
  gap: 15px; 
  padding: 15px 20px; 
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.1), rgba(181, 23, 158, 0.1)); 
  border-bottom: 1px solid #1f2632; 
  font-weight: 600; 
  font-size: 14px; 
  color: var(--text);
}

.document-row { 
  display: grid; 
  grid-template-columns: 80px 1fr 200px 120px 2fr 200px; 
  gap: 15px; 
  padding: 15px 20px; 
  border-bottom: 1px solid #1f2632; 
  transition: background-color 0.2s ease;
  min-height: 60px;
  align-items: center;
}

.document-row:hover { 
  background: rgba(76, 201, 240, 0.05); 
}

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

/* Column styles */
.col-bl { font-weight: 600; }
.bl-number { 
  color: var(--accent); 
  font-size: 16px; 
  font-weight: 700;
}

.col-bl .format-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.col-consignor { }
.consignor-name { 
  color: var(--text); 
  font-size: 14px; 
  font-weight: 500;
}

.col-ports { }
.port-route { 
  color: var(--muted); 
  font-size: 13px;
}

.col-weight { }
.weight-info { 
  color: var(--muted); 
  font-size: 13px;
}

.col-product { }
.product-info { 
  color: var(--text); 
  font-size: 14px; 
  font-weight: 300;
  line-height: 1.4;
}
.product-secondary { 
  color: var(--muted); 
  font-size: 14px; 
  font-weight: 400;
}

.col-actions { }
.action-buttons { 
  display: flex; 
  gap: 4px; /* Much smaller gap */
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
  justify-content: flex-start;
}

.download-group {
  display: flex;
  align-items: center;
  gap: 3px; /* Smaller gap */
  flex-wrap: nowrap;
  flex-shrink: 0; /* Prevent shrinking */
}

.btn-download, .btn-delete { 
  padding: 4px 8px; /* Much smaller padding */
  border-radius: 6px; 
  font-size: 11px; /* Smaller font */
  font-weight: 600; 
  text-decoration: none; 
  border: none; 
  cursor: pointer; 
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px; /* Smaller gap */
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  white-space: nowrap; /* Prevent text wrapping */
}

.btn-download { 
  background: linear-gradient(135deg, var(--accent), var(--accent2)); 
  color: white;
  min-width: 40px; /* Much smaller min-width */
  text-align: center;
  padding: 4px 8px;
}

.btn-download.docx {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}
.btn-download:hover { 
  opacity: 0.9; 
  transform: translateY(-1px);
}

.btn-download.pdf {
  background: linear-gradient(135deg, #ff6b6b, #e53e3e);
  color: white;
}

.btn-more { 
  background: transparent; 
  color: var(--muted); 
  border: 1px solid #1f2632; 
  font-size: 14px; /* Slightly smaller font */
  font-weight: bold;
  padding: 4px 8px; /* Smaller padding */
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 32px; /* Ensure consistent width */
  text-align: center;
  flex-shrink: 0; /* Prevent shrinking */
}
.btn-more:hover { 
  background: rgba(76, 201, 240, 0.1); 
  color: var(--accent); 
  border-color: var(--accent);
}

/* Dropdown styles - Complete rewrite for better positioning */
.dropdown {
  position: relative;
  display: inline-block;
  /* Create new stacking context */
  isolation: isolate;
  z-index: 1000;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card);
  border: 1px solid #1f2632;
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0,0,0,.5);
  min-width: 200px;
  z-index: 10000; /* Very high z-index */
  display: none;
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
  /* Force new stacking context */
  transform: translateZ(0);
  will-change: transform;
  /* Ensure it renders above everything */
  isolation: isolate;
}

.dropdown-menu.upward {
  top: auto;
  bottom: 100%;
}

/* Force dropdown to be above everything when visible */
/* Visibility and stacking when open is controlled via the 'open' class */
.dropdown.open .dropdown-menu {
  z-index: 999999;
}

/* Create proper stacking contexts */
.document-row {
  position: relative;
  /* Lower z-index for rows */
  z-index: 1;
}

/* When dropdown is open, elevate its container */
.dropdown.open {
  z-index: 10001 !important;
}

.dropdown.open .dropdown-menu {
  z-index: 10002 !important;
}

/* Ensure action buttons don't interfere */
.action-buttons {
  position: relative;
  z-index: 2; /* Higher than row but lower than dropdown */
}

/* Make sure containers don't clip dropdowns */
.documents-table {
  overflow: visible;
  position: relative;
  z-index: 1;
}

.card {
  overflow: visible;
  position: relative;
}

.container {
  overflow: visible;
}

.dropdown-item {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(76, 201, 240, 0.1);
  color: var(--accent);
}

.dropdown-item.danger {
  color: #ff6b6b;
}

.dropdown-item.danger:hover {
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
}

.dropdown-divider {
  margin: 4px 0;
  border: none;
  border-top: 1px solid #1f2632;
}

/* View Modal Styles */
.view-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.view-modal {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid #1f2632;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #1f2632;
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.1), rgba(181, 23, 158, 0.1));
  border-radius: 12px 12px 0 0;
}

.view-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
}

.view-body {
  padding: 20px;
}

.document-info {
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(76, 201, 240, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(76, 201, 240, 0.2);
}

.info-item {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.view-options h3 {
  margin: 0 0 15px 0;
  color: var(--text);
  font-size: 16px;
}

.view-buttons, .download-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.view-btn, .download-btn {
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 140px;
  justify-content: center;
}

.view-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}

.view-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.download-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid #1f2632;
}

.download-btn:hover {
  background: #1f2632;
  color: var(--accent);
}

.download-options h3 {
  margin: 0 0 15px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

/* Convert Modal Styles */
.convert-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.convert-modal {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid #1f2632;
}

.convert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #1f2632;
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.1), rgba(181, 23, 158, 0.1));
  border-radius: 12px 12px 0 0;
}

.convert-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.convert-body {
  padding: 20px;
}

.convert-info {
  margin-bottom: 25px;
}

.format-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(76, 201, 240, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(76, 201, 240, 0.2);
}

.current-format, .target-format {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.format-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.format-badge {
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
}

.format-badge.docx {
  background: linear-gradient(135deg, #4cc9f0, #2196f3);
  color: white;
}

.format-badge.pdf {
  background: linear-gradient(135deg, #ff6b6b, #e53e3e);
  color: white;
}

.convert-arrow {
  font-size: 24px;
  color: var(--accent);
  font-weight: bold;
}

.convert-details h3 {
  margin: 0 0 15px 0;
  color: var(--text);
  font-size: 16px;
}

.convert-details ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.convert-details li {
  margin-bottom: 8px;
  font-size: 14px;
}

.convert-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.convert-btn, .cancel-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 120px;
}

.convert-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}

.convert-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.cancel-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid #1f2632;
}

.cancel-btn:hover {
  background: #1f2632;
  color: var(--accent);
}

/* Responsive design for modals */
@media (max-width: 600px) {
  .view-modal, .convert-modal {
    width: 95%;
    margin: 10px;
  }
  
  .view-buttons, .download-buttons, .convert-actions {
    flex-direction: column;
  }
  
  .view-btn, .download-btn, .convert-btn, .cancel-btn {
    flex: none;
    width: 100%;
  }
  
  .format-info {
    flex-direction: column;
    gap: 15px;
  }
  
  .convert-arrow {
    transform: rotate(90deg);
  }
}

/* Format Section Styles for Enhanced View Modal */
.format-section, .download-section {
  background: var(--background);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.format-section h3, .download-section h3 {
  color: var(--accent);
  margin: 0 0 12px 0;
  font-size: 16px;
}

.format-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.format-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-width: 120px;
  justify-content: center;
}

.format-btn.docx-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}

.format-btn.pdf-btn {
  background: linear-gradient(135deg, #ff6b6b, #e53e3e);
  color: white;
}

.format-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  opacity: 0.9;
}

/* WhatsApp Modal Styles */
.whatsapp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.whatsapp-modal {
  background: var(--card-bg);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.whatsapp-header {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.whatsapp-header h2 {
  margin: 0;
  font-size: 18px;
}

.whatsapp-body {
  padding: 20px;
}

.document-summary {
  background: var(--background);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.document-summary h3 {
  margin: 0 0 10px 0;
  color: var(--accent);
}

.document-summary p {
  margin: 5px 0;
  font-size: 14px;
}

.contact-selection, .message-templates, .message-preview {
  margin-bottom: 20px;
}

.contact-selection label, .message-templates label, .message-preview label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.contact-selection select, .message-templates select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
}

.message-preview textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  resize: vertical;
  min-height: 120px;
}

.whatsapp-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-whatsapp:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

/* WhatsApp Contacts Page Styles */
.contacts-section {
  margin-top: 20px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.contact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.contact-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.contact-role {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.role-co-worker {
  background: #e3f2fd;
  color: #1976d2;
}

.role-client {
  background: #f3e5f5;
  color: #7b1fa2;
}

.role-supplier {
  background: #e8f5e8;
  color: #388e3c;
}

.role-other {
  background: #fff3e0;
  color: #f57c00;
}

.contact-details {
  margin-bottom: 15px;
}

.contact-phone, .contact-company, .contact-notes {
  margin: 8px 0;
  font-size: 14px;
  color: var(--muted);
}

.contact-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-test {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.btn-test:hover {
  opacity: 0.9;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.empty-state h3 {
  margin: 0 0 10px 0;
  color: var(--text);
}

.empty-state p {
  margin: 0 0 20px 0;
}

/* Modal Styles for Add Contact */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: var(--card-bg);
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.contact-form {
  padding: 20px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
}

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

.form-help {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Success Page Styles */
.success-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px;
  color: white;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bounce 1s ease-in-out;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.success-header h1 {
  margin: 0 0 10px 0;
  font-size: 32px;
  font-weight: 700;
}

.success-subtitle {
  margin: 0;
  font-size: 18px;
  opacity: 0.9;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.document-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.document-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.document-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.document-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  border-radius: 12px;
}

.document-info h3 {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.document-filename {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  font-family: 'Courier New', monospace;
}

.document-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-download, .btn-preview {
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-download {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 201, 240, 0.3);
}

.btn-preview {
  background: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-preview:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.quick-actions {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.quick-actions h3 {
  margin: 0 0 16px 0;
  color: var(--text);
  font-size: 18px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 201, 240, 0.3);
}

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

.btn-secondary:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.document-details {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.document-details h3 {
  margin: 0 0 16px 0;
  color: var(--text);
  font-size: 18px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 500;
  color: var(--muted);
}

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

.status-ready {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.navigation-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 32px;
}

.btn-nav {
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-nav:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-nav.secondary {
  background: var(--background);
  color: var(--muted);
}

.btn-nav.secondary:hover {
  background: var(--muted);
  color: white;
}

.tips-section {
  background: rgba(76, 201, 240, 0.05);
  border: 1px solid rgba(76, 201, 240, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.tips-section h4 {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-size: 16px;
}

.tips-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.tips-section li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Success Page Responsive */
@media (max-width: 768px) {
  .success-header {
    padding: 30px 15px;
    margin-bottom: 30px;
  }
  
  .success-header h1 {
    font-size: 24px;
  }
  
  .success-subtitle {
    font-size: 16px;
  }
  
  .documents-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 30px;
  }
  
  .document-card {
    padding: 20px;
  }
  
  .document-actions {
    flex-direction: column;
  }
  
  .btn-download, .btn-preview {
    width: 100%;
    justify-content: center;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .navigation-actions {
    flex-direction: column;
  }
  
  .btn-nav {
    width: 100%;
    justify-content: center;
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .table-header, .document-row { 
    grid-template-columns: 70px 1fr 150px 100px 1.5fr 180px; 
    gap: 10px; 
    padding: 12px 15px;
  }
}

@media (max-width: 900px) {
  .table-header, .document-row { 
    grid-template-columns: 1fr; 
    gap: 8px; 
    padding: 15px;
  }
  .table-header { display: none; }
  .document-row { 
    display: block; 
    margin-bottom: 15px; 
    border: 1px solid #1f2632; 
    border-radius: 8px;
  }
  .col-bl, .col-consignor, .col-ports, .col-weight, .col-product, .col-actions { 
    margin-bottom: 8px; 
  }
  .col-bl::before { content: "BL Number: "; font-weight: 600; color: var(--muted); }
  .col-consignor::before { content: "Consignor: "; font-weight: 600; color: var(--muted); }
  .col-ports::before { content: "Ports: "; font-weight: 600; color: var(--muted); }
  .col-weight::before { content: "Weight: "; font-weight: 600; color: var(--muted); }
  .col-product::before { content: "Product: "; font-weight: 600; color: var(--muted); }
  .col-actions::before { content: "Actions: "; font-weight: 600; color: var(--muted); }
  
  .download-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 8px;
  }
  
  .download-label {
    font-size: 12px;
  }
}

/* Flash messages */
.flash-item.error { color: #ff6b6b; }

/* Consignor Header Styles (when no logo) */
.consignee-header-section {
    margin-bottom: 40px; /* Two rows of space after underline */
}

.consignee-header-name {
    font-size: 17px; /* Base 12 + 5 */
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 5px;
}

.consignee-header-address {
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 0; /* No space between address and underline */
}

.consignee-header-underline {
    border: none;
    border-bottom: 1px solid #000;
    margin: 0 0 0 0; /* No margin - directly under address */
}

/* Responsive design */
@media (max-width: 760px) { 
  .grid-3, .grid-2 { grid-template-columns: 1fr; } 
  .header { flex-direction: column; align-items: stretch; }
  .header-actions { justify-content: center; }
  .folder-actions { flex-direction: column; }
  .documents-header { 
    flex-direction: column; 
    align-items: stretch; 
  }
  .documents-controls { 
    flex-direction: column; 
    align-items: stretch; 
    gap: 15px;
  }
  .search-input { 
    width: 100%; 
  }
  .filter-buttons { 
    justify-content: center; 
  }
}


