/*
 * Mobile-responsive table overrides for Kaalaivanakam
 * Loaded after the main bundle CSS to fix table layouts on small screens.
 */

/* ============================================================
   1. AGENT TABLES (Products, Employees, Areas, Subscriptions)
   ============================================================ */

/* The agent tableScroll already has overflow-x:auto and min-width:720px.
   On mobile, reduce min-width so it doesn't force a huge horizontal scroll,
   and convert cells to a more compact layout. */

@media (max-width: 767.98px) {

  /* --- Generic agent table: reduce min-width, tighten padding --- */
  ._agent__tableScroll_lnidy_388 ._agent__table_lnidy_84 {
    min-width: 540px;
  }

  ._agent__table_lnidy_84 th,
  ._agent__table_lnidy_84 td {
    padding: .4rem .5rem;
    font-size: .78rem;
  }

  /* --- Customer table: already has mobile cards, ensure they work well --- */
  ._agent__customerTableDesktop_lnidy_289 {
    display: none !important;
  }
  ._agent__customerCardsMobile_lnidy_293 {
    display: flex !important;
    flex-direction: column;
    gap: 1rem;
  }

  /* Mobile customer cards — ensure full-width, no overflow */
  ._agent__mobileCustomerCard_lnidy_297 {
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* --- Subscription cards on agent page --- */
  ._agent__subCard_lnidy_515 {
    padding: .75rem;
  }

  ._agent__subHead_lnidy_527 {
    flex-direction: column;
    gap: .25rem;
  }

  ._agent__subKv_lnidy_569 {
    flex-direction: column;
    gap: .15rem;
  }

  ._agent__lineGrid_lnidy_639 {
    grid-template-columns: 1fr;
    gap: .25rem;
  }

  ._agent__subFooterRow_lnidy_687 {
    flex-direction: column;
    gap: .25rem;
    text-align: left;
  }

  /* --- Employee table --- */
  ._agent__employeeModalWide_lnidy_787 {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0 auto;
  }

  ._agent__employeeGrid_lnidy_869 {
    grid-template-columns: 1fr !important;
  }

  ._agent__employeeField_lnidy_858,
  ._agent__employeeFieldWide_lnidy_865 {
    width: 100% !important;
  }
}

@media (max-width: 479.98px) {

  /* Even smaller screens: further reduce table min-width */
  ._agent__tableScroll_lnidy_388 ._agent__table_lnidy_84 {
    min-width: 420px;
  }

  ._agent__table_lnidy_84 th,
  ._agent__table_lnidy_84 td {
    padding: .3rem .4rem;
    font-size: .72rem;
  }

  /* Subscription detail line items — stack vertically */
  ._agent__lineItem_lnidy_601 {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }

  ._agent__lineDates_lnidy_651 {
    font-size: .72rem;
  }

  ._agent__lineAmountBlock_lnidy_665,
  ._agent__lineAmount_lnidy_665 {
    font-size: .8rem;
  }
}


/* ============================================================
   2. USER TABLES (Subscriptions/Orders)
   ============================================================ */

@media (max-width: 767.98px) {

  /* Wrap user table in a scrollable container */
  ._user__table_1i7sv_297 {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: .8rem;
  }

  ._user__table_1i7sv_297 th,
  ._user__table_1i7sv_297 td {
    padding: .4rem .5rem;
    white-space: nowrap;
  }

  /* Allow long text cells to wrap */
  ._user__breakCell_1i7sv_347,
  ._user__mutedCell_1i7sv_342 {
    white-space: normal !important;
    word-break: break-word;
  }
}

@media (max-width: 479.98px) {
  ._user__table_1i7sv_297 {
    font-size: .72rem;
  }

  ._user__table_1i7sv_297 th,
  ._user__table_1i7sv_297 td {
    padding: .3rem .35rem;
  }
}


/* ============================================================
   3. INVOICE / SUBSCRIPTION DETAIL TABLES (sheet view)
   ============================================================ */

@media (max-width: 767.98px) {

  /* Table wrap — already has overflow-x:auto, ensure it works */
  ._tableWrap_1whhb_206 {
    margin-left: -.5rem;
    margin-right: -.5rem;
    border-radius: 6px;
  }

  ._linesTable_1whhb_213 {
    font-size: .72rem;
    min-width: 400px;
  }

  ._linesTable_1whhb_213 th,
  ._linesTable_1whhb_213 td {
    padding: .35rem .4rem;
  }

  ._linesTable_1whhb_213 th {
    font-size: .6rem;
  }

  /* Sheet header — stack on mobile */
  ._sheetHeader_1whhb_97 {
    font-size: .7rem;
  }
}

@media (max-width: 479.98px) {
  ._linesTable_1whhb_213 {
    min-width: 320px;
    font-size: .65rem;
  }

  ._linesTable_1whhb_213 th,
  ._linesTable_1whhb_213 td {
    padding: .25rem .3rem;
  }
}


/* ============================================================
   4. ADMIN PAGE TABLES (super admin)
   ============================================================ */

@media (max-width: 767.98px) {

  /* Admin cards — full width, reduce padding */
  ._admin__card_1oiwx_34 {
    padding: 1rem;
  }

  ._admin__grid_1oiwx_65 {
    grid-template-columns: 1fr !important;
  }

  ._admin__field_1oiwx_71 {
    width: 100% !important;
  }

  /* Agent list in admin — single column */
  ._admin__agentList_1oiwx_167 {
    grid-template-columns: 1fr !important;
  }

  ._admin__agentCard_1oiwx_181 {
    padding: .75rem;
  }

  ._admin__agentMetaRow_1oiwx_255 {
    flex-direction: column;
    gap: .25rem;
  }

  ._admin__agentCardActions_1oiwx_305 {
    flex-wrap: wrap;
    gap: .5rem;
  }

  /* Admin modals — full width on mobile */
  ._admin__modal_1oiwx_330 {
    width: 95vw !important;
    max-width: 95vw !important;
  }

  ._admin__modalActions_1oiwx_392 {
    flex-direction: column;
    gap: .5rem;
  }

  ._admin__modalActions_1oiwx_392 button {
    width: 100%;
  }

  ._admin__checkGrid_1oiwx_404 {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 479.98px) {
  ._admin__checkGrid_1oiwx_404 {
    grid-template-columns: 1fr !important;
  }

  ._admin__btn_1oiwx_111 {
    font-size: .8rem;
    padding: .5rem .75rem;
  }
}


/* ============================================================
   5. GENERAL MOBILE LAYOUT FIXES
   ============================================================ */

@media (max-width: 767.98px) {

  /* Ensure all scroll wrappers have proper touch scrolling */
  ._agent__tableScroll_lnidy_388,
  ._agent__tableScrollCustomers_lnidy_405,
  ._tableWrap_1whhb_206 {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* Prevent horizontal page overflow from tables */
  body {
    overflow-x: hidden;
  }

  /* User profile form — single column */
  ._user__formGrid_1i7sv_161 {
    grid-template-columns: 1fr !important;
  }

  ._user__fieldSpan2_1i7sv_172,
  ._user__field_1i7sv_172 {
    grid-column: span 1 !important;
    width: 100% !important;
  }

  /* Subscription selection cart — stack items */
  ._subscriptionSelection__cartHead_1ojvd_178 {
    flex-direction: column;
    gap: .5rem;
  }
}


/* ============================================================
   6. LOGIN & FORGOT PASSWORD — no scroll at any size
   ============================================================ */

/* Kill both scrollbars on the login/forgot-password page */
._loginPage_1hm1d_1 {
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

/* The card frame must shrink to fit, never push beyond viewport */
._loginPage__frame_1hm1d_18 {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

/* Hide the inner scrollbar — page looks clean, card scrolls if needed */
._loginPage__frame_1hm1d_18::-webkit-scrollbar {
  display: none;
}

/* Card should not force width overflow */
._loginPage__card_1hm1d_23 {
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Inputs must not exceed card width */
._loginPage__input_1hm1d_146 {
  max-width: 100%;
  box-sizing: border-box;
}

/* Segment buttons — prevent overflow on narrow screens */
._loginPage__segment_1hm1d_89 {
  max-width: 100%;
  box-sizing: border-box;
}

._loginPage__segmentBtn_1hm1d_99 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Submit button — stay within card */
._loginPage__submit_1hm1d_293 {
  max-width: 100%;
  box-sizing: border-box;
}

/* Info box and error — prevent width overflow */
._loginPage__info_1hm1d_209,
._loginPage__error_1hm1d_283,
._loginPage__unifiedHint_1hm1d_124 {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 479.98px) {
  /* Extra-small screens: tighten spacing to avoid any overflow */
  ._loginPage__card_1hm1d_23 {
    padding: 1rem;
    border-radius: 16px;
  }

  ._loginPage__title_1hm1d_68 {
    font-size: 1.4rem;
  }

  ._loginPage__subtitle_1hm1d_79 {
    font-size: .8rem;
  }

  ._loginPage__input_1hm1d_146 {
    font-size: .875rem;
    min-height: 2.5rem;
    padding: .55rem .75rem;
  }

  ._loginPage__submit_1hm1d_293 {
    padding: .65rem .75rem;
    font-size: .875rem;
    margin-top: 1rem;
  }

  ._loginPage__label_1hm1d_247 {
    margin-top: .75rem;
    font-size: .625rem;
  }

  ._loginPage__brand_1hm1d_43 {
    margin-bottom: 1rem;
  }

  ._loginPage__mark_1hm1d_49 {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: .75rem;
  }

  ._loginPage__segment_1hm1d_89 {
    margin-bottom: 1rem;
  }

  ._loginPage__forgotRow_1hm1d_184 {
    margin-top: .25rem;
  }

  ._loginPage__secondaryActions_1hm1d_222 {
    margin-top: .75rem;
    font-size: .75rem;
  }
}
