/* ============================================================
   Tayor Biznes Bot — admin panel
   ============================================================ */
:root {
  --bg:      #f6f7f9;
  --panel:   #ffffff;
  --side:    #101828;
  --side-2:  #1a2233;
  --text:    #101828;
  --muted:   #667085;
  --faint:   #98a2b3;
  --line:    #e4e7ec;
  --blue:    #2563eb;
  --blue-2:  #1d4ed8;
  --blue-bg: #eff4ff;
  --green:   #039855;
  --green-bg:#ecfdf3;
  --amber:   #b54708;
  --amber-bg:#fffaeb;
  --red:     #d92d20;
  --red-bg:  #fef3f2;
  --shadow:  0 1px 2px rgba(16,24,40,.05);
  --shadow-2:0 4px 16px rgba(16,24,40,.08);
  --r: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }

/* ============================================================ yon panel */
.side {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 20;
  display: flex; flex-direction: column;
  background: var(--side); color: #cdd5e0;
  padding: 18px 14px;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(140deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.brand-mark.big { width: 54px; height: 54px; font-size: 19px; border-radius: 14px; }
.brand-text { min-width: 0; display: flex; flex-direction: column; }
.brand-text b { color: #fff; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text i { font-style: normal; font-size: 12px; color: #8a94a6; }

.shop-pick { margin: 0 0 14px; }
.shop-pick select {
  width: 100%; padding: 9px 12px; border-radius: 9px;
  background: var(--side-2); color: #fff;
  border: 1px solid #24304a; font-size: 14px;
}
.shop-pick select:focus { outline: 0; border-color: var(--blue); box-shadow: none; }

.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  font-size: 14.5px; color: #cdd5e0;
  transition: background-color .15s, color .15s;
}
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.on { background: var(--blue); color: #fff; }
.nav-ico { font-size: 16px; width: 20px; text-align: center; }

.pill {
  margin-left: auto; font-style: normal;
  min-width: 20px; padding: 1px 7px; border-radius: 20px;
  background: #f04438; color: #fff; font-size: 12px; font-weight: 600; text-align: center;
}
.nav-item.on .pill { background: rgba(255,255,255,.25); }

.side-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid #24304a; }
.side-foot .btn-ghost { background: var(--side-2); color: #cdd5e0; border-color: transparent; }
.side-foot .btn-ghost:hover { background: #24304a; color: #fff; }
.side-foot .danger:hover { background: #3a1d1d; color: #ff9b93; }

/* ============================================================ asosiy qism */
.main { margin-left: 248px; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 24px;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; font-size: 19px; font-weight: 600; }

.burger { display: none; cursor: pointer; }
.burger svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.who { display: flex; align-items: center; gap: 10px; }
.who-name { font-size: 14px; color: var(--muted); }
.who-ava {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: var(--blue-bg); color: var(--blue);
  font-weight: 600; font-size: 14px;
}

.content { padding: 24px; max-width: 1180px; }

.scrim { display: none; }

/* ============================================================ kartochkalar */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px;
  box-shadow: var(--shadow);
}
.card .label { font-size: 13px; color: var(--muted); }
.card .value { font-size: 27px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.card .delta { font-size: 13px; margin-top: 4px; color: var(--muted); }
.card .delta.up { color: var(--green); }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  margin-top: 22px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 16px; font-weight: 600; flex: 1; }
.panel-body { padding: 20px; }

/* ============================================================ jadval */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 11px 20px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  background: #fafbfc; border-bottom: 1px solid var(--line);
}
td { padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; white-space: nowrap; }

.thumb {
  width: 42px; height: 42px; border-radius: 8px; object-fit: cover;
  background: var(--bg); border: 1px solid var(--line);
}
.thumb.none { display: grid; place-items: center; font-size: 17px; color: var(--faint); }

.cell { display: flex; align-items: center; gap: 12px; }
.cell b { font-weight: 500; }
.cell small { display: block; color: var(--muted); font-size: 13px; }

/* ============================================================ tugmalar */
.btn, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn { background: var(--blue); color: #fff; }
.btn:hover { background: var(--blue-2); }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #fee4e2; }
.btn.sm, .btn-ghost.sm, .btn-danger.sm { padding: 6px 11px; font-size: 13.5px; }

/* ============================================================ nishonlar */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12.5px; font-weight: 500;
}
.tag.new  { background: var(--blue-bg);  color: var(--blue); }
.tag.done { background: var(--green-bg); color: var(--green); }
.tag.cancelled { background: var(--red-bg); color: var(--red); }
.tag.warn { background: var(--amber-bg); color: var(--amber); }
.tag.off  { background: #f2f4f7; color: var(--muted); }

/* ============================================================ forma */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--faint); }

input[type=text], input[type=number], input[type=tel], input[type=search], select, textarea {
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg);
}
textarea { resize: vertical; min-height: 96px; }

.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* rasm tanlash */
.drop {
  display: flex; align-items: center; gap: 16px;
  padding: 14px; border: 1px dashed var(--line); border-radius: var(--r);
  background: #fcfcfd;
}
.drop img { width: 84px; height: 84px; border-radius: 9px; object-fit: cover; background: var(--bg); }
.drop .drop-none {
  width: 84px; height: 84px; border-radius: 9px; background: var(--bg);
  display: grid; place-items: center; font-size: 26px; color: var(--faint);
}
input[type=file] { font-size: 14px; }

/* ============================================================ bo'sh holat */
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 40px; opacity: .5; }
.empty p { margin: 12px 0 18px; }

.toast {
  margin: 16px 24px -6px; padding: 11px 16px; border-radius: 9px;
  font-size: 14.5px;
}
.toast.ok  { background: var(--green-bg); color: var(--green); }
.toast.bad { background: var(--red-bg);   color: var(--red); }

/* ============================================================ kirish sahifasi */
.center-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.gate {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-2);
  padding: 40px 34px; max-width: 420px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.gate h1 { font-size: 22px; }
.gate p { margin: 0; color: var(--muted); font-size: 15px; }
.gate .btn, .gate .btn-ghost { width: 100%; }

/* ============================================================ mobil */
@media (max-width: 900px) {
  .side {
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.32,.72,0,1);
    box-shadow: 0 0 40px rgba(0,0,0,.3);
  }
  #nav-toggle:checked ~ .side { transform: none; }
  #nav-toggle:checked ~ .scrim {
    display: block; position: fixed; inset: 0; z-index: 15;
    background: rgba(16,24,40,.45);
  }
  .main { margin-left: 0; }
  .burger { display: grid; place-items: center; }
  .content { padding: 16px; }
  .who-name { display: none; }
  th, td { padding-left: 14px; padding-right: 14px; }
  .hide-sm { display: none; }
}

/* ============================================================ grafiklar */
.chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 190px; padding-top: 4px;
}
.chart.small { height: 120px; gap: 2px; }
.chart .bar {
  flex: 1; min-width: 3px;
  height: var(--h); border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #60a5fa, var(--blue));
  transition: opacity .15s;
}
.chart .bar:hover { opacity: .7; }
.chart-axis {
  display: flex; justify-content: space-between;
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
}

.meter { height: 7px; border-radius: 4px; background: #eef1f5; margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.meter.warn i { background: var(--amber); }
.meter.full i { background: var(--red); }
