/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  background: #f0f2f5;
  color: #1a1a2e;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
header {
  background: #1a1a2e;
  border-bottom: 2px solid #005bff;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: white;
}
header h1 { font-size: 17px; font-weight: bold; }
.badge {
  background: #005bff;
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 6px;
}
#account-selector label { color: #ccc; font-size: 12px; }
#account-selector select {
  margin-left: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  font-size: 13px;
}

/* ── Main ──────────────────────────────────────────────────────────────────── */
main { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── Toolbar ───────────────────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 8px; }

.btn {
  padding: 7px 16px;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: white;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary  { background: #005bff; }
.btn-primary:hover  { background: #0049cc; }
.btn-success  { background: #28a745; }
.btn-success:hover  { background: #1e7e34; }
.btn-danger   { background: #dc3545; }
.btn-danger:hover   { background: #b02a37; }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #545b62; }

/* ── Status bar ────────────────────────────────────────────────────────────── */
.status-bar {
  background: white;
  border: 1px solid #dde1ea;
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 12px;
  color: #444;
}

/* ── Two-column layout ─────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 10px;
  min-height: 400px;
}

/* ── Review list ───────────────────────────────────────────────────────────── */
.review-list {
  background: white;
  border: 1px solid #dde1ea;
  border-radius: 6px;
  overflow-y: auto;
}

table.reviews-table {
  width: 100%;
  border-collapse: collapse;
}
table.reviews-table th {
  background: #eaecf2;
  padding: 7px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
}
table.reviews-table td { padding: 6px 8px; border-bottom: 1px solid #f0f0f0; }
table.reviews-table tr:hover td { background: #f0f6ff; cursor: pointer; }
table.reviews-table tr.selected td { background: #d0e4ff; }

.stars { color: #f5a623; letter-spacing: 1px; }

.status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-new           { background: #dce8ff; color: #0055cc; }
.status-suggested     { background: #d4f5d4; color: #007a00; }
.status-processing    { background: #fff3cd; color: #856404; }
.status-processed     { background: #e8e8e8; color: #333; }
.status-error         { background: #ffe0e0; color: #cc0000; }
.status-skipped       { background: #f0f0f0; color: #777; }
.status-manual-only   { background: #fff0e0; color: #c44000; }
.status-pending_confirmation { background: #fff8d4; color: #8b6914; }

/* ── Review detail ─────────────────────────────────────────────────────────── */
.review-detail {
  background: white;
  border: 1px solid #dde1ea;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.meta-box {
  background: #f5f7fa;
  border: 1px solid #e0e4ed;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.7;
}

.review-text-box {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  font-size: 12px;
  max-height: 100px;
  overflow-y: auto;
  color: #444;
}

textarea.reply-edit {
  width: 100%;
  min-height: 80px;
  border: 1px solid #ccd0da;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
textarea.reply-edit:focus { border-color: #005bff; outline: none; }

.detail-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Log ───────────────────────────────────────────────────────────────────── */
details#log-section summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
  user-select: none;
}
.log {
  background: #111827;
  color: #22c55e;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 11px;
  padding: 10px 12px;
  border-radius: 5px;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Misc ──────────────────────────────────────────────────────────────────── */
.empty-hint { color: #999; text-align: center; padding: 40px 0; }

/* ── Header actions ────────────────────────────────────────────────────────── */
.header-actions { display: flex; gap: 8px; margin-left: auto; }

.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn-ozon { background: #005bff; }
.btn-ozon:hover:not(:disabled) { background: #0049cc; }
.btn-ozon:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay:not([hidden]) { display: flex; }

.modal {
  background: white;
  border-radius: 8px;
  padding: 24px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.modal-title { font-size: 16px; font-weight: 700; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: #555; font-weight: 600; }

.form-input {
  padding: 7px 10px;
  border: 1px solid #ccd0da;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
}
.form-input:focus { border-color: #005bff; outline: none; }

.modal-error {
  background: #ffe0e0;
  color: #cc0000;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
}

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Headless Login Modal ───────────────────────────────────────────────────── */
.modal-login {
  width: min(90vw, 900px);
  max-height: 90vh;
  overflow-y: auto;
}

.login-hint {
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
}

.screenshot-container {
  border: 2px solid #ccd0da;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  cursor: crosshair;
}

.login-screenshot {
  display: block;
  width: 100%;
  height: auto;
}

.login-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.login-input-row .form-input { flex: 1; }

.login-log {
  max-height: 140px;
  overflow-y: auto;
  background: #111;
  color: #ccc;
  font-size: 11px;
  padding: 8px;
  border-radius: 5px;
}
