.ftth-fdp-panel {
  display:grid;
  gap:12px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--border);
}

.ftth-fdp-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.ftth-fdp-heading small,
.ftth-fdp-heading h4 {
  display:block;
  margin:0;
}

.ftth-fdp-heading small {
  color:var(--muted);
  font-size:10px;
}

.ftth-fdp-heading h4 {
  margin-top:2px;
  color:var(--accent);
}

.ftth-fdp-heading > span {
  padding:4px 8px;
  border-radius:999px;
  background:color-mix(
    in srgb,
    #0ea5e9 14%,
    transparent
  );
  color:#0ea5e9;
  font-size:10px;
  font-weight:900;
}

.ftth-fdp-kpis {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}

.ftth-fdp-kpis > div {
  padding:9px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--bg);
}

.ftth-fdp-kpis small,
.ftth-fdp-kpis strong {
  display:block;
}

.ftth-fdp-kpis small {
  color:var(--muted);
  font-size:10px;
}

.ftth-fdp-kpis strong {
  margin-top:2px;
  font-size:18px;
}

.ftth-fdp-kpis .available {
  color:var(--green);
}

.ftth-fdp-capacity {
  color:var(--muted);
  font-size:11px;
}

.ftth-fdp-capacity select {
  display:block;
  width:100%;
  min-height:36px;
  margin-top:4px;
  padding:7px 8px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--panel);
  color:var(--text);
}

.ftth-fdp-list-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.ftth-fdp-list-heading b,
.ftth-fdp-list-heading small {
  display:block;
}

.ftth-fdp-list-heading small {
  margin-top:2px;
  color:var(--muted);
  font-size:9px;
}

.ftth-fdp-list-heading button {
  flex:0 0 auto;
  min-height:34px;
  padding:6px 8px;
  font-size:10px;
}

.ftth-fdp-port-list {
  display:grid;
  gap:8px;
}

.ftth-fdp-port-list[hidden] {
  display:none !important;
}

.ftth-fdp-port-row {
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:8px;
  padding:9px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--bg);
}

.ftth-fdp-port-row.occupied {
  border-color:color-mix(
    in srgb,
    var(--green) 45%,
    var(--border)
  );
}

.ftth-fdp-port-number {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:50px;
  border-radius:8px;
  background:#0ea5e9;
  color:#fff;
}

.ftth-fdp-port-number span {
  font-size:16px;
  font-weight:900;
}

.ftth-fdp-port-number small {
  font-size:9px;
}

.ftth-fdp-port-fields {
  display:grid;
  gap:7px;
  min-width:0;
}

.ftth-fdp-port-fields label {
  color:var(--muted);
  font-size:10px;
}

.ftth-fdp-port-fields input,
.ftth-fdp-port-fields textarea {
  display:block;
  width:100%;
  min-width:0;
  margin-top:3px;
  padding:7px 8px;
  border:1px solid var(--border);
  border-radius:7px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
  resize:vertical;
}

.ftth-fdp-port-status {
  padding:7px 8px;
  border:1px dashed var(--border);
  border-radius:7px;
}

.ftth-fdp-port-status.assigned {
  border-color:color-mix(
    in srgb,
    var(--green) 55%,
    var(--border)
  );
  background:color-mix(
    in srgb,
    var(--green) 7%,
    transparent
  );
}

.ftth-fdp-port-status small,
.ftth-fdp-port-status b {
  display:block;
}

.ftth-fdp-port-status small {
  color:var(--muted);
  font-size:9px;
}

.ftth-fdp-port-status b {
  margin-top:2px;
  font-size:11px;
  overflow-wrap:anywhere;
}

.ftth-fdp-note {
  margin:0;
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
}

.ftth-fdp-save {
  width:100%;
}

@media (max-width:420px) {
  .ftth-fdp-port-row {
    grid-template-columns:36px minmax(0,1fr);
    padding:7px;
    gap:6px;
  }

  .ftth-fdp-port-number {
    min-height:44px;
  }
}

.ftth-fdp-capacity input {
  display:block;
  width:100%;
  min-height:36px;
  margin-top:4px;
  padding:7px 8px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--panel);
  color:var(--text);
  font:inherit;
}
