:root {
  --wine-900: #4a0d19;
  --wine-700: #63101f;
  --wine-600: #7f1528;
  --wine-500: #952036;
  --rose-100: #fbede8;
  --rose-200: #f5d9cf;
  --rose-400: #e5a393;
  --rose-500: #db8974;
  --ink: #2b1c1d;
  --ink-soft: #6b5658;
  --bg: #fffdfc;
  --bg-alt: #fbf3f0;
  --border: #f0e0da;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(127, 21, 40, 0.1);
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --danger: #b3261e;
  --success: #1b7a4d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-alt);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--wine-600);
  margin: 0 0 0.4em;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

.hidden { display: none !important; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-card img { height: 40px; margin-bottom: 24px; }
.login-card h1 { font-size: 1.5rem; }

/* App shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 230px;
  background: var(--wine-600);
  color: #fff;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar img { height: 30px; margin-bottom: 28px; filter: brightness(0) invert(1); }
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.85);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.1); }
.nav-item.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 500; }
.sidebar-footer { margin-top: auto; }

.main {
  flex: 1;
  padding: 36px 44px;
  max-width: 900px;
}

/* Cards / forms */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--rose-400);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-card strong { display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--wine-600); }
.stat-card span { font-size: 0.85rem; color: var(--ink-soft); }

label {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 6px;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  margin-bottom: 16px;
}
textarea { resize: vertical; min-height: 90px; }

button.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--wine-600);
  color: #fff;
}
button.btn:hover { background: var(--wine-700); }
button.btn:disabled { opacity: 0.6; cursor: not-allowed; }
button.btn-ghost {
  background: transparent;
  color: var(--wine-600);
  border-color: var(--rose-400);
}

.message {
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.message.error { color: var(--danger); }
.message.success { color: var(--success); }

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
th { color: var(--ink-soft); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

.screen-intro {
  max-width: 62ch;
  margin-top: -4px;
  margin-bottom: 22px;
  font-size: 0.93rem;
}

.empty-note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

button.btn-small {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: 999px;
}

button.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: #e7c9c6;
}
button.btn-danger:hover { background: #fdf2f1; }

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; }

.done-note {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 500;
}

td code {
  background: var(--rose-100);
  color: var(--wine-600);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.card h3 { margin-bottom: 16px; }

.auto-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.7;
}
.auto-list strong { color: var(--wine-600); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
  margin-bottom: 18px;
}
.checkbox-row input { width: auto; margin: 0; }

.image-preview {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.image-preview img {
  max-width: 220px;
  max-height: 140px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.campaign-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-alt);
}
.campaign-thumb {
  width: 108px;
  height: 74px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.campaign-thumb-empty { background: var(--rose-100); }
.campaign-info { flex: 1; min-width: 0; }
.campaign-info strong { color: var(--wine-600); display: block; margin-bottom: 3px; }
.campaign-info p {
  margin: 0 0 5px;
  font-size: 0.89rem;
  line-height: 1.5;
}
.campaign-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}

.request-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg-alt);
}
.request-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.request-meta {
  font-size: 0.83rem;
  color: var(--ink-soft);
  margin-top: 2px;
}
.request-search {
  display: flex;
  gap: 8px;
  align-items: center;
}
.request-search input { margin-bottom: 0; }
.request-search .btn { flex-shrink: 0; }

.search-results:not(:empty) { margin-top: 12px; }
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.radio-row { display: flex; gap: 18px; margin-bottom: 16px; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin-bottom: 0; }
.radio-row input { width: auto; margin: 0; }
