@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Qorong'i mavzu: grafit-kulrang fon, sariq-oltin yozuvlar, logo harflari oq + oltin belgilar */
:root {
  --bg: #1e1e20;
  --surface: #2a2a2d;
  --surface-2: #343438;
  --border: #3d3d42;
  --text: #ecebe6;
  --muted: #a3a3a8;
  --accent: #e2bb5c;
  --accent-ink: #1e1e20;
  --accent-soft: rgba(226, 187, 92, .13);
  --heading: #e8c46a;
  --btn-primary: #dcb558;
  --wm-fill: #f3f1ec;
  --ok: #7bd29c;
  --warn: #f0c35f;
  --danger: #f08070;
  --radius: 10px;
  --shadow: 0 10px 34px rgba(0, 0, 0, .5);
  --serif: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --st-0: #a5a9b4; --st-1: #bfa3ea; --st-2: #86b8ec; --st-3: #e2bb5c;
  --st-4: #eaa877; --st-5: #72cccc; --st-6: #a2d685; --st-7: #7bd29c;
  color-scheme: dark;
}
/* Yorug' (asosiy) mavzu: oq fon, to'q ko'k matn, oltin faqat asosiy tugmalarda */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6f8; --surface: #ffffff; --surface-2: #eef1f5; --border: #e3e7ee;
    --text: #0b1b3f; --muted: #5b6478; --accent: #0b1b3f; --accent-ink: #ffffff;
    --accent-soft: rgba(11, 27, 63, .07); --ok: #1f8a4c; --warn: #a86a00; --danger: #c8372d;
    --btn-primary: #c9a54c; --wm-fill: #0b1b3f; --heading: #0b1b3f;
    --shadow: 0 8px 24px rgba(11, 27, 63, .10);
    --st-0: #64748b; --st-1: #7c4dbd; --st-2: #2563c9; --st-3: #a07a1f;
    --st-4: #c2571d; --st-5: #0f8a8a; --st-6: #4a8a1f; --st-7: #1f8a4c;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #eef1f5; --border: #e3e7ee;
  --text: #0b1b3f; --muted: #5b6478; --accent: #0b1b3f; --accent-ink: #ffffff;
  --accent-soft: rgba(11, 27, 63, .07); --ok: #1f8a4c; --warn: #a86a00; --danger: #c8372d;
  --btn-primary: #c9a54c; --wm-fill: #0b1b3f; --heading: #0b1b3f;
  --shadow: 0 8px 24px rgba(11, 27, 63, .10);
  --st-0: #64748b; --st-1: #7c4dbd; --st-2: #2563c9; --st-3: #a07a1f;
  --st-4: #c2571d; --st-5: #0f8a8a; --st-6: #4a8a1f; --st-7: #1f8a4c;
  color-scheme: light;
}

/* ---- Logotip ---- */
/* Tekis rang: Safari (iOS) background-clip:text ni ichki inline-block "A" ga qo'llamaydi va harf yo'qolib qoladi */
.wm { font-family: var(--serif); font-weight: 500; letter-spacing: .14em; line-height: 1; white-space: nowrap; color: var(--wm-fill); }
.wm .a { position: relative; display: inline-block; }
.wm .a::after {
  content: ""; position: absolute; left: 26%; right: 34%; top: 51.5%; height: .09em;
  background: linear-gradient(180deg, #ecd08a, #c9a54c 55%, #8a6a24);
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}
.swoosh { height: 4px; background: linear-gradient(90deg, rgba(201, 165, 76, 0), #8a6a24 22%, #c9a54c 70%, #ecd08a 97%); clip-path: polygon(0 46%, 98.6% 0, 100% 50%, 98.6% 100%, 0 54%); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
p a, small a { color: var(--accent); text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1, h2 { color: var(--heading, inherit); }
h1 { font-size: 22px; } h2 { font-size: 16px; margin-bottom: 10px; } h3 { font-size: 15px; }
.ic { flex: none; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---- Karkas ---- */
.side { display: none; }
.main { min-height: 100vh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 12px; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.top h1 { font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.view { max-width: 1100px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px; color: var(--muted); }
.bottom a.on { color: var(--accent); }
body.bare .bottom, body.bare .top { display: none; }
body.bare .main { padding-bottom: 0; }

@media (min-width: 1024px) {
  .side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 240px;
    background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px;
  }
  .brand { display: flex; align-items: center; padding: 8px 10px 24px; }
  .brand .wm { font-size: 22px; }
  .side nav { display: flex; flex-direction: column; gap: 2px; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
  .side nav a:hover { background: var(--surface-2); color: var(--text); }
  .side nav a.on { background: var(--accent-soft); color: var(--accent); }
  .side-foot { margin-top: auto; padding: 0 12px; }
  .main { margin-left: 240px; padding-bottom: 24px; }
  .bottom { display: none; }
  body.bare .side { display: none; }
  body.bare .main { margin-left: 0; }
  .view { padding: 24px 28px; }
}

/* ---- Elementlar ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; gap: 10px; }
.gap { gap: 8px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .pad { padding: 24px 0; }
.mt { margin-top: 16px; } .nowrap { white-space: nowrap; } .cap::first-letter { text-transform: uppercase; }
.pre { white-space: pre-wrap; margin: 6px 0 0; }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-danger { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--btn-primary, var(--accent)); border-color: transparent; color: #0a1633; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.sm { width: 32px; height: 32px; color: var(--muted); }
.icon-btn[hidden] { display: none; }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.muted { background: var(--surface-2); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; background: var(--surface-2); color: var(--text); }
a.tag:hover { color: var(--accent); }
.avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.avatar.lg { width: 58px; height: 58px; font-size: 22px; border-radius: 16px; }

/* Bosqich ranglari */
.st-0 { --c: var(--st-0); } .st-1 { --c: var(--st-1); } .st-2 { --c: var(--st-2); } .st-3 { --c: var(--st-3); }
.st-4 { --c: var(--st-4); } .st-5 { --c: var(--st-5); } .st-6 { --c: var(--st-6); } .st-7 { --c: var(--st-7); }
.pill[class*="st-"] { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.kpi:hover { border-color: var(--accent); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .kpis.k3 { grid-template-columns: 1fr; } .kpis.k3 .kpi { flex-direction: row; justify-content: space-between; align-items: baseline; } .kpis.k5 .kpi:last-child { grid-column: span 2; } }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.hello h1 { font-size: 24px; font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }
.quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.quick .btn { flex: 1 0 auto; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; align-items: start; } }

.pipeline { display: flex; flex-direction: column; gap: 4px; }
.pipe-row { display: grid; grid-template-columns: 10px 130px 1fr 28px; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; }
.pipe-row:hover { background: var(--surface-2); }
.pipe-row b { text-align: right; }
.pipe-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; }
.pipe-bar i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 99px; min-width: 2px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }

.list { display: flex; flex-direction: column; }
.list.card { padding: 4px 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); justify-content: space-between; min-width: 0; }
.list.card .list-row { padding: 12px 16px; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--surface-2); }
.list-row > div:first-child { min-width: 0; }

.toolbar { display: flex; gap: 10px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; outline: 0; color: var(--text); min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar, .quick::-webkit-scrollbar, .tabs::-webkit-scrollbar, .steps::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.cards { display: grid; gap: 10px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.order-card { display: flex; flex-direction: column; gap: 8px; transition: border-color .15s; }
.order-card:hover { border-color: var(--accent); }
.oc-title { font-weight: 650; font-size: 16px; }
.progress { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.fab {
  position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 25;
  display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px 0 16px; border-radius: 18px; border: 0;
  background: var(--btn-primary, var(--accent)); color: #0a1633; font-weight: 700; box-shadow: var(--shadow); cursor: pointer;
}
@media (min-width: 1024px) { .fab { bottom: 28px; right: 28px; } }

/* Buyurtma */
.order-head { display: flex; flex-direction: column; gap: 8px; }
.steps { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.step { flex: 1 0 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 12px; text-align: center; }
.step:hover { background: var(--surface-2); }
.step i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); font-style: normal; font-weight: 700; font-size: 12px; }
.step.done { color: var(--text); } .step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.cur { color: var(--accent); font-weight: 700; } .step.cur i { border-color: var(--accent); background: var(--accent-soft); }
.step small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.client-note { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--btn-primary, var(--accent)); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.client-note p { margin: 2px 0 0; }
.share { display: flex; flex-direction: column; gap: 14px; }
.share p { margin: 0; }
.qr { align-self: center; width: min(240px, 70vw); padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.qr svg { display: block; width: 100%; height: auto; }
.share-url { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 13px; }
.share-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin: -4px -16px 14px; padding: 0 12px; }
.tab { flex: none; padding: 10px 12px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--accent); border-color: var(--accent); }
.tab-body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.tab-body > .list, .tab-body > .table-wrap, .tab-body > .doc-grid, .tab-body > .timeline { align-self: stretch; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; }
.task.done b { text-decoration: line-through; color: var(--muted); }
.check { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border); background: transparent; color: transparent; cursor: pointer; padding: 0; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.timeline { display: flex; flex-direction: column; gap: 10px; border-left: 2px solid var(--border); padding-left: 14px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.doc-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; color: var(--text); }
.doc-card .ic { color: var(--accent); }
.doc-card:hover { border-color: var(--accent); }
.profile { display: flex; gap: 14px; align-items: flex-start; }
.profile h1 { margin-bottom: 8px; }

/* Forma */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid > .full, .form-grid > h2, .form-grid > .btn { grid-column: 1 / -1; }
.field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.half { grid-column: span 1; }
@media (max-width: 480px) { .field.half { grid-column: 1 / -1; } }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea, .month {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); outline: 0;
}
.month { width: auto; }
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus, .month:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .invalid { border-color: var(--danger); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.result .res-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.result .res-row:last-child { border-bottom: 0; }
.result .res-row b { color: var(--accent); text-align: right; }

/* Modal */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { width: 100%; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: up .2s ease-out; }
@media (min-width: 640px) { .modal-wrap { align-items: center; padding: 24px; } .modal { max-width: 520px; border-radius: 20px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 18px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 8px 18px 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.confirm-text { margin: 12px 0 0; font-size: 16px; }
.menu-list { display: flex; flex-direction: column; padding: 4px 8px 12px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; font-size: 15px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 200;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 500; transition: .25s; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { text-align: center; padding: 36px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty p { color: var(--muted); max-width: 360px; margin: 0 0 8px; }

/* Onboarding */
.onboard { max-width: 460px; margin: 0 auto; padding: 40px 0 24px; display: flex; flex-direction: column; gap: 14px; }
.brand-big { display: inline-flex; flex-direction: column; align-items: center; align-self: center; gap: 14px; margin-bottom: 12px; }
.brand-big .wm { font-size: 52px; padding-left: .14em; }
.brand-big .swoosh { width: 108%; }
.brand-big .tagline { font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.onboard h1 { font-size: 26px; font-family: var(--serif); font-weight: 600; text-align: center; }
.onboard > p.muted:first-of-type { text-align: center; }
.onboard p { margin: 0; }
