@font-face { font-family: 'Exo 2'; font-weight: 400 700; font-display: swap; src: url(/fonts/exo2-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Exo 2'; font-weight: 400 700; font-display: swap; src: url(/fonts/exo2-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4; }
:root {
  --bg: #f5f5f6; --card: #fff; --text: #1f1f22; --muted: #6b6b73; --line: #e6e6e9;
  --ink: #232326; --ink-2: #2e2e32;
  --brand: #df1c22; --brand-2: #b8141a; --brand-soft: #fdeaea;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2;
  --radius: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 8px rgba(15,23,42,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Exo 2", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: .2px; } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 0 0 8px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* layout */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #c9c9cf; border-right: 3px solid var(--brand); overflow-x: hidden; padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: flex-end; gap: 8px; padding: 6px 8px 20px; }
.logo img { height: auto; width: 150px; max-width: 100%; display: block; }
.logo span { flex: none; color: #8d8d95; font-size: 11px; font-weight: 700; letter-spacing: 2px; line-height: 1; }
.side-link { color: #ff8a8d; }
.nav a { display: flex; align-items: center; gap: 10px; color: #c9c9cf; padding: 9px 10px; border-radius: 8px; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(223,28,34,.35); }
.nav .ic { width: 20px; text-align: center; }
.nav .badge { margin-left: auto; background: #fff; color: var(--brand) !important; font-weight: 700; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); margin-top: 14px; padding: 12px 10px 0; font-size: 12px; }
.main { min-width: 0; }
.top { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 22px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.top-r { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.content { padding: 20px 22px 60px; max-width: 1400px; }
.btn.menu-btn { display: none; }

/* components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: 12px; } .kpi .v { font-size: 21px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.bad { border-top-color: var(--brand); } .kpi.ok { border-top-color: var(--ok); }
.kpi.bad .v { color: var(--bad); } .kpi.ok .v { color: var(--ok); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #c9c9cf; background: #fafafa; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); border-color: #fecaca; } .btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #d4d4d9; border-radius: 8px; background: #fff; color: var(--text); width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type=checkbox] { width: 18px; height: 18px; }
label.f { display: block; } label.f span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form .full { grid-column: 1 / -1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; background: #f7f7f8; position: sticky; top: 0; }
tbody tr:hover { background: #fdf5f5; }
tr.clickable { cursor: pointer; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #f0f0f2; color: #3a3a40; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.brand { background: var(--brand-soft); color: var(--brand-2); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.bar { height: 8px; background: #ececef; border-radius: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--brand); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; background: var(--ink-2); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars div:hover { background: var(--brand); }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.alert.warn { background: var(--warn-soft); color: #78350f; } .alert.bad { background: var(--bad-soft); color: #7f1d1d; } .alert.ok { background: var(--ok-soft); color: #14532d; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 12px; width: min(760px, 100%); max-height: 92vh; overflow-y: auto; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 60; max-width: 90vw; }
.toast.err { background: var(--bad); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 85% 10%, rgba(223,28,34,.35), transparent 45%), linear-gradient(160deg, #2b2b2f, #18181a); }
.login .card:first-child { border-top: 4px solid var(--brand); }
.login-logo { text-align: center; padding: 6px 0 22px; }
.login-logo img { width: min(240px, 80%); height: auto; }
.login-logo .erp-sub { color: var(--muted); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 8px; }
.login .card { width: min(380px, 100%); padding: 28px; }

/* POS */
.pos-line { display: grid; grid-template-columns: 1fr 90px 90px 120px 120px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.pos-head { font-size: 12px; color: var(--muted); }
.pos-line .pl { display: block; min-width: 0; } .pos-line .pl span { display: none; }
/* biriktirilgan cheklar */
.att-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.att { width: 110px; display: flex; flex-direction: column; gap: 4px; }
.att img, .att-pdf { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; background: #f7f7f8; font-weight: 700; color: var(--brand); }
.att .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type=file] { padding: 6px; }
.total-box { background: var(--brand-soft); border-radius: 10px; padding: 14px; }
.total-box .big { font-size: 24px; font-weight: 700; color: var(--brand-2); }

/* checklist */
.chk-row.done { background: #f0fdf4; } input[type=checkbox] { accent-color: var(--brand); } .chk-row.diff { background: #fffbeb; }

@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 240px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .btn.menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; } .content { padding: 16px; }
  .kpi .v { font-size: 17px; } .kpi { padding: 12px; }
  .g2, .form { grid-template-columns: 1fr; }
  .pos-line { grid-template-columns: repeat(3, minmax(0,1fr)); padding: 10px 0; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
  .pos-line > :first-child { grid-column: 1 / -1; }
  .pos-line .pl span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
  .pos-line .pl-total { grid-column: 1 / 3; text-align: left; font-weight: 700; align-self: center; }
  .pos-line [data-rm] { justify-self: end; align-self: center; }
  .pos-head { display: none; }
}

/* analitika va agent */
.hb { min-width: 80px; width: 14%; } .hbar { height: 8px; border-radius: 4px; background: #ececef; overflow: hidden; } .hbar i { display: block; height: 100%; background: var(--ink-2); border-radius: 0 4px 4px 0; }
tr:hover .hbar i { background: var(--brand); }
.wk { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding-top: 34px; }
.wk-col { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; position: relative; outline: none; }
.wk-bar { width: 100%; max-width: 46px; border-radius: 4px 4px 0 0; }
.wk-a { background: var(--ink-2); } .wk-f { background: var(--brand-soft); border: 2px dashed var(--brand); border-bottom: 0; }
.wk-lab { white-space: nowrap; font-weight: 600; } .wk-x { white-space: nowrap; }
.wk-col:hover .wk-bar, .wk-col:focus .wk-bar { filter: brightness(.85); }
.wk-col:hover::after, .wk-col:focus::after { content: attr(data-tip); position: absolute; top: -32px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 3; pointer-events: none; }
.wk-col:nth-child(-n+3):hover::after, .wk-col:nth-child(-n+3):focus::after { left: 0; transform: none; } .wk-col:nth-last-child(-n+3):hover::after, .wk-col:nth-last-child(-n+3):focus::after { left: auto; right: 0; transform: none; }
.wk-legend { display: flex; gap: 16px; } .wk-legend span { display: inline-flex; align-items: center; gap: 6px; } .wk-legend i { width: 14px; height: 12px; border-radius: 3px; display: inline-block; } .wk-legend .wk-f { border-bottom: 2px dashed var(--brand); }
.ag-chips { margin-top: 10px; } .ag-q { margin: 16px 0 8px auto; width: fit-content; max-width: 85%; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 12px 12px 2px 12px; }
.ag-a { background: #f7f7f8; border-radius: 12px 12px 12px 2px; padding: 12px 16px; } .ag-a p { margin: 4px 0 8px; } .ag-a th { background: #ececef; }
/* telegram */
.tg-ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; } .tg-note { color: #229ed9; }
.btn.tg { background: #1c86bb; border-color: #1c86bb; color: #fff; } .btn.tg:hover { background: #17719e; }
.modal-foot { flex-wrap: wrap; }
