/* Moliya dashboardi — toza, raqamlarga yo'naltirilgan dizayn */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --line: #e2e5ea;
  --line-2: #edeff3;
  --text: #0f1626;
  --muted: #5d6675;
  --accent: #2563eb;
  --accent-soft: #eef4ff;
  --green: #067647;
  --green-soft: #e9f7ef;
  --red: #c9271b;
  --red-soft: #fdeceb;
  --orange: #b54708;
  --orange-soft: #fff5e6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --radius: 12px;
  /* Grafik ranglari — dataviz tekshiruvidan o'tgan (yorug' rejim) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --chart-grid: #e6e8ec; --chart-axis: #c3c2b7;
}
:root[data-theme="dark"] {
  --bg: #0e1014;
  --panel: #171a20;
  --panel-2: #1c2027;
  --line: #272c35;
  --line-2: #21262e;
  --text: #eaeef5;
  --muted: #a3adbd;
  --accent: #6098ff;
  --accent-soft: #18223a;
  --green: #45c68f;
  --green-soft: #12251d;
  --red: #f4766c;
  --red-soft: #2a1715;
  --orange: #f6b26b;
  --orange-soft: #2a2016;
  --shadow: none;
  /* Grafik ranglari — tungi rejim uchun alohida tanlangan */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --chart-grid: #2c2c2a; --chart-axis: #383835;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
               Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 3px; letter-spacing: -.02em; font-weight: 680; }
h2 { font-size: 17px; margin: 0 0 16px; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: 12px; margin: 0 0 10px; color: var(--muted); font-weight: 650;
     text-transform: uppercase; letter-spacing: .06em; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.late { color: var(--orange); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---- Karkas ---- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: 0 0 232px; background: var(--panel);
  border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.brand { font-weight: 700; font-size: 17px; padding: 6px 12px 18px; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  padding: 7px 12px; border-radius: 9px; color: var(--text); font-weight: 520;
  font-size: 14.5px; display: flex; align-items: center; gap: 8px;
}
.side nav a:hover { background: var(--panel-2); text-decoration: none; }
.side nav a.on { background: var(--accent-soft); color: var(--accent); }
.side .spacer { flex: 1; }
.main { flex: 1; min-width: 0; padding: 26px 30px 70px; max-width: 1340px; }
.head { display: flex; align-items: flex-start; justify-content: space-between;
        gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---- Kartalar ---- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card.tight { padding: 0; overflow: hidden; }
.card-head { padding: 16px 22px; border-bottom: 1px solid var(--line-2);
             display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .g3, .g2 { grid-template-columns: 1fr; } }

/* ---- Katta raqamlar ---- */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
       padding: 17px 19px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 11.5px; font-weight: 650;
              text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 30px; font-weight: 680; margin-top: 7px; letter-spacing: -.025em;
              font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.45; }
.kpi.accent { border-color: var(--accent); }

/* Hisob qoldiqlari chizig'i */
.balances { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.bal {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; min-width: 160px; box-shadow: var(--shadow);
}
.bal .n { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.bal .v { font-size: 22px; font-weight: 680; margin-top: 3px; letter-spacing: -.02em;
          font-variant-numeric: tabular-nums; }
.bal.total { border-color: var(--accent); background: var(--accent-soft); }

/* ---- Jadval ---- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--line-2);
         vertical-align: middle; font-size: 14.5px; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
     font-weight: 650; background: var(--panel-2); position: sticky; top: 0; z-index: 1;
     padding-top: 10px; padding-bottom: 10px; }
td.num, th.right { font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--panel-2); }
/* Butun qator bosilsa tahrir ochiladi */
tbody tr[data-edit] { cursor: pointer; }
tbody tr[data-edit]:hover { background: var(--accent-soft); }
tbody tr[data-edit]:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tbody tr:last-child td { border-bottom: none; }
tfoot td { font-weight: 650; background: var(--panel-2); border-top: 1px solid var(--line); }
.table-wrap { max-height: 70vh; overflow: auto; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }

/* ---- Nishonlar ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px;
         font-weight: 620; border: 1px solid var(--line); background: var(--panel-2);
         color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.orange { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.badge.blue { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---- Tugmalar ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-size: 14px; font-weight: 570; cursor: pointer; font-family: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
.row-actions .btn { white-space: nowrap; }
td:last-child { white-space: nowrap; }

/* ---- Formalar ---- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 13px; font-weight: 620; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=tel],
input[type=url], input[type=search],
input[type=file], select, textarea {
  font: inherit; font-size: 14.5px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 62px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px;
                padding-top: 14px; border-top: 1px solid var(--line-2); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 130px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }

/* ---- Modal ---- */
.modal-back {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: none;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50;
  overflow: auto; backdrop-filter: blur(2px);
}
.modal-back.open { display: flex; }
.modal {
  background: var(--panel); border-radius: 12px; border: 1px solid var(--line);
  width: 100%; max-width: 560px; padding: 20px 22px;
  box-shadow: 0 20px 40px rgba(16, 24, 40, .22);
}
.modal h2 { display: flex; justify-content: space-between; align-items: center; }

/* ---- Xabarlar ---- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.alert.ok { background: var(--green-soft); color: var(--green); }
.alert.err { background: var(--red-soft); color: var(--red); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; box-shadow: var(--shadow);
         border: 1px solid var(--line); }

/* ---- Kirish sahifasi ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
             padding: 20px; }
.auth { width: 100%; max-width: 380px; }
.auth .card { margin: 0; padding: 26px; }
.auth h1 { text-align: center; margin-bottom: 4px; }
.auth p.lead { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 13px; }

/* ---- Bo'lim ajratgich ---- */
.split { border-top: 1px solid var(--line-2); margin: 18px 0; }
details.box { border: 1px solid var(--line); border-radius: var(--radius);
              background: var(--panel); margin-bottom: 12px; }
details.box > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 13px; }
details.box > div { padding: 0 16px 16px; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav .name { font-weight: 650; min-width: 130px; text-align: center; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --panel: #171a20;
    --panel-2: #1c2027;
    --line: #272c35;
    --line-2: #21262e;
    --text: #e8ebf1;
    --muted: #98a2b3;
    --accent: #6098ff;
    --accent-soft: #18223a;
    --green: #45c68f;
    --green-soft: #12251d;
    --red: #f4766c;
    --red-soft: #2a1715;
    --orange: #f6b26b;
    --orange-soft: #2a2016;
    --shadow: none;
}
}

/* ---- Grafiklar ---- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-label { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart-rowlabel { fill: var(--text); font-size: 12.5px; }
.chart-value { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-empty { padding: 30px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.legend-item .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend-item .nm { color: var(--text); }
.legend-item .vl { color: var(--muted); }

/* ---- Prognoz bloki ---- */
.forecast { border-left: 3px solid var(--accent); }
.forecast.warn { border-left-color: var(--red); }
.forecast .big { font-size: 32px; font-weight: 680; letter-spacing: -.02em; margin: 4px 0 2px; }
.forecast-calc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
                 margin-top: 12px; font-size: 13px; color: var(--muted); }
.forecast-calc .op { color: var(--muted); font-weight: 600; }
.forecast-calc b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- Meter (shaxsiy ehtiyoj) ---- */
.meter { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden;
         margin-top: 10px; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: var(--s1); }
.meter.full > span { background: var(--green); }

/* ---- P&L jadvali ---- */
.pnl td { padding: 7px 12px; }
.pnl tr.total td { font-weight: 680; background: var(--panel-2); }
.pnl tr.sub td:first-child { padding-left: 24px; color: var(--muted); }
.pnl .col-plan { color: var(--muted); }

/* ---- Qator bosilganda tahrir ---- */
.hint-row { padding: 10px 22px 14px; color: var(--muted); font-size: 12.5px; margin: 0; }
details.box > summary { font-size: 14.5px; padding: 14px 18px; }
.modal { padding: 24px 26px; }
.modal h2 { font-size: 19px; }
.empty { padding: 40px 18px; font-size: 14px; }

/* ---- Ikki tab: Agentlik / Shaxsiy ---- */
.scope-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
              background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px;
              margin-bottom: 14px; }
.scope-tab { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px;
             border-radius: 8px; color: var(--muted); text-decoration: none; }
.scope-tab:hover { background: var(--panel); text-decoration: none; }
.scope-tab .nm { font-size: 13px; font-weight: 650; color: var(--text); }
.scope-tab .vl { font-size: 12px; }
.scope-tab.on { background: var(--panel); box-shadow: var(--shadow);
                outline: 2px solid var(--accent); outline-offset: -2px; }
.scope-tab.on .nm { color: var(--accent); }
.nav-split { height: 1px; background: var(--line-2); margin: 8px 4px; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px 3px; }

/* Shaxsiy tabda asosiy rang boshqacha — qaysi "dunyo"da ekaningiz darhol ko'rinadi */
body[data-scope="shaxsiy"] { --accent: #7a3fd1; --accent-soft: #f3edfc; }
:root[data-theme="dark"] body[data-scope="shaxsiy"] { --accent: #b18cf2; --accent-soft: #2a2140; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-scope="shaxsiy"] {
    --accent: #b18cf2; --accent-soft: #2a2140; }
}
.scope-tab.personal.on { outline-color: #7a3fd1; }
.scope-tab.personal.on .nm { color: #7a3fd1; }
:root[data-theme="dark"] .scope-tab.personal.on { outline-color: #b18cf2; }
:root[data-theme="dark"] .scope-tab.personal.on .nm { color: #b18cf2; }
.badge.violet { background: #f3edfc; color: #6b35bd; border-color: transparent; }
:root[data-theme="dark"] .badge.violet { background: #2a2140; color: #c7a8f7; }
.scope-banner { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
                font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
                color: var(--accent); margin-bottom: 4px; }

/* ---- Tor ekran: yon panel tepaga o'tadi ---- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side { width: auto; flex: none; height: auto; position: static; padding: 14px 16px;
          border-right: none; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side nav a { padding: 7px 10px; font-size: 14px; }
  .nav-split { display: none; }
  .nav-group { width: 100%; padding: 6px 4px 0; }
  .side .spacer { display: none; }
  .brand { padding-bottom: 10px; }
  .main { padding: 18px 16px 60px; }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap, .card.tight { overflow-x: auto; }
}
@media (max-width: 600px) {
  .grid.g4, .grid.g3, .grid.g2 { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
}

/* ---- AI yordamchi ---- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: inline-flex;
          align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
          border: 1px solid var(--accent); background: var(--accent); color: #fff;
          font: inherit; font-weight: 620; font-size: 14px; cursor: pointer;
          box-shadow: 0 8px 24px rgba(16, 24, 40, .22); }
.ai-fab:hover { filter: brightness(1.07); }
.ai-fab-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: .85; }
.ai-panel { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 420px;
            max-width: calc(100vw - 32px); height: min(640px, calc(100vh - 44px));
            display: none; flex-direction: column; background: var(--panel);
            border: 1px solid var(--line); border-radius: 16px;
            box-shadow: 0 20px 50px rgba(16, 24, 40, .28); overflow: hidden; }
.ai-panel.open { display: flex; }
.ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
           padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.ai-head-actions { display: flex; gap: 4px; }
.ai-list { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column;
           gap: 10px; background: var(--bg); }
.ai-msg { max-width: 88%; padding: 9px 13px; border-radius: 13px; font-size: 14.5px;
          line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.ai-msg.user { align-self: flex-end; background: var(--accent); color: #fff;
               border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: var(--panel);
                    border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg.pending { color: var(--muted); font-style: italic; }
.ai-msg.system { align-self: center; background: transparent; color: var(--muted);
                 font-size: 12.5px; text-align: center; padding: 2px 8px; }
.ai-msg.error { align-self: center; background: var(--red-soft); color: var(--red);
                font-size: 13px; }
.ai-card { align-self: flex-start; width: 92%; background: var(--panel);
           border: 1px solid var(--line); border-left: 3px solid #2a78d6; border-radius: 12px;
           padding: 11px 13px; }
.ai-card.scope-shaxsiy { border-left-color: #7a3fd1; }
.ai-card-head { display: flex; justify-content: space-between; align-items: center; }
.ai-card-tab { font-size: 11px; font-weight: 700; text-transform: uppercase;
               letter-spacing: .06em; color: var(--muted); }
.ai-card-amount { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-card-title { font-weight: 650; margin: 2px 0 6px; }
.ai-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px;
           padding: 2px 0; }
.ai-line .k { color: var(--muted); }
.ai-line .v { text-align: right; }
.ai-card-foot { display: flex; gap: 6px; margin-top: 9px; }
.ai-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2);
            align-items: flex-end; }
.ai-input textarea { resize: none; min-height: 44px; max-height: 120px; font-size: 14.5px; }
@media (max-width: 600px) {
  .ai-panel { right: 8px; bottom: 8px; height: calc(100vh - 16px); }
  .ai-fab { right: 14px; bottom: 14px; }
}

/* ---- Byudjet ---- */
.meter.near > span { background: var(--orange); }
.meter.over > span { background: var(--red); }
.budget-list { display: grid; gap: 14px; margin-bottom: 14px; }
.budget-top, .budget-bottom { display: flex; justify-content: space-between; align-items: baseline;
                              gap: 10px; }
.budget-bottom { margin-top: 4px; }
.budget-add { display: flex; gap: 8px; flex-wrap: wrap; }
.budget-add select { flex: 1 1 160px; }
.budget-add input { flex: 0 1 120px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer;
            text-decoration: underline; font: inherit; }
.link-btn:hover { color: var(--red); }

/* ---- Loyiha formasi ---- */
.form-section { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase;
                letter-spacing: .04em; }
.form-section:first-child { margin-top: 0; }
.team-rows { display: grid; gap: 8px; }
.team-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.team-row select[name="m_member_id"] { flex: 2 1 160px; }
.team-row select[name="m_type"] { flex: 1 1 130px; }
.team-row input[name="m_value"] { flex: 1 1 90px; }
.team-row .pay-day { flex: 0 0 70px; }
.contact-links { display: flex; gap: 10px; flex-wrap: wrap; }
.agreement-text { white-space: pre-wrap; margin: 0; }

/* ---- Sana tanlagich (datepicker.js) ---- */
.dp { position: relative; display: block; width: 100%; }
.dp-field {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; cursor: pointer;
  font: inherit; font-size: 14.5px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 44px;
  transition: border-color .12s, box-shadow .12s;
}
.dp-field:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.dp-field:focus-visible, .dp-field.open {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.dp-field.empty .dp-text { color: var(--muted); }
.dp-icon { display: inline-flex; color: var(--muted); flex: none; }
.dp-field.open .dp-icon, .dp-field:not(.empty) .dp-icon { color: var(--accent); }
.dp-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
           font-variant-numeric: tabular-nums; }
.dp-clear { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex;
            align-items: center; justify-content: center; color: var(--muted); font-size: 17px;
            line-height: 1; }
.dp-clear:hover { background: var(--line-2); color: var(--text); }
.dp-field.empty .dp-clear { display: none; }
.dp-invalid .dp-field { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.dp-pop {
  position: fixed; z-index: 1000; width: 300px; padding: 12px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
  animation: dp-in .12s ease-out;
}
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dp-pop.sheet {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  animation: dp-up .16s ease-out;
}
@keyframes dp-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px;
           margin-bottom: 8px; }
.dp-title { flex: 1; font: inherit; font-weight: 650; font-size: 15px; color: var(--text);
            background: none; border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.dp-title:hover { background: var(--panel-2); }
.dp-nav { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
          background: var(--panel); color: var(--text); font-size: 20px; line-height: 1;
          cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dp-nav:hover { background: var(--panel-2); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { text-align: center; font-size: 11.5px; font-weight: 620; color: var(--muted);
         padding: 4px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.dp-wd.we { color: color-mix(in srgb, var(--red) 70%, var(--muted)); }
.dp-day {
  aspect-ratio: 1; min-height: 36px; border: 0; border-radius: 9px; background: none;
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
  font-variant-numeric: tabular-nums; position: relative;
}
.dp-day:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.dp-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dp-day.out { color: var(--muted); opacity: .55; }
.dp-day.we:not(.sel) { color: color-mix(in srgb, var(--red) 75%, var(--text)); }
.dp-day.out.we:not(.sel) { opacity: .45; }
.dp-day.today { font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-day.sel, .dp-day.sel:hover { background: var(--accent); color: #fff; font-weight: 650;
                                 box-shadow: none; opacity: 1; }
.dp-day:disabled { opacity: .25; cursor: not-allowed; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.dp-month { font: inherit; font-size: 14px; padding: 12px 0; border-radius: 10px; cursor: pointer;
            border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); }
.dp-month:hover { border-color: var(--accent); color: var(--accent); }
.dp-month.today { border-color: var(--accent); }
.dp-month.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.dp-foot { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px;
           border-top: 1px solid var(--line-2); }
.dp-quick { flex: 1; font: inherit; font-size: 13px; font-weight: 600; padding: 8px 6px;
            border-radius: 8px; border: 1px solid var(--line); background: var(--panel);
            color: var(--text); cursor: pointer; }
.dp-quick:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dp-clear-btn { color: var(--muted); }
.dp-clear-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
@media (max-width: 559px) {
  .dp-pop.sheet .dp-day { min-height: 42px; font-size: 15px; }
}
/* Tungi rejimda tanlangan kun matni to'q — och ko'k fonda yaxshi o'qilishi uchun */
:root[data-theme="dark"] .dp-day.sel, :root[data-theme="dark"] .dp-month.sel { color: #0e1014; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dp-day.sel,
  :root:not([data-theme="light"]) .dp-month.sel { color: #0e1014; }
}

/* ---- Bosh ekran: asosiy 4 raqam ---- */
.hero .kpi .value { font-size: 30px; }
.hero .kpi.accent .value { font-size: 34px; }
.kpi.kassa .balances { display: block; }
.kpi.kassa .bal { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
                  border: 0; background: none; padding: 3px 0; min-width: 0; border-radius: 0; }
.kpi.kassa .bal .n { font-size: 13px; }
.kpi.kassa .bal .v { font-size: 14px; font-weight: 600; margin: 0; }
.kpi.kassa .bal.total { display: block; padding: 0 0 6px; margin-bottom: 4px;
                        border-bottom: 1px solid var(--line-2); background: none; }
.kpi.kassa .bal.total .n { font-size: 11.5px; font-weight: 650; color: var(--muted);
                           text-transform: uppercase; letter-spacing: .06em; }
.kpi.kassa .bal.total .v { font-size: 30px; font-weight: 680; margin-top: 4px; }

/* ---- Loyihalar: tablar va filtr ---- */
.proj-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px;
            flex-wrap: wrap; margin: 4px 0 16px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line);
       border-radius: 12px; overflow-x: auto; max-width: 100%; }
.seg a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 9px;
         color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.seg a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.seg a.on { background: var(--accent-soft); color: var(--accent); }
.seg .cnt { font-size: 12px; font-weight: 650; min-width: 20px; padding: 1px 6px; border-radius: 10px;
            background: var(--line-2); color: var(--muted); text-align: center;
            font-variant-numeric: tabular-nums; }
.seg a.on .cnt { background: var(--accent); color: var(--panel); }
.proj-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kind-filter select { width: auto; min-width: 150px; padding: 8px 12px; }

/* ---- Ixcham dashboard (bosh ekran) ---- */
.hero { gap: 12px; margin-bottom: 12px; }
.hero .kpi { padding: 14px 16px; }
.hero .kpi .value { font-size: 26px; margin-top: 4px; }
.hero .kpi.accent .value { font-size: 26px; }
.hero .kpi .sub { font-size: 12px; margin-top: 3px; }
.kpi.kassa .bal.total .v { font-size: 26px; }
.dash-row, .dash-2-1 { gap: 12px; margin-bottom: 12px; }
.dash-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .dash-2-1 { grid-template-columns: 1fr; } }
.card.compact { padding: 14px 16px; margin: 0; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px;
              flex-wrap: wrap; font-size: 14px; font-weight: 650; margin: 0 0 10px; }
.card-title .more { font-size: 12.5px; font-weight: 600; }
.card.compact .mid { font-size: 24px; font-weight: 680; letter-spacing: -.02em;
                     font-variant-numeric: tabular-nums; }
.mini-rows { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line-2); }
.mini-rows > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px;
                   padding: 2px 0; }
.mini-rows dt { color: var(--muted); margin: 0; }
.mini-rows dd { margin: 0; font-weight: 600; }
.mini-note { margin: 8px 0 0; }
.mini-empty { margin: 2px 0 8px; }
.flow-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 650;
             text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
             margin: 4px 0 4px; }
.flow-head strong { font-size: 13.5px; letter-spacing: 0; }
.mini-list { list-style: none; margin: 0 0 8px; padding: 0; }
.mini-list li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; padding: 3px 0;
                border-bottom: 1px dashed var(--line-2); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .d { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 40px; }
.mini-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .num { flex: none; font-weight: 600; }
.sub-list { margin: 0 0 4px 10px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
            padding: 7px 0; color: var(--text); font-size: 13.5px;
            border-bottom: 1px solid var(--line-2); }
.stat-row:hover { text-decoration: none; color: var(--accent); }
.stat-row strong { font-size: 15px; }
.chart-legend.inline { display: inline-flex; gap: 12px; margin: 0; font-weight: 500; font-size: 12px; }
.mini-details { margin-top: 6px; }
.mini-details summary { cursor: pointer; }
.mini-details table { margin-top: 6px; font-size: 13px; }
.tight-table table { font-size: 13.5px; }
.tight-table th, .tight-table td { padding: 7px 8px; }
.more-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; }
.small-seg { padding: 2px; border-radius: 9px; }
.small-seg a { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.card.compact .budget-list { gap: 10px; margin-bottom: 10px; }
.plan-list li { align-items: center; }
.plan-list .btn.small { padding: 3px 9px; font-size: 12px; }
.plan-add { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.plan-add input[name="amount"] { flex: 0 1 110px; }
.plan-add .dp { flex: 0 1 170px; width: auto; }
.plan-add input[name="title"] { flex: 1 1 150px; }
.page-tabs { display: inline-flex; margin: 0 0 14px; max-width: 100%; overflow-x: auto; }
.page-tabs a { white-space: nowrap; flex: none; }
.split-preview { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; margin-top: 12px;
                 padding: 10px 12px; border-radius: 10px; background: var(--panel-2);
                 border: 1px solid var(--line-2); font-size: 13.5px; }
.split-preview:empty { display: none; }
.taqsim-table { font-size: 14px; }
.taqsim-table th, .taqsim-table td { padding: 7px 8px; }
.taqsim-member { cursor: pointer; }
.taqsim-member:hover td { background: var(--panel-2); }
.taqsim-item { display: none; }
.taqsim-item.show { display: table-row; }
.taqsim-item td:first-child { padding-left: 22px; }
.taqsim-table tfoot td { font-weight: 650; border-top: 1px solid var(--line); }
.brand-sub { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted);
             margin-left: 2px; vertical-align: middle; }
.side-user { padding: 6px 4px 10px; text-align: center; }

/* ---- Kirish berish oynasi ---- */
.invite-box { padding: 12px; border-radius: 10px; background: var(--accent-soft);
              border: 1px solid var(--line-2); margin-bottom: 14px; }
.invite-link { display: flex; gap: 6px; }
.invite-link input { flex: 1; font-size: 13px; }
.access-role { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.access-role select { flex: 1; }

/* ---- Mijozlar: voronka (kanban) ---- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 10px;
          overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
        display: flex; flex-direction: column; min-height: 240px; }
.kcol header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px;
               font-weight: 650; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.kcol header .cnt { font-size: 12px; color: var(--muted); background: var(--line-2); padding: 1px 7px;
                    border-radius: 10px; }
.kcards { padding: 8px; display: grid; gap: 8px; align-content: start; flex: 1; }
.kcol.drop-on { outline: 2px dashed var(--accent); outline-offset: -4px; }
.kcard { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
         padding: 10px 11px; color: var(--text); box-shadow: var(--shadow); cursor: grab; }
.kcard:hover { border-color: var(--accent); text-decoration: none; }
.kcard.dragging { opacity: .5; }
.kmeta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kcol.stage-lid header { border-top: 3px solid var(--s1); border-radius: 12px 12px 0 0; }
.kcol.stage-muzokara header { border-top: 3px solid var(--s4); border-radius: 12px 12px 0 0; }
.kcol.stage-taklif header { border-top: 3px solid var(--s5); border-radius: 12px 12px 0 0; }
.kcol.stage-shartnoma header { border-top: 3px solid var(--s2); border-radius: 12px 12px 0 0; }
.kcol.stage-faol header { border-top: 3px solid var(--s3); border-radius: 12px 12px 0 0; }
.kcol.stage-yoqotildi header { border-top: 3px solid var(--muted); border-radius: 12px 12px 0 0; }
.today-strip { margin-bottom: 12px; border-left: 3px solid var(--orange); }
.stage-bar { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 8px; }
.stage-step { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 9px;
              border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.stage-step:hover { color: var(--text); border-color: var(--accent); }
.stage-step.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.event-add { display: grid; gap: 6px; margin-bottom: 10px; }
.event-row { display: flex; gap: 6px; flex-wrap: wrap; }
.event-row select { flex: 0 0 140px; }
.event-row input[name="text"], .event-row input[name="next_step"] { flex: 1 1 220px; }
.event-row .dp { flex: 0 1 180px; width: auto; }
.next-step { padding: 8px 10px; border-radius: 9px; background: var(--orange-soft); font-size: 13.5px;
             margin-bottom: 10px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-2); }
.timeline li { padding: 6px 0 8px 10px; position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 11px; width: 8px; height: 8px;
                       border-radius: 50%; background: var(--line); }
.timeline li.ev-bosqich::before { background: var(--accent); }
.timeline li.ev-loyiha::before { background: var(--green); }
.timeline li.ev-qongiroq::before, .timeline li.ev-uchrashuv::before { background: var(--orange); }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(6, 240px); } }

/* ---- Brif ---- */
.brief-progress { display: flex; align-items: center; gap: 10px; }
.brief-nav { position: sticky; top: 0; z-index: 5; }
.brief-save { position: sticky; bottom: 0; background: var(--panel); padding: 10px 0 2px; margin-top: 0; }
.brief-card { display: block; color: var(--text); margin-bottom: 12px; }
.brief-card:hover { border-color: var(--accent); text-decoration: none; }
.brief-card-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.metric-table input { padding: 7px 9px; }
.metric-table .m-unit { width: 90px; }
.metric-table td { padding: 5px 6px; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0;
                border-bottom: 1px solid var(--line-2); }
.file-list .t { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.file-list .f-ico { font-size: 18px; }
.upload-box { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.proj-filters select, .proj-filters input[type=text] { width: auto; padding: 8px 12px; }
.proj-filters .check { white-space: nowrap; }
.brief-save { justify-content: flex-start; }

/* ---- Vazifalar ---- */
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.tasks-board { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
.tcol-reja header { border-top: 3px solid var(--muted); border-radius: 12px 12px 0 0; }
.tcol-jarayonda header { border-top: 3px solid var(--accent); border-radius: 12px 12px 0 0; }
.tcol-tekshiruvda header { border-top: 3px solid var(--orange); border-radius: 12px 12px 0 0; }
.tcol-bajarildi header { border-top: 3px solid var(--green); border-radius: 12px 12px 0 0; }
.tcol-bajarildi .kcard { opacity: .75; }
.tcol-bajarildi .kcard strong { text-decoration: line-through; text-decoration-color: var(--muted); }
.kcard.prio-shoshilinch { border-left: 3px solid var(--red); }
.kcard.prio-past { border-left: 3px solid var(--line-2); }
.kmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 6px; }
.kmeta .avatar { margin-left: auto; }
.kfoot { padding: 0 12px 10px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.task-stats { margin-bottom: 12px; }
.task-stats .kpi { text-decoration: none; color: inherit; }
.kpi.warn { border-color: var(--red); }
.prio-seg { display: flex; gap: 4px; }
.prio-seg label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; font-weight: 600; }
.prio-seg input { margin: 0; }
.prio-seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.prio-seg label.prio-shoshilinch:has(input:checked) { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.prio-badge.prio-shoshilinch { background: var(--red-soft); color: var(--red); border-color: transparent; }
.prio-badge.prio-past { color: var(--muted); }
.stage-step:disabled { opacity: .45; cursor: not-allowed; }
.stage-step.tstep-bajarildi.on { background: var(--green); border-color: var(--green); }
.stage-step.tstep-tekshiruvda.on { background: var(--orange); border-color: var(--orange); }
.review-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 12px 14px; border: 1px solid var(--orange); background: var(--orange-soft); border-radius: 12px; margin: 0 0 12px; }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.review-actions input { min-width: 220px; flex: 1; }
.checklist { list-style: none; margin: 0 0 8px; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.checklist li:last-child { border-bottom: 0; }
.checklist li .t { flex: 1; }
.checklist li.done .t { text-decoration: line-through; color: var(--muted); }
.checklist form { margin: 0; display: inline; }
.chk { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--panel);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; cursor: pointer; padding: 0; flex: none; }
.chk.on { background: var(--green); border-color: var(--green); }
.inline-add { display: flex; gap: 6px; }
.inline-add input { flex: 1; min-width: 0; }
.task-list { list-style: none; margin: 0 0 8px; padding: 0; }
.task-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.task-list li:last-child { border-bottom: 0; }
.task-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-list li.done .t { text-decoration: line-through; color: var(--muted); }
.tdot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.tdot.st-jarayonda { background: var(--accent); }
.tdot.st-tekshiruvda { background: var(--orange); }
.tdot.st-bajarildi { background: var(--green); }
@media (max-width: 900px) { .tasks-board { grid-template-columns: repeat(4, 250px); } }
#fayllar .upload-box { margin-top: 8px; }

/* ---- Reklama natijalari ---- */
.ad-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ad-kpis .kpi .value { font-size: 20px; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 560px; }
.ad-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.ad-row:last-child { border-bottom: 0; }
.ad-row .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-row .num { flex: none; }
.ai-run { margin: 0; }
.ai-text { font-size: 14.5px; line-height: 1.55; }
.ai-text h3 { font-size: 15px; margin: 14px 0 4px; }
.ai-text h3:first-child { margin-top: 0; }
.ai-text p { margin: 4px 0; }
.ai-text ul { margin: 4px 0 8px; padding-left: 20px; }
.client-copy { margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; display: grid; gap: 8px; }
.client-copy textarea { width: 100%; font: inherit; font-size: 14px; }
.metric-picks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.metric-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12.5px; padding: 4px 9px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); cursor: pointer; font-family: ui-monospace, Menlo, monospace; }
.chip:hover { border-color: var(--accent); }
.ad-range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ad-range .dp { width: 170px; }

/* ---- AI kreativ ---- */
.ai-sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; }
.ai-sources .src { font-size: 12.5px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.ai-sources .src.on { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.kind-seg { display: flex; gap: 4px; margin-bottom: 10px; }
.kind-seg label { flex: 1; display: flex; gap: 6px; align-items: center; justify-content: center; cursor: pointer;
  padding: 8px; border: 1px solid var(--line); border-radius: 9px; font-weight: 600; font-size: 14px; }
.kind-seg input { margin: 0; }
.kind-seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.output .output-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.custdev-item { border-top: 1px solid var(--line-2); padding: 8px 0; }
.custdev-item summary { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; font-size: 14px; }
.custdev-item .ai-text { margin: 6px 0; }
.custdev-item .ai-text h3 { font-size: 13.5px; }
#custdev .upload-box { margin-bottom: 8px; }

/* ---- Hujjatlar va oylik hisobot ---- */
.ph-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ph-list li { display: flex; gap: 8px; align-items: center; }
.chip.on { border-color: var(--green); color: var(--green); }
.doc-list { list-style: none; margin: 8px 0 0; padding: 0; }
.doc-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.doc-list li:last-child { border-bottom: 0; }
.doc-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.doc-form select { flex: 1; min-width: 160px; }
.doc-form input { width: 130px; }
.report-sheet { background: #fff; color: #1d2330; border-radius: 14px; padding: 36px 40px; max-width: 860px;
  margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.08); border: 1px solid var(--line); }
.report-sheet .muted { color: #6b7280; }
.report-sheet h2 { font-size: 16px; margin: 0 0 10px; color: #1d2330; border-bottom: 2px solid #4f6ef7; padding-bottom: 4px; display: inline-block; }
.rs-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #e5e7eb; padding-bottom: 14px; margin-bottom: 16px; }
.rs-brand { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.rs-title { font-size: 18px; font-weight: 650; }
.rs-block { margin: 0 0 22px; }
.rs-kv { display: flex; gap: 10px; font-size: 14px; padding: 2px 0; }
.rs-kv span { width: 90px; color: #6b7280; }
.rs-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.rs-kpi { border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 10px; font-size: 15px; }
.rs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rs-table th { text-align: left; font-weight: 600; color: #6b7280; border-bottom: 1px solid #e5e7eb; padding: 6px 4px; }
.rs-table td { border-bottom: 1px solid #f0f1f4; padding: 6px 4px; color: #1d2330; }
.rs-list { list-style: none; margin: 0; padding: 0; }
.rs-list li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f0f1f4; font-size: 14px; }
.rs-foot { border-top: 1px solid #e5e7eb; padding-top: 10px; margin-top: 10px; }
.report-sheet .ai-text { color: #1d2330; }
@media (max-width: 700px) { .report-sheet { padding: 20px 16px; } .rs-kpis { grid-template-columns: repeat(2, 1fr); } }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  .side, .ai-fab, .ai-panel, .toast, .no-print, .modal-back { display: none !important; }
  .layout { display: block !important; }
  .main { padding: 0 !important; max-width: none !important; }
  .report-sheet { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .rs-block { break-inside: avoid; }
}
.mini-details > summary { list-style: none; display: inline-flex; cursor: pointer; }
.mini-details > summary::-webkit-details-marker { display: none; }

/* ---- Moliya bo'limi ichki tablari ---- */
.fin-tabs { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 18px; flex-wrap: wrap; }
.fin-tabs .fin-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 0 6px; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 10px; padding-left: 8px;
  border-left: 2px solid var(--line-2); }
.side nav .nav-sub a { padding: 5px 10px; font-size: 13.5px; font-weight: 480; color: var(--muted); }
.side nav .nav-sub a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side nav .nav-sub a:hover { color: var(--text); }
@media (max-width: 900px) {
  .side nav > a { width: 100%; }
  .nav-sub { flex-direction: row; flex-wrap: wrap; margin: 0 0 4px; padding-left: 6px; }
}

/* ---- CEO dashboard ---- */
.ceo-h { font-size: 15px; margin: 18px 0 10px; display: flex; gap: 10px; align-items: baseline; }
.ceo-h a { font-weight: 500; }
.ceo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.ceo-grid.g2x { grid-template-columns: repeat(2, 1fr); }
.ceo-grid .kpi .value { font-size: 21px; }
.ceo-row { align-items: start; }
.ceo-brief .ai-text ul { margin: 0 0 6px; }
.delta { font-weight: 650; font-size: 12px; }
.delta.good { color: var(--green); }
.delta.bad { color: var(--red); }
.delta.neutral { color: var(--muted); }
.funnel-row { display: grid; grid-template-columns: 90px 1fr 36px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.funnel-row .fb { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.funnel-row .fb span { display: block; height: 100%; border-radius: 6px; background: var(--accent); min-width: 2px; }
.funnel-row .fb .stage-muzokara { background: var(--s4); } .funnel-row .fb .stage-taklif { background: var(--s5); }
.funnel-row .fb .stage-shartnoma { background: var(--s2); } .funnel-row .fb .stage-faol { background: var(--s3); }
.funnel-row .fb .stage-yoqotildi { background: var(--muted); } .funnel-row .fb .stage-lid { background: var(--s1); }
.funnel-row b { text-align: right; }
@media (max-width: 900px) { .ceo-grid { grid-template-columns: repeat(2, 1fr); } }

/* Loyiha sahifasi: bo'limlarga tez o'tish */
.proj-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 14px; }
.plink { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--text); }
.plink:hover { border-color: var(--accent); text-decoration: none; }
.plink .pl-t { font-weight: 650; font-size: 14px; margin-bottom: 4px; }
@media (max-width: 900px) { .proj-links { grid-template-columns: repeat(2, 1fr); } }

/* Yon panel: kompyuterda doim ochiq, telefonda "☰ Menyu" tugmasi bilan */
.side-top { display: flex; align-items: center; justify-content: space-between; }
.side-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .side { padding: 10px 16px; }
  .side-top .brand { padding: 4px 0; }
  .menu-toggle { display: inline-flex; }
  .side-body { display: none; padding-top: 10px; }
  .side.open .side-body { display: flex; }
  .side-body .spacer { display: none; }
}
@media (max-width: 900px) {
  .grid.g3.task-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .task-stats .kpi { padding: 10px; }
  .task-stats .kpi .value { font-size: 20px; }
  .task-stats .kpi .sub { display: none; }
  .task-stats .kpi .label { font-size: 10px; }
}
/* CEO 2.0 */
.kpi .value.small-val { font-size: 17px; }
.risk-list { list-style: none; margin: 0; padding: 0; }
.risk-list li { padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.risk-list li:last-child { border-bottom: 0; }
.risk-list .t { margin-right: 6px; }
.risk-why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rb { font-size: 12px; padding: 2px 8px; border-radius: 12px; }
.rb-natija { background: var(--red-soft); color: var(--red); }
.rb-tugayapti { background: var(--orange-soft); color: var(--orange); }
.rb-aloqa { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.nm-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.nm-v { font-size: 19px; font-weight: 700; }
.growth-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mrr-bars { display: flex; gap: 6px; align-items: flex-end; height: 56px; }
.mrr-bars .mb { width: 22px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.mrr-bars .mb span { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; display: block; }
.mrr-bars .mb i { font-style: normal; font-size: 10px; color: var(--muted); margin-top: 3px; }
.growth-foot { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); }
.growth-foot b { color: var(--text); }
.ceo-grid .kpi.warn { border-color: var(--red); }

/* Daromad bo'linishi: jamoa haqqi / agentlik */
.split-bar { height: 6px; border-radius: 4px; background: var(--green); overflow: hidden; margin: 6px 0 4px; }
.split-bar span { display: block; height: 100%; background: var(--orange); }
.split-sub { display: flex; flex-direction: column; gap: 1px; }
.split-sub b { color: var(--text); }

/* CEO: to'lov eslatmalari */
.remind-card { border-color: var(--orange); }
.remind-list { list-style: none; margin: 0; padding: 0; }
.remind-list li { display: grid; grid-template-columns: 150px 1fr auto auto; gap: 10px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.remind-list li:last-child { border-bottom: 0; }
.rm-when { font-size: 13px; font-weight: 600; color: var(--orange); }
.rm-kechikdi .rm-when { color: var(--red); }
.rm-contact { display: flex; gap: 4px; }
@media (max-width: 700px) { .remind-list li { grid-template-columns: 1fr auto; } .rm-when { grid-column: 1 / -1; } }

/* Egasiga to'lov va taqsimot */
.owner-card.ok { border-color: var(--green); }
.owner-card.warn { border-color: var(--orange); }
.owner-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
.owner-actions { display: flex; gap: 6px; align-items: center; }
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 1fr 110px 110px; gap: 8px; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.ladder li.head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ladder li.total { font-weight: 700; }
.ladder .bar { height: 6px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.ladder .bar span { display: block; height: 100%; background: var(--green); }
.ladder li.short .bar span { background: var(--orange); }
.inst { display: flex; gap: 8px; flex-wrap: wrap; }
.inst div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 120px; }
.inst .olindi { border-color: var(--green); }
.inst .kerak { border-color: var(--orange); }

/* Yetishmovchilikni yopish rejasi */
.load-bar { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.load-bar span { display: block; height: 100%; background: var(--accent); }
.load-bar span.over { background: var(--red); }
.scen-col { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.scen-h { font-weight: 650; margin-bottom: 6px; }
.scen-row { padding: 6px 0; border-top: 1px solid var(--line-2); }
.scen-row.no { opacity: .75; }
.tavsiya { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
.eco-table input { width: 80px; }
.member-load { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 10px; }
.member-load .ml { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; }
.load-bar.thin { height: 6px; margin: 4px 0 3px; }
.owner-ml { border-color: var(--accent) !important; }

/* Oy va'dasi */
.promise-card.ok { border-color: var(--green); }
.promise-card.warn { border-color: var(--red); }
.pr-bar { position: relative; height: 10px; background: var(--line-2); border-radius: 6px; }
.pr-bar span { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.pr-bar i { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--text); opacity: .6; }
.pr-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; margin-top: 8px; font-size: 14px; }
.ladder.pr-rows li { grid-template-columns: 1fr 100px 100px; }

/* CEO dashboard: bloklarni yoqish/o'chirish */
.ceo-cfg { position: relative; }
.ceo-cfg-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 260px;
  display: grid; gap: 8px; padding: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.ceo-cfg-box .btn { justify-self: start; margin-top: 4px; }

/* CEO: sodda ko'rinish — 4 ta katta raqam, bugungi ishlar, qolgani "Batafsil" da */
.ceo-big { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.ceo-big .big { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); }
.ceo-big .big.bad { border-color: var(--red); }
.ceo-big .big.good { border-color: var(--green); }
.ceo-big .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.ceo-big .v { font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin-top: 4px; line-height: 1.2; }
.ceo-big .s { color: var(--muted); font-size: 13px; margin-top: 4px; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.todo li:last-child { border-bottom: 0; }
.todo .when { color: var(--muted); font-size: 13px; margin-left: 6px; }
.todo .td-kechikdi .when { color: var(--red); font-weight: 600; }
.todo .td-yaqin .when, .todo .td-bugun .when { color: var(--orange); font-weight: 600; }
.todo .act { display: flex; gap: 4px; }
.ceo-more { margin-top: 18px; }
.ceo-more .more-h { margin: 0 0 6px 2px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; font-size: 11.5px; }
.ceo-more details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.ceo-more summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
  padding: 12px 16px; font-weight: 600; }
.ceo-more summary::-webkit-details-marker { display: none; }
.ceo-more summary::after { content: "›"; color: var(--muted); transition: transform .15s; margin-left: 6px; }
.ceo-more details[open] summary::after { transform: rotate(90deg); }
.ceo-more summary .sum-v { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 14px; }
.ceo-more summary .sum-v.neg { color: var(--red); }
.ceo-more .more-body { padding: 0 16px 14px; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv li:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .ceo-big { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ceo-big .big { padding: 12px 14px; }
  .ceo-big .v { font-size: 24px; }
}
@media (max-width: 600px) {
  .todo li { grid-template-columns: 22px 1fr; }
  .todo .act { grid-column: 2; }
}
a.big { display: block; color: inherit; }
a.big:hover { text-decoration: none; border-color: var(--accent); }

/* Loyiha sahifasi (soddalashtirilgan) */
.ceo-big.big3 { grid-template-columns: repeat(3, 1fr); }
.head-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#ulushlar, #tolov-rejasi { min-width: 0; }
.share-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.share-acts { display: flex; gap: 2px; white-space: nowrap; }
#ulushlar .mini-details, #tolov-rejasi .mini-details { display: block; margin-top: 10px; }
#ulushlar .mini-details > summary, #tolov-rejasi .mini-details > summary { color: var(--accent); font-size: 13px; font-weight: 600; }
#ulushlar .mini-details[open] > form, #tolov-rejasi .mini-details[open] > form { margin-top: 10px; }
.proj-tools { display: flex; flex-wrap: wrap; margin: 16px 0 0; }
.proj-list .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
#yangi-loyiha:not([open]) { display: none; }
@media (max-width: 900px) {
  .ceo-big.big3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .proj-tools a { flex: 1 1 45%; }
  .proj-list td:nth-child(2), .proj-list th:nth-child(2),
  .proj-list td:nth-child(5), .proj-list th:nth-child(5), .proj-list .agl { display: none; }
  .ceo-big.big3 > :last-child { grid-column: span 2; }
}

/* Moliya sahifalari (soddalashtirilgan): "Batafsil" ichidagi kartalar ramkasiz */
.ceo-more .more-body > .card { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
.ceo-more .more-body > .card > .card-title:first-child { display: none; }
.ceo-more .more-body .grid.g2 .card { box-shadow: none; }
.ceo-more .more-body .hero { margin-bottom: 0; }
.todo-card { margin-bottom: 0; }
#yangi-azo:not([open]), #yangi-qarz:not([open]) { display: none; }
.more-filters { flex-basis: 100%; }
.more-filters > summary { font-size: 13px; font-weight: 600; color: var(--accent); }
.more-filters[open] > .filters { margin-top: 10px; }
.ceo-big.big2 { grid-template-columns: repeat(2, 1fr); }
.ceo-more .more-body > .card.tight { margin-bottom: 10px; border: 1px solid var(--line); }
.xarajat-chart { max-width: 520px; }
#natija .chart { max-width: 900px; }
.more-sub { margin: 18px 0 8px; font-size: 14px; }
.flow-grid { align-items: start; }
.ceo-more a.more-row { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; color: inherit; }
.ceo-more a.more-row:hover { text-decoration: none; border-color: var(--accent); }
.ceo-more a.more-row::after { content: "→"; color: var(--muted); margin-left: 6px; }
.ceo-more a.more-row .sum-v { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 14px; }

/* Vazifalar (soddalashtirilgan): bitta qatorli forma, guruhlangan ro'yxat, bitta tugma */
.quick-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 150px auto; gap: 8px; align-items: center; }
.quick-task .mini-details > summary { color: var(--accent); font-weight: 600; margin-top: 4px; }
.tgroup .card-title { display: flex; align-items: center; gap: 8px; }
.tgroup .card-title .cnt { margin-left: auto; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 10px;
  background: var(--line-2); color: var(--muted); }
.tg-kechikdi { border-left: 3px solid var(--red); }
.tg-kechikdi .card-title { color: var(--red); }
.tg-bugun { border-left: 3px solid var(--orange); }
.tg-tekshiruvda { border-left: 3px solid var(--orange); }
.tlist li { align-items: start; }
.tlist .tdot { margin-top: 7px; justify-self: center; }
.tlist .t { min-width: 0; }
.tlist .t a { color: var(--text); }
.tlist .when.late { color: var(--red); font-weight: 600; }
.tlist .tsub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.tlist .act form { margin: 0; }
.card.tgroup, .card.now-box, .card.task-desc, .card.quick-card, #qadamlar, #fayllar, #izohlar { margin-bottom: 10px; }
#fayllar .mini-details > summary { color: var(--accent); font-weight: 600; }
.now-box { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.now-box form { margin: 0; }
.now-box .now-st { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.now-box .now-hint { flex-basis: 100%; }
.now-box.st-tekshiruvda { border-color: var(--orange); background: var(--orange-soft); }
.now-box .review-actions { flex: 1 1 320px; }
@media (max-width: 600px) {
  .quick-row { grid-template-columns: 1fr 1fr; }
  .quick-row input[name="title"] { grid-column: 1 / -1; }
  .quick-row .btn { grid-column: 1 / -1; }
  .now-box > form .btn { width: 100%; }
  .now-box > form { flex: 1 1 100%; }
}

/* Joyida tahrirlash (form.ie): oddiy matnga o'xshaydi, ustiga kelinsa/bosilsa maydon bo'ladi */
.ie { display: inline-flex; align-items: center; margin: 0; max-width: 100%; border-radius: 7px;
  border: 1px dashed transparent; transition: border-color .12s, background .12s; }
.ie:hover { border-color: var(--line); background: var(--panel-2); }
.ie:focus-within { border-color: var(--accent); border-style: solid; background: var(--panel); }
.ie input, .ie select { border: 0; background: transparent; padding: 3px 5px; font: inherit; color: inherit;
  box-shadow: none; min-width: 0; width: auto; field-sizing: content; }
.ie input:focus, .ie select:focus { outline: none; box-shadow: none; }
.ie select { padding-right: 2px; cursor: pointer; }
.ie-money { font-variant-numeric: tabular-nums; font-weight: 600; }
.ie-money .ie-cur { padding-left: 5px; color: var(--muted); }
.ie-money input { padding-left: 1px; text-align: right; }
.ie-text input::placeholder { color: var(--muted); }
.ie .dp { width: auto; }
.ie .dp-field { border: 0; background: transparent; padding: 3px 5px; min-height: 0; box-shadow: none; }
.ie .dp-icon { display: none; }
.ie.saving { opacity: .55; }
.ie.saved { border-color: var(--green); border-style: solid; }
td.late .ie .dp-field { color: var(--red); font-weight: 600; }
.ie-table td { vertical-align: top; }
.ie-table .small .ie { font-size: 12.5px; }
.todo .when-date { margin-left: 4px; font-size: 13px; }
.todo .when-date .dp-field { color: var(--muted); }
.tx-ie { display: inline-flex; align-items: center; font-weight: 600; }
.tx-ie.tx-in { color: var(--green); }
.tx-ie.tx-out { color: var(--red); }
.tx-ie .ie-money { font-weight: 600; }
.ie-inline.neg .ie-money { color: var(--red); }
.ie-inline.pos .ie-money { color: var(--green); }

/* Marketing → Metrikalar: kunlik jadvalda qo'lda kiritish */
.days-table .num-in { width: 84px; text-align: right; padding: 4px 6px; }
.days-table td { padding-top: 4px; padding-bottom: 4px; }
/* Marketing: kreativ rasmi va ko'rinishi */
.ad-cell { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; }
.ad-thumb { position: relative; flex: none; width: 48px; height: 48px; border-radius: 8px; overflow: hidden;
  background: var(--line-2); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-thumb i { position: absolute; right: 3px; bottom: 2px; font-style: normal; font-size: 10px; color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,.7); }
.ad-row-t { align-items: center; justify-content: flex-start; }
.ad-row-t .ad-thumb { width: 36px; height: 36px; }
.ad-row-t .t { flex: 1; }
.ad-body { color: var(--muted); margin: 2px 0; }
.ad-preview { max-width: 420px; }
.ad-preview .seg { margin-bottom: 10px; flex-wrap: wrap; }
.ad-preview-img { display: block; width: 100%; max-height: 520px; object-fit: contain; border-radius: 8px; background: var(--line-2); }
.ad-preview-frame iframe { width: 100%; height: 560px; border: 0; border-radius: 8px; background: var(--line-2); }
/* Marketing: Ads Manager uslubidagi jadval (kampaniya / ad set / reklama) */
.am { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 14px; }
.am-tabs { border-radius: var(--radius) var(--radius) 0 0; }
.am > .table-scroll { border-radius: 0 0 var(--radius) var(--radius); }
.am-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--panel-2); overflow-x: auto; }
.am-tabs a { flex: 1; display: flex; align-items: center; gap: 8px; padding: 12px 16px; min-width: 180px;
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
  border-right: 1px solid var(--line); border-bottom: 3px solid transparent; }
.am-tabs a:last-child { border-right: 0; }
.am-tabs a:hover { color: var(--text); text-decoration: none; background: var(--panel); }
.am-tabs a.on { background: var(--panel); color: var(--accent); border-bottom-color: var(--accent); }
.am-tabs .am-ic { font-size: 15px; opacity: .8; }
.am-tabs .cnt { margin-left: auto; font-size: 12px; padding: 1px 7px; border-radius: 10px;
  background: var(--line-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.am-tabs .am-for { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.am-pick { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 10px;
  background: var(--accent); color: var(--panel); }
.am-crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 16px;
  border-bottom: 1px solid var(--line-2); color: var(--muted); }
.am-crumbs .am-clear { margin-left: auto; color: var(--muted); }
.am-table { font-size: 13.5px; }
.am-table th { position: sticky; top: 0; background: var(--panel); white-space: nowrap; padding: 10px 12px; }
.am-table td { padding: 10px 12px; vertical-align: top; }
.am-table tbody tr:hover td { background: var(--panel-2); }
.am-table .am-name { position: sticky; left: 0; background: var(--panel); min-width: 230px; max-width: 340px;
  border-right: 1px solid var(--line-2); z-index: 1; }
.am-table tbody tr:hover .am-name { background: var(--panel-2); }
.am-table .am-name a { font-weight: 600; }
.am-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.am-table tfoot td { background: var(--panel-2); border-top: 2px solid var(--line); border-bottom: 0; }
.am-table tfoot .am-name { background: var(--panel-2); }
.am-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px;
  background: var(--line); vertical-align: 1px; }
.am-dot.on { background: var(--green); }
.am-dot.off { background: var(--muted); }
.am-dot.bad { background: var(--red); }
.am-dot.wait { background: var(--orange); }
.am-prev { font-size: 12px; white-space: nowrap; }
.am-table .ad-cell { align-items: center; }
.am-table .ad-cell .ad-thumb { width: 40px; height: 40px; }
/* Ustun bosilsa saralash */
.sortable th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable th[data-sort]:hover { color: var(--accent); }
.sortable th[data-sort]::after { content: " ⇅"; opacity: .35; font-size: 11px; }
.sortable th[data-dir="desc"]::after { content: " ↓"; opacity: 1; color: var(--accent); }
.sortable th[data-dir="asc"]::after { content: " ↑"; opacity: 1; color: var(--accent); }

/* Grafik ustidagi kunlik sonlar */
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-hit:hover { fill: var(--chart-grid); opacity: .35; }
.chart-tip { position: fixed; z-index: 50; display: none; pointer-events: none; padding: 8px 10px;
  border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-size: 12px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.chart-tip-h { font-weight: 600; margin-bottom: 2px; }

/* Ads Manager: Columns / Breakdown */
.am-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 16px;
  border-bottom: 1px solid var(--line-2); }
.am-drop { position: relative; }
.am-drop > summary { list-style: none; cursor: pointer; }
.am-drop > summary::-webkit-details-marker { display: none; }
.am-drop > summary.on { color: var(--accent); border-color: var(--accent); }
.am-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 260px; max-width: 340px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px 12px; }
.am-menu-h { font-weight: 600; margin-bottom: 4px; }
.am-checks { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; margin: 8px 0; }
.am-checks label { display: flex; gap: 8px; align-items: center; padding: 4px 2px; font-size: 13.5px; cursor: pointer; }
.am-menu .form-actions { margin: 0; justify-content: space-between; align-items: center; }
.am-menu-list a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--text); font-size: 13.5px; }
.am-menu-list a:hover { background: var(--panel-2); text-decoration: none; }
.am-menu-list a.on { color: var(--accent); font-weight: 600; }
.am-plus-th { width: 40px; }
.am-plus { width: 26px; height: 26px; border-radius: 50%; border: 1px dashed var(--line); background: var(--panel);
  color: var(--accent); font-size: 16px; line-height: 1; cursor: pointer; }
.am-plus:hover { border-color: var(--accent); }
.am-table tr.am-bd td { background: var(--panel-2); font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; }
.am-table tr.am-bd .am-name { background: var(--panel-2); }
.am-bd-l { padding-left: 18px; color: var(--muted); }
.am-bd-l::before { content: "↳ "; opacity: .6; }

/* O'lchov ranglari: yaxshi / o'rtacha / yomon */
.am-table td.g-good { color: var(--green); font-weight: 600; }
.am-table td.g-mid { color: var(--orange); font-weight: 600; }
.am-table td.g-bad { color: var(--red); font-weight: 600; }
.olchov-form { align-items: flex-end; }
.olchov-form .field { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.unit-in { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); overflow: hidden; }
.unit-in input { border: 0; width: 100px; background: transparent; }
.unit-in i { font-style: normal; font-size: 12px; color: var(--muted); padding: 0 10px; border-left: 1px solid var(--line-2); }

/* "+ Metrika qo'shish" va metrikalar oynasi */
.kpi-add { display: flex; align-items: center; justify-content: center; gap: 8px; border-style: dashed;
  color: var(--accent); font-weight: 600; min-height: 84px; }
.kpi-add span { font-size: 22px; line-height: 1; }
.kpi-add:hover { text-decoration: none; border-color: var(--accent); }
.kpi.g-good .value { color: var(--green); }
.kpi.g-mid .value { color: var(--orange); }
.kpi.g-bad .value { color: var(--red); }
.km-modal { max-width: 860px; width: 100%; }
.km-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.km-group { margin-bottom: 10px; }
.km-group-h { font-weight: 600; font-size: 13px; margin: 6px 0; }
.km-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); max-height: none; margin: 0; }
.km-cols { display: grid; grid-template-columns: 1fr 260px; gap: 18px; }
@media (max-width: 720px) { .km-cols { grid-template-columns: 1fr; } }
.km-ops { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.km-ops select { flex: 1; min-width: 170px; }
.km-ops .btn { min-width: 38px; justify-content: center; }
.km-new textarea { width: 100%; font-family: var(--mono, monospace); }
.km-popular { border-left: 1px solid var(--line-2); padding-left: 16px; }
.km-pop { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-2);
  padding: 9px 2px; color: var(--text); cursor: pointer; font-size: 13.5px; }
.km-pop:hover { color: var(--accent); }
/* Kartochkalar: aylana va plan/fakt */
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-wrap .donut { width: 180px; flex: none; }
.donut-wrap .chart-legend { flex: 1; min-width: 180px; }
.pf-row { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.pf-row:last-of-type { border-bottom: 0; }
.pf-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13.5px; }
.pf-bar { position: relative; height: 8px; border-radius: 6px; background: var(--line-2); }
.pf-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); }
.pf-bar i.pf-good { background: var(--green); }
.pf-bar i.pf-mid { background: var(--orange); }
.pf-bar i.pf-bad { background: var(--red); }
.pf-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .5; }

/* Metrikalar: loyiha kartochkalari — ramka o'lchov rangida */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pcard { display: flex; flex-direction: column; gap: 10px; min-height: 140px; padding: 16px 18px; color: var(--text);
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pcard:hover { text-decoration: none; border-color: var(--accent); }
.pcard.g-good { border-color: var(--green); }
.pcard.g-mid { border-color: var(--orange); }
.pcard.g-bad { border-color: var(--red); }
.pc-name { font-size: 16px; font-weight: 700; }
.pc-ms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pc-m .l { color: var(--muted); font-size: 12px; font-weight: 600; }
.pc-m .v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-top: 3px; }
.pc-m .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pc-plan { display: inline-block; margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.pc-m.g-good .v { color: var(--green); }
.pc-m.g-mid .v { color: var(--orange); }
.pc-m.g-bad .v { color: var(--red); }
.pc-other { color: var(--muted); }
.pcard-add { align-items: center; justify-content: center; border-style: dashed; color: var(--accent);
  font-weight: 650; font-size: 15px; box-shadow: none; }
@media (max-width: 600px) { .pcards { grid-template-columns: 1fr; } .pc-m .v { font-size: 17px; } }

/* Qo'shimcha kartochkalar: voronka, solishtirish, kampaniyalar reytingi */
.fn-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.fn-bar { display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; border-radius: 8px;
  background: var(--accent-soft); font-size: 13.5px; min-width: 0; }
.fn-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-pct { white-space: nowrap; }
table.cmp { width: 100%; font-size: 13.5px; }
table.cmp td { padding: 6px 4px; border-bottom: 1px solid var(--line-2); }
table.cmp tr:last-child td { border-bottom: 0; }
.rk-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 6px 0; font-size: 13.5px; }
.rk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-bar { height: 8px; border-radius: 6px; background: var(--line-2); position: relative; }
.rk-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--s1); }
@media (max-width: 600px) { .rk-row { grid-template-columns: 1fr auto; } .rk-bar { display: none; } }

/* Reklama sozlamalari — alohida oyna, tablar */
.sheet-modal { max-width: 900px; }
.sheet-tabs { margin: 4px 0 16px; flex-wrap: wrap; }
.wg-group { margin-bottom: 14px; }
.wg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.wg-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; }
.wg-card:hover { border-color: var(--accent); }
.wg-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.wg-card input { margin-top: 3px; }
.wg-card > span { display: flex; flex-direction: column; gap: 2px; }

/* Formula: Meta'dagidek metrika tanlash va yozganda taklif */
.mp { position: relative; flex: 1; min-width: 170px; }
.mp-btn { width: 100%; justify-content: space-between; text-align: left; }
.mp-menu { width: 320px; max-height: 380px; overflow: auto; padding: 8px; }
.mp-search { width: 100%; margin-bottom: 6px; }
.mp-h { font-weight: 700; font-size: 13px; padding: 6px 8px 2px; }
.mp-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px;
  padding: 7px 10px; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.mp-item:hover { background: var(--accent-soft); color: var(--accent); }
.mp-g { border-top: 1px solid var(--line-2); }
.mp-g > summary { list-style: none; display: flex; justify-content: space-between; padding: 9px 8px;
  font-weight: 620; font-size: 13.5px; cursor: pointer; }
.mp-g > summary::-webkit-details-marker { display: none; }
.mp-g > summary::after { content: "›"; color: var(--muted); font-size: 16px; transition: transform .15s; }
.mp-g[open] > summary::after { transform: rotate(90deg); }
.mp-g .mp-item { padding-left: 18px; }
.mp-none { padding: 8px; }
.fm-wrap { position: relative; }
.fm-sug { position: absolute; left: 8px; right: 8px; top: calc(100% - 4px); z-index: 30; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.fm-sug-i { padding: 7px 10px; border-radius: 6px; font-size: 13.5px; cursor: pointer; }
.fm-sug-i.on, .fm-sug-i:hover { background: var(--accent-soft); color: var(--accent); }

/* Columns va Metrikalar oynasi: bo'limlar va qidiruv */
.am-cols-search { margin: 8px 0 4px; }
.am-cols-body { max-height: 380px; overflow-y: auto; margin: 4px 0 8px; }
.am-cols-body .am-checks { max-height: none; overflow: visible; margin: 2px 0 8px; }
.am-cols-g .km-group-h { margin-top: 6px; }

/* AI xulosa: muammolar jadvali (belgi → sabab → qayerni tekshirish) */
table.dg { width: 100%; font-size: 13.5px; margin: 4px 0 6px; }
table.dg th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
table.dg td { padding: 7px 6px; border-top: 1px solid var(--line-2); vertical-align: top; }
table.dg td:first-child { width: 22px; }
@media (max-width: 600px) { table.dg th:last-child, table.dg td:last-child { display: none; } }
.ai-split h4 { margin: 0 0 6px; font-size: 14px; }
.am-prev { font-size: 12px; visibility: hidden; }
.am-table tr:hover .am-prev { visibility: visible; }
@media (hover: none) { .am-prev { visibility: visible; } }

/* Marketing → Kutubxona */
.lib-filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lib-add { margin-bottom: 14px; }
.lib-add > summary { cursor: pointer; }
.lib-add[open] > summary { margin-bottom: 12px; }
.lib-steps { margin-top: 2px; max-width: 560px; }
.lib-formats { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.lib-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.lib-chk input { width: auto; }
.lib-step-list { margin: 0 0 10px; padding-left: 22px; }
.lib-step-list li { padding: 3px 0; }
.lib-text { white-space: pre-wrap; margin: 0 0 8px; }
.lib-results { margin: 4px 0 10px; }
.lib-results > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.lib-proposal { border-color: var(--accent); }
.lib-linked { margin-bottom: 14px; }
@media (max-width: 720px) { .lib-table .hide-sm { display: none; } .lib-table td, .lib-table th { padding-left: 8px; padding-right: 8px; } }
.ceo-big a.big .l::after { content: " ›"; color: var(--muted); }

/* Fix + KPI */
.kpi-shart { list-style: none; margin: 0 0 10px; padding: 0; }
.kpi-shart li { padding: 6px 0; border-bottom: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kpi-forma select { flex: 1 1 170px; width: auto; }
.kpi-forma input[name="qty"], .kpi-forma input[name="price"], .kpi-forma input[name="rate"],
.kpi-forma input[name="label"] { flex: 0 1 200px; }

/* Plan-Fakt jadvali */
.pf-bar-top { flex-wrap: wrap; gap: 10px; align-items: center; }
.pf-month { display: flex; align-items: center; gap: 8px; }
.pf-month b { min-width: 120px; text-align: center; }
.pf-plan summary { cursor: pointer; }
.pf-plan-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; }
.pf-plan-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pf-plan-row { display: flex; gap: 6px; }
.pf-plan-row input { width: 90px; }
.pf-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin: 12px 0; }
table.pft { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }
table.pft th, table.pft td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); text-align: right; }
table.pft th { font-size: 12px; color: var(--muted); font-weight: 650; background: var(--panel-2); }
table.pft .pf-h1 th { text-align: center; color: var(--text); text-transform: uppercase; letter-spacing: .04em;
  border-left: 1px solid var(--line); }
table.pft .pf-h2 th:nth-child(1), table.pft .pf-h2 th:nth-child(5), table.pft .pf-h2 th:nth-child(8),
table.pft .pf-h2 th:nth-child(11), table.pft .pf-h2 th:nth-child(14),
table.pft tbody td:nth-child(2), table.pft tbody td:nth-child(6), table.pft tbody td:nth-child(9),
table.pft tbody td:nth-child(12), table.pft tbody td:nth-child(15),
table.pft tfoot td:nth-child(2), table.pft tfoot td:nth-child(6), table.pft tfoot td:nth-child(9),
table.pft tfoot td:nth-child(12), table.pft tfoot td:nth-child(15) { border-left: 1px solid var(--line); }
table.pft .pf-date { text-align: left; position: sticky; left: 0; background: var(--panel); font-weight: 600; z-index: 1; }
table.pft th.pf-date { background: var(--panel-2); }
table.pft tr.pf-we .pf-date { color: var(--muted); }
table.pft tr.pf-future td { color: var(--muted); }
table.pft tfoot td { font-weight: 700; background: var(--panel-2); border-top: 2px solid var(--line); }
table.pft tfoot .pf-date { background: var(--panel-2); }
.pf-k.k1 { background: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); font-weight: 650; }
.pf-k.k2 { background: var(--green-soft); color: var(--green); }
.pf-k.k3 { background: var(--orange-soft); color: var(--orange); }
.pf-k.k4 { background: var(--red-soft); color: var(--red); }
span.pf-k { padding: 1px 6px; border-radius: 6px; }
input.pf-in { width: 72px; padding: 4px 6px; font-size: 13px; text-align: right; }
.pf-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }

/* Dekompozitsiya */
.dk-new-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.dk-new-form label, .dk-meta label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.dk-h { margin: 22px 0 10px; }
.dk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
a.dk-card { color: var(--text); display: grid; gap: 6px; }
a.dk-card:hover { text-decoration: none; border-color: var(--accent); }
.dk-card-name { font-weight: 650; font-size: 15px; }
.dk-card-ms { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 4px; }
.dk-card-ms div { display: grid; }
.dk-tmpl { display: grid; gap: 8px; align-content: start; }
.dk-chain { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.dk-chain span { padding: 2px 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.dk-chain span + span::before { content: "→ "; color: var(--muted); }
.dk-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.dk-pop { position: relative; }
.dk-pop summary { list-style: none; cursor: pointer; }
.dk-pop summary::-webkit-details-marker { display: none; }
.dk-pop-body { position: absolute; right: 0; top: 38px; z-index: 20; width: 300px; display: grid; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12); }
.dk-pop-body label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.dk-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.dk-meta input { min-width: 260px; }
.dk-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.dk-sc { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.dk-sc.dk-yomon { border-top-color: var(--red); }
.dk-sc.dk-orta { border-top-color: var(--orange); }
.dk-sc.dk-yaxshi { border-top-color: var(--green); }
.dk-sc-h { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.dk-yomon .dk-sc-h { color: var(--red); }
.dk-orta .dk-sc-h { color: var(--orange); }
.dk-yaxshi .dk-sc-h { color: var(--green); }
.dk-sc-m { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.dk-sc-m b { font-size: 20px; color: var(--text); }
table.dk-t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.dk-t th, table.dk-t td { padding: 6px 12px; border-bottom: 1px solid var(--line-2); text-align: right; }
table.dk-t th:first-child, table.dk-t td:first-child { text-align: left; }
table.dk-t thead th { font-size: 13px; font-weight: 700; }
table.dk-t .dk-th-yomon { background: var(--red-soft); color: var(--red); }
table.dk-t .dk-th-orta { background: var(--orange-soft); color: var(--orange); }
table.dk-t .dk-th-yaxshi { background: var(--green-soft); color: var(--green); }
table.dk-t .dk-name { font-weight: 600; }
.dk-formula { font-size: 11.5px; color: var(--muted); font-weight: 400; }
tr.dk-in-row td:not(:first-child) { background: var(--green-soft); }
input.dk-in { width: 110px; text-align: right; padding: 5px 8px; border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
tr.dk-main td { background: var(--panel-2); font-weight: 700; font-size: 15px; }
.dk-save { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }
table.dk-st { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.dk-st th, table.dk-st td { padding: 5px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
table.dk-st input.dk-ord { width: 54px; }
table.dk-st input.dk-f { width: 100%; min-width: 280px; font-family: ui-monospace, monospace; font-size: 12.5px; }
tr.dk-new-row td { background: var(--panel-2); }
.dk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.dk-chips .chip { font-size: 12px; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--accent-soft); color: var(--accent); cursor: pointer; }
@media (max-width: 760px) {
  .dk-sum { grid-template-columns: 1fr; }
  input.dk-in { width: 80px; }
  table.dk-t th, table.dk-t td { padding: 6px 6px; }
}
/* Kutubxona: struktura kartochkalari — keng ekranda 3 × 2 = 6 tasi bir ekranga sig'adi */
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lib-grid > .lib-card { margin: 0; }
.lib-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; color: var(--text);
  height: max(260px, calc((100vh - 310px) / 2)); overflow: hidden; text-decoration: none;
  margin: 0; transition: border-color .15s, box-shadow .15s; }
.lib-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.lib-card-top { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.lib-card-name { font-size: 16.5px; font-weight: 680; line-height: 1.3; margin-top: 2px; }
.lib-card-steps { flex: 1; min-height: 0; overflow: hidden; margin: 4px 0 0; padding-left: 0; list-style-position: inside;
  font-size: 13.5px; color: var(--muted); }
.lib-card-steps li { padding: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-card-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--line-2); }
@media (max-width: 1100px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .lib-grid { grid-template-columns: 1fr; } .lib-card { height: auto; } }
.lib-add-bottom { margin: 14px 0 0; }

/* Rejalar: dividend va maosh */
.reja-add { margin-top: 10px; align-items: center; }
.reja-add input[name="title"], .reja-add input[name="note"] { flex: 1 1 180px; }
.reja-add select { flex: 0 1 160px; width: auto; }
.reja-add .check { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.reja-azo { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.reja-azo:last-of-type { border-bottom: 0; }
.reja-azo-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- Yozuvlar: Kirim / Chiqim / O'tkazma va kategoriya tugmalari ---- */
.tx-yon-list { margin-bottom: 10px; }
.tx-kat { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tx-kat .chip { font-family: inherit; font-size: 13px; padding: 5px 12px; text-decoration: none; }
.tx-kat .chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---- Loyiha: to'lov qismlari ---- */
.qism-list { display: grid; gap: 6px; margin-bottom: 8px; }
.qism-row { display: grid; grid-template-columns: 18px 1fr 1fr auto; gap: 8px; align-items: center; }
.tartib-qismlar .check { display: flex; gap: 6px; align-items: center; margin-top: 8px; }

/* Oylik 6 raqam (Moliya va CEO) */
.ceo-big.oy6 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .ceo-big.oy6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ceo-big.oy6 .v { font-size: 20px; } .ceo-big.oy6 .s { font-size: 12px; } }

/* Jamoa: xodim kartochkalari va kartochka sahifasi */
.xcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 16px 0; }
.xcard { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.xcard:hover { border-color: var(--accent); }
.xcard.off { opacity: .6; }
.xc-top { display: flex; align-items: center; gap: 12px; color: var(--text); }
.xc-top:hover { text-decoration: none; }
.xc-ava { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 42px; height: 42px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 18px; font-weight: 700; }
.xc-ava.big { width: 48px; height: 48px; font-size: 20px; margin-right: 12px; vertical-align: middle; }
.xc-name { display: flex; flex-direction: column; min-width: 0; }
.xc-name strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xc-ms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.xc-ms .l { color: var(--muted); font-size: 12px; font-weight: 600; }
.xc-ms .v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.xc-ms small { font-size: 11px; font-weight: 600; }
.xc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--line-2); }
.xc-h1 { display: flex; align-items: center; margin-top: 6px; }
.xc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.xc-grid .card { margin: 0; }
.xc-grid .mini-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
@media (max-width: 760px) { .xc-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .xcards { grid-template-columns: 1fr; } .xc-ms .v { font-size: 16px; } }
.ulush-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow: auto;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.ulush-list .check[hidden] { display: none; }
