/* ─────────────────────────────────────────────────────────────────────────────
   QUINNI FIX SOLUTIONS — DARK NEO-BRUTALIST & CYBER-MANGA UI SYSTEM v6.0
   Design Concept: Dark Cell-Shaded Comic / Bold Outlines / Elastic Transitions
   ───────────────────────────────────────────────────────────────────────────── */

/* Failsafe Visibility Rules */
.hidden, [hidden] {
  display: none !important;
}
#impersonationFloatingBanner.hidden {
  display: none !important;
}
#actionBlockerLoader.hidden {
  display: none !important;
}

:root {
  /* Official Quinni Fix Brand Palette */
  --bg:           #0B0B0F; /* Deep Charcoal Midnight */
  --bg-card:      #12111A; /* Dark Solid Panel */
  --bg-card-raw:  #12111A;
  --bg-card2:     #181624; /* Elevated Solid Card */
  --bg-side:      #09090D; /* Darker Sidebar */
  --bg-modal:     #13121F;
  
  /* Borders */
  --border-width: 2px;
  --border:       rgba(0, 237, 255, 0.15);
  --border-hover: #00EDFF;
  --border-act:   #FF1993;

  /* Official Brand Accents */
  --cyan:         #00EDFF; /* Electric Cyan */
  --purple:       #8A3BE2; /* Cyber Violet */
  --primary:      #FF1993; /* Hot Magenta */
  --orange:       #FF1993; /* Hot Magenta Accent */
  
  /* High Contrast Off-White Typography */
  --text-main:    #E6E6E6; /* Clean Off-White */
  --text-sub:     #A0A0B5; /* Muted Light Lavender */
  --text-muted:   #686880;

  /* Status Signaling */
  --success:      #00E676; /* Mint Green */
  --warning:      #FFD600; /* Neon Yellow */
  --danger:       #FF1993; /* Neon Magenta Alert */
  --info:         #00EDFF; /* Electric Cyan Info */

  /* Brand Glows */
  --cyan-glow:    rgba(0, 237, 255, 0.35);
  --magenta-glow: rgba(255, 25, 147, 0.35);
  --purple-glow:  rgba(138, 59, 226, 0.35);
}

/* ─── Global Reset ─── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  background-color: var(--bg);
  /* Cyber-Manga Halftone dotted background style */
  background-image: radial-gradient(rgba(0, 237, 255, 0.05) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  color: var(--text-main);
  min-height: 100vh;
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

header, main {
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

/* ─── Typography & Headers ─── */
h1, h2, h3, h4, h5, h6, .font-brand {
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Retro Pop Manga signature branding */
.brand-signature {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(2px 2px 0px #000000);
}

.text-gradient-cyan { color: var(--cyan) !important; -webkit-text-fill-color: initial !important; }
.text-gradient-orange { color: var(--orange) !important; -webkit-text-fill-color: initial !important; }
.text-gradient-purple { color: var(--primary) !important; -webkit-text-fill-color: initial !important; }

/* ─── Smooth & Elastic Pop Buttons (Pushes down on click) ─── */
button, .btn {
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  border-radius: 14px !important;
  border: var(--border-width) solid #000000 !important;
  background: var(--bg-card2) !important;
  color: var(--text-main) !important;
  box-shadow: 4px 4px 0px #000000 !important;
  /* Elastic bounce transition for smooth feeling */
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 10px 18px !important;
}
button:hover, .btn:hover {
  background: var(--bg-card) !important;
  transform: translate(-2px, -2px) !important;
  box-shadow: 6px 6px 0px #000000 !important;
  border-color: #000000 !important;
}
button:active, .btn:active {
  transform: translate(2px, 2px) !important;
  box-shadow: 2px 2px 0px #000000 !important;
}

/* Primary Bubblegum Button */
button.bg-orange-600, .bg-orange-600 {
  background: var(--primary) !important;
  color: #000000 !important;
  border: var(--border-width) solid #000000 !important;
  box-shadow: 4px 4px 0px #000000 !important;
}
button.bg-orange-600:hover, .bg-orange-600:hover {
  background: #ff5c93 !important;
  color: #000000 !important;
}

/* Secondary Sky Blue Button */
button.bg-purple-600, .bg-purple-600 {
  background: var(--purple) !important;
  color: #ffffff !important;
  border: var(--border-width) solid #000000 !important;
  box-shadow: 4px 4px 0px #000000 !important;
}
button.bg-purple-600:hover, .bg-purple-600:hover {
  background: #9575cd !important;
}

/* Neutral Slate / Dark Mode Buttons */
button.bg-slate-800, button.bg-slate-700 {
  background: var(--bg-card2) !important;
  border-color: #000000 !important;
  color: var(--text-main) !important;
}
button.bg-slate-800:hover, button.bg-slate-700:hover {
  background: var(--bg-card) !important;
}

/* ─── Cel-Shaded Panels & Cards ─── */
.glass-panel {
  background: var(--bg-card) !important;
  border: var(--border-width) solid #000000 !important;
  border-radius: 24px !important;
  box-shadow: 8px 8px 0px #000000 !important;
  position: relative;
  overflow: hidden;
}
.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--purple), var(--cyan));
  border-bottom: var(--border-width) solid #000000;
}

/* ─── Pop Art Cards ─── */
.glass-card {
  background: var(--bg-card2) !important;
  border: var(--border-width) solid #000000 !important;
  border-radius: 20px !important;
  box-shadow: 5px 5px 0px #000000 !important;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s ease !important;
  position: relative;
}
.glass-card::before {
  display: none; /* Disable standard neon gradients */
}
.glass-card:hover {
  transform: translate(-2px, -2px) !important;
  box-shadow: 8px 8px 0px #000000 !important;
  background: var(--bg-card) !important;
}

/* ─── Form Inputs & Dropdowns ─── */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select, textarea {
  font-family: 'Space Grotesk', sans-serif !important;
  background: var(--bg) !important;
  border: var(--border-width) solid #000000 !important;
  color: var(--text-main) !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  box-shadow: 3px 3px 0px #000000 !important;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease !important;
}
input:focus, select:focus, textarea:focus {
  outline: none !important;
  transform: translate(1px, 1px) !important;
  box-shadow: 2px 2px 0px #000000 !important;
  border-color: var(--primary) !important;
}

/* ─── Premium Navigation Sidebar ─── */
aside#mainSidebar {
  background: var(--bg-side) !important;
  border-right: var(--border-width) solid #000000 !important;
  box-shadow: 8px 0 0px #000000 !important;
}

.sidebar-nav-btn {
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  border: var(--border-width) solid transparent !important;
  border-radius: 14px !important;
  margin-bottom: 8px;
  background: transparent !important;
  color: var(--text-sub) !important;
  box-shadow: none !important;
  transition: all 0.2s ease-out !important;
  padding: 12px 18px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px;
}
.sidebar-nav-btn:hover {
  background: var(--bg-card2) !important;
  border-color: #000000 !important;
  color: var(--text-main) !important;
  box-shadow: 3px 3px 0px #000000 !important;
  transform: translate(-1px, -1px) !important;
}

/* Active navigation item */
.sidebar-nav-btn.text-white {
  background: var(--primary) !important;
  color: #000000 !important;
  border: var(--border-width) solid #000000 !important;
  font-weight: 800 !important;
  box-shadow: 3px 3px 0px #000000 !important;
}
.sidebar-nav-btn.text-white::after {
  display: none;
}

/* ─── Sticky Header Navigation ─── */
header {
  background: var(--bg-side) !important;
  border-bottom: var(--border-width) solid #000000 !important;
}

/* ─── Sub-Navigation Tabs ─── */
.tab-active-orange {
  border-bottom: 3.5px solid #000000 !important;
  color: var(--primary) !important;
  font-weight: 800 !important;
}

/* ─── Precision Telemetry Tables ─── */
table { 
  border-collapse: collapse !important;
  width: 100% !important;
}
th {
  background-color: var(--bg-card2) !important;
  color: var(--text-main) !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 800 !important;
  border-bottom: var(--border-width) solid #000000 !important;
  padding: 14px 16px !important;
}
td {
  padding: 14px 16px !important;
  border-bottom: 2px solid #000000 !important;
  color: var(--text-sub) !important;
  font-weight: 500 !important;
}
tr:hover td {
  background-color: rgba(255, 64, 129, 0.05) !important;
  color: var(--text-main) !important;
}

/* ─── Status Badges ─── */
.badge {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 2px solid #000000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge-pending   { background-color: var(--warning); color: #000000; }
.badge-sent      { background-color: var(--cyan); color: #000000; }
.badge-processing{ background-color: var(--orange); color: #000000; }
.badge-completed { background-color: var(--success); color: #000000; }
.badge-rejected  { background-color: var(--danger); color: #000000; }
.badge-failed    { background-color: var(--danger); color: #000000; }

/* ─── Cards & Badges Grid ─── */
.admin-stats-card {
  background-color: var(--bg-card) !important;
  border: var(--border-width) solid #000000 !important;
  border-radius: 20px !important;
  box-shadow: 5px 5px 0px #000000 !important;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─── Utility classes overrides to adjust for dark mode colors ─── */
.text-slate-400 { color: #8e94b2 !important; }
.text-slate-500 { color: #6d7394 !important; }
.text-slate-300 { color: #a5abbf !important; }
.text-slate-200 { color: #d1d4e0 !important; }
.text-slate-100 { color: #f5f5fa !important; }
.text-white { color: #f5f5fa !important; }

/* Header/Landing updates */
.bg-slate-900 { background-color: var(--bg-card) !important; border: var(--border-width) solid #000000 !important; }
.bg-slate-800 { background-color: var(--bg-card2) !important; border: var(--border-width) solid #000000 !important; }
.bg-white\/5 { background-color: var(--bg-card2) !important; border: 2px solid #000000 !important; }
.bg-black\/40 { background-color: rgba(0,0,0,0.3) !important; }
.border-white\/5 { border-color: #000000 !important; }
.border-b { border-bottom: 2px solid #000000 !important; }
.border-t { border-top: 2px solid #000000 !important; }

.text-purple-400 { color: var(--purple) !important; }
.text-blue-500 { color: var(--cyan) !important; }
.text-pink-400 { color: var(--primary) !important; }
.text-emerald-500 { color: var(--success) !important; }

/* Admin menu specific purple styling mapping */
.tab-active-purple {
  border-bottom: 3.5px solid #000000 !important;
  color: var(--purple) !important;
  font-weight: 800 !important;
}
.btn-admin-purple {
  background: var(--purple) !important;
  color: #ffffff !important;
  border: var(--border-width) solid #000000 !important;
  box-shadow: 3px 3px 0px #000000 !important;
}
.btn-admin-purple:hover {
  background: #9575CD !important;
}

/* Modal tweaks */
#authModal, #purchaseModal, #editUserModal, #editServiceModal, #editProviderModal, #editRomModal, #editRechargeModal, #createTicketModal, #ticketChatModal {
  background: rgba(11, 9, 20, 0.6) !important; /* Darkened translucent comic overlay background */
}

/* Scrollbars Pop Style */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
  border-left: var(--border-width) solid #000000;
}
::-webkit-scrollbar-thumb {
  background-color: var(--purple);
  border-radius: 99px;
  border: 3px solid var(--bg);
}

/* Toast alert popups style */
.toast-popup {
  border: var(--border-width) solid #000000 !important;
  border-radius: 16px !important;
  box-shadow: 4px 4px 0px #000000 !important;
  font-weight: 700 !important;
  color: #000000 !important;
}
.toast-success { background-color: var(--success) !important; }
.toast-danger  { background-color: var(--danger) !important; }
.toast-info    { background-color: var(--info) !important; }

/* Toast alert popups style */
.toast-popup {
  border: var(--border-width) solid #000000 !important;
  border-radius: 16px !important;
  box-shadow: 4px 4px 0px #000000 !important;
  font-weight: 700 !important;
  color: #000000 !important;
}
.toast-success { background-color: var(--success) !important; }
.toast-danger  { background-color: var(--danger) !important; }
.toast-info    { background-color: var(--info) !important; }

/* ─── Mobile Responsiveness Utilities ─── */
@media (max-width: 1023px) {
  aside#mainSidebar {
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
  aside#mainSidebar.sidebar-hidden {
    transform: translateX(-100%) !important;
    box-shadow: none !important;
  }
  
  #sidebarBackdrop {
    display: none;
  }
  #sidebarBackdrop.block {
    display: block !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   FULL RESPONSIVE SYSTEM — QUINNI FIX SOLUTIONS
   Covers: Header · Sidebar · Main · All Modals · Tables ·
           Admin Panel · Wallet · Tickets · QuickQuote · Arcade
   ═══════════════════════════════════════════════════════════════ */

/* ─── Prevent horizontal overflow globally ─── */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
* {
  max-width: 100%;
}
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* ─── Automatic Horizontal Table Scroll Wrappers ─── */
div:has(> table), .table-responsive {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  margin-bottom: 12px;
}

/* ─── All modals: always scroll within viewport ─── */
[id$="Modal"] > div,
[id*="modal"] > div {
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ════════════════════════════════
   TABLET  ≤ 1024px
   ════════════════════════════════ */
@media (max-width: 1023px) {

  /* Header: no left margin (sidebar is drawer) */
  header {
    margin-left: 0 !important;
    padding: 10px 16px !important;
  }

  /* Main: no left margin */
  main {
    margin-left: 0 !important;
    padding: 16px !important;
  }

  /* Admin tabs: horizontal scroll */
  #section-admin > div:first-child {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #section-admin > div:first-child::-webkit-scrollbar {
    display: none;
  }

  /* Wallet grid: 1 col on tablets */
  #section-wallet .grid-cols-1.lg\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* Tickets: stack layout */
  #section-tickets .grid.lg\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  #ticketChatView {
    min-height: 400px;
  }
}

/* ════════════════════════════════
   TABLET SMALL  ≤ 768px
   ════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Header ── */
  header {
    padding: 8px 12px !important;
    gap: 8px;
  }
  #headerTitle {
    font-size: 11px !important;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Balance pill in header: compact */
  #userProfileHeader > div:first-child {
    padding: 6px 10px !important;
  }
  #userProfileHeader > div:first-child .text-xs {
    font-size: 10px !important;
  }

  /* ── Main ── */
  main {
    padding: 12px 10px !important;
  }

  /* ── Panels ── */
  .glass-panel {
    padding: 14px 12px !important;
    border-radius: 18px !important;
    box-shadow: 4px 4px 0px #000 !important;
  }
  .glass-card {
    padding: 14px 12px !important;
    border-radius: 16px !important;
    box-shadow: 4px 4px 0px #000 !important;
  }

  /* ── Tables ── */
  table {
    min-width: 560px !important;
  }
  th, td {
    padding: 10px 8px !important;
    font-size: 10.5px !important;
  }

  /* ── Admin tabs ── */
  .admin-tabs-scroll,
  #section-admin > div:first-child {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .admin-tabs-scroll::-webkit-scrollbar,
  #section-admin > div:first-child::-webkit-scrollbar {
    display: none;
  }

  /* ── Grids: force single column on small screens ── */
  .grid-cols-2:not(.keep-2col),
  .md\:grid-cols-2:not(.keep-2col),
  .md\:grid-cols-3:not(.keep-2col),
  .md\:grid-cols-4:not(.keep-2col) {
    grid-template-columns: 1fr !important;
  }

  /* Wallet recharge options: 2-col keeps */
  #section-wallet .grid.sm\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  #section-wallet .grid.sm\:grid-cols-2 > div {
    min-height: 120px;
  }

  /* Workshop grid: 1 col */
  #workshopOrdersList {
    grid-template-columns: 1fr !important;
  }

  /* ── Inputs: prevent iOS zoom ── */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  select, textarea {
    font-size: 14px !important;
    padding: 10px 12px !important;
  }

  /* ── Grid gaps ── */
  .grid { gap: 12px !important; }

  /* ── All Modals ── */
  [id$="Modal"] > div,
  [id*="modal"] > div {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: 0 auto !important;
    padding: 16px 14px !important;
    border-radius: 20px !important;
  }

  /* QuickQuote modal: stack columns */
  #quickQuoteModal > div {
    padding: 16px 14px !important;
    max-height: 92vh !important;
  }
  #quickQuoteModal .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  #mqPreviewText {
    height: 130px !important;
  }

  /* Edit service modal: full width */
  #editServiceModal > div {
    max-width: 98vw !important;
  }

  /* Admin ticket chat modal */
  #adminTicketChatModal > div {
    height: 90vh !important;
    max-height: 90vh !important;
  }

  /* Arcade modal */
  #arcadeModal > div {
    max-width: 98vw !important;
    border-radius: 20px !important;
  }

  /* User Profile modal */
  #userProfileModal > div {
    padding: 16px 14px !important;
  }

  /* Scroll-snap tabs (brand/ROM filters) */
  .scroll-tabs-mobile, #romBrandsFilter {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
  }
  .scroll-tabs-mobile::-webkit-scrollbar,
  #romBrandsFilter::-webkit-scrollbar {
    display: none;
  }
}

/* ════════════════════════════════
   MOBILE  ≤ 640px
   ════════════════════════════════ */
@media (max-width: 639px) {

  /* ── Header: ultra-compact ── */
  header {
    padding: 6px 10px !important;
    flex-wrap: nowrap;
    gap: 6px;
  }
  #headerTitle {
    font-size: 10px !important;
    max-width: 100px;
  }
  /* Hide balance label on very small screens */
  #userProfileHeader > div:first-child .text-\[7px\] {
    display: none;
  }

  /* ── Sidebar: full width when open ── */
  aside#mainSidebar {
    width: 280px !important;
  }

  /* ── Main ── */
  main {
    padding: 10px 8px !important;
  }

  /* ── Workshop stats row: 2-col ── */
  #section-workshop .grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── Admin stats: 2-col ── */
  #adminStatsGrid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── Services grid: 1 col ── */
  #servicesGrid {
    grid-template-columns: 1fr !important;
  }

  /* ── ROMs grid: 2 col ── */
  #romsGridContainer {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── Wallet: recharge methods in 1 col ── */
  #section-wallet .grid.sm\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* ── Modals: full-screen style ── */
  [id$="Modal"] > div,
  [id*="modal"] > div {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 95vh !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 14px 12px !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    transform: none !important;
  }

  /* Center-stack modals (not bottom-sheet) */
  #authModal > div,
  #tosModal > div,
  #disclaimerModal > div,
  #arcadeModal > div {
    position: relative !important;
    bottom: auto !important;
    border-radius: 20px !important;
    margin: auto !important;
    top: auto !important;
  }

  /* QuickQuote: full screen */
  #quickQuoteModal > div {
    max-height: 95vh !important;
    overflow-y: auto;
    position: relative !important;
    bottom: auto !important;
    border-radius: 20px !important;
  }

  /* ── Table cells: ultra compact ── */
  th, td {
    padding: 8px 6px !important;
    font-size: 10px !important;
  }

  /* ── Button text: hide labels on icon buttons ── */
  #btn-quick-quote span:not(.emoji) {
    display: none;
  }

  /* ── Wallet transaction table ── */
  #walletTxTable td:nth-child(3),
  #walletTxTable th:nth-child(3) {
    display: none !important; /* Hide "Descripción" col on tiny screens */
  }
}

/* ════════════════════════════════
   EXTRA SMALL  ≤ 480px
   ════════════════════════════════ */
@media (max-width: 480px) {

  /* Header */
  header {
    padding: 6px 8px !important;
    white-space: nowrap !important;
  }
  header button,
  header select,
  header .header-btn {
    padding: 4px 6px !important;
    font-size: 9.5px !important;
    border-radius: 10px !important;
    min-height: unset !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
  #headerTitle {
    display: none !important;
  }
  .credits-display {
    font-size: 10px !important;
  }

  /* ── ROMs: 2 col ── */
  #romsGridContainer {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* ── Admin stats: 2-col compact ── */
  #adminStatsGrid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* ── Workshop stats: 2-col ── */
  #section-workshop .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* ── Panels compact ── */
  .glass-panel {
    padding: 12px 10px !important;
    border-radius: 16px !important;
  }

  /* ── Sidebar narrower on SE screens ── */
  aside#mainSidebar {
    width: 260px !important;
  }

  /* ── Language selector compact ── */
  header select {
    padding: 4px 6px !important;
    font-size: 10px !important;
  }
}

/* ════════════════════════════════
   VERY SMALL  ≤ 380px  (Galaxy A/Fold, iPhone SE 1st gen)
   ════════════════════════════════ */
@media (max-width: 380px) {

  main {
    padding: 8px 6px !important;
  }

  .glass-panel {
    padding: 10px 8px !important;
    border-radius: 14px !important;
    box-shadow: 3px 3px 0px #000 !important;
  }

  /* Hide notification badge text */
  #headerNotificationBadge {
    width: 14px !important;
    height: 14px !important;
    font-size: 6px !important;
  }

  /* Single col everything */
  .grid {
    grid-template-columns: 1fr !important;
  }

  /* Exception: keep 2-col for stats */
  #adminStatsGrid,
  #section-workshop .grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Sidebar: max width */
  aside#mainSidebar {
    width: 240px !important;
  }

  th, td {
    padding: 6px 4px !important;
    font-size: 9.5px !important;
  }
}

/* ════════════════════════════════
   TOUCH & INTERACTION POLISH
   ════════════════════════════════ */

/* Larger tap targets for mobile */
@media (hover: none) and (pointer: coarse) {
  button, .btn, a[onclick], [role="button"] {
    min-height: 40px;
  }

  /* Better scrollability in overflow containers */
  .overflow-x-auto, div:has(> table) {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  /* Disable hover translate on touch (prevents stuck states) */
  button:hover, .btn:hover,
  .glass-card:hover {
    transform: none !important;
  }
  button:active, .btn:active {
    transform: scale(0.97) !important;
  }
}

/* ─── No Scrollbar Utility ─── */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ─── Modal backdrop always covers full viewport ─── */
.fixed.inset-0[id$="Modal"],
.fixed.inset-0[id*="modal"] {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fixed.inset-0[id$="Modal"].flex,
.fixed.inset-0[id*="modal"].flex {
  display: flex !important;
}

/* ─── Scrollbar Pop Style ─── */
::-webkit-scrollbar {
  width: 10px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
  border-left: 2px solid #000;
}
::-webkit-scrollbar-thumb {
  background-color: var(--purple);
  border-radius: 99px;
  border: 3px solid var(--bg);
}

/* ─── Toast alert popups ─── */
.toast-popup {
  border: var(--border-width) solid #000 !important;
  border-radius: 16px !important;
  box-shadow: 4px 4px 0px #000 !important;
  font-weight: 700 !important;
  color: #000 !important;
  max-width: calc(100vw - 32px) !important;
}
.toast-success { background-color: var(--success) !important; }
.toast-danger  { background-color: var(--danger) !important; }
.toast-info    { background-color: var(--info) !important; }

/* Ghost float animation */
@keyframes ghost-float {
  0%, 100% { transform: translateY(0px) rotate(-1deg); }
  50% { transform: translateY(-16px) rotate(1deg); }
}

/* ─── Service Notes & Technical Instructions (Whitespace & Linebreak Preservation) ─── */
.formatted-service-notes,
#purchDesc,
.order-notes-container,
.order-notes-box,
#provModalNotesVal {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}





.sidebar-nav-btn.hidden,
#sidebarBtnArcade.hidden,
.sidebar-nav-btn[style*="display: none"],
#sidebarBtnArcade[style*="display: none"] {
  display: none !important;
}

/* ─── Web Store Services Table Container & Fixed Styling ─── */
#webStoreServicesTableContainer {
  max-height: 560px !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  position: relative !important;
}

#webStoreServicesTable {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
}

#webStoreServicesTable thead {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
}

#webStoreServicesTable thead th {
  background-color: #0e101a !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#webStoreServicesTable tbody td {
  vertical-align: middle !important;
}
