/* HartaMediu PATCH 2.5 - import Excel X/Y si reordonare puncte */
.hm1519-excel-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #d7e4df;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdfc 0%, #f5f9f7 100%);
}
.hm1519-excel-card > div:first-child {
  display: grid;
  gap: 5px;
}
.hm1519-excel-card strong {
  color: #12362e;
  font-size: 15px;
}
.hm1519-excel-card p {
  margin: 0;
  color: #687a74;
  font-size: 13px;
  line-height: 1.55;
}
.hm1519-excel-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hm1519-excel-controls input[type="file"] {
  min-width: min(360px, 100%);
  max-width: 100%;
  padding: 9px 10px;
  border: 1px solid #c9dcd5;
  border-radius: 12px;
  background: #fff;
}
.hm1519-excel-controls .hm157-primary {
  width: auto !important;
  min-height: 42px;
}
.hm1519-import-status {
  min-height: 20px;
  color: #667872;
  font-size: 12px;
  font-weight: 700;
}
.hm1519-import-status[data-state="success"] { color: #12705e; }
.hm1519-import-status[data-state="error"] { color: #a53b34; }
.hm1519-import-status[data-state="loading"] { color: #8b6717; }

.hm1514-geometry-card {
  flex-wrap: wrap;
}
.hm1519-order-editor {
  flex: 1 0 100%;
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #dce7e3;
}
.hm1519-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.hm1519-order-head > div {
  display: grid;
  gap: 3px;
}
.hm1519-order-head strong {
  color: #17382f;
  font-size: 14px;
}
.hm1519-order-head small {
  color: #6b7c76;
  font-size: 12px;
  line-height: 1.45;
}
.hm1519-order-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hm1519-order-list li {
  display: grid;
  grid-template-columns: 24px 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d8e5e0;
  border-radius: 12px;
  background: #fff;
  cursor: grab;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.hm1519-order-list li.is-dragging {
  opacity: .55;
  box-shadow: 0 10px 24px rgba(15, 74, 61, .14);
}
.hm1519-drag {
  color: #7f938c;
  font-weight: 900;
  letter-spacing: -4px;
  user-select: none;
}
.hm1519-order-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #0d5b4d;
  background: #e6f3ef;
  font-size: 12px;
  font-weight: 900;
}
.hm1519-order-list li > div:nth-child(3) {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.hm1519-order-list li strong,
.hm1519-order-list li small {
  overflow-wrap: anywhere;
}
.hm1519-order-list li strong {
  color: #18362e;
  font-size: 13px;
}
.hm1519-order-list li small {
  color: #70807b;
  font-size: 11px;
}
.hm1519-order-actions {
  display: flex;
  gap: 5px;
}
.hm1519-order-actions button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #cadbd5;
  border-radius: 9px;
  color: #16483d;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}
.hm1519-order-actions button:hover:not(:disabled) {
  background: #f1f8f5;
}
.hm1519-order-actions button:disabled {
  opacity: .35;
  cursor: default;
}
.hm1519-order-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.hm1519-order-footer .hm157-primary {
  width: auto !important;
  min-height: 40px;
}
.hm1519-order-footer span {
  color: #64766f;
  font-size: 12px;
  font-weight: 700;
}
.hm1519-order-footer span[data-state="success"] { color: #12705e; }
.hm1519-order-footer span[data-state="error"] { color: #a53b34; }

.hm1519-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 3000;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid #cbded7;
  border-radius: 13px;
  color: #173a31;
  background: #fff;
  box-shadow: 0 18px 46px rgba(10, 52, 43, .16);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
  font-size: 13px;
  font-weight: 750;
}
.hm1519-toast.is-visible { opacity: 1; transform: translateY(0); }
.hm1519-toast.is-success { border-color: #9bcdbf; }
.hm1519-toast.is-error { border-color: #e1aaa5; color: #8e302b; }

@media (max-width: 720px) {
  .hm1519-excel-controls { align-items: stretch; flex-direction: column; }
  .hm1519-excel-controls input[type="file"],
  .hm1519-excel-controls .hm157-primary { width: 100% !important; }
  .hm1519-order-list li { grid-template-columns: 20px 30px minmax(0, 1fr); }
  .hm1519-order-actions { grid-column: 2 / -1; justify-content: flex-end; }
  .hm1519-order-footer { align-items: stretch; flex-direction: column; }
  .hm1519-order-footer .hm157-primary { width: 100% !important; }
}

/* PATCH 2.6 - editorul ordinii ocupa integral cardul geometriei. */
.hm1514-geometry-card > .hm1519-order-editor {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  margin: 14px 0 0 !important;
  padding: 16px 0 0 !important;
}
.hm1519-order-editor > form,
.hm1519-order-list {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.hm1519-order-head {
  min-width: 0;
}
.hm1519-order-head > div {
  min-width: 0;
}
.hm1519-order-head small {
  max-width: 760px;
}
.hm1519-order-list li {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  grid-template-columns: 24px 34px minmax(220px, 1fr) auto !important;
}
.hm1519-order-list li > div:nth-child(3) {
  min-width: 0 !important;
  width: auto !important;
}
.hm1519-order-list li strong,
.hm1519-order-list li small {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
}
.hm1519-order-list li small {
  line-height: 1.45;
}
@media (max-width: 720px) {
  .hm1514-geometry-card > .hm1519-order-editor {
    padding-top: 14px !important;
  }
  .hm1519-order-list li {
    grid-template-columns: 20px 30px minmax(140px, 1fr) !important;
  }
  .hm1519-order-actions {
    grid-column: 2 / -1 !important;
    justify-content: flex-start !important;
  }
}

.hm1514-context-status {
  max-width: min(420px, calc(100vw - 48px));
  padding: 8px 11px;
  border: 1px solid rgba(15, 86, 72, .22);
  border-radius: 10px;
  color: #17453a;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(7, 47, 39, .12);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}
.hm1514-context-status.is-warning {
  color: #77520e;
  border-color: rgba(180, 124, 24, .30);
  background: rgba(255, 248, 230, .96);
}
.hm1514-map-window .leaflet-control-layers {
  border: 1px solid #cadbd5;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(10, 52, 43, .14);
  font: inherit;
}
.hm1514-map-window .leaflet-control-layers-expanded {
  padding: 10px 12px;
}

/* PATCH 2.7 - panou de straturi vizibil permanent in harta proiectului */
.hm1514-map-window .hm1521-layer-panel {
  width: 245px;
  max-width: min(245px, calc(100vw - 44px));
  overflow: hidden;
  border: 1px solid #c7d9d3;
  border-radius: 14px;
  color: #173a31;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 14px 34px rgba(8, 48, 39, .18);
  font-family: inherit;
}
.hm1521-layer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid #dfeae6;
  background: #f6faf8;
}
.hm1521-layer-title strong {
  color: #0c4f42;
  font-size: 13px;
  line-height: 1.2;
}
.hm1521-layer-title small {
  color: #6f817b;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.hm1521-layer-panel > label {
  display: grid;
  grid-template-columns: 18px 13px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin: 0;
  padding: 10px 13px;
  border-bottom: 1px solid #edf3f1;
  cursor: pointer;
}
.hm1521-layer-panel > label:last-child {
  border-bottom: 0;
}
.hm1521-layer-panel > label:hover {
  background: #f7fbfa;
}
.hm1521-layer-panel input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: #0b6958;
}
.hm1521-layer-panel input[type="checkbox"]:disabled {
  opacity: .55;
}
.hm1521-layer-panel label > span:last-child {
  min-width: 0;
  color: #183d34;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.hm1521-layer-panel label small {
  display: block;
  margin-top: 3px;
  color: #73837e;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
}
.hm1521-swatch {
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: currentColor;
  opacity: .72;
}
.hm1521-swatch.is-natura { color: #7d36a8; }
.hm1521-swatch.is-protected { color: #248247; }
.hm1521-swatch.is-water { color: #087cad; }
.hm1521-layer-panel label[data-state="loading"] small::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border: 1px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: hm1521-spin .8s linear infinite;
}
.hm1521-layer-panel label[data-state="error"] small {
  color: #9b3d34;
}
.hm1521-layer-panel label[data-state="empty"] small {
  color: #8a6a1c;
}
@keyframes hm1521-spin { to { transform: rotate(360deg); } }

.hm1514-map-window .leaflet-top.leaflet-right {
  top: 10px;
  right: 10px;
}
.hm1514-map-window .leaflet-control-container {
  font-family: inherit;
}
.hm1514-map-window .leaflet-overlay-pane svg {
  overflow: visible;
}

@media (max-width: 720px) {
  .hm1514-map-window .hm1521-layer-panel {
    width: 210px;
    max-height: 42vh;
    overflow-y: auto;
  }
  .hm1521-layer-title,
  .hm1521-layer-panel > label {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm1521-layer-panel label[data-state="loading"] small::after {
    animation: none;
  }
}
