/* FastFood Accounting V7 — mobile-first usability layer */
:root{
  --mobile-nav-h:74px;
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-top:env(safe-area-inset-top,0px);
  --touch:48px;
}
html{-webkit-text-size-adjust:100%}
body{-webkit-tap-highlight-color:transparent}
button,a,input,select,textarea{touch-action:manipulation}
.sidebar-scrim,.mobile-quick-actions,.mobile-cart-dock,.mobile-cart-backdrop,.mobile-cart-close,.mobile-sheet-handle,.mobile-kds-tabs{display:none}
.mobile-bottom-nav button{font:inherit}

/* A calmer, clearer surface */
.button,.icon-button,.chip,.status-button,.table-action{transition:transform .14s ease,box-shadow .14s ease,background .14s ease,border-color .14s ease}
.button:active,.icon-button:active,.chip:active,.status-button:active,.table-action:active{transform:scale(.97)}
input,select,textarea{min-height:46px}
textarea{padding-top:11px;padding-bottom:11px}
label>small{display:block;margin-top:4px;color:var(--muted)}

@media (max-width:980px){
  :root{--topbar-h:62px}
  body{font-size:14px;line-height:1.7;padding-top:var(--safe-top)}
  body.menu-open,body.cart-open{overflow:hidden}
  .workspace{min-height:100dvh}
  .main-content{padding:14px 12px calc(var(--mobile-nav-h) + var(--safe-bottom) + 26px)}
  .topbar.v4-topbar{height:62px;padding:0 10px;box-shadow:0 1px 0 var(--line);background:color-mix(in srgb,var(--panel) 96%,transparent)}
  .topbar-start{min-width:0;gap:9px}.topbar-title{min-width:0}.topbar-title strong{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-title small{display:none}
  .mobile-menu{display:grid;place-items:center;width:44px;height:44px;padding:11px;border-radius:14px;flex:0 0 auto}
  .topbar-actions{gap:6px}.topbar-actions .icon-button{width:42px;height:42px;border-radius:14px}.topbar-actions .notification-button{display:none}.quick-sale{display:none}

  /* Native-like bottom navigation */
  .bottom-nav.mobile-bottom-nav{right:8px;left:8px;bottom:calc(6px + var(--safe-bottom));height:var(--mobile-nav-h);padding:7px 8px;display:flex;gap:2px;border-radius:23px;background:color-mix(in srgb,var(--panel) 96%,transparent);box-shadow:0 14px 40px rgba(16,24,40,.16);z-index:70}
  .mobile-bottom-nav>a,.mobile-bottom-nav>button{position:relative;flex:1;min-width:0;height:58px;padding:4px 2px;border:0;border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:transparent;color:var(--muted);font-size:10px;font-weight:750}
  .mobile-bottom-nav svg{width:21px;height:21px}.mobile-bottom-nav .active{color:var(--primary);background:var(--primary-soft)}
  .mobile-bottom-nav a>b{position:absolute;top:3px;right:calc(50% - 18px);min-width:17px;height:17px;padding:0 4px;display:grid;place-items:center;border:2px solid var(--panel);border-radius:20px;background:var(--red);color:#d8cec5;font-size:8px}
  .mobile-bottom-nav .sale-tab{overflow:visible;background:transparent;color:var(--text)}
  .sale-tab-icon{width:48px;height:48px;margin-top:-24px;display:grid;place-items:center;border:5px solid var(--bg);border-radius:18px;background:var(--primary);color:#d8cec5;box-shadow:0 10px 24px rgba(241,88,50,.28)}
  .sale-tab-icon svg{width:24px;height:24px}.mobile-bottom-nav .sale-tab>span:last-child{margin-top:-2px}.mobile-bottom-nav .sale-tab.active{background:transparent;color:var(--primary)}
  .mobile-more{cursor:pointer}

  /* "More" is a phone-friendly bottom sheet, not a tiny desktop sidebar */
  .v4-sidebar{top:auto!important;right:8px!important;left:8px!important;bottom:calc(-100dvh - 50px)!important;width:auto!important;max-height:calc(100dvh - var(--mobile-nav-h) - var(--safe-top) - 28px);border:1px solid rgba(255,255,255,.08);border-radius:28px 28px 20px 20px;box-shadow:0 -16px 50px rgba(0,0,0,.28);transition:bottom .28s cubic-bezier(.2,.8,.2,1)!important;overflow:hidden}
  .v4-sidebar.open{bottom:calc(var(--mobile-nav-h) + var(--safe-bottom) + 10px)!important}
  .sidebar-scrim{position:fixed;z-index:64;inset:0;display:block;border:0;background:rgba(4,8,15,.48);backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity .22s}
  .v4-sidebar.open+.sidebar-scrim{opacity:1;pointer-events:auto}
  .sidebar-brand-row{height:64px;padding:0 16px}.sidebar-collapse{display:none}.branch-chip{margin:10px 12px 4px;padding:10px 12px}
  .sidebar-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:10px 12px 14px;overflow:auto;overscroll-behavior:contain}
  .sidebar-nav .nav-label{grid-column:1/-1;padding:10px 5px 2px}
  .sidebar-nav a{min-height:58px;padding:8px 11px;border:1px solid rgba(255,255,255,.055);border-radius:15px;gap:9px;background:rgba(255,255,255,.025);font-size:12px}
  .sidebar-nav a.active:before{display:none}.sidebar-nav a.active{background:rgba(241,88,50,.17);border-color:rgba(241,88,50,.22)}
  .sidebar-nav a svg{width:21px;height:21px}.nav-hot{display:none}.sidebar-footer{padding:11px 14px calc(11px + var(--safe-bottom))}

  /* Universal mobile touch targets */
  .button{min-height:48px;border-radius:14px;font-size:13px}.button.large{min-height:54px}
  .chip{min-height:42px;padding:0 15px;white-space:nowrap}
  input,select,textarea{min-height:50px;border-radius:13px;font-size:16px!important} /* stops iOS zoom */
  .stack-form{gap:14px}.two-col{gap:11px}
  .panel{border-radius:18px}.page-head,.page-intro{margin-bottom:15px}.page-head p,.page-intro p{font-size:12px}.page-head h1,.page-intro h1{font-size:21px}
  .filter-tabs,.preset-row{margin:0 -12px 14px;padding:0 12px 5px;display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;overscroll-behavior-inline:contain}.filter-tabs::-webkit-scrollbar,.preset-row::-webkit-scrollbar{display:none}.filter-tabs a,.preset-row a{flex:0 0 auto;min-height:42px;padding:0 15px;display:grid;place-items:center;border-radius:13px}
  .table-wrap{margin-inline:-4px;overflow-x:auto;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}.table-wrap table{min-width:690px}.table-action{min-height:40px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;border-radius:11px}
  .form-footer{position:sticky;bottom:calc(var(--mobile-nav-h) + var(--safe-bottom) + 8px);z-index:15;margin:18px -10px -10px;padding:10px;border:1px solid var(--line);border-radius:17px;background:color-mix(in srgb,var(--panel) 96%,transparent);backdrop-filter:blur(14px)}

  /* Dashboard: practical first screen */
  .v4-commandbar{gap:12px;margin-bottom:12px}.v4-command-copy h1{font-size:21px}.v4-command-copy p{display:none}.v4-command-actions{gap:7px}.v4-command-actions>.button.ghost{display:none}.v4-command-actions>.button.primary{display:none}.v4-range-tabs{min-height:46px;padding:4px;border-radius:15px;overflow-x:auto}.v4-range-tabs a{min-width:74px;min-height:38px}
  .mobile-quick-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}
  .mobile-quick-actions a{min-width:0;padding:11px 5px 9px;display:flex;flex-direction:column;align-items:center;text-align:center;border:1px solid var(--line);border-radius:17px;background:var(--panel);box-shadow:var(--shadow)}
  .mobile-quick-actions a>span{width:40px;height:40px;display:grid;place-items:center;border-radius:13px;background:var(--primary-soft);color:var(--primary)}.mobile-quick-actions svg{width:20px;height:20px}.mobile-quick-actions b{max-width:100%;margin-top:6px;font-size:11px;white-space:nowrap}.mobile-quick-actions small{max-width:100%;color:var(--muted);font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .v4-revenue-hero{border-radius:22px}.v4-revenue-number strong{font-size:31px}.v4-revenue-number span{font-size:10px}.v4-change-line{padding:7px 9px}.v4-mini-kpi{min-height:94px;border-radius:18px}.v4-card{border-radius:20px}.v4-card-head h2{font-size:15px}.v4-card-head p{display:none}.v4-chart-wrap.large{height:225px}.v4-chart-wrap.medium{height:200px}

  /* POS: products stay visible; basket opens from bottom */
  .pos-page .main-content{padding-bottom:calc(var(--mobile-nav-h) + var(--safe-bottom) + 105px)}
  .v4-pos-heading{margin-bottom:10px}.v4-pos-heading h1{font-size:21px}.v4-pos-heading p,.v4-pos-shortcuts{display:none}
  .v4-pos-layout{display:block}.v4-menu-panel{padding:0;border:0;background:transparent;box-shadow:none;overflow:visible}
  .v4-menu-toolbar{position:sticky;z-index:25;top:62px;margin:0 -12px 10px;padding:9px 12px 8px;display:block;background:color-mix(in srgb,var(--bg) 94%,transparent);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
  .v4-search{width:100%;height:50px;margin-bottom:8px;border-radius:15px;background:var(--panel);box-shadow:0 5px 18px rgba(16,24,40,.05)}.v4-search input{min-height:48px!important;font-size:15px!important}
  .v4-category-chips{margin:0 -12px;padding:0 12px 1px;display:flex;gap:7px;overflow-x:auto;scrollbar-width:none}.v4-category-chips::-webkit-scrollbar{display:none}
  .v4-menu-meta{margin:0 1px 10px}.v4-menu-meta p{display:none}
  .v4-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .v4-product-card{min-height:148px;padding:10px;border-radius:18px;align-items:stretch;background:var(--panel);box-shadow:0 5px 18px rgba(16,24,40,.055)}
  .v4-product-card:active{transform:scale(.975)}.v4-product-card.just-added{outline:3px solid color-mix(in srgb,var(--primary) 25%,transparent)}
  .v4-product-visual{height:70px;border-radius:14px}.v4-product-visual>span{font-size:18px}.v4-product-visual i{width:32px;height:32px;font-size:20px}
  .v4-product-copy{padding-top:2px}.v4-product-copy strong{font-size:13px;line-height:1.5}.v4-product-copy small{font-size:9px}.v4-product-card>b{font-size:12px}.v4-product-card>b em{font-size:8px}
  .v4-cart-panel{position:fixed!important;z-index:101;right:0;left:0;bottom:0;top:auto;max-height:min(86dvh,760px);padding:8px 14px calc(14px + var(--safe-bottom));border:1px solid var(--line);border-bottom:0;border-radius:28px 28px 0 0;background:var(--panel);box-shadow:0 -25px 70px rgba(16,24,40,.25);transform:translateY(110%);transition:transform .3s cubic-bezier(.2,.8,.2,1);display:flex;flex-direction:column;overflow:hidden}
  body.cart-open .v4-cart-panel{transform:translateY(0)}
  .mobile-sheet-handle{width:46px;height:5px;margin:0 auto 7px;display:block;border-radius:10px;background:var(--line-strong)}
  .mobile-cart-close{width:42px;height:42px;display:grid;place-items:center;flex:0 0 auto;border:0;border-radius:14px;background:var(--panel-2);color:var(--text);font-size:25px}
  .v4-cart-head{padding-bottom:9px;align-items:flex-start}.v4-clear-cart{min-height:40px;margin-right:auto}.v4-cart-items{flex:1;min-height:90px;max-height:none;padding:2px 0 8px;overflow:auto;overscroll-behavior:contain}
  .cart-item{min-height:76px;padding:10px;border-radius:16px}.cart-qty button{width:40px;height:40px;border-radius:12px;font-size:18px}.cart-remove{min-height:40px;padding:0 10px}
  .v4-order-fields{flex:0 0 auto}.v4-segmented{padding:4px;border-radius:15px}.v4-segmented label span{min-height:42px;display:grid;place-items:center}.v4-customer-details summary{min-height:48px;padding:0 4px;display:flex;align-items:center}.v4-customer-details[open]{max-height:35dvh;overflow:auto}
  .v4-cart-totals{flex:0 0 auto;padding-top:8px}.v4-adjustments{gap:8px}.v4-adjustments input{min-height:44px!important;font-size:15px!important}.v4-submit-order{flex:0 0 auto;min-height:56px;border-radius:17px;font-size:14px}
  .mobile-cart-backdrop{position:fixed;z-index:100;inset:0;display:block;background:rgba(5,9,16,.5);backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity .22s}.cart-open .mobile-cart-backdrop{opacity:1;pointer-events:auto}
  .mobile-cart-dock{position:fixed;z-index:69;right:10px;left:10px;bottom:calc(var(--mobile-nav-h) + var(--safe-bottom) + 14px);height:68px;padding:8px 12px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;border:0;border-radius:20px;background:#18202d;color:#d8cec5;box-shadow:0 14px 32px rgba(10,15,25,.25);text-align:right}
  [data-theme="dark"] .mobile-cart-dock{background:#f3f5f8;color:#151923}.mobile-cart-dock:active{transform:scale(.985)}.mobile-cart-dock-count{position:relative;width:46px;height:46px;display:grid;place-items:center;border-radius:15px;background:var(--primary);color:#d8cec5}.mobile-cart-dock-count svg{width:22px}.mobile-cart-dock-count b{position:absolute;top:-5px;left:-5px;min-width:20px;height:20px;padding:0 4px;display:grid;place-items:center;border:2px solid #18202d;border-radius:20px;background:#fff;color:#161b24;font-size:9px}.mobile-cart-dock>span:nth-child(2){min-width:0;display:flex;flex-direction:column}.mobile-cart-dock>span:nth-child(2) strong{font-size:13px}.mobile-cart-dock>span:nth-child(2) small{color:#aeb7c5;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-cart-dock>b{display:flex;align-items:baseline;white-space:nowrap}.mobile-cart-dock>b strong{font-size:16px}.mobile-cart-dock>b small{font-size:8px;margin-right:3px}.cart-open .mobile-cart-dock{opacity:0;pointer-events:none}

  /* Kitchen: one stage at a time on phone */
  .v4-kds-head{margin-bottom:10px}.v4-kds-head h1{font-size:21px}.v4-kds-head p,.v4-kds-live{display:none}
  .mobile-kds-tabs{position:sticky;z-index:24;top:62px;margin:0 -12px 11px;padding:8px 12px;display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:color-mix(in srgb,var(--bg) 94%,transparent);backdrop-filter:blur(14px)}
  .mobile-kds-tabs button{min-height:46px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text-2);font:inherit;font-size:11px;font-weight:800}.mobile-kds-tabs button b{min-width:20px;height:20px;margin-right:3px;padding:0 5px;display:inline-grid;place-items:center;border-radius:20px;background:var(--panel-2);font-size:9px}.mobile-kds-tabs button.active{border-color:var(--primary);background:var(--primary-soft);color:var(--primary)}
  .v4-kds-board{display:block}.v4-kds-column{display:none!important;min-height:0;padding:11px;border-radius:20px}.v4-kds-column.mobile-active{display:block!important}.v4-kds-column>header{position:static}.v4-ticket{border-radius:18px}.v4-ticket-top strong{font-size:17px}.v4-ticket-items{font-size:13px}.v4-ticket-action{min-height:52px;border-radius:15px;font-size:13px}

  /* Order list becomes readable cards */
  .orders-panel{padding:0;border:0;background:transparent;box-shadow:none}.mobile-card-table{overflow:visible}.mobile-card-table table{min-width:0;display:block}.mobile-card-table thead{display:none}.mobile-card-table tbody{display:grid;gap:10px}.mobile-card-table tr{padding:13px;display:grid;grid-template-columns:1fr 1fr;gap:9px 12px;border:1px solid var(--line);border-radius:18px;background:var(--panel);box-shadow:var(--shadow)}.mobile-card-table td{height:auto!important;padding:0!important;display:flex;flex-direction:column;align-items:flex-start;border:0!important;font-size:12px}.mobile-card-table td:before{content:attr(data-label);margin-bottom:1px;color:var(--muted);font-size:9px;font-weight:700}.mobile-card-table .mobile-card-action{grid-column:1/-1}.mobile-card-table .mobile-card-action:before{display:none}.mobile-card-table .mobile-card-action a{width:100%;min-height:46px;background:var(--primary-soft);color:var(--primary)}

  /* Date picker sized for thumbs */
  .jalali-picker{right:8px!important;left:8px!important;width:auto!important;padding:13px;border-radius:22px}.jalali-days button,.jalali-days .empty-day{height:43px}.jalali-weekdays span{height:32px}.jalali-picker-head button{width:44px;height:44px}
}

@media (max-width:560px){
  .main-content{padding-inline:10px}.v4-menu-toolbar,.mobile-kds-tabs{margin-inline:-10px;padding-inline:10px}
  .mobile-quick-actions{gap:6px}.mobile-quick-actions a{padding-inline:2px}.mobile-quick-actions a>span{width:38px;height:38px}.mobile-quick-actions b{font-size:10px}
  .v4-product-grid{gap:8px}.v4-product-card{min-height:144px;padding:9px}.v4-product-visual{height:66px}.v4-product-copy strong{font-size:12px}
  .v4-hero-mini-grid{gap:8px}.v4-card{padding:14px}.v4-health-main{gap:12px}.v4-health-copy p{font-size:10px}
  .report-filter{grid-template-columns:1fr!important}.report-filter label{min-width:0}.report-kpis,.kpi-grid{grid-template-columns:1fr 1fr}.kpi-card{min-height:139px;padding:13px}.kpi-card>strong{font-size:17px}.kpi-card footer{font-size:8px}
  .management-grid{gap:10px}.management-grid>.panel{padding:14px}.inventory-card{min-height:116px}
}

@media (max-width:380px){
  .mobile-bottom-nav>a,.mobile-bottom-nav>button{font-size:9px}.mobile-bottom-nav svg{width:19px;height:19px}.sale-tab-icon{width:45px;height:45px}
  .mobile-quick-actions{grid-template-columns:repeat(2,1fr)}.mobile-quick-actions a{flex-direction:row;justify-content:flex-start;gap:8px;text-align:right;padding:8px}.mobile-quick-actions a>span{flex:0 0 auto}.mobile-quick-actions small{display:block}
  .v4-product-grid{grid-template-columns:1fr 1fr}.v4-product-card{min-height:136px}.v4-product-visual{height:60px}
  .mobile-cart-dock{right:7px;left:7px;padding-inline:9px}.mobile-cart-dock>b strong{font-size:14px}
  .report-kpis,.kpi-grid{grid-template-columns:1fr}
}

@media (min-width:981px){
  .mobile-bottom-nav{display:none!important}
}
button[data-submitting]{opacity:.72;pointer-events:none;position:relative}
