/* Los Chollos del Tato — manual publishing UI */
:root {
  --bg: #0f1419;
  --bg-elev: #1a2129;
  --bg-elev-2: #232c36;
  --text: #e6edf3;
  --text-muted: #8b96a3;
  --border: #2a3340;
  --accent: #ff7a00;          /* Amazon orange */
  --accent-text: #fff;
  --primary: #2e80ff;
  --primary-text: #fff;
  --danger: #d9534f;
  --success: #2ecc71;
  --radius: 10px;
  --space: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 28px; margin: 24px 0 8px; }
h2 { font-size: 20px; margin: 24px 0 8px; }
p { margin: 8px 0; }
code { background: var(--bg-elev-2); padding: 2px 6px; border-radius: 4px; }

.muted { color: var(--text-muted); }
.inline { display: inline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); font-size: 18px; }
.brand:hover { text-decoration: none; opacity: 0.9; }
.topbar nav { display: flex; gap: 18px; }
.navlink { color: var(--text-muted); font-weight: 500; }
.navlink:hover { color: var(--text); text-decoration: none; }
.user { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.login-card {
  max-width: 360px;
  margin: 80px auto;
  text-align: center;
}
.login-card h1 { margin-top: 0; }
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
  text-align: left;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
input[type="text"], input[type="password"], input[type="number"], textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

button, .primary {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-text);
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button:hover, .primary:hover { filter: brightness(1.1); text-decoration: none; }
button.ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
}
button.ghost:hover { color: var(--text); }

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 14px;
}
.alert.error { background: rgba(217, 83, 79, 0.15); color: #ffb3b1; border: 1px solid rgba(217, 83, 79, 0.4); }
.alert.success { background: rgba(46, 204, 113, 0.12); color: #8ee2a8; border: 1px solid rgba(46, 204, 113, 0.4); }

.empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.card-grid {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-top: 20px;
}
.msg img { width: 100%; border-radius: 8px; display: block; margin-bottom: 12px; }
.msg-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.msg-text { font-size: 14px; max-height: 8em; overflow: hidden; }
.msg-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.msg-footer .asin { font-family: monospace; color: var(--text-muted); font-size: 13px; }
.source { font-weight: 600; color: var(--text); }

.filters {
  display: flex;
  gap: 8px;
  margin: 18px 0 4px;
  flex-wrap: wrap;
}
.filter {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.filter:hover { color: var(--text); text-decoration: none; }
.filter.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

.status-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.status-pill.status-pending  { background: rgba(46, 128, 255, 0.18); color: #93c0ff; }
.status-pill.status-published{ background: rgba(46, 204, 113, 0.18); color: #6ddc9c; }
.status-pill.status-skipped  { background: rgba(139, 150, 163, 0.18); color: var(--text-muted); }

.msg.status-published { opacity: 0.55; }
.msg.status-skipped   { opacity: 0.4; }

/* Compose page */
.back {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 18px 0 0;
}
.compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 24px;
  margin-top: 18px;
}
@media (max-width: 980px) {
  .compose-layout { grid-template-columns: 1fr; }
}
.compose-form .price-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.compose-form .price-row label {
  flex: 0 0 auto;
  width: 150px;
  margin-bottom: 4px;
}
.compose-form .price-row input { width: 100%; }
.form-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #ffb3b1;
}
.compose-form label { margin-bottom: 14px; }
.compose-form textarea {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  resize: vertical;
}
.compose-form .actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.skip-form { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.required { color: #ff8b8b; font-weight: 700; }
.alert.warning {
  background: rgba(255, 175, 0, 0.12);
  color: #ffd591;
  border: 1px solid rgba(255, 175, 0, 0.35);
}
.alert.warning a { color: #ffd591; text-decoration: underline; }

.compose-side { display: flex; flex-direction: column; gap: 16px; }
.compose-side img { width: 100%; border-radius: 8px; display: block; background: #fff; }
.small { font-size: 12px; }
.raw-image {
  width: 100%;
  display: block;
  border-radius: 6px;
  margin: 10px 0;
  background: #fff;
  border: 1px solid var(--border);
}
.raw-text {
  white-space: pre-wrap;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  max-height: 320px;
  overflow: auto;
}

.hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.hint code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.link-row input { flex: 1; min-width: 0; }
.link-row .small {
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.link-row a.small { text-decoration: none; }

.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.upload-row input[type="file"] {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.upload-row input[type="file"]::file-selector-button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  margin-right: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.upload-row input[type="file"]::file-selector-button:hover {
  background: var(--bg-elev-2);
}
.upload-row .small {
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.affiliate-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 12px;
  background: rgba(255, 122, 0, 0.10);
  border: 1px solid rgba(255, 122, 0, 0.45);
  border-radius: 10px;
  transition: border-color 120ms, background 120ms, box-shadow 120ms;
}
.affiliate-field:focus-within {
  border-color: var(--accent);
  background: rgba(255, 122, 0, 0.16);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.18);
}
.affiliate-field__icon {
  font-size: 18px;
  opacity: 0.9;
}
.affiliate-field input {
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 0;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}
.affiliate-field input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

button:disabled,
button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
