/* Yeni cihaz oluştur — mockup oranları; taşma / yazı karışması önlenir */
#page-device-create.active {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.dcr {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0;
}

.dcr__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--primary, #1976d2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
}
.dcr__back:hover { text-decoration: underline; }

/* Sol / orta / sağ — mockup gibi daha dengeli */
.dcr__layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr) minmax(300px, 340px);
  gap: 14px;
  align-items: stretch;
  overflow: hidden;
}

.dcr__steps {
  padding: 16px 14px;
  overflow: auto;
  align-self: stretch;
}
.dcr-stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.dcr-stepper__item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  position: relative;
  padding: 8px 4px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  line-height: 1.25;
}
.dcr-stepper__item:hover { background: rgba(25, 118, 210, 0.06); }
.dcr-stepper__item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}
.dcr-stepper__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #64748b;
  font-weight: 800;
  font-size: 13px;
  z-index: 1;
  flex-shrink: 0;
}
.dcr-stepper__label {
  padding-top: 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.dcr-stepper__item.is-active { color: var(--text); }
.dcr-stepper__item.is-active .dcr-stepper__num {
  background: var(--primary, #1976d2);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.18);
}
.dcr-stepper__item.is-done { color: #15803d; }
.dcr-stepper__item.is-done .dcr-stepper__num {
  background: #22c55e;
  color: #fff;
}
.dcr-stepper__item.is-done:not(:last-child)::after { background: #86efac; }
.dcr-stepper__item.is-done.is-active .dcr-stepper__num {
  background: var(--primary, #1976d2);
  box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.18);
}

.dcr__main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dcr-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

/* Panel: taşan yazı komşu karta binmesin */
.dcr-panel {
  padding: 14px 16px;
  margin: 0;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
  position: relative;
  isolation: isolate;
  background: var(--card, #fff);
}
.dcr-panel.is-active {
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.22);
  background: #f8fbff;
}
.dcr-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 1;
}
.dcr-panel__badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary, #1976d2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.dcr-panel > .dcr-grid-2,
.dcr-panel > .dcr-field {
  flex: 0 0 auto;
}
.dcr-panel > .dcr-info {
  flex: 0 0 auto;
  margin-top: auto;
}

.dcr-field { margin-bottom: 10px; }
.dcr-field:last-child { margin-bottom: 0; }
.dcr-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dcr-field .req { color: #dc2626; }
.dcr-field .muted { color: var(--muted); font-weight: 500; }
.dcr-field input,
.dcr-field select,
.dcr-field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  line-height: 1.3;
}
.dcr-field textarea {
  min-height: 52px;
  height: 52px;
  max-height: 88px;
  resize: vertical;
  display: block;
  overflow: auto;
  color: var(--text, #0f172a) !important;
  background: #fff !important;
  -webkit-text-fill-color: var(--text, #0f172a);
  caret-color: var(--primary, #1976d2);
}
.dcr-field input:focus,
.dcr-field select:focus,
.dcr-field textarea:focus {
  outline: none;
  border-color: var(--primary, #1976d2);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.16);
}
.dcr-field__mac { position: relative; display: block; }
.dcr-field__mac input {
  width: 100%;
  padding-right: 44px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
.dcr-field__scan {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--primary, #1976d2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dcr-field__scan:hover { background: #eef5ff; }
.dcr-field__counter {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.dcr-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 14px;
  min-width: 0;
}
.dcr-grid-2 > .dcr-field { min-width: 0; margin-bottom: 0; }

.dcr-info {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 8px;
  max-width: 100%;
  box-sizing: border-box;
}
.dcr-info i {
  margin-top: 2px;
  flex-shrink: 0;
  font-size: 13px;
}
.dcr-info p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dcr-info--compact { margin-top: 10px; }

#dcrFormMessage {
  margin: 0;
  flex: 0 0 auto;
  font-size: 12px;
  padding: 8px 10px;
}
#dcrFormMessage.hidden { display: none !important; }

.dcr-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0;
  flex: 0 0 auto;
}
.dcr-footer__left,
.dcr-footer__right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Sağ özet — daha geniş, satırlar düzgün */
.dcr__summary {
  padding: 16px 14px;
  overflow: auto;
  min-height: 0;
  align-self: stretch;
  min-width: 0;
}
.dcr-summary__title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}
.dcr-summary__block { margin-bottom: 14px; }
.dcr-summary__block h4 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
.dcr-summary__row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: start;
  margin-bottom: 8px;
  font-size: 12px;
}
.dcr-summary__row > span {
  color: var(--muted);
  padding-top: 2px;
  white-space: nowrap;
}
.dcr-summary__row code,
.dcr-topic code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
  overflow-wrap: anywhere;
  min-width: 0;
  line-height: 1.35;
}
.dcr-copy {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
  flex-shrink: 0;
}
.dcr-copy:hover { color: var(--primary); background: #eef5ff; }
.dcr-summary__topic-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 5px;
}
.dcr-topic {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: start;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  min-width: 0;
}
.dcr-topic--tel { background: #eff6ff; }
.dcr-topic--cmd { background: #ecfdf5; }

body.app-device-create #page-content,
body.app-device-create .main-body {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}
body.app-device-create #page-device-create.active {
  flex: 1 1 auto;
  min-height: 0;
}

@media (max-width: 1280px) {
  .dcr__layout {
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) minmax(280px, 310px);
  }
}
@media (max-width: 1100px) {
  .dcr__layout {
    grid-template-columns: minmax(180px, 200px) minmax(0, 1fr);
  }
  .dcr__summary { display: none; }
}
@media (max-width: 800px) {
  #page-device-create.active { overflow: auto; height: auto; }
  .dcr, .dcr__layout, .dcr__main, .dcr-form { overflow: visible; height: auto; }
  .dcr__layout { grid-template-columns: 1fr; }
  .dcr-panel { flex: none; overflow: visible; }
  .dcr-stepper { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .dcr-stepper__item { padding: 6px; }
  .dcr-stepper__item::after { display: none; }
  .dcr-grid-2 { grid-template-columns: 1fr; }
  .dcr__summary { display: block; }
}

/* MAC + Cihaz ismi — mockup: yan yana */
.dcr-grid-2--identity {
  margin-bottom: 4px;
  align-items: start;
}
.dcr-grid-2--identity > .dcr-field {
  margin-bottom: 0;
}
.dcr-field__mac {
  position: relative;
}
.dcr-field__mac input {
  padding-right: 44px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
.dcr-field__mac .dcr-field__scan {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dcr-field__mac .dcr-field__scan:hover {
  background: #eef5ff;
}

.dcr-stepper__item.is-locked {
  opacity: 0.55;
  cursor: default;
}
.dcr-stepper__item.is-done.is-active .dcr-stepper__num {
  background: var(--primary, #1976d2);
}
.dcr-footer.is-active {
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.22);
  background: #f8fbff;
}
.dcr-stepper__item[data-dcr-step="4"].is-done .dcr-stepper__num {
  background: #22c55e;
  color: #fff;
}

/* Temel bilgiler: açıklama + sayaç yukarı, boşluk yok */
#dcrPanel1 > .dcr-info {
  margin-top: 8px;
}
.dcr-field--desc {
  flex: 0 0 auto !important;
  margin-bottom: 0;
  margin-top: 0;
}
.dcr-field--desc .dcr-field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.dcr-field--desc .dcr-field__head label {
  margin-bottom: 0;
}
.dcr-field--desc .dcr-field__counter {
  margin: 0;
  flex-shrink: 0;
  line-height: 1;
}
.dcr-desc-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.dcr-desc-wrap textarea {
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 8px;
}
