/* Reset & base styles */
body {
    margin: 0;
    font-family: sans-serif;
    color: #333;
  }
  
  /* Navbar */
  .navbar {
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    display: flex;
    align-items: center;
    z-index: 1000;
  }
  
  .navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .logo {
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    text-decoration: none;
  }
  
  .nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
  }
  
  .nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
  }
  
  .nav-links a:hover {
    text-decoration: underline;
  }
  
  /* Main layout */
  #content {
    display: flex;
    height: calc(100vh - 50px); /* subtract navbar height */
    margin-top: 50px; /* push below navbar */
  }
  
  #map {
    flex: 3;
  }

  #map-controls {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    gap: 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
  }

  .priority-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
  }

  .priority-toggle input {
    width: 16px;
    height: 16px;
    cursor: pointer;
  }

  .priority-toggle input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
  }

  .priority-toggle:has(input:disabled) {
    opacity: 0.65;
  }
  
  #sidebar {
    width: 360px;
    flex: 0 0 360px;
    overflow-y: auto;
    border-left: 1px solid #ccc;
    padding: 10px;
    padding-top: 30px;
    background: #fafafa;
    transition: width 0.2s ease, padding 0.2s ease, flex-basis 0.2s ease;
  }

  #content.sidebar-collapsed #sidebar {
    width: 0;
    flex-basis: 0;
    padding-left: 0;
    padding-right: 0;
    border-left: none;
    overflow: hidden;
  }

  .sidebar-toggle-btn {
    position: fixed;
    top: 60px;
    right: 12px;
    z-index: 1200;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.96);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  }

  .sidebar-toggle-btn:hover {
    background: #f3f6fa;
  }
  
  /* Order cards */
  .order {
    border: 1px solid #ccc;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    background: white;
    transition: background 0.2s ease, border-color 0.2s ease;
  }
  
  .order:hover {
    background: #f9f9f9;
  }
  
  .highlight {
    background-color: #f0f8ff;
    border-color: #007bff;
  }
  

  .welcome-container {
    margin-top: 70px; /* account for navbar */
    text-align: center;
    padding: 40px;
  }
  
  #uploadStatus {
    margin-top: 20px;
    font-weight: bold;
    color: green;
  }
  

  .order {
    padding: 9px;
    margin: 5px 4px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
  }

  .order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    gap: 8px;
    line-height: 1.25;
  }

  .order-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .order-card-col {
    display: grid;
    gap: 5px;
  }

  .order-card-col > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
  }

  .order-key {
    display: inline;
    font-size: 11px;
    color: #666;
    margin-bottom: 0;
    line-height: 1.2;
    white-space: nowrap;
  }

  .order-value {
    display: inline;
    font-size: 12px;
    line-height: 1.25;
    color: #222;
    margin-left: 0;
    text-align: left;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .order.highlight-ongoing .order-key,
  .order.highlight-rejected .order-key {
    color: rgba(255, 255, 255, 0.8);
  }

  .order.highlight-ongoing .order-value,
  .order.highlight-rejected .order-value {
    color: #fff;
  }
  
  .order:hover {
    background: #f0f0f0;
  }
  
  .order.highlight-approved {
    background: #ffeb3b; /* yellow */
    border-color: #fbc02d;
  }
  
  .order.highlight-rejected {
    background: #8b0000; /* dark red */
    color: #fff;
    border-color: #5a0000;
  }
  
  .order.highlight-ongoing {
    background: #015c16; /* dark green */
    color: #fff;
    border-color: #043b13;
  }

  .status-label {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  }

  .status-approved {
    color: #0d47a1;
  }

  .status-rejected {
    color: #b71c1c;
  }

  .status-pending {
    color: #1b5e20;
  }

  .priority-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #8a1f11;
    background: #ffe0b2;
    border: 1px solid #ffb74d;
  }

  .deprioritized-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #37474f;
    background: #e0e0e0;
    border: 1px solid #9e9e9e;
  }

  #sidebar .status-label {
    font-size: 10px;
    padding: 1px 5px;
  }
  


  /* Styling for our tooltip to look popup-like */
.leaflet-tooltip.order-tooltip {
    background: #fff;
    color: #222;
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    padding: 8px 10px;
    border-radius: 6px;
    min-width: 200px;
    max-width: 340px;
    white-space: normal;
    font-size: 13px;
  }
  
  /* Remove default tooltip arrow if you prefer */
  .leaflet-tooltip.order-tooltip::before {
    display: none;
  }
  
  /* Optional inner styling */
  .order-tooltip-content strong { display: block; margin-bottom: 4px; font-size: 14px; }
  .maps-button {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    border: 1px solid #1e88e5;
    border-radius: 4px;
    color: #1e88e5;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
  }

  .maps-button:hover {
    background: #e3f2fd;
  }

  .road-badge {
    display: inline-block;
    margin: 4px 0 6px 0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
  }

  .road-ok {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #81c784;
  }

  .road-missing {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
  }

  .map-legend {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    padding: 8px 10px;
    line-height: 1.35;
    font-size: 12px;
  }

  .legend-title {
    font-weight: 700;
    margin-bottom: 4px;
  }

  .legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
  }

  .legend-approved { background: #1e88e5; }
  .legend-pending { background: #43a047; }
  .legend-rejected { background: #e53935; }

  .legend-note {
    margin-top: 4px;
    color: #444;
  }
  
