/* ============================================================
   Payslashes Premium Dashboard UI (mobile-native)
   - Smaller, cleaner buttons across dashboards
   - Premium card + table + form control polish
   Safe to include globally (scoped to dashboard containers)
   ============================================================ */

:root{
  --ps-radius-xl: 20px;
  --ps-radius-lg: 16px;
  --ps-radius-md: 12px;
  --ps-border: rgba(15,23,42,.06);
  --ps-shadow: 0 12px 30px rgba(2,6,23,.07);
  --ps-shadow-sm: 0 8px 22px rgba(2,6,23,.06);
  --ps-text: #0f172a;
  --ps-muted: #64748b;
}

/* Dashboard containers */
.native-page, .sp-main, .storefront-dashboard, .wallet-page, .reseller-page{
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--ps-text);
}

/* Premium cards */
.native-page .card,
.sp-main .card,
.storefront-dashboard .card,
.wallet-page .card,
.reseller-page .card{
  border-radius: var(--ps-radius-xl) !important;
  border: 1px solid var(--ps-border) !important;
  box-shadow: var(--ps-shadow-sm) !important;
  overflow: hidden;
}

.native-page .card .card-header,
.sp-main .card .card-header,
.storefront-dashboard .card .card-header,
.wallet-page .card .card-header,
.reseller-page .card .card-header{
  background: #fff !important;
  border-bottom: 1px solid var(--ps-border) !important;
}

/* iOS-style hairlines + softer borders */
:root{ --ps-hairline: rgba(15,23,42,.07); }

.native-page .card,
.sp-main .card,
.storefront-dashboard .card,
.wallet-page .card,
.reseller-page .card{
  border-color: rgba(15,23,42,.05) !important;
  box-shadow: 0 10px 26px rgba(2,6,23,.06) !important;
}

.native-page .card .card-header,
.sp-main .card .card-header,
.storefront-dashboard .card .card-header,
.wallet-page .card .card-header,
.reseller-page .card .card-header{
  border-bottom: 1px solid var(--ps-hairline) !important;
}

/* Thin separators inside cards (lists, tables, borders) */
.native-page .card .list-group-item,
.sp-main .card .list-group-item,
.storefront-dashboard .card .list-group-item,
.wallet-page .card .list-group-item,
.reseller-page .card .list-group-item{
  border-color: var(--ps-hairline) !important;
}

.native-page .card hr,
.sp-main .card hr,
.storefront-dashboard .card hr,
.wallet-page .card hr,
.reseller-page .card hr{
  border-top: 1px solid var(--ps-hairline) !important;
  opacity: 1;
}

.native-page .card .border-top,
.native-page .card .border-bottom,
.sp-main .card .border-top,
.sp-main .card .border-bottom{
  border-color: var(--ps-hairline) !important;
}

/* Table wrappers: remove heavy outline */
.native-page .table-responsive,
.sp-main .table-responsive{
  border-color: rgba(15,23,42,.05);
  box-shadow: 0 8px 20px rgba(2,6,23,.05);
}

/* Small, premium buttons (global inside dashboards) */
.native-page .btn,
.sp-main .btn,
.storefront-dashboard .btn,
.wallet-page .btn,
.reseller-page .btn{
  border-radius: var(--ps-radius-md) !important;
  font-weight: 800 !important;
  letter-spacing: .1px;
  padding: .40rem .65rem !important; /* smaller */
  font-size: 0.85rem !important;
  line-height: 1.1 !important;
}

/* Extra-compact variant (use .btn-compact) */
.native-page .btn-compact,
.sp-main .btn-compact,
.storefront-dashboard .btn-compact,
.wallet-page .btn-compact,
.reseller-page .btn-compact{
  padding: .32rem .55rem !important;
  font-size: 0.82rem !important;
}

/* Icon buttons */
.btn-icon{
  width: 34px;
  height: 34px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Form controls: slightly tighter */
.native-page .form-control,
.sp-main .form-control,
.storefront-dashboard .form-control,
.wallet-page .form-control,
.reseller-page .form-control{
  border-radius: var(--ps-radius-md) !important;
  padding: .55rem .75rem !important;
  border-color: rgba(2,6,23,.14) !important;
}

.native-page .form-control.form-control-sm,
.sp-main .form-control.form-control-sm,
.storefront-dashboard .form-control.form-control-sm,
.wallet-page .form-control.form-control-sm,
.reseller-page .form-control.form-control-sm{
  padding: .45rem .65rem !important;
  font-size: .86rem !important;
}

/* Badges/chips */
.native-page .badge,
.sp-main .badge,
.storefront-dashboard .badge,
.wallet-page .badge,
.reseller-page .badge{
  border-radius: 999px !important;
  padding: .35rem .55rem !important;
  font-weight: 800 !important;
}

/* Tables: more “native” on mobile */
.native-page .table,
.sp-main .table,
.storefront-dashboard .table,
.wallet-page .table,
.reseller-page .table{
  font-size: .90rem;
}

.native-page .table td,
.native-page .table th,
.sp-main .table td,
.sp-main .table th{
  vertical-align: middle !important;
}

/* Make table wrappers feel like cards */
.native-page .table-responsive,
.sp-main .table-responsive{
  border-radius: var(--ps-radius-xl);
  box-shadow: var(--ps-shadow-sm);
  border: 1px solid var(--ps-border);
}

/* Topbars */
.sp-main .topbar{
  border-radius: var(--ps-radius-xl) !important;
  box-shadow: var(--ps-shadow-sm) !important;
}

/* Mobile: slightly tighter spacing */
@media (max-width: 575.98px){
  .native-page .card .card-body,
  .sp-main .card .card-body{
    padding: 14px !important;
  }

  .native-page .btn,
  .sp-main .btn{
    padding: .38rem .60rem !important;
    font-size: .83rem !important;
  }
}


/* Premium tabbar (staff/customer dashboards) */
.ps-tabbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  padding:4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */

  scroll-snap-type: x mandatory;
  scroll-padding-left: 8px;
  scroll-behavior: smooth;
}
.ps-tabbar::-webkit-scrollbar{ display:none; }

/* iPhone-native swipe snap + micro tap feel */
.ps-tabbar a.ps-tab,
.ps-tabbar a.btn{
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
  will-change: transform;
}
.ps-tabbar a.ps-tab:active,
.ps-tabbar a.btn:active,
.ps-tabbar a.ps-tab.tap,
.ps-tabbar a.btn.tap{
  transform: scale(.96);
}


/* Sticky tabbar (mobile-native) */
.ps-tabbar-wrap{
  position: sticky;
  top: 12px;
  z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  padding: 6px 8px;
  margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.ps-tabbar-wrap.is-stuck{
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
  border-color: rgba(0,0,0,.08);
}
.ps-tabbar-wrap .ps-tabbar{
  padding: 0;
  margin: 0;
}
.ps-tabbar .btn{
  border-radius: 999px !important;
  padding: .32rem .52rem !important;
  font-size: .80rem !important;
  line-height: 1.1;
  white-space: nowrap;
}

@media (max-width: 768px){
  .ps-tabbar{ padding-bottom:10px; }
  .ps-tabbar .btn{
    padding: .30rem .50rem !important;
    min-height: 30px;
    font-size: .80rem !important;
  }
}


/* Tabbar pills */
.ps-tabbar .ps-tab{
  background:#f3f5f7;
  border:1px solid #d7dde3;
  color:#111827;
}
.ps-tabbar .ps-tab:hover{
  background:#eef2f7;
}
.ps-tabbar .ps-tab.is-active{
  background:#0d6efd;
  border-color:#0d6efd;
  color:#fff;
  box-shadow: 0 8px 18px rgba(13,110,253,.18);
}
.ps-tabbar .ps-tab.is-active:hover{
  background:#0b5ed7;
  border-color:#0b5ed7;
}


/* ============================================================
   iPhone-native finishing touches
   - active underline glow for selected pill
   - smoother typography + glassy sticky bar
   ============================================================ */
.native-page, .sp-main{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Make tab pills positionable for underline */
.ps-tabbar .ps-tab{
  position: relative;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

/* Subtle underline glow under the active pill */
.ps-tabbar .ps-tab.is-active::after{
  content:"";
  position:absolute;
  left:14px;
  right:14px;
  bottom:-8px;
  height:3px;
  border-radius:999px;
  background: rgba(13,110,253,.95);
  box-shadow: 0 0 10px rgba(13,110,253,.35), 0 6px 16px rgba(13,110,253,.18);
  pointer-events:none;
}

/* Prevent underline from being clipped */
.ps-tabbar-wrap{
  padding-bottom: 10px;
}

/* Glassy sticky header feel (works best when tabbar is sticky) */
.ps-tabbar.is-stuck{
  background: rgba(248,250,252,.86) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(15,23,42,.08);
}

/* Slight lift on active tab */
.ps-tabbar .ps-tab.is-active{
  transform: translateY(-.5px);
}



/* ==== iOS Grouped Settings Look (v12) ==== */
.native-page{
  background: #F2F2F7;
  min-height: 100vh;
  padding-bottom: 28px;
}

/* tighter gutters like iOS grouped sections */
.native-page.container-fluid{
  padding-left: 12px;
  padding-right: 12px;
}
.native-page .row{
  --bs-gutter-x: 12px;
  --bs-gutter-y: 12px;
}

/* floating grouped cards */
.native-page .native-card{
  border: 1px solid rgba(60, 60, 67, 0.10) !important;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 10px 24px rgba(0,0,0,0.06) !important;
  backdrop-filter: saturate(180%) blur(14px);
}

/* iOS hairline separators inside cards (even lighter) */
.native-page .native-card hr,
.native-page .native-card .dropdown-divider{
  border-top: 1px solid rgba(60, 60, 67, 0.12) !important;
  opacity: 1;
}

/* subtle grouped section title helper */
.ios-section-title{
  color: rgba(60,60,67,0.6);
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 12px;
  text-transform: uppercase;
  margin: 10px 4px 8px;
}

/* ------------------------------------------------------------
   iOS list-style tables (no grid)
   - separators only (hairlines)
   - row tap highlight
   - no heavy borders / gridlines
   ------------------------------------------------------------ */

/* Outer wrapper should feel like a grouped iOS list */
.native-page .native-table-wrap{
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(60,60,67,0.10);
}

.native-page table.table,
.native-page table.native-table{
  background: transparent;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
}

/* Remove grid look */
.native-page table.table td,
.native-page table.table th,
.native-page table.native-table td,
.native-page table.native-table th{
  background: transparent;
  border: 0 !important;
  padding: 10px 12px;
}

/* Optional header: keep minimal, no boxy borders */
.native-page table.table thead th,
.native-page table.native-table thead th{
  color: rgba(60,60,67,0.70);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* iOS hairline separator per row */
.native-page table.table tbody tr,
.native-page table.native-table tbody tr{
  position: relative;
}
.native-page table.table tbody tr::after,
.native-page table.native-table tbody tr::after{
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: rgba(60,60,67,0.12);
  transform: scaleY(.5); /* thinner than 1px on retina */
  transform-origin: bottom;
  pointer-events: none;
}
.native-page table.table tbody tr:last-child::after,
.native-page table.native-table tbody tr:last-child::after{
  display: none;
}

/* Row interaction: subtle iOS tap highlight */
.native-page table.table tbody tr,
.native-page table.native-table tbody tr{
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s ease, transform .12s ease;
}
.native-page table.table tbody tr:hover,
.native-page table.native-table tbody tr:hover{
  background: rgba(0,0,0,0.03);
}
.native-page table.table tbody tr:active,
.native-page table.native-table tbody tr:active{
  background: rgba(0,0,0,0.05);
}
.native-page table.table tbody tr.ios-pressed,
.native-page table.native-table tbody tr.ios-pressed{
  background: rgba(0,0,0,0.05);
}

/* Tighter on small screens (keep compact) */
@media (max-width: 480px){
  .native-page table.table td,
  .native-page table.table th,
  .native-page table.native-table td,
  .native-page table.native-table th{
    padding: 8px 10px;
    font-size: 13px;
  }
  .native-page table.table thead th,
  .native-page table.native-table thead th{
    font-size: 11px;
  }
}

/* sticky tabbar blends into grouped background */
.ps-tabbar-wrap{
  background: #F2F2F7;
  border-radius: 14px;
}
.ps-tabbar{
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(60,60,67,0.10);
}


/* Optional iOS chevron on table rows (feel like navigation rows) */
.native-page table.table.ios-chevron tbody tr::before,
.native-page table.native-table.ios-chevron tbody tr::before{
  content: "›";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(60,60,67,0.45);
  font-weight: 700;
  font-size: 18px;
  pointer-events: none;
}
.native-page table.table.ios-chevron td:last-child,
.native-page table.native-table.ios-chevron td:last-child{
  padding-right: 28px !important;
}


/* Referral actions (iOS-like) */
.ps-ref-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ps-ref-chip{ border-radius:999px; padding:6px 10px; font-size:12px; }
.ps-mini-btn{
  padding:5px 10px !important;
  font-size:12px !important;
  line-height:1.1 !important;
  border-radius:999px !important;
  border:1px solid rgba(0,0,0,.08) !important;
}
.ps-mini-btn.ps-outline{ background:rgba(255,255,255,.65) !important; }
.ps-pressed{ transform:scale(0.97); }

/* Tiny toast (native feedback) */
.ps-toast{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  background:rgba(20,20,20,.86); color:#fff;
  padding:10px 14px; border-radius:999px;
  font-size:12px; font-weight:600;
  opacity:0; transition:opacity .18s ease, transform .18s ease;
  z-index:9999;
}
.ps-toast.show{ opacity:1; transform:translateX(-50%) translateY(-2px); }


/* iOS Filter Sheet (Customer Dashboard) */
.ps-filter-bar{
  display:none;
  user-select:none;
  cursor:pointer;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 12px;
}
.ps-filter-title{ font-weight:800; font-size:13px; line-height:1; }
.ps-filter-sub{ font-size:12px; color: rgba(0,0,0,.55); margin-top:2px; }
.ps-filter-bar-left{ min-width:0; }
.ps-filter-bar-left .ps-filter-sub{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width: 70vw; }
.ps-filter-bar-right{ display:flex; align-items:center; gap:8px; }
.ps-filter-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  background: rgba(0,122,255,.10);
  color: rgba(0,122,255,1);
  font-weight:800;
  font-size:12px;
}
.ps-filter-chevron{ font-size:20px; color: rgba(0,0,0,.35); line-height:1; }

.ps-filter-overlay{
  display:none;
}
.ps-filter-overlay.is-open{
  display:block;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9998;
}

.ps-filter-sheet{
  position:static;
  background: transparent;
  border:0;
  box-shadow:none;
}
.ps-filter-sheet-header{ display:none; }

@media (max-width: 768px){
  .ps-filter-bar{ display:flex; }
  /* turn the existing filter form content into a bottom sheet */
  .ps-filter-sheet{
    display:block;
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    box-shadow: 0 -16px 40px rgba(0,0,0,.18);
    transform: translateY(110%);
    transition: transform .22s ease;
    z-index: 9999;
    max-height: 78vh;
    overflow:hidden;
  }
  .ps-filter-form.is-open .ps-filter-sheet{ transform: translateY(0); }
  /* iOS drag-to-close */
  .ps-filter-sheet.is-dragging{ transition: none !important; }
  .ps-filter-sheet-header, .ps-filter-sheet-handle{ touch-action: none; }

  .ps-filter-sheet-header{ display:block; padding:10px 12px 0; }
  .ps-filter-sheet-handle{
    width:42px; height:5px; border-radius:99px;
    background: rgba(0,0,0,.16);
    margin: 0 auto 10px;
  }
  .ps-filter-sheet-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding-bottom:10px;
    border-bottom: 1px solid rgba(0,0,0,.06);
  }
  .ps-filter-sheet-title{ font-weight:900; font-size:14px; }
  .ps-filter-close{
    padding:6px 10px !important;
    border-radius: 999px !important;
    font-weight:800 !important;
  }
  .ps-filter-sheet-body{
    padding:12px;
    overflow:auto;
    max-height: calc(78vh - 56px);
  }
  .ps-filter-sheet-body .form-row .col-12,
  .ps-filter-sheet-body .form-row .col-6{ padding-left:6px; padding-right:6px; }
  .ps-filter-sheet-body .btn{ width:100%; }
  .ps-filter-sheet-body .d-flex.gap-2{ gap:8px !important; }
}

/* prevent background scroll when sheet open */
html.ps-noscroll, body.ps-noscroll{ overflow:hidden !important; }


/* iOS-like refresh icon inside compact icon buttons */
.btn-icon .ios-refresh{display:block;}
