/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: #1a1a2e; color: #e0e0e0; line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { color: #e0e0e0; }
a { color: #5a9fff; }
a:hover { color: #7bb3ff; }

/* ===== Top nav ===== */
.topnav {
  display: flex; align-items: center; gap: 1.5rem;
  background: #1a1a2e; color: #eee; padding: .6rem 1.5rem;
}
.topnav .nav-brand { font-weight: 700; font-size: 1.1rem; color: #fff; text-decoration: none; }
.topnav .nav-links { display: flex; gap: 1rem; margin-left: auto; }
.topnav .nav-links a { color: #ccc; text-decoration: none; font-size: .9rem; }
.topnav .nav-links a:hover { color: #fff; }

/* ===== Container ===== */
.container { margin: 1.5rem 1.5rem; padding: 0 1rem; }

/* ===== Auth card ===== */
.auth-card { max-width: 380px; margin: 4rem auto; background: #2a2a3e; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.3); border: 1px solid #3a3a4e; }
.auth-card h1 { margin-bottom: 1rem; color: #e0e0e0; }

/* ===== Fields ===== */
.field { margin-bottom: 1rem; }
.form-row .field { margin-bottom: 0;}
.field label { display: block; font-weight: 600; margin-bottom: .25rem; color: #e0e0e0; }
.field input, .field select, .field textarea { width: 100%; padding: .45rem .6rem; border: 1px solid #4a4a5e; border-radius: 4px; font-size: .95rem; background: #2a2a3e; color: #e0e0e0; }
.field input::placeholder, .field textarea::placeholder { color: #888; }
.field-error, .errors p { color: #ff6b6b; font-size: .85rem; }
/* Form inputs and textareas outside .field wrapper */
input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea, select {
  background: #2a2a3e;
  color: #e0e0e0;
  border: 1px solid #4a4a5e;
}
input[type="text"]::placeholder, input[type="number"]::placeholder, textarea::placeholder {
  color: #888;
}

/* ===== Buttons ===== */
button, .btn { padding: .5rem 1rem; border: none; border-radius: 4px; cursor: pointer; font-size: .9rem; background: #2d6cdf; color: #fff; }
button:hover { background: #1b4fa0; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #962d22; }
.btn-small { padding: .25rem .6rem; font-size: .8rem; }
.button-link { display: inline-block; padding: .5rem 1rem; border-radius: 4px; font-size: .9rem; background: #6c757d; color: #fff; text-decoration: none; }
.button-link:hover { background: #5a6268; }

/* ===== Tables ===== */
.data-table { width: 100%; border-collapse: collapse; background: #2a2a3e; border-radius: 6px; overflow: hidden; margin-bottom: 1rem; border: 1px solid #3a3a4e; }
.data-table th, .data-table td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid #3a3a4e; font-size: .9rem; color: #e0e0e0; }
.data-table th { background: #1e1e2e; font-weight: 600; color: #e0e0e0; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .attrs-cell { white-space: normal; }
.data-table .payments-cell { 
  max-width: 200px; 
  white-space: normal; 
  font-size: 0.8rem; 
  word-wrap: break-word; 
}
.data-table .ecommerce-cell { 
  max-width: 200px; 
  white-space: normal; 
  font-size: 0.8rem; 
  word-wrap: break-word; 
}

/* ===== Cards ===== */
.header-with-status {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.header-with-status h1 {
  flex: 1;
  margin: 0;
}
.domain-status {
  font-size: 0.75em;
  font-weight: normal;
  color: #9aa5b1;
  margin-left: 0.5rem;
}
.header-with-status .status-card {
  flex: 0 0 auto;
  width: auto;
  min-width: 250px;
}
.cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.card { 
  background: #2a2a3e; 
  padding: 1.25rem; 
  border-radius: 6px; 
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  border: 1px solid #3a3a4e;
  flex: 0 0 calc(50% - 0.625rem);
  max-width: calc(50% - 0.625rem);
  box-sizing: border-box;
}
.card-full {
  flex: 0 0 100%;
  max-width: 100%;
  margin-top: 1.25rem;
}
.card h2 { font-size: 1.1rem; margin-bottom: .75rem; color: #e0e0e0; }
.card-error { border-left: 4px solid #ff6b6b; }
.card-error pre { white-space: pre-wrap; font-size: .85rem; color: #ff6b6b; }

/* ===== Search ===== */
.search-bar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-bar input, .search-bar textarea { flex: 1; padding: .45rem .6rem; border: 1px solid #4a4a5e; border-radius: 4px; background: #2a2a3e; color: #e0e0e0; }
.search-bar input::placeholder, .search-bar textarea::placeholder { color: #888; }

/* ===== Filters ===== */
.filter-panel { margin-bottom: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: .2rem; }
.filter-group label { font-size: .8rem; font-weight: 600; color: #e0e0e0; }
.filter-group input, .filter-group select { padding: .3rem .5rem; border: 1px solid #4a4a5e; border-radius: 4px; font-size: .85rem; width: 140px; background: #2a2a3e; color: #e0e0e0; }

/* Inline filters - 25% width, 4 per row */
.filters-form { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.filter-row { flex: 0 0 calc(25% - 0.75rem); display: flex; flex-direction: column; gap: 0.25rem; }
.filter-row label { font-size: 0.85rem; font-weight: 600; color: #e0e0e0; }
.filter-row select { padding: 0.4rem 0.5rem; border: 1px solid #4a4a5e; border-radius: 4px; font-size: 0.9rem; width: 100%; background: #2a2a3e; color: #e0e0e0; }
.filter-actions { flex: 0 0 100%; display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; font-size: .9rem; color: #e0e0e0; }
.pagination a { color: #5a9fff; text-decoration: none; }
.pagination a:hover { color: #7bb3ff; }

/* ===== Misc ===== */
.attr-tag { display: inline-block; background: #3a3a4e; padding: .1rem .4rem; border-radius: 3px; font-size: .8rem; margin: .1rem; color: #e0e0e0; }
.attrs-cell { max-width: 400px; }
.annotation {
  width: 100%;
  border: 1px solid #3a3a4e;
  background: #1e1e2e;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
}
.annotation-header {
  font-size: 0.85rem;
  color: #9aa5b1;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.annotation-meta {
  font-size: 0.85rem;
  color: #9aa5b1;
  font-weight: normal;
}
.annotation-meta a {
  color: #5a9fff;
  text-decoration: none;
}
.annotation-meta a:hover {
  color: #7bb3ff;
  text-decoration: underline;
}
.annotation-text {
  color: #e0e0e0;
  line-height: 1.5;
  white-space: pre-wrap;
}
#annotation-form {
  margin-top: 1rem;
  border: 1px solid #3a3a4e;
  background: #1e1e2e;
  padding: 0.5rem;
  border-radius: 4px;
}
#annotation-form .field {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.field-half {
  flex: 0 0 calc(50% - 0.5rem);
  max-width: calc(50% - 0.5rem);
}
.inline-form { display: flex; gap: .4rem; align-items: center; margin-top: .3rem; }
.inline-form input { flex: 1; padding: .5rem .6rem; border: 1px solid #4a4a5e; border-radius: 4px; font-size: .9rem; background: #2a2a3e; color: #e0e0e0; height: auto; }
.edit-input { padding: .25rem .4rem; border: 1px solid #4a4a5e; border-radius: 3px; background: #2a2a3e; color: #e0e0e0; }
.row-notfound td { color: #888; font-style: italic; }
.number-list { columns: 3; list-style: none; }
.number-list li { padding: .15rem 0; }
.number-list a { color: #5a9fff; }
.number-list a:hover { color: #7bb3ff; }

/* Status colours */
.status-queued { color: #f39c12; }
.status-running { color: #2d6cdf; }
.status-completed { color: #27ae60; }
.status-failed { color: #c0392b; }

.messages .msg { padding: .5rem 1rem; border-radius: 4px; margin-bottom: .5rem; }
.msg-success { background: #2d5a3d; color: #a8e6cf; border: 1px solid #3d6a4d; }
.msg-error { background: #5a2d2d; color: #ffb3b3; border: 1px solid #6a3d3d; }

/* Info box */
.info-box { background: #2a3a4e; padding: 12px; border-radius: 4px; margin-bottom: 16px; border: 1px solid #3a4a5e; color: #e0e0e0; }
.info-box code { background: #1e1e2e; padding: 2px 6px; border-radius: 3px; color: #5a9fff; }
.info-box a { color: #5a9fff; }
.info-box a:hover { color: #7bb3ff; }
