 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:wght@400;500&display=swap');

/* ===== BODY ===== */
body {
  font-family: 'Inter', sans-serif;
  background: url('/background.png') no-repeat center center;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  color: #1a1a1a;
}

/* ===== CONTAINER ===== */
.container {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
  border: 1px solid #fcd34d; /* yellow accent */
  padding: 2.5rem 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}

/* ===== TITLE ===== */
h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
/*      margin-bottom: 0.8rem;*/
  background: linear-gradient(90deg, #b36b00, #804d00); /* dark gold/brown gradient */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  font-size: 0.95rem;
  color: #1a1a1a;
  margin-bottom: 2rem;
}

/* ===== LABELS ===== */
label {
  font-weight: 500;
  font-size: 0.95rem;
  color: #1a1a1a;
  display: block;
  margin-bottom: 0.5rem;
}

/* ===== INPUTS & SELECTS ===== */
.file-wrapper, .select-wrapper {
  margin-bottom: 1.5rem;
  width: 100%;
  text-align: left;
}

input[type="file"],
input[type="email"],
input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #fcd34d;
  font-size: 0.95rem;
  background: #fff8e5;
  color: #1a1a1a;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

#newsletter-test-form input[type="email"] {
  padding: 1rem 1.1rem;
  font-size: 1.05rem;
  min-height: 52px;
}

input[type="file"]:hover,
input[type="email"]:hover,
input[type="text"]:hover,
input[type="password"]:hover,
select:hover {
  border-color: #fbbf24;
  box-shadow: 0 4px 12px rgba(251,191,36,0.25);
}

input[type="file"]:focus,
input[type="email"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: #fbbf24;
  box-shadow: 0 0 0 4px rgba(251,191,36,0.2);
}

/* ===== SUBMIT BUTTON ===== */
input[type="submit"] {
  background: linear-gradient(90deg, #fbbf24, #fcd34d);
  color: #1a1a1a;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  padding: 0.9rem;
  cursor: pointer;
  font-size: 1rem;
  width: 100%;
  transition: all 0.2s ease;
}

input[type="submit"]:hover {
  background: linear-gradient(90deg, #fcd34d, #fbbf24);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(251,191,36,0.3);
}

/* ===== FOOTER ===== */
footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: #1a1a1a;
}

/* ===== NOTICE MESSAGE ===== */
.notice {
  background-color: #fef3c7; /* light yellow background */
  color: #b45309; /* darker yellow/brown text */
  border: 1px solid #fcd34d; /* yellow accent border */
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 10px rgba(251,191,36,0.2);
  animation: noticeFade 0.5s ease-in-out;
}

/* Optional: fade-in animation */
@keyframes noticeFade {
  0% { opacity: 0; transform: translateY(-5px); }
  100% { opacity: 1; transform: translateY(0); }
}

#logs {
  white-space: pre-wrap;
  height: 120px;               /* fixed height */
  overflow-y: scroll;          /* always show vertical scroll */
  padding: 12px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: monospace;
  font-size: 14px;
}

#content_check {
  white-space: pre-wrap;
  height: 120px;               /* fixed height */
  overflow-y: scroll;          /* always show vertical scroll */
  padding: 12px;
  background-color: #FF7F7F;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: monospace;
  font-size: 14px;
  color: white;
}

.logs-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* centers the table horizontally */
  margin-top: 40px;
}

.logs-table {
  border-collapse: separate; /* allows border-radius on table */
  border-spacing: 0;
  width: 80%;
  max-width: 800px;
  background-color: #fdfdf0; /* very light yellowish background */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 16px; /* more rounded corners */
  overflow: hidden;
}

.logs-table th,
.logs-table td {
  padding: 12px 18px;
  text-align: left;
  width: 180px;
}

.logs-table th {
  background: linear-gradient(90deg, #a2d39c, #fdfd96); /* soft green-yellow gradient */
  color: #202020;
  font-weight: 600;
}

.logs-table td {
  border-bottom: 1px solid #e0e0c2; /* soft divider */
}

.logs-table tr:nth-child(even) td {
  background-color: #f8f9e0; /* alternating soft row color */
}

.logs-table tr:hover td {
  background-color: #e6f2c3; /* gentle hover highlight */
}

.logs-table a {
  color: #4a772e; /* soft green link */
  text-decoration: none;
  font-weight: 500;
}

.logs-table a:hover {
  text-decoration: underline;
}

a[href="/logs"],
a[href="/newsletter_logs"],
a[href="/newsletter_test"],
a[href="/import"],
a[href="/scheduled_jobs"],
a[href="/subscription_statuses"] {
  display: inline-block;
  padding: 22px 18px;
  margin-top: 20px;
  background: linear-gradient(90deg, #fcd34d88, #fde68a88); 

  color: #202020;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

a[href="/logs"]:hover,
a[href="/newsletter_logs"]:hover,
a[href="/newsletter_test"]:hover,
a[href="/import"]:hover,
a[href="/scheduled_jobs"]:hover,
a[href="/subscription_statuses"]:hover {
  background: linear-gradient(90deg, #fcd34d88, #fde68a88);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.home-container {
  max-width: 680px;
}

.dashboard-links {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-link {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 28px;
  padding: 0 14px;
  margin-top: 0;
  line-height: 1.25;
  border-radius: 16px;
  border: 1px solid #fbbf24;
  background: linear-gradient(145deg, #fff7cc, #fde68a);
  color: #202020;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 8px 18px rgba(251, 191, 36, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dashboard-link:hover {
  transform: translateY(-2px);
  background: linear-gradient(145deg, #fff3b0, #fcd34d);
  box-shadow: 0 12px 24px rgba(251, 191, 36, 0.35);
}

@media (max-width: 640px) {
  .dashboard-links {
    grid-template-columns: 1fr;
  }
}

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(251,191,36,0.35);
}

.brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
  background: linear-gradient(90deg, #b36b00, #804d00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  color: #6b4b12;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  background: rgba(251,191,36,0.18);
  transform: translateY(-1px);
}

.nav-link.is-active {
  background: rgba(251,191,36,0.22);
}

/* ===== PAGE TITLE ===== */
.page-title {
  margin: 18px 0 14px;
  font-size: 2.1rem;
}

/* ===== STATS ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  gap: 8px;
  margin: 10px 0 18px;
}

.stat {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 16px;
  padding: 10px 12px;
  text-align: left;
  box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

.stat-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0,0,0,0.08);
  border-color: rgba(251,191,36,0.6);
}

.stat-link.is-active {
  border-color: rgba(217, 119, 6, 0.72);
  background: linear-gradient(180deg, rgba(255, 244, 214, 0.98), rgba(254, 233, 175, 0.92));
}

.stat-label {
  font-size: 0.8rem;
  color: #6b4b12;
  margin-bottom: 4px;
  font-weight: 600;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #202020;
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.card-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 18px 18px;
  border-radius: 18px;
  border: 1px solid rgba(251,191,36,0.55);
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  color: #202020;
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.card-link-wide {
  grid-column: span 2;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.card-link:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 30px rgba(0,0,0,0.12);
}

.card-link-accent {
  background: linear-gradient(145deg, #fff7cc, #fde68a);
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 10px 22px rgba(251, 191, 36, 0.28);
}

.card-link-accent:hover {
  background: linear-gradient(145deg, #fff3b0, #fcd34d);
  box-shadow: 0 16px 30px rgba(251, 191, 36, 0.34);
}

.card-link-affiliates:hover,
.card-link-affiliates:active {
  background: linear-gradient(145deg, #fff7cc, #fde68a);
  box-shadow: 0 16px 30px rgba(251, 191, 36, 0.28);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fff7cc, #fde68a);
  border: 1px solid rgba(251,191,36,0.6);
  font-size: 22px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.card-subtitle {
  font-size: 0.92rem;
  color: #5a5a5a;
  font-weight: 500;
  text-align: center;
}

.jobs-panel {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(251,191,36,0.4);
  background: rgba(255,255,255,0.78);
  box-shadow: 0 12px 26px rgba(0,0,0,0.08);
  text-align: left;
}

.jobs-panel-standalone {
  margin-top: 0;
}

.jobs-panel-header {
  margin-bottom: 14px;
}

.jobs-panel-title {
  margin: 0;
  font-size: 1.55rem;
  text-align: left;
}

.jobs-panel-subtitle {
  margin: 8px 0 0;
  color: #6b4b12;
}

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

.jobs-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.jobs-table th,
.jobs-table td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(180, 131, 29, 0.14);
}

.jobs-table th {
  color: #6b4b12;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.jobs-table tbody tr:last-child td {
  border-bottom: none;
}

.jobs-name {
  font-size: 1rem;
  font-weight: 700;
  color: #202020;
}

.jobs-meta {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #6b4b12;
  line-height: 1.45;
}

.jobs-code {
  margin-top: 6px;
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: #3b2f15;
  background: rgba(251,191,36,0.12);
  border-radius: 10px;
  padding: 4px 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.status-pill.is-running {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.status-pill.is-queued {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.status-pill.is-idle {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.status-pill.is-disabled {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

.jobs-empty,
.jobs-error {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.94rem;
}

.jobs-empty {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.jobs-error {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
}

/* Footer */
.footer {
  margin-top: 20px;
  font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 640px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  .card-link-wide {
    grid-column: auto;
  }
  .jobs-panel {
    padding: 16px;
  }
  .jobs-table {
    min-width: 720px;
  }
}

.report-shell {
  width: 100%;
  padding: 32px 20px;
  box-sizing: border-box;
}

.report-card {
  max-width: 1420px;
  margin: 0 auto;
  background: rgba(255,255,255,0.97);
  /* `backdrop-filter` is very expensive on large, scrollable report pages (janky scrolling/typing). */
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
  border: 1px solid #fcd34d;
  padding: 28px 24px 24px;
}

.report-meta {
  margin: 0 0 16px;
}

.report-controls {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.report-select {
  margin-bottom: 0;
  max-width: 260px;
}

.report-filter-field {
  display: grid;
  gap: 6px;
  color: #6b4e09;
  font-size: 0.92rem;
  font-weight: 600;
}

.report-filter-field select {
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(180, 131, 29, 0.24);
  background: rgba(255, 253, 247, 0.96);
  color: #2d2310;
}

.report-filter-field input {
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(180, 131, 29, 0.24);
  background: rgba(255, 253, 247, 0.96);
  color: #2d2310;
}

.report-button {
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(90deg, #fbbf24, #fcd34d);
  color: #1a1a1a;
  font-weight: 700;
  cursor: pointer;
}

.report-error {
  text-align: left;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid rgba(251,191,36,0.35);
  background: rgba(255,255,255,0.85);
}

.report-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.report-table th,
.report-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #efe2b4;
}

.report-table th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #fff6cc, #fde68a);
  z-index: 1;
}

.report-table th.is-sorted {
  background: linear-gradient(180deg, #fde68a, #fbbf24);
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.sort-link:hover {
  text-decoration: underline;
}

.sort-indicator {
  min-width: 0.9em;
  color: #6b4b12;
}

.report-value-link {
  color: #0f4c81;
  text-decoration: none;
  font-weight: 600;
}

.report-value-link:hover {
  text-decoration: underline;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.comment-input {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #e4c96f;
  border-radius: 10px;
  background: #fffdf5;
  color: #202020;
  font: inherit;
  line-height: 1.35;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.comment-input.is-saved {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.comment-input.is-error {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.comment-save-button {
  align-self: flex-start;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  background: linear-gradient(90deg, #fbbf24, #fcd34d);
  color: #1a1a1a;
  font-weight: 700;
  cursor: pointer;
}

.comment-save-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.comment-save-button:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.comment-status {
  min-height: 1.2em;
  font-size: 0.84rem;
  font-weight: 600;
}

.comment-status.is-error {
  color: #b91c1c;
}

.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  padding: 14px 16px 0;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid rgba(251,191,36,0.35);
  background: linear-gradient(180deg, rgba(255, 250, 235, 0.98), rgba(255, 241, 191, 0.92));
  box-shadow: 0 8px 18px rgba(107, 75, 18, 0.08);
  color: #6b4e09;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.pagination-link:hover {
  background: linear-gradient(180deg, rgba(255, 244, 204, 1), rgba(251, 224, 120, 0.95));
  border-color: rgba(217, 119, 6, 0.35);
  box-shadow: 0 10px 22px rgba(107, 75, 18, 0.14);
  transform: translateY(-1px);
}

.pagination-link.is-active {
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  border-color: rgba(217, 119, 6, 0.65);
  box-shadow: 0 10px 22px rgba(217, 119, 6, 0.18);
  color: #1a1a1a;
}

.report-table tbody tr:nth-child(even) {
  background: rgba(255, 248, 229, 0.6);
}

.report-table tbody tr.is-deleted {
  background: rgba(239, 68, 68, 0.2);
}

.report-table tbody tr.is-deleted:nth-child(even) {
  background: rgba(239, 68, 68, 0.24);
}

.report-table tbody tr:hover {
  background: rgba(251,191,36,0.12);
}

.report-table tbody tr.is-deleted:hover {
  background: rgba(239, 68, 68, 0.3);
}

.status-active {
  color: #166534;
  font-weight: 700;
}

.status-inactive {
  color: #7c2d12;
  font-weight: 600;
}

.affiliate-create-card {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 20px;
  background: rgba(255, 248, 229, 0.7);
}

.affiliate-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.affiliate-field {
  margin: 0;
}

.affiliate-field input {
  margin-top: 6px;
}

.password-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.password-input-wrap input {
  margin-top: 0;
}

.password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fff8e5;
  color: #6b4b12;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
  color: #b36b00;
  border-color: #fbbf24;
  box-shadow: 0 4px 12px rgba(251,191,36,0.25);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.9);
  outline-offset: 2px;
}

.password-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.affiliate-table {
  min-width: 980px;
}

.affiliate-table .password-input-wrap {
  margin-top: 0;
}

.affiliate-table td > input,
.affiliate-table td .password-input-wrap input {
  margin-top: 0;
}

.affiliate-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.danger-button {
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  background: linear-gradient(90deg, #ef4444, #f87171);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.danger-button:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.affiliate-password-hint {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 0.84rem;
  color: #6b4b12;
}

.affiliate-lock-note {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #6b4b12;
}

.payments-table {
  min-width: 1080px;
}

.payments-table-compact {
  min-width: 840px;
}

.payment-status-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.payment-status-form select {
  min-width: 130px;
}

.payment-state {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.payment-state-pending {
  background: rgba(251, 191, 36, 0.18);
  color: #92400e;
}

.payment-state-paid {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

.payment-state-cancelled {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.danger-button:disabled,
.comment-save-button:disabled,
.report-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 640px) {
  .report-shell {
    padding: 18px 10px;
  }

  .report-card {
    padding: 20px 14px;
  }

  .report-controls {
    align-items: stretch;
  }

  .report-select {
    max-width: none;
    width: 100%;
  }

  .affiliate-form-grid {
    grid-template-columns: 1fr;
  }
}
