/* EasyPurchase UI (T-012) — компактный внутренний инструмент. */
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1a1a1a; background: #f4f5f7; }
a { color: #1858c2; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; } h2 { font-size: 16px; margin: 0 0 8px; } h3 { font-size: 14px; }
.muted { color: #6b7280; } .small { font-size: 12px; }
.hidden { display: none; }

/* топбар */
.topbar { display: flex; align-items: center; gap: 16px; background: #1f2937; color: #fff; padding: 8px 16px; }
.topbar a { color: #d1d5db; } .topbar a:hover { color: #fff; }
.topbar .brand { font-weight: 700; color: #fff; font-size: 16px; }
.topbar .spacer { flex: 1; } .topbar .who { color: #9ca3af; font-size: 12px; }

/* кнопки/формы */
button, .btn { display: inline-block; cursor: pointer; border: 1px solid #c3c9d2; background: #fff; color: #1a1a1a;
  padding: 5px 10px; border-radius: 6px; font-size: 13px; }
button[type=submit], #btn-export { background: #1858c2; color: #fff; border-color: #1858c2; }
button:hover, .btn:hover { filter: brightness(0.97); text-decoration: none; }
.btn.danger { color: #b91c1c; border-color: #e3b3b3; }
input, select, textarea { padding: 5px 8px; border: 1px solid #c3c9d2; border-radius: 6px; font-size: 13px; font-family: inherit; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row-form.compact { gap: 4px; }
.card-form { display: flex; flex-direction: column; gap: 6px; max-width: 360px; margin-bottom: 12px; }
.card-form .inline { display: flex; gap: 8px; align-items: center; }
.w-qty { width: 70px; } .w-unit { width: 55px; }

/* таблицы */
.grid { width: 100%; border-collapse: collapse; background: #fff; }
.grid th, .grid td { border: 1px solid #e5e7eb; padding: 5px 7px; text-align: left; vertical-align: top; }
.grid th { background: #eef1f5; font-weight: 600; position: sticky; top: 0; }
.grid.mini th, .grid.mini td { padding: 3px 5px; font-size: 12px; }
.grid tr.best { background: #eafaef; }

.container { padding: 16px; max-width: 1100px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; max-width: 1300px; }
.form-actions { display: flex; gap: 8px; }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* статусы парсинга */
.status { padding: 1px 7px; border-radius: 10px; font-size: 12px; }
.status.queued, .status.parsing { background: #fef3c7; color: #92400e; }
.status.active { background: #dcfce7; color: #166534; }
.status.error { background: #fee2e2; color: #991b1b; cursor: help; }

/* вход */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { background: #fff; padding: 28px 32px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.1);
  display: flex; flex-direction: column; gap: 12px; width: 300px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.login-card .error { background: #fee2e2; color: #991b1b; padding: 8px; border-radius: 6px; }

/* трёхпанельный экран */
.workspace { padding: 0; }
.three-pane { display: grid; grid-template-columns: 300px 1fr 360px; gap: 0; height: calc(100vh - 41px); }
.pane { padding: 12px; overflow-y: auto; border-right: 1px solid #e5e7eb; }
.pane-right { border-right: none; }
.pane-center { background: #fafbfc; }
.counter { margin: 6px 0; }
.bulk { margin: 8px 0; }
.bulk textarea { width: 100%; }

.lines { list-style: none; padding: 0; margin: 8px 0 0; }
.line { display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid #e5e7eb; border-radius: 6px;
  margin-bottom: 6px; background: #fff; border-left: 3px solid #c3c9d2; }
.line.matched { border-left-color: #16a34a; }
.line.no_match { border-left-color: #b91c1c; }
.line-name { font-weight: 600; }
.line-qty { color: #6b7280; font-size: 12px; }
.line-actions { display: flex; gap: 4px; margin-top: 4px; }

.results td input { width: 64px; }
.cart-group { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; margin-bottom: 10px; background: #fff; }
.cart-head { display: flex; justify-content: space-between; }
.cart-sub { text-align: right; margin-top: 4px; }
.cart-total { margin: 10px 0; font-size: 15px; }
.export-actions { display: flex; gap: 8px; margin-bottom: 10px; }
#export-result div { margin: 4px 0; }
