:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --ok: #16a34a;
  --warn: #d97706;
  --error: #dc2626;
  --tag: #6366f1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 2rem;
  background: #0b0b0d;
  border-bottom: 1px solid #1f1f23;
  color: #f5f5f7;
}
.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: #f5f5f7;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.logo:hover { color: #ffffff; }
header .tag { color: #9ca3af; font-size: 0.85rem; }
.nav-links a { color: #d1d5db; }
.nav-links a:hover { color: #ffffff; text-decoration: underline; }

main { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

h1 { margin: 0 0 0.5rem; font-size: 1.4rem; }
h2 { margin: 0 0 1rem; font-size: 1.15rem; }
h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.muted { color: var(--muted); }
code { background: #f3f4f6; padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85rem; }
.small { font-size: 0.8rem; }

/* dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  cursor: pointer;
  margin: 1rem 0;
  background: #fafbfc;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover { background: #f0f4ff; border-color: var(--accent); }
.dropzone input { display: none; }
.dropzone-text { font-weight: 500; }

button, .btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 500;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:hover:not(:disabled), .btn:hover { background: #f9fafb; }
.btn.primary, button[type=submit]:not(:disabled) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn.primary:hover, button[type=submit]:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

#progress { margin-top: 1rem; }
.bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
#bar-fill { height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }
#progress-text { display: block; margin-top: 0.3rem; font-size: 0.85rem; color: var(--muted); }

.howto { margin-top: 1.5rem; color: var(--muted); }
.howto summary { cursor: pointer; font-weight: 500; color: var(--text); }
.howto ol { margin: 0.75rem 0 0 1rem; padding: 0; }
.howto li { margin-bottom: 0.3rem; }

/* report */
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: 0.5rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.stat {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.stat .num { display: block; font-size: 1.8rem; font-weight: 600; }
.stat .lbl { color: var(--muted); font-size: 0.8rem; }
.stat.ok .num { color: var(--ok); }
.stat.warn .num { color: var(--warn); }

.warnings { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 1rem; margin-top: 1rem; }
.warnings h3 { margin-bottom: 0.5rem; color: var(--warn); }
.warnings ul { margin: 0; padding-left: 1.2rem; }

/* table */
.result-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.result-table th, .result-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.result-table th { background: #fafbfc; font-weight: 600; }
.result-table tr.row-tag { background: #f5f3ff; }
.result-table tr.row-tag-uin-not-in-excel { background: #fef2f2; }
.result-table tr.row-no-tag-yet { background: #fffbeb; }
.thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 500; }
.badge.tag { background: #e0e7ff; color: #4338ca; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.black { background: #1f2937; color: #f9fafb; }
.badge.set { background: #fce7f3; color: #9d174d; }

.result-table tr.row-black-divider { background: #f3f4f6; color: var(--muted); }

footer { text-align: center; color: var(--muted); padding: 2rem; font-size: 0.85rem; }

.nav-links { margin-left: auto; font-size: 0.9rem; }
.nav-links a { text-decoration: none; }

/* /docs страница: рендер markdown из README */
.docs { line-height: 1.6; }
.docs h1 { font-size: 1.8rem; margin: 0 0 1rem; }
.docs h2 { font-size: 1.3rem; margin: 2rem 0 0.75rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
.docs h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.docs p { margin: 0.6rem 0; }
.docs ul, .docs ol { padding-left: 1.4rem; }
.docs li { margin: 0.3rem 0; }
.docs hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.docs code { background: #f3f4f6; padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
.docs pre { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.85rem; }
.docs pre code { background: transparent; color: inherit; padding: 0; }
.docs table { border-collapse: collapse; margin: 0.8rem 0; }
.docs table th, .docs table td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; }
.docs table th { background: #fafbfc; font-weight: 600; }
.docs blockquote { border-left: 3px solid var(--accent); margin: 0.8rem 0; padding: 0.2rem 1rem; color: var(--muted); }
.docs a { color: var(--accent); }
