/* KarobarOS os-34 — Full-audit fixes (loaded LAST; overrides by order).
   1) Parcels: courier-connections collapsed section (JS in audit-fixes.js)
   2) No sideways "slider" anywhere: tab bars wrap, parcel tables fit
   3) Modal Back button (top bar) styling
   4) Contrast: tab labels + table headers, light & dark
   5) Staff attendance controls fit their cells; dk Parcels wide tile */

/* ── 1 · Courier connections: compact section below the orders ────── */
.kos-connections{margin:16px 0 6px}
.kos-conn-head{display:flex;align-items:center;gap:10px;width:100%;min-height:54px;padding:10px 14px;
  background:var(--panel,#fff);border:1px solid var(--line,#e3e6e3);border-radius:14px;
  color:var(--ink,#1d2126);cursor:pointer;text-align:left;box-shadow:0 1px 3px #0000000a}
.kos-conn-head:active{transform:scale(.995)}
.kos-conn-title{font-size:15px;font-weight:700;white-space:nowrap}
.kos-conn-sub{flex:1;min-width:0;font-size:12px;color:#747d87;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kos-conn-chev{flex:none;font-size:15px;color:#ed612d;font-weight:700}
.kos-conn-body{padding-top:12px}
.kos-conn-body[hidden]{display:none!important}
body[data-theme="dark"] .kos-conn-head{background:#1d1f24;border-color:#33363d;color:#f4f4f5}
body[data-theme="dark"] .kos-conn-sub{color:#a7b0ba}

/* ── 2 · Slider khatam: tabs wrap karte hain, side-scroll nahi ────── */
@media (max-width:899px){
  #app .tabs{flex-wrap:wrap!important;overflow-x:visible!important}
  /* Parcels tables (orders/hisaab/reports): poori chaudai mein fit */
  #parcelData .tablewrap{overflow-x:hidden!important}
  #parcelData table{min-width:0!important;width:100%!important;table-layout:fixed!important}
  #parcelData th,#parcelData td{white-space:normal!important;overflow-wrap:anywhere}
  /* Staff attendance: select/input cell se bahar na nikle */
  #records td select,#records td input[type="number"]{width:100%;min-width:0;box-sizing:border-box}
}
/* Stock item cell: icon + naam cell ke andar rahe */
.item-cell{min-width:0;overflow:hidden}
.item-cell svg{flex:none}
.item-cell>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── 3 · Modal Back button (har drill-in ke top par) ──────────────── */
.modal-close-bar{gap:8px}
.audit-back{flex:none;min-height:38px;padding:6px 14px;border-radius:10px;cursor:pointer;
  border:1px solid #ed612d;background:#fff4ee;color:#c2410c;font-size:14px;font-weight:700}
.audit-back:active{transform:scale(.97)}
body[data-theme="dark"] .audit-back{background:#2a2118;border-color:#ed612d;color:#ff9a68}
/* os-36 (Round 2, item 4): parcel detail sheet ke andar TOP par
   Back — neeche wale actions wohi rehte hain, sirf upar ka
   return control joda hai. */
.parcel-invoice-topbar{display:flex;justify-content:flex-start;margin:0 0 8px}

/* ── 4 · Contrast fixes (sirf rang) ───────────────────────────────── */
/* Light: tab labels aur table headers ka halka gray gehra kiya */
body[data-theme="light"] .tabs button{color:#49525b}
body[data-theme="light"] .tabs button.selected{color:#c2410c}
body[data-theme="light"] th{color:#49525b}
body[data-theme="light"] .kos-conn-sub{color:#5c666e}
/* Dark: ghair-selected tab labels roshan (slide/tab bar wazeh parhi jaye) */
body[data-theme="dark"] .tabs button{color:#aeb7c0}
body[data-theme="dark"] .tabs button.selected{color:#fb7a45}

/* ── 5 · DK home: Parcels wide tile (KHATA grid ki akhri strip) ───── */
.dk-khata a.dk-tile-wide{grid-column:1/-1;flex-direction:row;justify-content:flex-start;
  gap:14px;min-height:60px;padding:10px 16px;text-align:left}
.dk-khata a.dk-tile-wide .dk-tile-ico{width:42px;height:42px}
.dk-khata a.dk-tile-wide .dk-arrow{margin-left:auto}

/* Toolbar search: mobile par apni poori row (placeholder na kate) */
@media (max-width:899px){
  #app .toolbar label.search{flex:1 1 100%}
  #app .toolbar>input[type="search"]{flex:1 1 100%}
}
