/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

/* Layout */
body {
  background: #f7f7f7;
  padding: 12px;
}

main {
  max-width: 1600px;
  margin: auto;
}

/* Loader */
.loading-icon {
  display: none;
  justify-content: center;
  margin-bottom: 10px;
}

.loader {
  width: 18px;
  height: 18px;
  border: 3px solid #ddd;
  border-top: 3px solid #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* File Upload */
.file-loader {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.file-input {
  flex: 1;
}

.btn {
  padding: 5px 10px;
  cursor: pointer;
}

/* Container */
.data-container {
  background: white;
  border: 1px solid #ddd;

  height: calc(100vh - 100px);
}

/* Options bar */
.data-options {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  flex-wrap: wrap;

  position: sticky;
  top: 0px;
  background: white;
  z-index: 20;
}

/* Inputs */
.search-input {
  padding: 4px 6px;
  width: 180px;
}

.page-offset {
  padding: 4px;
}

.prev-page-btn,
.next-page-btn {
  padding: 4px 8px;
  cursor: pointer;
}

.page-numbers {
  font-size: 14px;
  margin: auto;
}
.page-numbers button {
  width: 30px;
  margin: 2px;
  height: 25px;
}

/* Table */
.data-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 14px;
  overflow: auto;
}
.table {
  overflow: auto;
  width: 100%;
  height: 100%;
}
/* Cells */
.data-table th,
.data-table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

/* Header */
.data-table th {
  background: #f0f0f0;
  font-weight: 600;

  position: sticky;
  top: 0px;
  z-index: 10;
}

/* Row styling */
.data-table tr:nth-child(even) {
  background: #fafafa;
}
.data-table tr:hover {
  background-color: #e6e6e6;
}

/* Optional: prevent huge cells */
.data-table td {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlighted-text {
  background-color: yellow;
}

.th-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.th-content i {
  cursor: pointer;
  font-size: 12px;
  color: #666;
}
/* Overlay */
.record-dialog-overlay,
.add-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.4);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 1000;
}

/* Dialog */
.record-dialog,
.add-dialog {
  background: white;
  width: 500px;
  max-height: 80vh;

  border-radius: 6px;
  overflow: hidden;

  display: flex;
  flex-direction: column;
}

/* Header */
.record-header,
.add-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 10px 14px;
  border-bottom: 1px solid #ddd;

  background: #f7f7f7;
}

.record-header h3,
.addheader h3 {
  font-size: 16px;
}

/* Close button */
.close-btn {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}

/* Content */
.record-content,
.add-content {
  padding: 12px;
  overflow-y: auto;
}

/* Record rows */
.record-row,
.add-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;

  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.record-key,
.add-key {
  font-weight: 600;
  color: #333;
}

.record-value,
.add-value {
  color: #555;
  word-break: break-word;
}
.record-dialog-overlay,
.add-dialog-overlay {
  display: none;
}
.add-btn {
  margin-right: 15px;
}

.add-submit-btn {
  width: 200px;
  margin: auto;
  margin-bottom: 5px;
}
