/* ==========================================================================
   TALLY-BOOK ERP: MOBILE & TABLET RESPONSIVE STYLESHEET (mobile_style.css)
   Dedicated Mobile & Tablet styles for dev.tallybookapp.com
   Isolated inside media queries to keep Desktop Mode clean and untouched.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SOLAIMANLIPI BENGALI FONT FACE FOR MOBILE DEVICES
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'SolaimanLipi';
  src: url('fonts/solaimanlipi.woff2') format('woff2'),
       url('fonts/solaimanlipi.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'solaimanlipi';
  src: url('fonts/solaimanlipi.woff2') format('woff2'),
       url('fonts/solaimanlipi.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

/* --------------------------------------------------------------------------
   2. DESKTOP VS MOBILE MENU VIEW VISIBILITY RULES
   -------------------------------------------------------------------------- */
@media screen and (min-width: 1025px) {
  .desktop-menu-view {
    display: block !important;
  }
  .mobile-menu-view {
    display: none !important;
  }
}

@media screen and (max-width: 1024px) {
  .desktop-menu-view {
    display: none !important;
  }
  .mobile-menu-view {
    display: block !important;
  }
}

/* --------------------------------------------------------------------------
   3. MOBILE & TABLET BOTTOM NAVIGATION BAR & ACTION BAR (Max Width 1024px)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 1024px) {
  .navbar_bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 46px;
    padding: 0 10px;
    background-color: #ffffff;
    z-index: 99999;
    display: flex !important;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    box-sizing: border-box;
  }

  .navbar_bottom ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    gap: 8px;
  }

  .navbar_bottom ul li {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .m-bottom-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 22px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: transform 0.1s ease, background 0.15s ease;
    width: 100%;
    box-sizing: border-box;
    text-decoration: none !important;
  }

  .m-bottom-nav-btn:active {
    transform: scale(0.94);
  }

  .m-btn-home {
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
  }
  .m-btn-home:active {
    background: #dbeafe;
  }

  .m-btn-menu {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
  }
  .m-btn-menu:active {
    background: #a7f3d0;
  }

  .m-btn-close {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
  }
  .m-btn-close:active {
    background: #fecaca;
  }

  .mobile-page-bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 99998;
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .m-page-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 20px;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .m-page-act-btn:active {
    transform: scale(0.95);
  }
}

/* --------------------------------------------------------------------------
   4. GRID & COLUMN RESPONSIVENESS FOR TABLETS & MOBILE (Max Width 1024px)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 1024px) {
  [class*="col-"] {
    width: 100%;
  }
  .col-BlPc {
    width: 100% !important;
  }
}

/* --------------------------------------------------------------------------
   5. MOBILE & TABLET SIDEBAR DRAWER & BACKDROP OVERLAY
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 230px !important;
    height: 100% !important;
    z-index: 999999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease-in-out !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.2) !important;
  }

  #sidebar.active {
    transform: translateX(0) !important;
  }

  .scenav {
    left: 0 !important;
    width: 100% !important;
  }

  #sidebar .side-menu li {
    height: 34px;
  }

  #sidebar .side-menu li a {
    font-size: 14px;
  }

  #sidebar .side-menu li a i {
    font-size: 18px;
  }
}

#sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 999998;
}

#sidebar-backdrop.active,
#sidebar.active-mobile ~ #sidebar-backdrop {
  display: block !important;
}

/* --------------------------------------------------------------------------
   6. MOBILE & TABLET HORIZONTAL SCROLLMENUS
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  .profilenav {
    height: auto !important;
    min-height: 25.5px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  div.scrollmenu {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    display: block !important;
  }

  div.scrollmenu .nav {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: 100% !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  div.scrollmenu .nav > li {
    display: inline-block !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    float: none !important;
  }

  div.scrollmenu .nav > li > a {
    white-space: nowrap !important;
  }

  div.scrollmenu::-webkit-scrollbar {
    height: 3px;
  }

  div.scrollmenu::-webkit-scrollbar-track {
    background: transparent;
  }

  div.scrollmenu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
  }
}

/* --------------------------------------------------------------------------
   7. MOBILE POPUPS, DIALOGS & BOTTOM BREATHING CLEARANCE SPACER
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 1024px) {
  .PupUpView,
  .PupUpView .panel,
  .PupUpView .panel-body,
  .PupUpView .panel-heading,
  .PupUpView .container-fluid,
  .PupUpView .table-responsive,
  .PupUpView fieldset,
  .PupUpView form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-popup-bottom-spacer,
  .PupUpView::after {
    display: block !important;
    content: "" !important;
    height: 75px !important;
    min-height: 75px !important;
    width: 100% !important;
    clear: both !important;
    pointer-events: none !important;
  }

  .PupUpView .panel-body {
    padding-bottom: 25px !important;
  }
}

/* --------------------------------------------------------------------------
   8. MOBILE MULTI-TAB VIEW RESPONSIVENESS
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  .popup-tabs {
    position: relative;
    font-family: var(--lato);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    white-space: nowrap;
    font-size: var(--font-size);
    width: 100%;
    max-width: 100%;
    z-index: 9999;
    background: var(--light);
    box-sizing: border-box;
  }

  .tab-list {
    list-style: none;
    margin: 0;
    padding: 0 12px;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    background: var(--light);
    gap: var(--tab-gap);
    font-size: var(--font-size);
    overflow-x: auto;
    overflow-y: hidden;
    font-family: var(--lato);
    white-space: nowrap;
    border-bottom: 0.5px solid #6e6e6e61;
    width: 100%;
    box-sizing: border-box;
  }

  .tab-list::-webkit-scrollbar {
    height: 2px;
  }

  .tab-list::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
  }

  .tab-list li {
    height: var(--tab-height);
    padding: 0 12px;
    background: var(--tablethbg);
    cursor: pointer;
    position: relative;
    color: var(--tableth);
    border: 0.5px solid gray;
    border-bottom: none;
    flex: 0 0 auto;
    width: auto;
    max-width: 250px;
    font-size: 12px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    box-sizing: border-box;
    font-family: var(--lato);
    font-weight: 500;
  }

  .tab-list li .tab-title {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1;
    text-overflow: ellipsis;
  }

  .tab-list li.active {
    background: var(--tabbgactive);
    color: var(--dev);
    border: 0.5px solid gray;
    font-weight: 700;
    z-index: 1;
  }

  .tab-list li .close-btn {
    color: rgb(255, 255, 255);
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
    flex: 0 0 auto;
    margin-left: 4px;
  }

  .tab-list li .close-btn:hover { color: #ff4d4d; }

  .tab-content {
    margin-top: 0px !important;
    padding: 0px !important;
    width: 100%;
  }

  .tab-content .tab-pane { display: none; width: 100%; }
  .tab-content .tab-pane.active { display: block; width: 100%; }
}

/* --------------------------------------------------------------------------
   9. MOBILE LEDGER TOOLS TOOLBAR (Max Width 1024px for Mobile & Tablets < 10")
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  .x9v-ledger-tools {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 2px 0 !important;
  }

  .x9v-toolbar-main {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .x9v-toolbar-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
    white-space: nowrap !important;
  }

  .x9v-toolbar-main .x9v-selected-group-label {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 3px 6px !important;
    background: #eef6fc !important;
    border: 1px solid #d0e3f4 !important;
    border-radius: 4px !important;
    color: #1684a2 !important;
    max-width: calc(100% - 160px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .x9v-toolbar-main .x9v-leaf-search {
    flex: 1 1 110px !important;
    min-width: 90px !important;
    max-width: 100% !important;
    height: 28px !important;
    font-size: 11px !important;
    padding: 2px 6px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
  }

  .x9v-toolbar-main .x9v-show-label { display: none !important; }
  .x9v-toolbar-main .x9v-page-size { flex: 0 0 42px !important; width: 42px !important; min-width: 42px !important; max-width: 42px !important; height: 28px !important; font-size: 11px !important; text-align: center !important; padding: 2px !important; border: 1px solid #cbd5e1 !important; border-radius: 4px !important; box-sizing: border-box !important; }
  .x9v-toolbar-main .x9v-date-input { flex: 0 0 88px !important; width: 88px !important; min-width: 88px !important; max-width: 88px !important; height: 28px !important; font-size: 11px !important; text-align: center !important; padding: 2px 4px !important; border: 1px solid #cbd5e1 !important; border-radius: 4px !important; box-sizing: border-box !important; }
  .x9v-area-filter-wrap { flex: 1 1 120px !important; min-width: 110px !important; max-width: 100% !important; height: 28px !important; display: inline-flex !important; align-items: center !important; gap: 3px !important; }
  .x9v-area-filter-wrap select.x9v-area-filter { flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important; height: 28px !important; font-size: 11px !important; padding: 1px 3px !important; border: 1px solid #cbd5e1 !important; border-radius: 4px !important; }
  .x9v-sort-group { flex: 0 0 auto !important; display: inline-flex !important; align-items: center !important; gap: 2px !important; background: #f1f5f9 !important; border: 1px solid #cbd5e1 !important; border-radius: 4px !important; padding: 1px 2px !important; height: 28px !important; box-sizing: border-box !important; }
  .x9v-sort-group .x9v-action-sort { font-size: 14px !important; padding: 3px 6px !important; line-height: 1 !important; cursor: pointer !important; border-radius: 3px !important; border: 0 !important; }
  .x9v-sort-group .x9v-action-sort.x9v-state-active { background: #1684a2 !important; color: #fff !important; }
  .x9v-toolbar-main .x9v-action-icon { font-size: 14px !important; padding: 2px !important; line-height: 18px !important; }
  .x9v-toolbar-actions .x9v-action-icon { font-size: 16px !important; padding: 3px !important; }
  .x9v-export-panel, .x9v-column-panel, .x9v-balance-panel { right: 0 !important; left: auto !important; min-width: 185px !important; }
}
