.admin-page {
  background: #f7f8fb;
  color: #172033;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
  min-height: 100vh;
}

.admin-hero {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 32px clamp(16px, 5vw, 64px) 18px;
}

.admin-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
}

.admin-actions,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-main {
  display: grid;
  gap: 16px;
  padding: 0 clamp(16px, 5vw, 64px) 42px;
}

.admin-status,
.admin-warning,
.import-help {
  border-radius: 8px;
  padding: 12px 14px;
}

.admin-status {
  background: #ffffff;
  border: 1px solid #dde4ef;
  box-shadow: 0 12px 34px rgba(23, 32, 51, 0.07);
  font-weight: 600;
}

.admin-status[data-tone="success"] {
  background: #ecfdf3;
  border-color: #b9ebca;
  color: #116c36;
}

.admin-status[data-tone="warning"] {
  background: #fff8e7;
  border-color: #f3d38a;
  color: #8a5a00;
}

.admin-status[data-tone="error"] {
  background: #fff1f1;
  border-color: #f0b3b3;
  color: #a62424;
}

.admin-warning {
  background: #fff1f1;
  border: 1px solid #f0b3b3;
}

.admin-workspace {
  display: grid;
  gap: 12px;
}

.color-settings {
  background: #ffffff;
  border: 1px solid #dde4ef;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.color-settings h2 {
  font-size: 1.25rem;
}

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

.color-card {
  background: #f8fafc;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.color-preview {
  align-items: center;
  background: var(--preview-color, #64748b);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  font-weight: 800;
  height: 46px;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.color-input-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 46px 1fr;
}

.color-input-row input[type="color"] {
  height: 42px;
  padding: 4px;
}

.toolbar {
  align-items: end;
  background: #ffffff;
  border: 1px solid #dde4ef;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
}

.search-box {
  flex: 1 1 280px;
  max-width: 520px;
}

.file-button {
  cursor: pointer;
  position: relative;
}

.file-button input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.import-help {
  background: #eef4ff;
  border: 1px solid #c9dafc;
  color: #345078;
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  background: #ffffff;
  border: 1px solid #dde4ef;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
  min-width: 1120px;
  overflow: hidden;
}

.admin-row {
  align-items: center;
  border-bottom: 1px solid #e5eaf2;
  display: grid;
  gap: 14px;
  grid-template-columns: 150px 330px 220px 300px 92px;
  padding: 12px;
}

.admin-row:last-child {
  border-bottom: 0;
}

.admin-row--header {
  background: #f1f5f9;
  color: #475467;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
}

.stack {
  display: grid;
  gap: 6px;
}

.field-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid--compact {
  grid-template-columns: 76px 128px 1fr;
}

.admin-row label {
  color: #667085;
  font-size: 0.78rem;
  gap: 4px;
}

.admin-row input,
.admin-row select,
.toolbar input {
  background: #ffffff;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  color: #172033;
  font-family: inherit;
  font-size: 0.92rem;
  min-width: 0;
  padding: 9px 10px;
  width: 100%;
}

.row-note {
  color: #667085;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.empty-state {
  color: #667085;
  padding: 24px;
  text-align: center;
}

@media (max-width: 760px) {
  .admin-hero,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions,
  .toolbar-actions {
    width: 100%;
  }

  .admin-actions .btn,
  .toolbar-actions .btn {
    flex: 1 1 auto;
  }
}
