/* Cola Next ERP v1.67.0 - Card home screen (Digi Khata style).
   Every feature is one card on the Home screen. Tap a card -> that feature opens on its own screen with a Back button.
   All rules are scoped to .nc-app.nch, which JS adds only after the cards are built, so the classic layout is the fallback. */

/* ---------- layout switch: sidebar nav off, simple column on ---------- */
.nc-app.nch{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:14px!important;grid-template-columns:none!important}
.nc-app.nch>*{grid-column:auto!important;grid-row:auto!important;order:20;min-width:0}
.nc-app.nch>.nch-bar{order:0}
.nc-app.nch>.nch-tabs{order:0}
.nc-app.nch>.nc-header{order:1}
.nc-app.nch>.nc-gs{order:2}
.nc-app.nch>.nc-quick{order:3}
.nc-app.nch>.nch-home{order:4}
.nc-app.nch>.nc-target-metrics{order:5}
.nc-app.nch>.nc-booker-cards{order:6}
.nc-app.nch>.nc-footer{order:99}
.nc-app.nch>.nc-tabs{display:none!important}
.nc-app.nch>.nc-panel{margin:0!important;width:100%!important;box-sizing:border-box}

/* ---------- HOME: only the cards, summary and shortcuts ---------- */
.nc-app.nch[data-nch="home"]>.nc-panel,
.nc-app.nch[data-nch="home"]>.nc-dl-bar,
.nc-app.nch[data-nch="home"]>.nc-manual,
.nc-app.nch[data-nch="home"]>.nc-stats,
.nc-app.nch[data-nch="home"]>.nch-bar,
.nc-app.nch[data-nch="home"]>.nch-tabs{display:none!important}

/* ---------- DETAIL: one feature at a time ---------- */
.nc-app.nch[data-nch="detail"]>*:not(.nch-chain):not(.nch-target):not(.nch-bar):not(.nch-tabs):not(.nc-footer):not(.nc-notice):not(.nc-splash):not(#nc-toast):not(.nc-install):not(script):not(style){display:none!important}
.nc-app.nch[data-nch="detail"] .nch-chain>*:not(.nch-chain):not(.nch-target):not(#nc-offline-notice){display:none!important}
.nc-app.nch .nch-hide{display:none!important}
.nc-app.nch[data-nch="detail"] .nch-target.nc-collapsible>.nc-section-title{cursor:default;padding-right:16px}
.nc-app.nch[data-nch="detail"] .nch-target.nc-collapsible>.nc-section-title:after{display:none!important}

/* ---------- top bar on a feature screen ---------- */
.nch-bar{position:sticky;top:8px;z-index:60;display:flex;align-items:center;gap:12px;padding:9px 12px;background:rgba(255,255,255,.96);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid #e2e8f1;border-radius:16px;box-shadow:0 8px 24px rgba(29,53,84,.10)}
body.admin-bar .nch-bar{top:40px}
@media(max-width:782px){body.admin-bar .nch-bar{top:54px}}
.nch-back{display:inline-flex;align-items:center;gap:6px;min-height:42px;padding:0 16px 0 12px;border:0;border-radius:999px;background:#c91f32;color:#fff;font:inherit;font-size:14px;font-weight:800;cursor:pointer;box-shadow:0 4px 12px rgba(201,31,50,.28);-webkit-tap-highlight-color:transparent}
.nch-back:hover{background:#ad182a}
.nch-back:active{transform:scale(.96)}
.nch-back b{font-size:19px;line-height:1;font-weight:900}
.nch-bt{min-width:0;flex:1}
.nch-bt strong{display:block;font-size:16px;line-height:1.25;font-weight:850;color:#14243b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nch-bt small{display:block;font-size:12px;line-height:1.6;color:#6b7b90;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:"Noto Nastaliq Urdu","Jameel Noori Nastaleeq","Segoe UI",Tahoma,sans-serif}
.nch-bic{flex:0 0 auto;width:42px;height:42px;border-radius:13px;display:flex;align-items:center;justify-content:center;font-size:23px;background:var(--gt,#fdecef)}

/* ---------- home: groups of cards ---------- */
.nch-home{display:block}
.nch-sec{margin:0 0 20px;--g:#c91f32;--gt:#fdecef}
.nch-sec[data-g="stock"]{--g:#1769aa;--gt:#e6f1fa}
.nch-sec[data-g="money"]{--g:#0f8a5f;--gt:#e3f5ee}
.nch-sec[data-g="admin"]{--g:#6d4cc2;--gt:#eee9fb}
.nch-sh{display:flex;align-items:center;gap:9px;margin:0 2px 10px;font-size:14px;font-weight:850;letter-spacing:.2px;color:#14243b}
.nch-sh:before{content:"";width:5px;height:19px;border-radius:3px;background:var(--g)}
.nch-sh small{margin-left:auto;font-size:12px;font-weight:700;color:#7a8aa0;font-family:"Noto Nastaliq Urdu","Jameel Noori Nastaleeq","Segoe UI",Tahoma,sans-serif}
.nch-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media(min-width:620px){.nch-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:900px){.nch-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:1280px){.nch-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}

.nch-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:11px;min-height:116px;width:100%;box-sizing:border-box;padding:14px;border-radius:18px;border:1px solid #e6ecf4;background:#fff;box-shadow:0 6px 18px rgba(20,36,59,.06);cursor:pointer;text-align:left;font:inherit;color:#14243b;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;-webkit-tap-highlight-color:transparent}
.nch-card:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(20,36,59,.12);border-color:var(--g)}
.nch-card:active{transform:scale(.97)}
.nch-card:focus-visible{outline:3px solid rgba(201,31,50,.35);outline-offset:2px}
.nch-ic{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:48px;height:48px;border-radius:15px;font-size:25px;line-height:1;background:var(--gt)}
.nch-tx{min-width:0;width:100%}
.nch-tx b{display:block;font-size:14px;line-height:1.3;font-weight:800;color:#14243b}
.nch-tx small{display:block;margin-top:2px;font-size:12px;line-height:1.75;color:#6b7b90;font-family:"Noto Nastaliq Urdu","Jameel Noori Nastaleeq","Segoe UI",Tahoma,sans-serif}
.nch-bd{position:absolute;top:12px;right:12px;max-width:62%;padding:2px 9px;border-radius:999px;background:var(--g);color:#fff;font-size:11px;font-weight:800;font-style:normal;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nch-bd[hidden]{display:none}

/* highlighted main action card (New Order) */
.nch-card.nch-hot{background:linear-gradient(135deg,#ed1c2e,#b8142a);border-color:transparent;box-shadow:0 10px 24px rgba(201,31,50,.28)}
.nch-card.nch-hot .nch-ic{background:rgba(255,255,255,.2)}
.nch-card.nch-hot .nch-tx b{color:#fff}
.nch-card.nch-hot .nch-tx small{color:#ffe3e6}
.nch-card.nch-hot .nch-bd{background:#fff;color:#b8142a}
.nch-card.nch-hot:hover{border-color:transparent}


@media(max-width:650px){
 /* phone: the cards already cover every quick action, so show the cards first */
 .nc-app.nch>.nc-quick{display:none!important}
 .nch-card{min-height:106px;padding:12px;border-radius:16px}
 .nch-ic{width:44px;height:44px;font-size:23px;border-radius:13px}
 .nch-tx b{font-size:13px}
 .nch-bt strong{font-size:15px}
}
@media(prefers-reduced-motion:reduce){.nch-card,.nch-back{transition:none}.nch-card:hover{transform:none}}

/* ---------- v1.67.5: dashboard blocks are cards too; compact grid so the whole home fits with little/no scrolling ---------- */
.nc-app.nch[data-nch="home"]>.nc-target-metrics,
.nc-app.nch[data-nch="home"]>.nc-booker-cards,
.nc-app.nch[data-nch="home"]>.nc-ss-dash{display:none!important}
.nch-sec[data-g="dash"]{--g:#e07a00;--gt:#fff1dc}
.nch-sec{margin:0 0 14px}
.nch-sh{margin-bottom:8px}
@media(min-width:651px){
  .nch-grid{gap:10px}
  .nch-card{flex-direction:row;align-items:center;gap:11px;min-height:0;padding:10px 12px;border-radius:14px}
  .nch-ic{width:38px;height:38px;font-size:20px;border-radius:12px}
  .nch-tx{width:auto;flex:1}
  .nch-tx b{font-size:13px}
  .nch-tx small{font-size:11px;line-height:1.6;margin-top:0}
  .nch-bd{top:6px;right:8px}
}
@media(max-width:650px){
  .nch-grid{gap:9px}
  .nch-card{min-height:92px;gap:8px;padding:10px}
  .nch-ic{width:38px;height:38px;font-size:20px}
  .nch-tx small{font-size:11px;line-height:1.6}
}

/* v1.67.11: a feature panel opened from a card is always visible (phone / installed app too) */
.nc-app.nch[data-nch="detail"]>section.nch-target.nc-panel{display:block!important}

/* ---------- v1.67.37: tabs inside the one Shops card ---------- */
.nch-tabs{display:flex;gap:8px;overflow-x:auto;-webkit-overflow-scrolling:touch;padding:2px 2px 6px;margin:-4px 0 0;scrollbar-width:none}
.nch-tabs::-webkit-scrollbar{display:none}
.nch-tabs[hidden]{display:none!important}
.nch-tab{flex:1 0 auto;min-width:92px;display:flex;flex-direction:column;align-items:center;gap:1px;position:relative;padding:9px 12px;border:1px solid #e2e8f1;border-radius:14px;background:#fff;color:#334155;font:inherit;cursor:pointer;min-height:56px}
.nch-tab span{font-size:18px;line-height:1.1}
.nch-tab b{font-size:13px;font-weight:700}
.nch-tab small{font-size:11px;opacity:.7}
.nch-tab i{position:absolute;top:-6px;right:-2px;min-width:20px;padding:1px 6px;border-radius:999px;background:#dc2626;color:#fff;font:700 11px/1.5 inherit;font-style:normal;text-align:center}
.nch-tab.is-on{background:#0f766e;border-color:#0f766e;color:#fff;box-shadow:0 4px 12px rgba(15,118,110,.25)}
.nch-tab.is-on small{opacity:.9}
/* a tab that is not selected is hidden (stronger than the rule that forces target panels visible) */
.nc-app.nch[data-nch="detail"] section.nch-tabhide.nch-target.nc-panel,
.nc-app.nch[data-nch="detail"] .nch-tabhide{display:none!important}
