* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #05080d;
  color: #f5f5f5;
  font-family: Arial, sans-serif;
}

.dashboard {
  display: grid;
  grid-template-columns:  1.0fr 1.4fr;
  height: 100vh;
  padding: 24px;
  gap: 24px;
  overflow:hidden
}

.map-panel,
.data-panel {
  background: #05080d;
}

.top-kpis {
  display: grid;
  grid-template-columns: 0.9fr 0.6fr 1.1fr 1.1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.top-kpis > div:not(:first-child) {
    text-align: center;
}

.top-kpis > div:first-child {
    text-align: center;
}

h1, h2, h3 {
  margin: 0;
}

.top-kpis h1 {
  font-size: 28px;
}

.top-kpis h2 {
  font-size: 28px;
}

.top-kpis span {
  color: #888;
  font-size: 13px;
}

#map {
  height: calc(100vh - 130px);
  width: 100%;
  border-left: 1px solid #333;
  border-right: 1px solid #333;
}
/*
.updated {
  position: absolute;
  left: 40px;
  bottom: 20px;
  color: #40a9ff;
  font-size: 13px;
  font-weight: bold;
}

.updated {
  color: #40a9ff;
  font-size: 13px;
  font-weight: bold;
}*/

.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 10px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

select {
  margin-top: 8px;
  background: #080c13;
  color: white;
  border: 1px solid #777;
  padding: 10px;
  border-radius: 4px;
}

.leaflet-control-attribution {
    font-size: 8px;
    opacity: 0.5;
}

.charts {
  display: grid;
  grid-template-columns: 1fr 1.4fr; 
  gap: 28px;
  height: 100%;
  min-height: 0;
  margin-bottom: 0px;
  overflow: hidden;
}

.charts > div {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.charts h3 {
  margin-bottom: 6px;
  font-size:16px;
  margin-top: 6px;
}
/*
.charts canvas {
  margin-top: 10px;
  width: 95% !important;
  height: calc(100% - 0px) !important;
  max-height: 270px !important;
  display: block;
}


*/

.chart-box {
  min-height:0;
  height: 100%;
}


.echart-box {
  width: 100%;
  height: 100%;
}

.department-scroll {
  height: 270px;
  overflow: hidden;
}
/*
.table-box {
  width: 100%;
  min-width: 0;
  overflow: auto;
  padding-top: 10px;
}*/

table.dataTable {
  background: #05080d;
  color: white;
  font-size: 13px;
}

table.dataTable thead th {
  color: #ccc;
  border-bottom: 1px solid #0077cc;
}

table.dataTable tbody tr:nth-child(even) {
  background: #15191f;
}

table.dataTable tbody tr:nth-child(odd) {
  background: #090d12;
}

.leaflet-container {
  background: #05080d;
}

.leaflet-popup-content-wrapper {
  background: #111820;
  color: white;
}

.data-panel {
  display: grid;
  grid-template-rows: 60px 400px 1fr;
  height: 100%;
  overflow: hidden;
}

.table-box {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding-top: 6px;
}

#auctionTable {
  width: 100% !important;
  table-layout: auto;
  white-space: nowrap;
  
}

.dataTables_scrollHeadInner {
  margin: 0 auto !important;
}

.dataTables_scrollHeadInner table,
#auctionTable {
  margin: 0 auto !important;
}

#auctionTable th,
#auctionTable td {
  margin: 0 auto;
  width: max-content;
  padding: 6px 10px;
  font-size: 14px;
  white-space: nowrap;
}

/*
table = new DataTable("#auctionTable", {
  paging: false,
  searching: false,
  info: false,
  scrollX: true,
  scrollY: "260px",
  autoWidth: false,
  order: [[7, "desc"]]
}); */

/*
.table-box::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-box::-webkit-scrollbar-track {
    background: #05080d;
}

.table-box::-webkit-scrollbar-thumb {
    background: #2b3440;
    border-radius: 6px;
} */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #05080d;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.20);
}

/*

.district-scroll {
    width: 100%;
    overflow-y: hidden;
    overflow-x: auto;
}



.district-scroll canvas {
    height: 600px !important;
}

*/

.department-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.district-scroll {
  width: 100%;
  height: 400px;
  overflow-y: hidden;
  overflow-x: auto;
}

.department-scroll canvas {
  width: 100% !important;
  height: var(--dep-chart-height) !important;
  max-height: none !important;
  display: block;
}

/* PopUp */

.leaflet-popup-content-wrapper {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.leaflet-popup-content {
  margin: 0;
}

.leaflet-popup-tip {
  background: #c0392b;
}

.auction-popup {
  width: 260px;
  background: #b8c6d1;
  color: #111;
  border-radius: 12px;
  padding: 14px;
  font-size: 11px;
  position: relative;
}

.popup-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.popup-badge {
  display: inline-block;
  background: #86bad8;
  font-size: 9px;
  padding: 3px 6px;
  margin-bottom: 8px;
}

.popup-body {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.popup-img {
  width: 115px;
  height: 105px;
  object-fit: cover;
  border-radius: 8px;
}

.popup-line {
  border-top: 1px solid rgba(0,0,0,.25);
  margin: 12px 0;
}

.popup-address {
  font-size: 10px;
  line-height: 1.4;
}

.leaflet-popup-close-button {
  color: #222 !important;
  font-size: 18px !important;
  padding: 8px !important;
}

.auction-popup.dark {
  background: #111827;
  color: white;
}

.auction-popup.dark .popup-line {
  border-top: 1px solid rgba(255,255,255,.25);
}

.leaflet-popup-close-button {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;

  color: #2b2929 !important; /* red X */
  font-size: 18px !important;
  font-weight: 700 !important;

  top: 12px !important;
  right: 12px !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
}

/*
.leaflet-popup-close-button span {
  display: none !important;
}*/

/* Highlight rows based on map point */

#auctionTable tbody tr.dimmed-row td {
  opacity: 0.25;
}

#auctionTable tbody tr.selected-row td {
  opacity: 1;
  background: rgba(77, 163, 255, 0.22) !important;
}

.footer-bar {
  position: static;
  left: 40px;
  bottom: 20px;

  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 5px; 
}

.map-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 4px 8px;
  margin-left: auto;
  position: relative;

  right: 0px;
  bottom: 0px;
  z-index: 999;

  background: transparent;
  color: #9aa4b2;
  border: 1px solid #1f8f4d;
  border-radius: 5px;


  font-size: 10px;
  font-weight: 600;

  cursor: pointer;
  opacity: 0.9;
  transition: all 0.15s ease;
}

.map-export-btn:hover {
    background: #08381e;
    border-color: #0ecc63;
    transform: translateY(-1px);
    opacity: 1;
}

.excel-icon {
    background: #107c41;
    color: white;
    font-size: 7px;
    padding: 2px 2px;
    border-radius: 5px;
}

.alert-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 4px 8px;


  background: transparent;
  color: #9aa4b2;

  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 5px;

  font-size: 10px;
  font-weight: 500;

  cursor: pointer;
  transition: all 0.15s ease;
}

.alert-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #fbbf24;
  transform: translateY(-1px);
}

.alert-btn:active {
  transform: translateY(0);
}


.view-toggle {
  display: none;
}

.updated {
  position:static;
  color: #9ca3af;
  font-size: 8px;
  font-weight: 600;
  padding-top:5px;
}

.description-cell {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}

/* Alert Modal */

/*
.alert-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.alert-modal.active {
  display: flex;
}

.alert-modal-content {
  width: 440px;
  max-width: 92%;
  background: linear-gradient(180deg, #111827 0%, #0b1220 100%);
  color: #e5e7eb;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.alert-modal-content h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: #f9fafb;
}

#alertPreview {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  padding: 14px 16px;
}

#alertPreview p {
  margin: 9px 0;
  font-size: 13px;
  color: #cbd5e1;
}

#alertPreview strong {
  color: #f8fafc;
  font-weight: 600;
}

.alert-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.alert-modal-actions button {
  padding: 8px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

#cancelAlertBtn {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

#cancelAlertBtn:hover {
  background: rgba(148, 163, 184, 0.08);
}

#saveAlertBtn {
  background: #0f2f66;
  color: #ffffff;
  border: 1px solid #3b82f6;
}

#saveAlertBtn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

*/

.alert-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(7px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.alert-modal.active {
  display: flex;
}

.alert-modal-content {
  position: relative;
  width: 720px;
  max-width: 92%;
  background: linear-gradient(180deg, #0f172a 0%, #07111f 100%);
  color: #e5e7eb;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 16px;
  padding: 26px 30px 24px;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.72);
}

.alert-close-x {
  position: absolute;
  top: 18px;
  right: 22px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 30px;
  cursor: pointer;
}

.alert-close-x:hover {
  color: #e5e7eb;
}

.alert-modal-content h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  color: #f8fafc;
}

.alert-subtitle {
  margin: 10px 0 26px;
  color: #94a3b8;
  font-size: 14px;
}

.alert-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 26px;
}

.alert-field label {
  display: block;
  margin-bottom: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.alert-field select {
  width: 100%;
  height: 46px;
  background: #07111f;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 9px;
  padding: 0 13px;
  font-size: 14px;
  outline: none;
}

.alert-field select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.alert-query-label {
  margin-top: 26px;
  margin-bottom: 10px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.alert-query-preview {
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: rgba(15, 23, 42, 0.72);
  border-radius: 10px;
  padding: 18px 20px;
}

.alert-query-preview strong {
  color: #f8fafc;
}

.alert-query-preview p {
  margin: 6px 0;
  color: #cbd5e1;
  font-size: 14px;
}

.alert-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.alert-modal-actions button {
  padding: 10px 17px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

#cancelAlertBtn {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.32);
}

#cancelAlertBtn:hover {
  background: rgba(148, 163, 184, 0.09);
}

#saveAlertBtn {
  background: #0f2f66;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.25);
}

#saveAlertBtn:hover {
  background: #15408c;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

/* Mobile */
@media (max-width: 768px) {

  .alert-modal-content {
    width: 92%;
    max-height: 85vh;
    padding: 18px;
  }

  .alert-modal-content h2 {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .alert-modal-content p {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .alert-form-group {
    margin-bottom: 10px;
  }

  .alert-form-group label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .alert-form-group select,
  .alert-form-group input {
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  #alertQueryPreview {
    padding: 12px;
    min-height: 70px;
    font-size: 13px;
  }

  #alertQueryPreview strong {
    font-size: 14px;
  }

  .alert-modal-actions {
    gap: 8px;
  }

  .alert-modal-actions button {
    height: 42px;
    font-size: 13px;
  }
}

/*Premium Actions (For user)

.premium-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.premium-modal.active {
  display: flex;
}

.premium-modal-content {
  width: 100%;
  max-width: 340px;
  background: linear-gradient(180deg, #1e293b, #111827);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.premium-modal-content h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.premium-feature-message {
  margin: 0;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.45;
}

.premium-feature-name {
  margin-top: 12px;
  color: #60a5fa;
  font-size: 15px;
  font-weight: 700;
}

.premium-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.premium-actions button {
  min-width: 92px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  cursor: pointer;
  font-weight: 700;
}

#premiumCloseBtn {
  background: #0f172a;
  color: #cbd5e1;
}

#premiumLoginBtn {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

#premiumCloseBtn:hover {
  background: #1e293b;
}

#premiumLoginBtn:hover {
  background: #1d4ed8;
}

*/


@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  #table-box {
    display: none;
    height:auto;
  }

  .dashboard {
    display: flex;
    flex-direction: column;
    height: auto !important;
    min-height: 100vh;
    padding: 2px 8px 8px 4px ;
    gap: 8px;
    overflow: visible !important;
  }

  .map-panel {
    order: 1;
    position:relative;
  }

  .data-panel {
    order: 2;
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    overflow: visible !important;
  }

  .top-kpis {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  .top-kpis > div:first-child {
    display: none;
  }

  .top-kpis h1,
  .top-kpis h2 {
    font-size: 20px;
  }

  .filters {
    order: 1;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  label {
    font-size: 11px;
  }

  select {
    padding: 6px 10px;
    font-size: 11px;
    height: 42px;
  }

  #map,
  #table-box {
    height: 380px !important;
    max-height: 100% !important;
    width: 100%;
  }
  /*
  #table-box .dataTables_scrollBody {
    height: 100% !important;
    max-height: 100% !important;
  }*/

  #auctionTable {
    width: 100% !important;
    table-layout: auto;
    white-space: nowrap;
  }

  #propertiesTable {
    width: max-content !important;
    min-width: 720px;
    table-layout: auto;
    white-space: nowrap;
  }

  #propertiesTable th,
  #propertiesTable td {
    padding: 6px 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .charts {
    display: none;
  }

  /* Hide for phone 
  .charts {
    order: 2;
    display: flex !important;
    flex-direction: column;
    height: auto !important;  
    overflow: visible !important;
    gap: 16px;
  }

  .charts > div {
    height: 300px;
    overflow: hidden;
  }*/


  .department-scroll,
  .district-scroll {
    height: 250px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .echart-box {
    height: 100%;
    min-width: 420px;
  }
  
  .updated {
    position:static;
    color: #444547;;
    font-size: 11px;
    font-weight: 600;
    padding-top:5px;
    transform: translateY(-8px);
  }
  /*
  .table-box {
    order: 3;
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
    padding-top: 14px;
  }*/

  #auctionTable th,
  #auctionTable td {
    font-size: 11px;
    padding: 5px 8px;
  }

  .view-toggle {
    display:block;
    background: transparent;
    color: #9aa4b2;
    border: none;
    border-bottom: 1px solid #2a3441;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-left: auto;
    
  }


  /*
  #table-container {
    height: 450px;
  }*/

  .view-toggle:hover {
    color: #ffffff;
  }

  .view-toggle.active {
    color: #00aaff;
  }

  .view-toggle:focus {
    outline: none;
    border-color: #00aaff;
    box-shadow: 0 0 0 2px rgba(0, 170, 255, 0.25);
  }

  .footer-bar {
    position: static;
    left: 40px;
    bottom: 20px;

    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 2px;

  }

  

/*
  .view-toggle {
    background: transparent;
    color: #9aa4b2;
    border: none;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  .view-toggle:hover {
    color: #ffffff;
  }

  .view-toggle.active {
    color: #00aaff;
  }
*/

}


/*
@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
    height: auto;
  }

  #map {
    height: 500px;
  }

  .filters,
  .charts {
    grid-template-columns: 1fr;
  }
}
*/

