@font-face { font-family: "Manrope"; src: url("fonts/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #14161a;
  --ink-2: #3b3f47;
  --muted: #7a808b;
  --line: #e6e7eb;
  --bg: #f4f5f7;
  --card: #fff;
  --red: #d7120f;
  --orange: #f39a2e;
  --grad: linear-gradient(90deg, #d7120f 0%, #ea4a1b 45%, #f39a2e 100%);
  --radius: 12px;
  --focus: 0 0 0 3px rgba(234, 74, 27, .18);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 1;
}
h1, h2 { font-family: "Manrope", "Inter", sans-serif; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 800; }
a { color: inherit; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-weight: 600; text-decoration: none; color: var(--red); }
.num { text-align: right; white-space: nowrap; }

/* ---------- Nav ---------- */
.nav { background: #15171c; color: #fff; position: sticky; top: 0; z-index: 20; }
.nav::after { content: ""; display: block; height: 3px; background: var(--grad); }
.nav-inner { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 34px; background: #fff; border-radius: 8px; padding: 3px 6px; }
.brand span { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 16px; }
.nav nav { display: flex; gap: 4px; }
.nav nav a { text-decoration: none; color: #b9bdc6; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.nav nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-right form { margin: 0; }
.rate-badge { font-size: 12px; color: #b9bdc6; border: 1px solid rgba(255,255,255,.14); padding: 5px 10px; border-radius: 999px; }
.rate-badge b { color: var(--orange); margin-left: 4px; }
.who { color: #d6d8de; font-weight: 600; font-size: 13px; }
.nav .btn.ghost { color: #d6d8de; border-color: rgba(255,255,255,.2); }
.nav .btn.ghost:hover { background: rgba(255,255,255,.08); }

/* ---------- Layout ---------- */
.container { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }
.back { display: inline-block; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.back:hover { color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head + .card-head, .fields + .card-head { margin-top: 26px; }
.card.narrow { max-width: 760px; }
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: start; }
.two-col .card { margin-bottom: 0; }
.empty { text-align: center; padding: 48px 20px; }
.empty h2 { margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 13.5px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #f7f7f9; border-color: #d4d6dc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label small { font-weight: 500; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #ea4a1b; box-shadow: var(--focus); }
.fields { display: grid; gap: 14px; }
.fields.cols-2 { grid-template-columns: repeat(2, 1fr); }
.fields.cols-3 { grid-template-columns: repeat(3, 1fr); }
.fields.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.form-foot { margin-top: 18px; display: flex; justify-content: flex-end; }
.hint { font-size: 12px; color: var(--muted); margin: -6px 0 14px; }
.hint.warn { color: #b4560c; }
.stack { display: grid; gap: 14px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.alert.success { background: #effaf3; border-color: #c6ecd3; color: #16693a; }
.alert.error { background: #fff1f0; border-color: #ffd1cc; color: #a3140f; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- List ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat small { display: block; color: var(--muted); font-weight: 600; }
.stat b { font-family: "Manrope", sans-serif; font-size: 22px; font-weight: 800; }
.stat.accent { background: #15171c; border-color: #15171c; color: #fff; }
.stat.accent small { color: #b9bdc6; }
.stat.accent b { color: var(--orange); }
.filters { display: flex; gap: 10px; margin-bottom: 14px; }
.filters input[type=search] { max-width: 420px; }
.filters select { width: auto; }
.table-card { padding: 0; overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafafb; }
table.list th.num { text-align: right; }
table.list td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fcfcfd; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.actions form { margin: 0; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eef0f3; color: var(--ink-2); }
.pill.gonderildi { background: #e8f1ff; color: #1f57c3; }
.pill.onaylandi { background: #e6f7ec; color: #16693a; }
.pill.reddedildi { background: #fff0ef; color: #a3140f; }

/* ---------- Quote form ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.form-side .sticky { position: sticky; top: 82px; }
.form-side h2 { margin-bottom: 12px; }
#customerPick { width: auto; max-width: 340px; }
.items-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.items-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.items-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 0 6px 8px; border-bottom: 1px solid var(--line); }
.items-table th.num { text-align: right; }
.items-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.items-table input, .items-table select { padding: 8px 9px; }
.items-table .i-desc { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); padding: 6px 9px; }
.c-idx { width: 30px; color: var(--red); font-family: "Manrope", sans-serif; font-weight: 800; padding-top: 18px !important; }
.c-qty { width: 84px; }
.c-unit { width: 92px; }
.c-price { width: 128px; }
.c-cur { width: 92px; }
.c-total { width: 128px; padding-top: 18px !important; }
.c-total small { display: block; color: var(--muted); font-size: 11.5px; }
.c-act { width: 96px; white-space: nowrap; text-align: right; }
.item-row.is-usd .i-price { border-color: #f3c58f; background: #fffaf3; }
.icon { width: 28px; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 15px; }
.icon:hover { background: #f2f3f5; color: var(--ink); }
.icon.danger:hover { color: var(--red); background: #fff1f0; }
.add-row { margin-top: 12px; width: 100%; padding: 10px; border: 1.5px dashed #d6d8de; border-radius: 9px; background: transparent; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.add-row:hover { border-color: #ea4a1b; color: #ea4a1b; }
label.plain textarea { font-weight: 400; }

.rate-box { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.rate-box label { margin-bottom: 10px; }
.rate-box input { font-size: 18px; font-weight: 700; }
.rate-box .hint { margin: 8px 0 0; }
.rate-box.needed input { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,18,15,.12); }
label.inline { flex-direction: row; align-items: center; justify-content: space-between; margin-bottom: 10px; }
label.inline input { width: 90px; text-align: right; }
.t-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.t-row span { color: var(--muted); }
.t-grand { margin-top: 12px; background: var(--grad); color: #fff; border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.t-grand span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.t-grand b { font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 800; }
.totals-box .hint { margin: 10px 0 0; }
.side-actions { display: grid; gap: 8px; margin-top: 18px; }

.user-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }

/* ---------- Auth ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #15171c radial-gradient(circle at 80% 0%, rgba(243,154,46,.25), transparent 50%); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-logo { display: block; height: 70px; margin: 0 auto 18px; }
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-card > p { text-align: center; margin: 4px 0 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-side .sticky { position: static; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-inner { gap: 12px; padding: 0 14px; }
  .brand span, .who { display: none; }
  .nav nav a { padding: 8px 8px; }
  .rate-badge { display: none; }
  .container { padding: 18px 14px 48px; }
  .fields.cols-2, .fields.cols-3, .fields.cols-4, .stats { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .card-head { flex-wrap: wrap; }
  .filters { flex-wrap: wrap; }
}
