/* =======================================================
   /css/styles.css
   MajikBonus Affiliate Portal — unified desktop + mobile
   ======================================================= */

/* ========== THEME / BASE ========== */
:root {
    --app-max: 430px;   /* large iPhone range */
    --app-min: 320px;   /* practical 98% floor */
    --app-bg: #ffffff;
    --page-bg: #f6f7fb;
  }
  
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: var(--page-bg);
    color: #000;
    /* allow horizontal scroll if viewport goes under the floor */
    min-width: 0;
    overflow-x: auto;
  }
  
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background-color: #f8f9fa; /* your original body bg */
  }
  
  /* Navbar + footer theme */
  nav, footer {
    background-color: #e9ecef;
  }
  footer {
    text-align: center;
  }
  
  /* ========== APP SHELL ========== */
  .app-shell {
    /* size: never smaller than var(--app-min), prefer viewport width, never larger than var(--app-max) */
    width: clamp(var(--app-min), 100svw, var(--app-max));
    max-width: var(--app-max);
    min-width: var(--app-min);
  
    min-height: 100svh;
    margin-inline: auto;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    box-sizing: border-box;
    box-shadow:
      0 0 0 1px rgba(0,0,0,.04),
      0 8px 24px rgba(0,0,0,.08);
  }
  
  /* On small/phone viewports, go full-bleed and remove chrome */
  @media (max-width: 480px) {
    .app-shell {
      width: 100svw;
      max-width: 100svw;
      min-width: 100svw;
      border-radius: 0;
      box-shadow: none;
    }
  }
  
  /* If viewport is narrower than our min, anchor left (no drifting center) */
  @media (max-width: 359.98px) {
    .app-shell {
      margin-left: 0;       /* stop centering */
      margin-right: auto;   /* anchor left; overflow goes right */
    }
  }
  
  /* iOS safe-area padding */
  .safe-area {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  /* Structure inside shell */
  .app-header,
  .app-footer {
    flex: 0 0 auto;
    width: 100%;
  }
  .app-main {
    flex: 1 1 auto;
    width: 100%;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
  }
  
  /* Constrain nav/footer to shell width and neutralize viewport pinning */
  .app-shell .app-header .navbar,
  .app-shell .app-footer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;      /* of the shell, not the viewport */
    max-width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box;
  }
  
  .app-shell .fixed-top,
  .app-shell .fixed-bottom,
  .app-shell .sticky-top {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
  }
  
  /* ========== ICONS ========== */
  .icon-container {
    display: flex;
    align-items: center;
    margin: 0;
    border: 0;
    width: 100%;
    overflow-x: auto;
  }
  .icon-button {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
  }
  .icon-svg {
    width: 100%;
    height: auto;
  }
  .icon-button span {
    margin-bottom: 0;
  }
  .icon-text {
    color: #000;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  
  /* ========== TABLES ========== */
  .table td,
  .table th {
    padding: 0.10rem;
    font-size: 0.75rem;
  }
  .nowrap { white-space: nowrap; }
  
  /* ========== RESPONSIVE TWEAKS ========== */
  @media (max-width: 768px) {
    .icon-text { font-size: 0.70rem; }
    .table td, .table th { font-size: 0.70rem; }
  }
  @media (max-width: 576px) {
    .icon-text { font-size: 0.65rem; }
    .table td, .table th { font-size: 0.65rem; }
  }
  
  