
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.cost-panel { margin-top: 16px; border: 1px solid #d8e3f0; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,0.86); }
.cost-panel-header { display: flex; align-items: center; padding: 10px 14px; background: rgba(248,250,252,0.95); border-bottom: 1px solid #e2e8f0; }
.cost-panel-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #1f2937; }
.cost-type-toggle-row { display: flex; border-bottom: 1px solid #e2e8f0; }
.cost-type-btn { flex: 1; padding: 8px 0; border: none; background: #f8fafc; font-size: 11px; font-weight: 700; color: #64748b; cursor: pointer; transition: background .15s ease, color .15s ease; border-right: 1px solid #e2e8f0; }
.cost-type-btn:last-child { border-right: none; }
.cost-type-btn.active { background: #1e40af; color: #fff; }
.cost-type-btn:hover:not(.active) { background: #e2e8f0; color: #1e40af; }
.cost-vehicle-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid #f0f4f8; }
.cost-vehicle-row:last-child { border-bottom: none; }
.cost-label { font-size: 11px; font-weight: 700; color: #64748b; white-space: nowrap; }
.cost-vehicle-select { flex: 1; font-size: 12px; border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 8px; background: #fff; cursor: pointer; outline: none; }
.cost-vehicle-select:focus { border-color: #2563eb; }
.cost-vehicle-select-saved {
  flex: 0 0 150px;
  max-width: 150px;
}
.cost-consumption {
  flex: 1;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}
.settings-vehicles-card { margin-top: 24px; padding: 20px; border: 1px solid #e0e7ef; border-radius: 12px; background: rgba(255,255,255,0.88); }
.settings-vehicles-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.vehicle-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid #e0e7ef; border-radius: 10px; background: #fafcff; gap: 10px; }
.vehicle-item-left { display: flex; flex-direction: column; gap: 3px; }
.vehicle-item-name { font-weight: 700; font-size: 14px; color: #111827; }
.vehicle-item-meta { font-size: 12px; color: #64748b; }
.btn-vehicle-delete { font-size: 12px; background: none; border: 1px solid #e0e7ef; color: #dc2626; border-radius: 6px; padding: 4px 10px; cursor: pointer; flex-shrink: 0; transition: background .15s ease; }
.btn-vehicle-delete:hover { background: #fef2f2; }
.settings-vehicle-form { margin-top: 16px; padding: 16px; border: 1px dashed #d1d5db; border-radius: 10px; background: #f8fafc; }
.vehicle-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.vehicle-form-item label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.vehicle-form-item input, .vehicle-form-select { width: 100%; box-sizing: border-box; border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 10px; font-size: 13px; background: #fff; outline: none; transition: border-color .15s ease; }
.vehicle-form-item input:focus, .vehicle-form-select:focus { border-color: #2563eb; }
.vehicle-form-actions { display: flex; gap: 10px; }
.btn-outline { padding: 8px 18px; border: 1px solid #cbd5e1; background: #fff; color: #1f2937; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s ease; }
.btn-outline:hover { background: #f8fafc; }
.settings-inline-row { display: flex; align-items: center; gap: 10px; }
.settings-inline-row input { flex: 1; }
.settings-inline-btn { white-space: nowrap; flex-shrink: 0; }
.settings-places-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0 18px; }
.settings-place-row { display: grid; grid-template-columns: 0.95fr 1.35fr; gap: 10px; }

@media (max-width: 600px) {
  .vehicle-form-grid { grid-template-columns: 1fr; }
  .settings-inline-row { flex-direction: column; align-items: stretch; }
  .settings-places-grid { grid-template-columns: 1fr; }
  .settings-place-row { grid-template-columns: 1fr; }
}



/* for expressways analysis dashboard display */
#expressway-forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.exp-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid cornflowerblue;
}

.exp-card:hover {
  transform: translateY(-2px);
  transition: 0.2s ease;
  cursor: pointer;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;

}

.exp-code {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.exp-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.sector-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sector-row {
  display: grid;
  grid-template-columns: 72px 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.92rem;
}

.sector-name {
  font-weight: 700;
  color: #1e293b;
}

.sector-metric {
  color: #475569;
}

.sector-metric strong {
  color: #0f172a;
}

.tab-content {
    display: none; /* Hide by default */
}

.tab-content.active {
    display: block; /* Show only the active one */
}

.tab-btn.active {
    border-bottom: 2px solid #2563eb;
    color: #2563eb;
    font-weight: bold;
}

.tab-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}


.tab-btn {
    flex: 1;           
    padding: 5px;
    cursor: pointer;
}

.tab-btn.active {
    background-color: #2563eb;
    color: white;
    font-weight: bold;
}

.tab-content { display: none; }
.tab-content.active { display: block; }
/* end for expressway analysis dashboard display */


/* start for incident hotspot display */

.exp-header {
    min-height: 3rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px !important;
}

.exp-card {
    display: flex;
    flex-direction: column;
    height: 100%; 
}

.clearance-footer {
    margin-top: auto; 
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
/* end for incident hotspot display */


/* HABIT ROUTES NEW for integrated page */
#habit-routes-list {
  overflow-x: hidden !important;
  padding-right: 5px;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#habit-routes-list::-webkit-scrollbar {
  display: none;
}


.habit-route-card {
  padding: 0 !important;
  margin-bottom: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.habit-route-card > div {
  padding: 10px !important; 
  box-sizing: border-box !important;
  width: 100% !important;
}


.habit-route-card .btn-sm,
.habit-route-card .btn-outline-primary,
.habit-route-card .btn-outline-secondary,
.habit-route-card .btn-outline-danger {
  padding: 6px 2px !important; 
  font-size: 9px !important; 
  letter-spacing: -0.2px; 
}


.habit-plan-input {
  max-width: 135px !important; 
  font-size: 10px !important;
}
.habit-plan-btn {
  padding: 5px 8px !important;
}

.habit-route-settings {
  padding: 10px !important;
  margin-top: 8px !important;
}
.habit-alert-start, .habit-alert-end {
  min-width: 0 !important; 
  width: 75px !important;
}


.subsection-title {
  font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
  color: #374151; margin-bottom: 12px;
}

#habit-tab-title {
  display: none; 
  font-size: 14px; 
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.04em; 
  text-align: center;
}

#habit-plan-divider {
  width: 50px;
  height: 1px;
  background: #e2e8f0; 
  margin: 12px auto;   
}

.habit-mode-group {
  display: flex; 
  justify-content: center; 
  gap:6px; 
  margin-bottom:10px;
}

.habit-mode-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  background: #f8fafc;
  color: #334155;
}

.habit-mode-btn.active {
  background: #3b82f6;
  color: white;
  font-weight: 600;
}

#habit-plan-helper {
  margin-bottom: 4px;
}

/* Habit Planner Time section */

.habit-plan-datetime-display {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  display: inline-block;
  min-width: 220px;
  position: relative;
  z-index: 1;
}

.habit-plan-date-line {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.habit-plan-time-line {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.speedband-tooltip {
  position: relative;
  display: inline-flex;
  cursor: help;
  margin-left: 4px;
}

.speedband-tooltip .info-icon {
  font-size: 1.1rem;
  color: #94a3b8;
  transition: color 0.2s;
}

.speedband-tooltip:hover .info-icon {
  color: cornflowerblue; 
}

.tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 10px;
  background: white; 
  color: black;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  width: 240px;
  font-size: 11px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tooltip-content::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #1e293b transparent;
}

.speedband-tooltip:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

.band-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

/* FOR ADMIN TOOLBAR SECTION */



.admin-tools-fab {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1200;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  background: #0f172a;
  color: white;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.admin-tools-modal {
  position: fixed;
  top: 58px;
  right: 14px;
  z-index: 1201;
  width: 320px;
  max-height: 75vh;
  overflow-y: auto;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  padding: 14px;
}

.admin-tools-header {
  cursor: grab;
  user-select: none;
}

.admin-tools-header:active {
  cursor: grabbing;
}

.hidden {
  display: none !important;
}
/* END ADMIN TOOLBAR SECTION */




/* Status Dot & Animations */
.dot-green { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 8px #22c55e; }
.dot-red { width: 8px; height: 8px; background: #ef4444; border-radius: 50%; box-shadow: 0 0 12px #ef4444; animation: pulse 1.5s infinite; }

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.hidden { display: none !important; opacity: 0; pointer-events: none; }
/* END PLAN JOURNEY SECTION */

/* For Expressway Toolbar in Map */
.expressways-dropdown-menu {
  display: none; 
  position: absolute;
  top: 100%; 
  left: 0;
  margin-top: 8px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  min-width: 180px;
}

.expressways-dropdown-menu.show {
  display: grid;
  grid-template-columns: 1fr 1fr; 
  gap: 10px 20px;
}

.expressways-dropdown-menu label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #1e293b;
  font-weight: 700;
  cursor: pointer;
}



.incident-ml-panel {
  position: absolute;
  top: 72px;
  left: -320px;
  width: 300px;
  max-height: calc(100% - 84px); /* 72 top + 12 bottom gap */
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15,23,42,0.18);
  z-index: 1000;
  overflow-y: auto;
  transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
  padding: 16px;
  box-sizing: border-box;
}
.incident-ml-panel.open { left: 12px; }
.incident-ml-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.incident-ml-panel-badge { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; background: #22c55e; color: #fff; border-radius: 5px; padding: 2px 10px; }
.incident-ml-panel-badge.accident { background: #ef4444; }
.incident-ml-panel-badge.heavy-traffic { background: #f59e0b; }
.incident-ml-panel-badge.roadwork { background: #3b82f6; }
.incident-ml-panel-close { background: none; border: 1px solid #e5e7eb; border-radius: 50%; width: 26px; height: 26px; font-size: 16px; cursor: pointer; color: #6b7280; line-height: 1; display: flex; align-items: center; justify-content: center; }
.incident-ml-panel-close:hover { background: #f3f4f6; }
.incident-ml-panel-title { font-size: 18px; font-weight: 700; color: #111827; margin-bottom: 2px; }
.incident-ml-panel-meta { font-size: 12px; color: #6b7280; margin-bottom: 10px; }
.incident-ml-panel-message { font-size: 12px; color: #374151; background: #f9fafb; border-radius: 8px; padding: 10px; margin-bottom: 12px; line-height: 1.5; }
.incident-ml-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.incident-ml-card-title { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; color: #6b7280; margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.incident-ml-severity-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.incident-ml-score-circle { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #f59e0b; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.incident-ml-score-num { font-size: 20px; font-weight: 700; color: #111827; line-height: 1; }
.incident-ml-score-denom { font-size: 10px; color: #6b7280; }
.incident-ml-severity-info { flex: 1; }
.incident-ml-badge { display: inline-block; border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.incident-ml-summary { font-size: 11px; color: #374151; line-height: 1.5; }
.incident-ml-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.incident-ml-stat { background: #f9fafb; border-radius: 8px; padding: 8px 10px; }
.incident-ml-stat-label { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; color: #9ca3af; margin-bottom: 3px; }
.incident-ml-stat-value { font-size: 13px; font-weight: 700; color: #111827; }
.incident-ml-stat-sub { font-size: 10px; color: #6b7280; }
.incident-ml-why { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; }
.incident-ml-why-title { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: #6b7280; margin-bottom: 8px; }
.incident-ml-signal { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.incident-ml-signal-name { font-size: 11px; color: #374151; font-weight: 500; }
.incident-ml-signal-bar { display: flex; align-items: center; gap: 6px; }
.incident-ml-signal-track { width: 60px; height: 5px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.incident-ml-signal-fill { height: 100%; border-radius: 3px; }

/* Incident panel JR's prediction section */
.incident-ml-forecast {
  margin-top: 14px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.incident-ml-forecast-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 2px;
}

.incident-ml-forecast-col {
  display: flex;
  flex-direction: column;
}

.incident-ml-forecast-col.right {
  align-items: flex-end;
}

.incident-ml-forecast-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}

.incident-ml-forecast-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.incident-ml-forecast-value.good {
  color: #22c55e;
}

.incident-ml-forecast-value.bad {
  color: #ef4444;
}

.incident-ml-forecast-arrow {
  font-size: 18px;
  font-weight: 600;
  color: #94a3b8;
  padding: 0 8px;
}

.incident-ml-forecast-status {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.incident-ml-forecast-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #6b7280;
  margin-bottom: 10px;
}

.incident-ml-affected-roads {
  margin-top: 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 12px;
}

.incident-ml-affected-roads-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #6b7280;
  margin-bottom: 10px;
}

.incident-ml-road-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.incident-ml-road-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  line-height: 1.2;
}
/* End incident panel prediction section */



.dashboard-analytics-section { margin-top: 24px; }
.dashboard-section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.dashboard-section-title { margin: 0; color: #1e293b; font-size: 1.2rem; font-weight: 700; }
.dashboard-section-sub { font-size: 0.9rem; font-weight: 400; }
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.analytics-empty { color: #94a3b8; font-style: italic; }
.analytics-card { background: rgba(255,255,255,0.92); border: 1px solid #dbeafe; border-radius: 16px; box-shadow: 0 10px 24px rgba(30,64,175,0.08); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.analytics-card-title { font-size: 1.05rem; font-weight: 800; color: #0f172a; }
.analytics-card-meta, .analytics-stat-line { font-size: 0.9rem; color: #475569; }
.analytics-tab-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.analytics-tab-btn { border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.analytics-tab-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.analytics-sector { display: none; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 12px; }
.analytics-sector.active { display: block; }
.analytics-sector.status-jammed { border-color: #fecaca; background: #fff1f2; }
.analytics-sector.status-warning { border-color: #fde68a; background: #fffbeb; }

