/* Feniks ERP — mobil qat (telefon və planşet, ≤ 900px).
 * Masaüstünə toxunmur: bütün qaydalar media sorğusunun içindədir.
 * Səhifələrin öz CSS-i bəzən bu fayldan SONRA gəlir, ona görə layout qaydalarında !important var. */

.fx-mtop,.fx-mbar,.fx-mback,.fx-mclose{display:none}

@media (max-width:900px){
  :root{--fx-top:56px;--fx-bar:62px;--fx-safe-b:env(safe-area-inset-bottom,0px);--fx-p:#6d28d9;--fx-line:#e5e7eb}
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  html,body{overflow-x:hidden!important;max-width:100%}
  body:has(>.fx-mtop){display:block!important;padding-top:var(--fx-top)!important;padding-bottom:calc(var(--fx-bar) + var(--fx-safe-b))!important;min-width:0!important}
  body{min-width:0!important}

  /* ---------- Üst panel ---------- */
  .fx-mtop{display:flex;position:fixed;left:0;right:0;top:0;height:var(--fx-top);z-index:1100;align-items:center;gap:6px;
    padding:0 8px 0 4px;background:rgba(255,255,255,.96);backdrop-filter:saturate(1.4) blur(8px);-webkit-backdrop-filter:saturate(1.4) blur(8px);
    border-bottom:1px solid var(--fx-line);font-family:Inter,Arial,sans-serif;box-sizing:border-box}
  .fx-mtop *{box-sizing:border-box}
  .fx-mtop .fx-mbtn{width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;border:0;background:transparent;border-radius:12px;color:#1f2937;font-size:20px;line-height:1;cursor:pointer;text-decoration:none;position:relative;-webkit-tap-highlight-color:transparent}
  .fx-mtop .fx-mbtn:active{background:#f3f0ff}
  .fx-mtop .fx-mburger{display:flex;flex-direction:column;gap:4px;width:20px}
  .fx-mtop .fx-mburger i{display:block;height:2px;border-radius:2px;background:#1f2937}
  .fx-mtop .fx-mtitle{flex:1 1 auto;min-width:0;font-size:17px;font-weight:700;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.2px}
  .fx-mtop .fx-mbadge{position:absolute;top:6px;right:5px;min-width:17px;height:17px;padding:0 4px;border-radius:99px;background:#ef4444;color:#fff;font-size:10px;font-weight:700;line-height:17px;text-align:center;font-style:normal}
  .fx-mtop .fx-mavatar{width:34px;height:34px;border-radius:50%;background:#ede9fe;color:#5b21b6;font-weight:800;font-size:14px;display:grid;place-items:center}

  /* ---------- Alt naviqasiya ---------- */
  .fx-mbar{display:flex!important;flex-direction:row!important;margin:0!important;position:fixed;left:0;right:0;bottom:0;z-index:1100;height:calc(var(--fx-bar) + var(--fx-safe-b));padding-bottom:var(--fx-safe-b);
    background:rgba(255,255,255,.97);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-top:1px solid var(--fx-line);font-family:Inter,Arial,sans-serif;box-sizing:border-box}
  .fx-mbar a,.fx-mbar button{flex:1 1 0!important;min-width:0!important;width:auto!important;height:auto!important;margin:0!important;border-radius:0!important;box-shadow:none!important;display:flex!important;flex-direction:column!important;align-items:center;justify-content:center;gap:3px;border:0;background:transparent;
    color:#6b7280;text-decoration:none;font:600 10.5px/1.1 Inter,Arial,sans-serif;cursor:pointer;-webkit-tap-highlight-color:transparent;padding:6px 2px}
  .fx-mbar .fx-mi{font-size:19px;line-height:1;height:22px;display:grid;place-items:center}
  .fx-mbar .fx-ml{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .fx-mbar a.on{color:var(--fx-p)}
  .fx-mbar a.on .fx-mi{background:#ede9fe;border-radius:99px;width:48px}

  /* ---------- Menyu (sürüşən panel) ---------- */
  .fx-sidebar{width:min(86vw,320px)!important;height:100dvh!important;padding:14px 12px calc(14px + var(--fx-safe-b))!important;z-index:1300!important;
    transform:translateX(-105%);transition:transform .22s ease;box-shadow:none;border-right:0!important}
  body.fx-menu-open .fx-sidebar{transform:none;box-shadow:0 20px 50px rgba(17,24,39,.25)}
  .fx-sidebar .fx-logo{height:52px!important;padding:0 40px 10px 0!important;justify-content:flex-start!important}
  .fx-sidebar .fx-logo img{content:normal!important;width:160px!important;height:auto!important;max-height:44px!important}
  .fx-sidebar .fx-nav a{justify-content:flex-start!important;padding:11px 12px!important;font-size:15px!important;min-height:46px!important}
  .fx-sidebar .fx-nav .fx-icon{width:22px!important;flex:0 0 22px!important;font-size:16px!important}
  .fx-sidebar .fx-label,.fx-sidebar .fx-nav em,.fx-sidebar .fx-footer .fx-footer-label{display:inline!important}
  .fx-sidebar .fx-nav em{display:inline-grid!important}
  .fx-sidebar .fx-footer{padding:10px 4px 0!important}
  .fx-sidebar .fx-footer a{justify-content:flex-start!important;font-size:15px!important;min-height:44px!important}
  .fx-mclose{display:grid;position:absolute;top:12px;right:10px;width:40px;height:40px;place-items:center;border:0;border-radius:12px;background:#f3f4f6;color:#374151;font-size:20px;cursor:pointer}
  .fx-mback{display:block;position:fixed;inset:0;z-index:1250;background:rgba(17,24,39,.45);opacity:0;pointer-events:none;transition:opacity .2s}
  body.fx-menu-open .fx-mback{opacity:1;pointer-events:auto}
  body.fx-menu-open{overflow:hidden!important}

  /* ---------- Səhifə konteynerləri ---------- */
  body>main,body>.main,body>.page,.mk-main,.rk-main,.ai-main,main.ai-main{
    margin-left:0!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:14px 12px 24px!important;min-height:0!important;box-sizing:border-box!important}
  body>main *,body>.main *,body>.page *,.rk-main *,.mk-main *,.ai-main *{box-sizing:border-box}
  img,video,canvas,svg{max-width:100%}
  body>main>header,body>.main>header,main>.head,.main>.head,.page>.head,.page>.header,main>.top,.cashier-shell>header,.ai-head,.rk-head,.mk-head{
    flex-wrap:wrap!important;gap:10px!important;align-items:flex-start!important;margin-bottom:14px!important}
  :is(body>main>header,body>.main>header,main>.head,.main>.head,.page>.head,.page>.header,main>.top,.mk-head,.cashier-shell>header)>div:first-child{flex:1 1 100%!important;min-width:0!important}
  :is(body>main>header,main>.head,.page>.head,.page>.header,.cashier-shell>header)>.toolbar{flex-wrap:wrap!important;justify-content:flex-start!important}
  /* başlıq: çörək qırıntısı və istifadəçi kartı artıq üst paneldədir */
  body>main>header small:first-child,main>header>div>small:first-child,main>.head>div>small:first-child,.main>.head>div>small:first-child,.page>.head>div>small:first-child,.ai-head small,.rk-head small:first-child,.mk-head small:first-child,.head .eyebrow{display:none!important}
  main>header .profile>button{display:none!important}
  :is(main,.main,.page) :is(small,div.muted,div.eyebrow,.crumb):has(+ h1),.backbar .crumb{display:none!important}
  main>header h1,.cashier-shell>header h1,.main>.head h1,main>.head h1,.page h1,.ai-head h1,.rk-main h1,.mk-main h1{font-size:22px!important;line-height:1.2!important;margin:2px 0 0!important;letter-spacing:-.3px}
  main>header .profile>span,main>header .profile>b,main>header>div>.profile>span,main>header>div>.profile>b,.ai-user,header .profile>.avatar{display:none!important}
  main>header .profile{gap:8px!important;flex-wrap:wrap}

  /* ---------- Kartlar / panellər ---------- */
  .panel,.card,section.panel,.box{border-radius:14px!important}
  .panel,.card{padding:14px!important}

  /* ---------- Formalar ---------- */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea{font-size:16px!important;max-width:100%;min-width:0!important}
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),select{min-height:44px}
  button,.btn,a.btn,input[type=submit],input[type=button]{min-height:42px}
  input[type=checkbox],input[type=radio]{width:20px;height:20px}
  form.toolbar,.toolbar,.filters,.search,.actions,.btns,.bar{flex-wrap:wrap!important}
  .toolbar>input,.toolbar>select,form.toolbar>input,form.toolbar>select,.search>input,.filters .field,.toolbar>.field,.toolbar>label{flex:1 1 100%!important;width:100%!important}
  form>*,.toolbar>*,.filters>*,.field,.form-grid>*{min-width:0!important;max-width:100%!important}

  /* ---------- Cədvəllər ---------- */
  .fx-tscroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;margin:0 0 4px;border-radius:10px}
  .fx-tscroll>table{min-width:100%}
  .fx-tscroll.fx-has-more{background:linear-gradient(to left,rgba(109,40,217,.08),transparent 24px) right/24px 100% no-repeat}

  /* Kart rejimi: hər sətir ayrıca kart */
  table.fx-cards,table.fx-cards tbody,table.fx-cards tr,table.fx-cards td{display:block!important;width:100%!important}
  table.fx-cards{border:0!important;background:transparent!important;min-width:0!important}
  table.fx-cards thead{display:none!important}
  table.fx-cards tr{background:#fff;border:1px solid var(--fx-line)!important;border-radius:14px;padding:10px 12px;margin:0 0 10px;box-shadow:0 1px 2px rgba(17,24,39,.04)}
  table.fx-cards tr:hover{background:#fff}
  table.fx-cards td{display:flex!important;justify-content:space-between;align-items:flex-start;gap:12px;padding:6px 0!important;border:0!important;border-bottom:1px dashed #eef0f4!important;
    text-align:right!important;white-space:normal!important;font-size:14px;max-width:none!important;height:auto!important}
  table.fx-cards td:last-child{border-bottom:0!important}
  table.fx-cards td::before{content:attr(data-label);flex:0 0 40%;max-width:44%;text-align:left;color:#6b7280;font-size:12.5px;font-weight:600;line-height:1.35;padding-top:1px}
  table.fx-cards td[data-label=""]::before{display:none}
  table.fx-cards td>*{max-width:60%}
  table.fx-cards td.fx-ctitle{display:block!important;text-align:left!important;font-size:15px;font-weight:700;color:#111827;padding-top:2px!important}
  table.fx-cards td.fx-ctitle::before{display:none}
  table.fx-cards td.fx-ctitle>*{max-width:none}
  table.fx-cards td.fx-cactions{display:flex!important;flex-wrap:wrap;justify-content:flex-start;gap:8px;padding-top:10px!important}
  table.fx-cards td.fx-cactions::before{display:none}
  table.fx-cards td.fx-cactions>*{max-width:none}
  table.fx-cards td.fx-cempty{display:none!important}
  table.fx-cards tr.fx-csingle td{text-align:center!important;justify-content:center}
  table.fx-cards tr.fx-csingle td::before{display:none}
  table.fx-cards tfoot{display:block}
  table.fx-cards tfoot tr{background:#faf9ff}

  /* ---------- Modallar ---------- */
  .modal,.pinmodal,.modal-bg,.overlay,.fx-modal,[class*="modal-backdrop"]{padding:0!important;align-items:flex-end!important;justify-content:stretch!important;z-index:1400!important}
  .modal>div,.pinmodal>div,.modal .modal-card,.modal .box,.modal-content,.modal-box,.modalbox,.modal-card,.dialog{width:100%!important;max-width:100%!important;max-height:92dvh!important;overflow:auto!important;
    border-radius:18px 18px 0 0!important;margin:0!important;padding-bottom:calc(16px + var(--fx-safe-b))!important;-webkit-overflow-scrolling:touch}
  .toast{left:12px!important;right:12px!important;max-width:none!important;bottom:calc(var(--fx-bar) + var(--fx-safe-b) + 10px)!important}

  /* ---------- Qrid köməkçiləri (JS tərəfindən qoyulur) ---------- */
  .fx-g1{grid-template-columns:minmax(0,1fr)!important}
  .fx-g2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .fx-wrap{flex-wrap:wrap!important}
  .fx-wrap>*{min-width:0}
  .fx-formrow>input,.fx-formrow>select,.fx-formrow>.field{flex:1 1 100%!important;width:100%!important;max-width:100%!important}

  .pill,.badge,.tag,.chip{max-width:100%}
  .rk-main .pill{white-space:normal;text-align:left}

  /* ---------- Səhifəyə xas düzəlişlər ---------- */
  .fx-p-customers .panel>.toolbar{align-items:stretch!important}
  /* Hesabatlar: 12 hesabat kartı üfüqi sürüşən çiplərə çevrilir */
  .fx-p-reports .report-grid{display:flex!important;overflow-x:auto;gap:8px!important;margin:0 -12px 14px!important;padding:2px 12px 6px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .fx-p-reports .report-grid::-webkit-scrollbar{display:none}
  .fx-p-reports .report-card{flex:0 0 auto!important;min-height:0!important;flex-direction:row!important;align-items:center!important;gap:8px;padding:8px 12px 8px 8px!important;border-radius:999px!important;scroll-snap-align:start;white-space:nowrap}
  .fx-p-reports .report-card .report-icon{width:30px;height:30px;font-size:14px;border-radius:99px}
  .fx-p-reports .report-card p{display:none!important}
  .fx-p-reports form.filters{display:grid!important;grid-template-columns:1fr 1fr;gap:10px!important}
  .fx-p-reports form.filters>*{grid-column:1/-1}
  .fx-p-reports form.filters>.field:nth-child(-n+2){grid-column:auto}
  .fx-p-reports .report-card h3{margin:0!important;font-size:13.5px!important}
  .fx-p-index .cards strong,.fx-p-index .pay-value strong,.fx-p-index .stock-value strong{font-size:20px!important}

  /* Çap/gizli: mobil üçün lazımsız ikonlar */
  .fx-hide-m{display:none!important}
}

@media (max-width:900px) and (orientation:landscape) and (max-height:500px){
  :root{--fx-bar:50px}
  .fx-mbar .fx-ml{display:none}
}
