/* Offer Agent — modern plain CSS, mobile-first responsive. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1b2433;
  --muted: #6b7689;
  --border: #e2e8f2;
  --accent: #1f6feb;
  --accent-dark: #175cd3;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Top bar */
.topbar { background: #101828; color: #fff; position: sticky; top: 0; z-index: 50; }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.userbox .uname small { color: #b6c2d6; }
.mainnav {
  display: flex; gap: 2px; overflow-x: auto; padding: 0 12px 8px;
  max-width: 1200px; margin: 0 auto;
}
.mainnav a {
  color: #cfd8e6; text-decoration: none; padding: 8px 12px; border-radius: 8px;
  white-space: nowrap; font-size: .9rem;
}
.mainnav a:hover { background: #1d2939; color: #fff; }
.mainnav a.active { background: var(--accent); color: #fff; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 10px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }

/* Cards & stats */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.card.highlight { border: 2px solid var(--accent); }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat { text-decoration: none; color: inherit; text-align: center; transition: transform .08s; }
a.stat:hover { transform: translateY(-2px); border-color: var(--accent); }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { color: var(--muted); font-size: .85rem; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #f8fafd; font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
code { background: #eef2f7; padding: 1px 6px; border-radius: 6px; font-size: .85em; }
pre {
  background: #101828; color: #d5e0f0; padding: 14px; border-radius: 10px;
  overflow-x: auto; font-size: .82rem;
}
pre.resp { background: #0b3d2e; }

/* Forms */
.form-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; max-width: 860px;
}
label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .9rem; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input, select, textarea {
  width: 100%; padding: 10px 12px; margin-top: 4px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; background: #fff; color: var(--text);
}
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; font-size: .9rem;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: var(--err); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-block { width: 100%; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; margin-top: 0; }

/* Alerts, badges, pills */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; }
.alert.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .75rem;
  background: #eef2f7; color: var(--muted); font-weight: 700;
}
.badge.new { background: #dcfce7; color: #166534; }
.badge.role-admin { background: #dbeafe; color: #1e40af; }
.badge.role-seller { background: #fef3c7; color: #92400e; }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .78rem;
  background: #eef2f7; color: var(--muted); white-space: nowrap;
}
.pill.st-new { background: #dbeafe; color: #1e40af; }
.pill.st-offered, .pill.st-quoted, .pill.st-sent { background: #fef3c7; color: #92400e; }
.pill.st-accepted, .pill.st-won { background: #dcfce7; color: #166534; }
.pill.st-rejected, .pill.st-declined, .pill.st-lost { background: #fee2e2; color: #991b1b; }
.pill.st-in_work, .pill.st-draft { background: #f3f4f6; color: #4b5563; }
.pill.auto { background: #e0e7ff; color: #3730a3; }
.score { font-weight: 800; padding: 3px 10px; border-radius: 8px; }
.score.shi { background: #dcfce7; color: #166534; }
.score.smid { background: #fef3c7; color: #92400e; }
.score.slo { background: #eef2f7; color: var(--muted); }
.score.big { font-size: 1.3rem; }
.keybox { font-size: 1rem; background: #fff; border: 1px dashed var(--warn); padding: 8px 12px; border-radius: 8px; display: inline-block; margin: 6px 0; }

/* Dorks */
.dork-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px;
}
.dork-row code { flex: 1; min-width: 200px; }
ul.notes { list-style: none; padding: 0; }
ul.notes li { border-bottom: 1px solid var(--border); padding: 8px 0; }
ul.err-list { color: var(--err); }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px; width: 100%; max-width: 400px; box-shadow: 0 10px 30px rgba(16,24,40,.08);
}
.login-card h1 { margin-top: 0; }

.footer { text-align: center; color: var(--muted); padding: 20px; font-size: .8rem; }
.doc h3 { margin-top: 26px; }

/* Usage meters (subscription plans) */
.meter-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: .85rem; }
.meter-label { min-width: 120px; color: var(--muted); }
.meter { flex: 1; min-width: 80px; height: 10px; background: #e8edf5; border-radius: 6px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); border-radius: 6px; }
.meter > span.near { background: var(--warn); }
.meter > span.over { background: var(--err); }
.meter-val { min-width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.plan-card h3 { margin-top: 0; }
.badge-plan { display: inline-block; background: #eef4ff; border: 1px solid #c7dbff; color: #1f6feb; border-radius: 999px; padding: 2px 12px; font-size: .8rem; font-weight: 600; }
