/* GSMVanta customer workspace — fluid geometry and container behavior. */

html[data-app-area="client"] body.app-client .app-main,
html[data-app-area="client"] body.app-client .app-content,
html[data-app-area="client"] body.app-client .app-content-inner,
html[data-app-area="client"] body.app-client .workspace-page,
html[data-app-area="client"] body.app-client .panel,
html[data-app-area="client"] body.app-client .table-wrap {
  min-width: 0;
}

html[data-app-area="client"] body.app-client .app-content-inner {
  container: client-workspace / inline-size;
}

html[data-app-area="client"] body.app-client .service-grid,
html[data-app-area="client"] body.app-client .catalog-card-grid,
html[data-app-area="client"] body.app-client .metric-grid {
  width: 100%;
  align-items: stretch;
}

html[data-app-area="client"] body.app-client :is(
  .panel,
  .card,
  .metric-card,
  .dashboard-bento-card,
  .security-card,
  .catalog-service-card
) {
  min-width: 0;
  max-width: 100%;
}

html[data-app-area="client"] body.app-client :is(
  .panel-head,
  .workspace-page-head,
  .catalog-toolbar,
  .orders-filter-form,
  .page-actions
) > * {
  min-width: 0;
}

html[data-app-area="client"] body.app-client :is(
  .table-wrap,
  .gv-data-table-wrap,
  .orders-table-wrap,
  .wallet-transaction-table-wrap,
  .topup-table-wrap,
  .client-support-table-wrap
) {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

html[data-app-area="client"] body.app-client :is(.table,.gv-unified-table) {
  width: max-content;
  min-width: 100%;
}

html[data-app-area="client"] body.app-client .app-language-popover,
html[data-app-area="client"] body.app-client .app-profile-popover {
  width: min(320px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - var(--theme-topbar-height) - 24px);
}

html[data-app-area="client"] body.app-client .app-notification-popover {
  width: min(380px, calc(100vw - 24px));
  max-width: min(380px, calc(100vw - 24px));
}

@media (max-width: 680px) {
  html[data-app-area="client"] body.app-client .app-header-menu > :is(
    .app-language-popover,
    .app-profile-popover,
    .app-notification-popover
  ) {
    max-width: calc(100vw - 20px);
  }
}


@container client-workspace (max-width: 980px) {
  html[data-app-area="client"] body.app-client .dashboard-bento-grid,
  html[data-app-area="client"] body.app-client .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container client-workspace (max-width: 640px) {
  html[data-app-area="client"] body.app-client .dashboard-bento-grid,
  html[data-app-area="client"] body.app-client .metric-grid,
  html[data-app-area="client"] body.app-client .catalog-card-grid,
  html[data-app-area="client"] body.app-client .service-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  html[data-app-area="client"] body.app-client .app-topbar-actions {
    gap: 5px;
  }

  html[data-app-area="client"] body.app-client :is(
    .app-menu-button,
    .app-language-button,
    .app-notification-button,
    .app-profile-button
  ) {
    min-width: 38px;
    height: 38px;
  }

  html[data-app-area="client"] body.app-client .workspace-page-head {
    align-items: stretch;
  }

  html[data-app-area="client"] body.app-client .workspace-page-head > * {
    width: 100%;
  }

  html[data-app-area="client"] body.app-client .page-actions,
  html[data-app-area="client"] body.app-client .client-profile-actions,
  html[data-app-area="client"] body.app-client .security-form-actions {
    align-items: stretch;
  }

  html[data-app-area="client"] body.app-client .page-actions :is(.button,.btn),
  html[data-app-area="client"] body.app-client .client-profile-actions .button,
  html[data-app-area="client"] body.app-client .security-form-actions .button {
    flex: 1 1 150px;
  }
}

/* customer header popovers, Security sign-in controls and mobile order history. */
html[data-app-area="client"] body.app-client .app-language-popover {
  width: min(250px, calc(100vw - 32px));
  max-width: min(250px, calc(100vw - 32px));
}

html[data-app-area="client"] body.app-client .security-customer-signin-grid {
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr);
  gap: 16px;
  min-width: 0;
}
html[data-app-area="client"] body.app-client .security-customer-signin-grid > .security-card {
  min-width: 0;
}
html[data-app-area="client"] body.app-client .security-customer-login-body,
html[data-app-area="client"] body.app-client .security-customer-password-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}
html[data-app-area="client"] body.app-client .security-customer-google-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}
html[data-app-area="client"] body.app-client .security-customer-google-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
html[data-app-area="client"] body.app-client .security-customer-google-row :is(b,small) {
  min-width: 0;
  overflow-wrap: anywhere;
}
html[data-app-area="client"] body.app-client .security-customer-login-empty {
  min-height: 110px;
  padding: 16px;
  border: 1px dashed var(--theme-border, var(--ui-border));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
html[data-app-area="client"] body.app-client .security-customer-google-action {
  display: grid;
  gap: 12px;
}
html[data-app-area="client"] body.app-client .security-customer-password-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  min-width: 0;
}
html[data-app-area="client"] body.app-client .security-customer-password-grid .field {
  min-width: 0;
}
html[data-app-area="client"] body.app-client .security-customer-password-grid .security-password-control {
  min-width: 0;
}
html[data-app-area="client"] body.app-client .security-customer-password-grid input.input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  height: 54px;
}
html[dir="rtl"][data-app-area="client"] body.app-client .security-customer-password-grid input.input {
  padding-inline: 48px 16px;
}
html[data-app-area="client"] body.app-client .security-customer-password-grid .security-password-toggle-v2 {
  width: 38px;
  height: 38px;
  inset-inline-end: 8px;
}

@media (max-width: 900px) {
  html[data-app-area="client"] body.app-client .security-customer-signin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  html[data-app-area="client"] body.app-client .app-language-popover {
    width: min(260px, calc(100vw - 28px));
    max-width: min(260px, calc(100vw - 28px));
  }
  html[data-app-area="client"] body.app-client .app-notification-popover {
    width: min(300px, calc(100vw - 28px));
    max-width: min(300px, calc(100vw - 28px));
  }
  html[data-app-area="client"] body.app-client .security-customer-password-grid {
    grid-template-columns: 1fr;
  }
  html[data-app-area="client"] body.app-client .security-customer-login-empty {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
  }
  html[data-app-area="client"] body.app-client .security-customer-login-empty .button,
  html[data-app-area="client"] body.app-client .security-customer-google-action .button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer {
    width: 820px;
    min-width: 820px;
    max-width: none;
    table-layout: fixed;
  }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer .orders-col-number { width: 90px; }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer .orders-col-service { width: 300px; }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer .orders-col-target { width: 170px; }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer .orders-col-amount { width: 110px; }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer .orders-col-status { width: 150px; }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer th {
    white-space: nowrap;
    word-break: normal;
  }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer td:not(.orders-service-cell) {
    white-space: nowrap;
    word-break: normal;
  }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer .orders-service-cell {
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer .orders-service-cell .order-service-link {
    display: -webkit-box;
    max-height: 2.8em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.4;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  html[data-app-area="client"] body.app-client .orders-page-customer .gv-orders-table-customer .orders-target-cell {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* visible customer password fields and borderless brand/catalog imagery. */
html[data-app-area="client"] body.app-client .security-customer-password-grid input.input,
html[data-app-area="client"] body.app-client .security-customer-google-action input.input {
  padding-inline: 16px;
  font-size: 15px;
  font-weight:600;
}

/* The collapsible customer rail shows the actual logo, not a framed tile. */
html[data-app-area="client"] body.app-client .app-sidebar .app-brand-mark > img {
  overflow: hidden;
}

/* Service/group artwork is the image itself: no extra square frame around it. */


/* polished collapsed customer rail and balanced Security CTA. */
@media (min-width: 1025px) {
  /* Animate the actual rail geometry instead of snapping between widths. */
  html[data-app-area="client"] body.app-client .app-sidebar {
    transition: width 280ms cubic-bezier(.22,.8,.24,1),
                box-shadow 220ms ease,
                border-color 220ms ease,
                background-color 220ms ease;
    will-change: width;
  }
  html[data-app-area="client"] body.app-client .app-main {
    transition: margin-inline-start 280ms cubic-bezier(.22,.8,.24,1),
                width 280ms cubic-bezier(.22,.8,.24,1);
  }
  html[data-app-area="client"] body.app-client .app-topbar {
    transition: inset-inline-start 280ms cubic-bezier(.22,.8,.24,1),
                background-color 220ms ease,
                border-color 220ms ease;
  }

  /* Keep labels in the layout long enough to fade/slide, then clip them fully. */
  html[data-app-area="client"] body.app-client .app-sidebar .app-brand-copy,
  html[data-app-area="client"] body.app-client .app-sidebar .app-nav-label {
    display: block !important;
    max-width: 170px;
    opacity: 1;
    transform: translateX(0);
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 220ms cubic-bezier(.22,.8,.24,1),
                opacity 140ms ease,
                transform 220ms cubic-bezier(.22,.8,.24,1);
  }
  html[dir="rtl"][data-app-area="client"] body.app-client .app-sidebar .app-brand-copy,
  html[dir="rtl"][data-app-area="client"] body.app-client .app-sidebar .app-nav-label {
    transform: translateX(0);
  }
  html[data-app-area="client"] body.app-client .app-sidebar .app-nav-group-title {
    display: block !important;
    max-height: 28px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 180ms ease, opacity 120ms ease, padding 180ms ease;
  }

  html[data-app-area="client"].app-sidebar-collapsed body.app-client .app-sidebar .app-brand-copy,
  html[data-app-area="client"].app-sidebar-collapsed body.app-client .app-sidebar .app-nav-label {
    display: block !important;
    max-width: 0;
    opacity: 0;
    transform: translateX(-7px);
    pointer-events: none;
  }
  html[dir="rtl"][data-app-area="client"].app-sidebar-collapsed body.app-client .app-sidebar .app-brand-copy,
  html[dir="rtl"][data-app-area="client"].app-sidebar-collapsed body.app-client .app-sidebar .app-nav-label {
    transform: translateX(7px);
  }
  html[data-app-area="client"].app-sidebar-collapsed body.app-client .app-sidebar .app-nav-group-title {
    display: block !important;
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    pointer-events: none;
  }

  /* The collapsed rail is icon-only — no stray brand or navigation text. */
  html[data-app-area="client"].app-sidebar-collapsed body.app-client .app-sidebar-head {
    justify-content: center;
    padding-inline: 10px;
  }
  html[data-app-area="client"].app-sidebar-collapsed body.app-client .app-brand {
    width: 34px;
    max-width: 34px;
    justify-content: center;
    gap: 0;
    overflow: hidden;
  }
  html[data-app-area="client"].app-sidebar-collapsed body.app-client .app-nav {
    padding-inline: 9px;
  }
  html[data-app-area="client"].app-sidebar-collapsed body.app-client .app-nav-link {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
    overflow: hidden;
  }
}

/* Transparent customer logos keep a clean edge on the sidebar surface. */
html[data-app-area="client"] body.app-client .app-sidebar .app-brand-mark {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
  border-radius: 8px;
}
html[data-app-area="client"] body.app-client .app-sidebar .app-brand-mark > img {
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain;
}
html[data-app-area="client"] body.app-client .app-sidebar .app-brand-mark > .app-brand-fallback {
  border: 0;
  border-radius: 8px;
  background: var(--theme-accent);
  color: var(--theme-accent-text);
}
html[data-app-area="client"] body.app-client .app-sidebar .app-brand-mark > .app-brand-fallback[hidden] {
  display: none !important;
}

/* Make the two-word Google action read like a proper CTA instead of a tight pill. */
html[data-app-area="client"] body.app-client .security-customer-login-empty > .button.primary {
  min-width: 132px;
  min-height: 44px;
  padding-inline: 20px;
  justify-content: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight:600;
  border-radius: 11px;
}

@media (max-width: 680px) {
  html[data-app-area="client"] body.app-client .security-customer-login-empty > .button.primary {
    min-width: 0;
    width: 100%;
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-app-area="client"] body.app-client .app-sidebar,
  html[data-app-area="client"] body.app-client .app-main,
  html[data-app-area="client"] body.app-client .app-topbar,
  html[data-app-area="client"] body.app-client .app-sidebar :is(.app-brand-copy,.app-nav-label,.app-nav-group-title) {
    transition-duration: .01ms !important;
  }
}

/* Keep the desktop rail collapse affordance visually icon-only. */
@media (min-width: 1025px) {
  html[data-app-area="client"] body.app-client .app-sidebar .app-sidebar-collapse,
  html[data-app-area="client"].app-sidebar-collapsed body.app-client .app-sidebar .app-sidebar-collapse {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  html[data-app-area="client"] body.app-client .app-sidebar .app-sidebar-collapse:hover,
  html[data-app-area="client"] body.app-client .app-sidebar .app-sidebar-collapse:focus-visible {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--theme-accent);
  }
  html[data-app-area="client"] body.app-client .app-sidebar .app-sidebar-collapse-icon {
    border: 0;
    border-radius: 7px;
    background: transparent;
  }
}
