* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #0f1115;
  color: #f3f4f6;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* TOP HEADER */
.topbar {
  margin-bottom: 18px;
  padding: 16px 22px;
  background: linear-gradient(to right, #1c1c1c, #2a2a2a);
  border: 1px solid #30343b;
  border-radius: 0;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.brand-block {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  align-items: center;
  width: 100%;
}

.left-logo {
  justify-self: start;
  max-height: 55px;
  width: auto;
  object-fit: contain;
  opacity: 0.6;
}

.right-logo {
  justify-self: end;
  max-height: 55px;
  width: auto;
  object-fit: contain;
  opacity: 0.6;
}

.brand-text {
  text-align: center;
  min-width: 0;
  opacity: 0.6;
}

.brand-text h1 {
  margin: 0 0 4px;
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.subtitle {
  margin: 0;
  color: #b8c1cc;
  font-size: 15px;
}

.brand-text h1 {
  margin: 0 0 4px;
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.subtitle {
  margin: 0;
  color: #b8c1cc;
  font-size: 15px;
}

/* MAIN CONTENT PANEL */
.panel {
  background: #171a20;
  border: 1px solid #2f3540;
  border-radius: 0;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* SEARCH AREA */
.search-row {
  display: flex;
  flex-direction: column;
}

.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(23, 26, 32, 0.96);
  backdrop-filter: blur(6px);
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2f3540;
}

.search-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.search-box input {
  flex: 1;
  min-width: 260px;
  padding: 13px 14px;
  border: 1px solid #3c4350;
  border-radius: 0;
  background: #10141c;
  color: #f9fafb;
  font-size: 16px;
}

.search-box input::placeholder {
  color: #8a94a3;
}

.search-box input:focus {
  outline: none;
  border-color: #4d78ff;
  box-shadow: 0 0 0 1px #4d78ff;
}

.search-box button {
  padding: 13px 18px;
  border: 1px solid #4d78ff;
  border-radius: 0;
  background: #4d78ff;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.search-box button.secondary {
  background: #5a6472;
  border-color: #5a6472;
}

.search-box button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

/* FILTER BUTTONS */
.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

.filter-buttons button {
  padding: 11px 18px;
  border: 1px solid #3a4250;
  border-radius: 0;
  background: #11161f;
  color: #f3f4f6;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  min-width: 92px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.filter-buttons button:hover {
  border-color: #4d78ff;
  background: #182131;
  transform: translateY(-1px);
}

.filter-buttons button.active {
  background: #4d78ff;
  border-color: #4d78ff;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(77, 120, 255, 0.6);
}

/* COUNT */
.result-count {
  font-size: 14px;
  font-weight: 700;
  color: #aeb8c6;
  margin-bottom: 8px;
}

/* RESULTS */
.results {
  display: grid;
  gap: 12px;
}

.record {
  background: #121722;
  border: 1px solid #313845;
  border-radius: 0;
  padding: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.record:hover {
  border-color: #43506a;
}

.record h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  padding-bottom: 8px;
  border-bottom: 1px solid #28303c;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.field {
  background: #1c2431;
  border: 1px solid #2f3947;
  border-radius: 0;
  padding: 10px 12px;
}

.label {
  display: block;
  font-size: 11px;
  color: #9aa4b2;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.value {
  font-size: 15px;
  color: #ffffff;
  word-break: break-word;
  font-weight: 600;
}

/* EMPTY / NOT FOUND */
.empty-state,
.not-found {
  text-align: center;
  padding: 26px;
  border-radius: 0;
  background: #10141c;
  border: 1px dashed #3a4250;
  color: #9aa4b2;
}

/* DNR */
.dnr-record {
  border: 1px solid #8b1e1e;
  background: linear-gradient(to right, #191214, #151820);
  box-shadow: inset 3px 0 0 #ff4d4d;
}

.record.dnr-record h3 {
  color: #ff7676;
}

.dnr-inline-alert {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #b52b2b;
  border-left: 5px solid #ff4d4d;
  border-radius: 0;
  background: #231619;
}

.dnr-inline-title {
  color: #ff6666;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.dnr-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dnr-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #141922;
  border: 1px solid #4a2525;
  border-radius: 0;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
  color: #f9fafb;
}

/* COPY BUTTON */
.copy-btn {
  margin-left: 6px;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 0;
  border: 1px solid #3a4250;
  background: #1a2230;
  color: #fff;
  cursor: pointer;
}

.copy-btn:hover {
  background: #243041;
}

/* ADMIN PANEL */
.admin-panel {
  margin-top: 24px;
  background: #121722;
  border: 1px solid #313845;
  border-radius: 0;
  padding: 18px;
}

.admin-panel h2 {
  margin-bottom: 6px;
  font-size: 20px;
  color: #ffffff;
}

.admin-note {
  color: #9aa4b2;
  font-size: 13px;
  margin-bottom: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.admin-form label {
  display: block;
  font-size: 12px;
  color: #c5ccd6;
  margin-bottom: 4px;
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 0;
  border: 1px solid #3c4350;
  background: #10141c;
  color: #ffffff;
  font-size: 15px;
  font-family: inherit;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: #4d78ff;
  box-shadow: 0 0 0 1px #4d78ff;
}

.admin-full {
  margin-top: 12px;
}

.admin-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-actions button {
  padding: 12px 18px;
  border-radius: 0;
  border: 1px solid #4d78ff;
  background: #4d78ff;
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.admin-actions button.secondary {
  background: #5a6472;
  border-color: #5a6472;
}

.admin-actions button:hover {
  filter: brightness(1.03);
}

.admin-message {
  margin-top: 10px;
  font-size: 13px;
  color: #7ea2ff;
}

/* BACK TO TOP */
#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: #4d78ff;
  color: white;
  border: 1px solid #4d78ff;
  border-radius: 0;
  width: 46px;
  height: 46px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

#backToTop.show {
  opacity: 1;
  pointer-events: auto;
}

#backToTop:hover {
  background: #3f68ea;
  transform: translateY(-2px);
}

/* MOBILE */
@media (max-width: 700px) {
  .app {
    padding: 14px;
  }

  .topbar,
  .panel {
    padding: 16px;
  }

  .brand-block {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .brand-block::after {
    display: none;
  }

  .logo {
    justify-self: center;
    max-height: 56px;
  }

  .brand-text {
    text-align: center;
  }

  .brand-text h1 {
    font-size: 24px;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box button,
  .admin-actions button {
    width: 100%;
  }

  .filter-buttons {
    justify-content: center;
  }
}
.copy-btn.copied {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
}

.editable-notes {
  cursor: pointer;
  border-bottom: 1px dashed #4d78ff;
}

.editable-notes:hover {
  color: #7ea2ff;
}

.notes-editor {
  width: 100%;
}

.notes-textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  padding: 10px;
  border: 1px solid #3c4350;
  background: #10141c;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
}

.notes-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.notes-editor-actions button {
  padding: 8px 12px;
  border: 1px solid #4d78ff;
  background: #4d78ff;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.notes-editor-actions button.secondary {
  background: #5a6472;
  border-color: #5a6472;
}

.notes-save-message {
  margin-top: 6px;
  font-size: 13px;
  color: #ff6666;
}