/* styles.css — professional, dark-text-on-light, responsive.
   The layout is two panels side by side on desktop and stacked on mobile. */

:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --ink: #22201c;
  --muted: #6b6157;
  --line: #e3ded6;
  --accent: #5b4636;      /* warm bronze-brown */
  --accent-dark: #3f3025;
  --green: #2e7d4f;
  --green-bg: #e4f2ea;
  --amber: #b8791b;
  --amber-bg: #fbf0dc;
  --red: #b3352c;
  --red-bg: #f8e3e1;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 6px 20px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

h1, h2, h3 { font-weight: 600; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--panel);
  padding: 40px 34px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 380px;
}
.brand { margin: 0; font-size: 30px; letter-spacing: 0.5px; color: var(--accent-dark); }
.subtitle { margin: 4px 0 26px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; font-size: 13px; margin: 14px 0 6px; color: var(--muted); }
.login-card input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 15px; background: #fff; color: var(--ink);
}
.login-card button { margin-top: 22px; }

/* ---------- Buttons ---------- */
button { cursor: pointer; font-size: 15px; font-family: inherit; }
.primary-btn, .login-card button {
  width: 100%; background: var(--accent); color: #fff; border: none;
  padding: 12px; border-radius: 8px; font-weight: 600;
}
.primary-btn:hover, .login-card button:hover { background: var(--accent-dark); }
.primary-btn:disabled { opacity: 0.6; cursor: default; }
.ghost-btn {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  padding: 8px 14px; border-radius: 8px;
}
.ghost-btn:hover { background: #f0ece5; }

/* ---------- Top bar ---------- */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand-small { font-size: 18px; font-weight: 600; color: var(--accent-dark); }
.tag {
  font-size: 12px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); padding: 2px 8px; border-radius: 20px; margin-left: 6px;
}

/* ---------- Workspace layout ---------- */
.workspace {
  max-width: 1200px; margin: 0 auto; padding: 22px 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start;
}
@media (max-width: 840px) {
  .workspace { grid-template-columns: 1fr; }
}
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px; box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 16px; font-size: 18px; }

/* ---------- Upload form ---------- */
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; }
.field-label:first-of-type { margin-top: 0; }
.file-drop {
  display: block; border: 2px dashed var(--line); border-radius: 10px;
  padding: 22px; text-align: center; color: var(--muted); cursor: pointer;
  background: #faf8f5;
}
.file-drop:hover { border-color: var(--accent); color: var(--accent); }
textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; font-size: 15px; font-family: inherit; resize: vertical; color: var(--ink);
}
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumbs .thumb {
  position: relative; width: 74px; height: 74px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--line);
}
.thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .thumb .remove {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6);
  color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px;
  font-size: 12px; line-height: 1; padding: 0;
}

/* ---------- Spinner / errors ---------- */
.spinner { margin-top: 14px; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.spinner .dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-text { color: var(--red); font-size: 14px; margin: 10px 0 0; min-height: 1em; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- History list ---------- */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: flex; gap: 12px; align-items: center; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; cursor: pointer;
}
.history-item:hover { border-color: var(--accent); background: #faf8f5; }
.history-item .hi-thumb {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
  background: #eee; flex-shrink: 0; border: 1px solid var(--line);
}
.history-item .hi-body { flex: 1; min-width: 0; }
.history-item .hi-date { font-size: 13px; color: var(--muted); }
.history-item .hi-note {
  font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap;
}
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.grey { background: #ececec; color: #555; }

/* ---------- Report overlay ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 25, 20, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px; overflow-y: auto; z-index: 50;
}
.report-card {
  background: var(--panel); border-radius: 14px; padding: 26px;
  max-width: 780px; width: 100%; box-shadow: var(--shadow); position: relative;
}
.report-close { position: absolute; top: 16px; right: 16px; }
.report-content h3 { margin: 22px 0 6px; font-size: 16px; color: var(--accent-dark); }
.report-content h3:first-child { margin-top: 0; }
.report-content p { margin: 0 0 4px; }
.report-content ul { margin: 4px 0 0; padding-left: 20px; }
.report-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.report-images { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.report-images img {
  width: 130px; height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
}
.report-meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.report-note {
  background: #faf8f5; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; font-size: 14px; margin-bottom: 4px; white-space: pre-wrap;
}
