/* ===== Page-specific Styles ===== */

/* ---- Map Layout (Leaflet) ---- */
.map-layout {
  display: flex;
  gap: 0;
  height: 520px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Left panel */
.map-panel {
  width: 280px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fff;
}
.map-panel-search {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.map-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Noto Sans JP', sans-serif;
  outline: none;
  transition: border-color var(--transition-fast);
}
.map-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.map-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.map-prop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}
.map-prop-item:hover {
  background: var(--surface-2);
}
.map-prop-item.active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}
.mpi-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mpi-info {
  flex: 1;
  min-width: 0;
}
.mpi-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpi-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}
.map-panel-legend {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-2);
  justify-content: center;
}

/* Right map container */
.map-container {
  flex: 1;
  min-height: 100%;
}

/* Custom Leaflet pin markers */
.leaflet-pin-custom {
  background: none !important;
  border: none !important;
}
.lpin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  border: 2.5px solid #fff;
  margin-left: 4px;
}
.lpin span {
  transform: rotate(45deg);
  font-family: 'Noto Sans JP', sans-serif;
}
.lpin-label {
  margin-top: 4px;
  background: #fff;
  border: 1px solid #D1D5DB;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  text-align: center;
  font-family: 'Noto Sans JP', sans-serif;
  transform: translateX(-6px);
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.15) !important;
}
.leaflet-popup-content {
  margin: 14px 16px !important;
}

/* Responsive */
@media (max-width: 900px) {
  .map-layout {
    flex-direction: column;
    height: auto;
  }
  .map-panel {
    width: 100%;
    min-width: unset;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .map-container {
    height: 400px;
  }
}

/* ---- Calendar ---- */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-h, .cal-cell {
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
}
.cal-h {
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
  font-size: 11px;
  padding: 6px;
}
.cal-h.sat { color: #2563EB; }
.cal-h.sun { color: #DC2626; }
.cal-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-height: 68px;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.cal-cell:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,.1);
}
.cal-cell.muted { opacity: .35; pointer-events: none; }
.cal-cell.special {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-color: #F59E0B;
}
.cal-cell.today {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.cal-cell .d { font-weight: 700; }
.cal-cell .v { font-size: 10.5px; color: var(--text-2); margin-top: 2px; }
.cal-cell .v.high { color: var(--success); font-weight: 700; }
.cal-cell.special .d { color: #92400E; }
.cal-cell.special .v { color: #92400E; }

/* ---- Time-band Table ---- */
.tb-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px 80px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.tb-row:last-child { border-bottom: none; }
.tb-bar {
  height: 20px;
  background: var(--bg);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.tb-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 4px;
  transition: width .6s ease;
}
.tb-bar-fill.normal { background: linear-gradient(90deg, #60A5FA, #3B82F6); }
.tb-bar-fill.high { background: linear-gradient(90deg, #FBBF24, #F59E0B); }
.tb-bar-fill.peak { background: linear-gradient(90deg, #FB7185, #EF4444); }

/* ---- Pricing ---- */
.price-table {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.price-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: all var(--transition-fast);
}
.price-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.price-card .pc-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.price-card .pc-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}
.price-card .pc-unit {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ---- Dashboard Alt ---- */
.property-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.property-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--primary);
}
.property-card .pc-name {
  font-weight: 700;
  font-size: 14px;
}
.property-card .pc-area {
  font-size: 12px;
  color: var(--text-2);
}
.property-card .pc-stats {
  display: flex;
  gap: 16px;
  margin-left: auto;
  font-size: 12px;
}
.property-card .pc-stat {
  text-align: center;
}
.property-card .pc-stat .st-val {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.property-card .pc-stat .st-lbl {
  color: var(--text-3);
  font-size: 11px;
}

/* ---- Monitoring ---- */
.monitoring-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.status-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.status-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.status-card .sc-val {
  font-size: 24px;
  font-weight: 800;
}
.status-card .sc-lbl {
  font-size: 12px;
  color: var(--text-2);
}

/* ---- Responsive for pages ---- */
@media (max-width: 1280px) {
  .price-table { grid-template-columns: 1fr; }
  .monitoring-status { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .map { height: 280px; }
  .property-card { flex-wrap: wrap; }
  .property-card .pc-stats { margin-left: 0; width: 100%; justify-content: space-around; }
}
