/* 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,#DFE6F2);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:#5D6E8F;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kos-conn-chev{flex:none;font-size:15px;color:#FF7A00;font-weight:700}
.kos-conn-body{padding-top:12px}
.kos-conn-body[hidden]{display:none!important}
body[data-theme="dark"] .kos-conn-head{background:#0E2148;border-color:#2A4480;color:#f4f4f5}
body[data-theme="dark"] .kos-conn-sub{color:#9DADD2}

/* ── 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 #0B2E63;background:#EDF2FB;color:#0B2E63;font-size:14px;font-weight:700}
.audit-back:active{transform:scale(.97)}
body[data-theme="dark"] .audit-back{background:#16294D;border-color:#FF7A00;color:#FFB066}
/* 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:#B85C00}
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:#FF9E00}

/* ── 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%}
}

/* Boss (2026-11-14): menu ka grey slider (scrollbar) khatam — scroll chalega, patti nazar nahi ayegi */
aside{scrollbar-width:none;-ms-overflow-style:none}
aside::-webkit-scrollbar{display:none;width:0;height:0}
main>header>.page-options[open]>.page-options-content{scrollbar-width:none;-ms-overflow-style:none}
main>header>.page-options[open]>.page-options-content::-webkit-scrollbar{display:none;width:0;height:0}

/* ═══════ os-43 · Halki animations (Boss, 2026-11-14) ═══════════════════
   Sirf animation/transition properties — layout, rang, tartib, items aur
   features bilkul wese hi. Koi loop/bounce nahi; reduced-motion par sab band.
   Ye file sab se aakhir mein load hoti hai, is liye ye rules jeet-ti hain. */

/* 1 · Header ⋮ drawer: left se naram slide-in + fade (220ms ease-out).
   Animation [open] state se mashroot hai — drawer band hote hi rule khatam,
   dobara khulne par hi phir chalti hai; page re-render par nahi chalti. */
main>header>.page-options[open]>.page-options-content{animation:kos43-drawer-in .28s cubic-bezier(.32,.72,.24,1) both}
main>header>.page-options[open]>.drawer-backdrop{animation:kos43-fade-in .28s ease-out both}
@keyframes kos43-drawer-in{from{opacity:0;transform:translateX(-14px)}to{opacity:1;transform:none}}
@keyframes kos43-fade-in{from{opacity:0}to{opacity:1}}

/* 2 · Tools grid tiles: drawer khulte hi aik aik karke halki fade+rise
   (stagger 10ms qadam, har tile 160ms — aakhri tile ~290ms par khatam).
   Sirf khule hue drawer ke andar aur os-42 wali ≤899px grid par. */
@media (max-width:899px){
  main>header>.page-options[open]>.page-options-content #topToolsGrid a{animation:kos43-tile-in .18s cubic-bezier(.32,.72,.24,1) both}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(1){animation-delay:0s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(2){animation-delay:.01s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(3){animation-delay:.02s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(4){animation-delay:.03s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(5){animation-delay:.04s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(6){animation-delay:.05s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(7){animation-delay:.06s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(8){animation-delay:.07s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(9){animation-delay:.08s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(10){animation-delay:.09s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(11){animation-delay:.1s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(12){animation-delay:.11s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(13){animation-delay:.12s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(14){animation-delay:.13s}
  main>header>.page-options[open]>.page-options-content #topToolsGrid a:nth-child(n+15){animation-delay:.14s}
}
@keyframes kos43-tile-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* 3 · Tap feedback: tiles aur dock ke pill buttons (Cash IN/OUT, Party FAB)
   dabane par halka scale(.97) press. Dock par ye os-26 ke aam button
   scale(.98) se zyada-specific hai, is liye .97 hi lagta hai. */
@media (max-width:899px){
  main>header>.page-options-content #topToolsGrid a{transition:transform .12s ease}
  main>header>.page-options-content #topToolsGrid a:active{transform:scale(.97)}
}
#pageAddDock button{transition:transform .12s ease}
#pageAddDock button:not(:disabled):active{transform:scale(.97)}

/* 4 · Entry modal/sheet: neeche se halki slide-up + fade (200ms).
   os-26 ke kos-modal-in ki jagah sirf animation property badli hai
   (scale hata kar seedha slide-up); baqi modal rules wese hi. */
dialog#modal[open]{animation:kos43-sheet-in .28s cubic-bezier(.32,.72,.24,1) both}
@keyframes kos43-sheet-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* Reduced motion: os-43 ki saari animations/transitions band */
@media (prefers-reduced-motion:reduce){
  main>header>.page-options[open]>.page-options-content,
  main>header>.page-options[open]>.drawer-backdrop,
  main>header>.page-options-content #topToolsGrid a,
  dialog#modal[open]{animation:none!important}
  main>header>.page-options-content #topToolsGrid a,
  #pageAddDock button{transition:none!important}
  main>header>.page-options-content #topToolsGrid a:active,
  #pageAddDock button:not(:disabled):active{transform:none}
}

/* ── os-43 (jari) · ⋮ drawer ke andar ke buttons/rows — professional set ──
   Boss (2026-11-14): "Dots k andar jo button hain wo b set kro, professional
   look do" + icons naam parhe baghair pehchane jayen. Tools grid (os-42) ke
   ilawa drawer mein jo kuch tappable hai sab aik andaaz mein: aik unchai,
   aik radius (12px), saaf 14px/600 type, grid wale icon chips. Sirf visual
   styling — labels, links, tartib, features bilkul wese hi.
   Scope sirf header wala drawer: main>header>.page-options>.page-options-content */

/* Aam drawer buttons: Customer support / Policies & FAQs, Install app,
   aur seedhe child buttons (theme / owner privacy — jab nazar ayen) */
main>header>.page-options>.page-options-content #supportMenuEntry button,
main>header>.page-options>.page-options-content .app-install-bar button,
main>header>.page-options>.page-options-content>button{
  display:flex;align-items:center;gap:12px;width:100%;
  min-height:50px;padding:10px 14px;margin:0;
  border:1px solid var(--line);border-radius:12px;
  background:var(--panel,#fff);color:var(--ink);
  font-size:14px;font-weight:600;text-align:left;cursor:pointer;
}
main>header>.page-options>.page-options-content #supportMenuEntry{display:flex;flex-direction:column;gap:10px}
main>header>.page-options>.page-options-content #supportMenuEntry hr{width:100%;border:0;border-top:1px solid var(--line);margin:2px 0}
main>header>.page-options>.page-options-content #supportMenuEntry button svg,
main>header>.page-options>.page-options-content .app-install-bar button svg{width:20px;height:20px;flex:none;color:#FF7A00}

/* Install app: drawer ka primary action — hamara orange, chip icon safed */
main>header>.page-options>.page-options-content .app-install-bar{display:flex;flex-direction:column;gap:10px}
main>header>.page-options>.page-options-content .app-install-bar>span{font-size:12px;line-height:1.45;color:var(--muted)}
main>header>.page-options>.page-options-content .app-install-bar button{background:var(--navy,#0B2E63);border-color:transparent;color:#fff;justify-content:center}
main>header>.page-options>.page-options-content .app-install-bar button svg{color:#fff}

/* BUSINESS TOOLS list rows: ab grid wale .tool-symbol icon chips ke sath
   (chip ki base shakal clean-ui.css se ati hai — dono themes mein set) */
main>header>.page-options>.page-options-content .all-app-tools a{
  display:flex;align-items:center;justify-content:flex-start;gap:12px;
  min-height:52px;padding:6px 8px;
  border-bottom:1px solid var(--line);
  font-size:14px;font-weight:600;color:var(--ink);text-decoration:none;
}
main>header>.page-options>.page-options-content .all-app-tools a>span:last-child{margin-left:auto;color:var(--muted);font-size:18px;font-weight:400}
main>header>.page-options>.page-options-content .all-app-tools a:last-child{border-bottom:0}
main>header>.page-options>.page-options-content .all-app-tools>small{display:block;padding:10px 8px 4px}

/* Hover par halki orange tint — light/dark dono par naram */
main>header>.page-options>.page-options-content .all-app-tools a:hover,
main>header>.page-options>.page-options-content #supportMenuEntry button:hover{background:rgba(234,88,12,.07)}

/* Dark saved-choice: --panel dark mein define nahi hota (fallback #fff ata
   hai), is liye drawer buttons ko dark mein wazeh gehri shakal di hai —
   warna safed button par halka text gum ho jata. Rang sirf buttons ke. */
body[data-theme=dark] main>header>.page-options>.page-options-content #supportMenuEntry button,
body[data-theme=dark] main>header>.page-options>.page-options-content>button{background:#26262c;border-color:#34343c;color:#f4f4f5}
body[data-theme=dark] main>header>.page-options>.page-options-content #supportMenuEntry button svg{color:#ffac85}
