/* ============================================================================
   IWO HUB // NEO-BRUTALISM POLISH LAYER (PURE — NO GLASS)
   Loads AFTER iwo-matrix.css. Enforces: solid surfaces, 3px black borders,
   hard offset shadows, sharp corners, Inter + JetBrains Mono.
   Plus universal responsive + smooth hard-snap motion.
   ============================================================================ */

/* ---------- 1. SOLID SURFACES (kill translucency everywhere) ---------- */
.hero-neo-card,
.neo-table-card,
.neo-navbar-box,
.neo-modal-window,
.modal-card,
.overview-stat-box,
.member-metrics-grid > *,
.ticket-stats-grid > * {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sticker-tag,
.pill-tag,
.neo-badge {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: #ffffff;
}

/* ---------- 2. BRUTALIST FRAME LOCK (Dava convention) ---------- */
:root {
  --nb-border: #0f0f12;              /* off-black, never pure #000 per taste rule */
  --nb-ink: #0f0f12;
  --border-thick: 3px solid var(--nb-border);
  --border-heavy: 3.5px solid var(--nb-border);
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --shadow-sm: 2px 2px 0px var(--nb-border);
  --shadow-md: 4px 4px 0px var(--nb-border);
  --shadow-lg: 6px 6px 0px var(--nb-border);
  --shadow-xl: 8px 8px 0px var(--nb-border);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --ease-snap: cubic-bezier(0.2, 0.9, 0.25, 1);
  --dur-fast: 0.12s;
  --dur-med: 0.2s;
}

/* Global radius purge: sharp corners everywhere */
.hero-neo-card,
.neo-table-card,
.neo-table-bar,
.neo-navbar-box,
.neo-modal-window,
.modal-card,
.overview-stat-box,
.sticker-tag,
.pill-tag,
.neo-badge,
.neo-btn,
button,
input,
select,
textarea,
.neo-table th,
.neo-table td {
  border-radius: 0 !important;
}

/* Cards: crisp frame + hard shadow, no hover-lift softness */
.hero-neo-card,
.neo-table-card,
.overview-stat-box {
  border: 3px solid var(--nb-border) !important;
  box-shadow: 6px 6px 0px var(--nb-border) !important;
}

.neo-navbar-box,
.neo-modal-window,
.modal-card {
  border: 3px solid var(--nb-border) !important;
  box-shadow: 6px 6px 0px var(--nb-border) !important;
}

/* Tables: hard row rules, hover = solid accent fill */
.neo-table th {
  border-bottom: 3px solid var(--nb-border) !important;
  background: #0f0f12 !important;
  color: #ffffff !important;
}
.neo-table td {
  border-bottom: 2px solid #0f0f12 !important;
}
.neo-table tbody tr:hover td {
  background: #ffe600 !important;
}

/* ---------- 3. TYPOGRAPHY (Inter + JetBrains Mono) ---------- */
body, .iwo-container, .view-section { font-family: var(--font-main) !important; }
.hero-neo-title, .brand-name-heavy, h1, h2, h3 { letter-spacing: -0.02em; }
.mono, code, pre, .neo-table th, .sticker-tag { font-family: var(--font-mono) !important; }

.hero-neo-title { font-size: clamp(24px, 5vw, 40px) !important; line-height: 1.1; font-weight: 800; }
.brand-name-heavy { font-size: clamp(14px, 2.2vw, 18px) !important; font-weight: 800; }

/* ---------- 4. HARD-SNAP MOTION (brutalist: press = shadow collapse) ---------- */
.neo-tab-link, .neo-btn, button, .sticker-tag {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.neo-tab-link,
.neo-btn,
button.neo-btn {
  border: 3px solid var(--nb-border);
  box-shadow: 4px 4px 0px var(--nb-border);
  transition: transform var(--dur-fast) var(--ease-snap), box-shadow var(--dur-fast) var(--ease-snap), background var(--dur-fast) ease, color var(--dur-fast) ease;
  will-change: transform;
}

.neo-btn:active,
button.neo-btn:active,
.neo-tab-link:active {
  transform: translate(4px, 4px) !important;
  box-shadow: 0px 0px 0px var(--nb-border) !important;
}

@media (hover: hover) and (pointer: fine) {
  .neo-btn:hover, button.neo-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0px var(--nb-border); }
  .hero-neo-card:hover, .neo-table-card:hover { transform: none; box-shadow: 6px 6px 0px var(--nb-border); }
}

/* View switching: fast hard slide, GPU-only */
.view-section {
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-snap), transform var(--dur-med) var(--ease-snap);
}
.view-section.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.iwo-container, .view-section, .neo-table-scroll-container, .neo-modal-window {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* NOTE: .iwo-container & .view-section DIHAPUS dari overscroll contain — bikin gesture
   makan di layer dalam sebelum sampai window scroll. Cuma kontainer tabel/modal yang contain. */
.neo-table-scroll-container, .neo-modal-window { overscroll-behavior: contain; }

/* ---------- 5. RESPONSIVE: ALL ASPECT RATIOS ---------- */
@supports (padding: max(0px)) {
  body, .iwo-container {
    padding-left: max(var(--iwo-pad, 0px), env(safe-area-inset-left));
    padding-right: max(var(--iwo-pad, 0px), env(safe-area-inset-right));
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (pointer: coarse) {
  .neo-tab-link, .neo-btn, button, .pill-tag, .sticker-tag { min-height: 44px; }
  .neo-tab-link { padding: 10px 14px !important; }
  .neo-table td, .neo-table th { padding: 12px 10px !important; }
  input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea, select { font-size: 16px !important; }
}

@media (max-width: 390px) {
  .member-metrics-grid, .ticket-stats-grid, .overview-telemetry-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  .hero-neo-title { font-size: 23px !important; }
  .neo-table { font-size: 12px !important; }
  .neo-tab-link { font-size: 11px !important; padding: 9px 10px !important; }
  .iwo-container { padding-left: 10px !important; padding-right: 10px !important; }
}

@media (max-width: 360px) {
  .member-metrics-grid, .ticket-stats-grid { grid-template-columns: 1fr !important; }
  .brand-sub-badge { display: none !important; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .neo-header, .neo-navbar-box { padding-top: 4px !important; padding-bottom: 4px !important; }
  .hero-neo-card { padding: 14px !important; }
  .hero-neo-title { font-size: 20px !important; }
  .view-section { padding-top: 8px !important; }
}

@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  .member-metrics-grid, .ticket-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (min-width: 1600px) {
  .iwo-container { max-width: 1440px; margin-left: auto; margin-right: auto; }
}

@media (min-width: 2000px) {
  .neo-table { font-size: 15px; }
}

/* ---------- 6. BUG-PROOFING ---------- */
html, body { overflow-x: hidden; max-width: 100vw; }
.iwo-container, .view-section { max-width: 100%; }
img, video, canvas, svg { max-width: 100%; height: auto; }
pre, code, .neo-table-scroll-container { max-width: 100%; }
.neo-table td, .overview-stat-box, .pill-tag { overflow-wrap: anywhere; word-break: break-word; }

@media (max-height: 640px) {
  .neo-modal-window, .modal-card { max-height: 92vh; overflow-y: auto; }
}

/* Reduced motion: instant states, zero animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================================
   MOBILE SCROLL UNLOCK — fix Home & Aktivitas gak bisa scroll di HP
   Root cause: refinement block lama set html,body{overflow:hidden!important}
   (sudah dihapus). Ini belty+suspenders.
   ============================================================================ */
@media (max-width: 850px) {
  html, body { overflow-x: hidden !important; overflow-y: auto !important; }
  #iwo-app { overflow: visible !important; }
  /* View activation (kept for transition support, no scroll lock) */
  .view-section.active { animation: none; }
}
/* overscroll-behavior-y: none di html/body MATIKAN scroll di Android Chrome (breaks scroll chaining) — dilarang */

/* ============================================================================
   BRIGHTNESS BOOST — light mode lebih cerah, dark mode kontras naik
   ============================================================================ */
:root {
  --nb-canvas: #fdfdf6;          /* warm paper putih cerah */
  --nb-surface: #ffffff;
  --nb-ink: #0f0f12;             /* off-black */
  --nb-border: #0f0f12;
  --nb-yellow: #ffd400;          /* cyber lemon lebih terang */
  --nb-pink: #ff5b89;
  --nb-cyan: #22c3f7;
  --nb-purple: #c084fc;
  --nb-orange: #fb923c;
  --text-main: #0f0f12;
  --text-muted: #4b5563;
  --shadow-sm: 2px 2px 0px #0f0f12;
  --shadow-md: 4px 4px 0px #0f0f12;
  --shadow-lg: 6px 6px 0px #0f0f12;
  --shadow-xl: 8px 8px 0px #0f0f12;
  --shadow-hover: 6px 6px 0px #0f0f12;
  --shadow-pressed: 1px 1px 0px #0f0f12;
  --border-thick: 2.5px solid #0f0f12;
  --border-heavy: 3px solid #0f0f12;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}
[data-theme="dark"] {
  --nb-canvas: #0c0c10;          /* charcoal pekat, bukan hijau */
  --nb-surface: #16161c;
  --nb-ink: #f2f2f7;
  --nb-border: #f2f2f7;
  --nb-yellow: #ffd400;
  --nb-pink: #ff5b89;
  --nb-cyan: #22c3f7;
  --nb-purple: #c084fc;
  --nb-orange: #fb923c;
  --text-main: #f2f2f7;
  --text-muted: #a1a1aa;
  --border-thick: 2.5px solid #f2f2f7;
  --border-heavy: 3px solid #f2f2f7;
  --shadow-sm: 2px 2px 0px #f2f2f7;
  --shadow-md: 4px 4px 0px #f2f2f7;
  --shadow-lg: 6px 6px 0px #f2f2f7;
  --shadow-xl: 8px 8px 0px #f2f2f7;
  --shadow-hover: 6px 6px 0px #f2f2f7;
  --shadow-pressed: 1px 1px 0px #f2f2f7;
}

/* Brutalist white surfaces enforce */
.hero-neo-card, .neo-ticket-card, .neo-table-card, .neo-box-card,
.activity-stat-card, .neo-model-card, .neo-navbar-box,
.modal-card, .neo-modal-window {
  background: #ffffff;
  border-radius: 0;
}
[data-theme="dark"] .hero-neo-card,
[data-theme="dark"] .neo-ticket-card,
[data-theme="dark"] .neo-table-card,
[data-theme="dark"] .neo-box-card,
[data-theme="dark"] .activity-stat-card,
[data-theme="dark"] .neo-model-card,
[data-theme="dark"] .neo-navbar-box,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .neo-modal-window {
  background: #16161c;
}

/* Neutral table (no green tint) */
.neo-table th { background: #0f0f12 !important; color: #ffffff !important; }
[data-theme="dark"] .neo-table th { background: #f2f2f7 !important; color: #0c0c10 !important; }
.neo-table tr:hover td { background: #fff7cc !important; }
[data-theme="dark"] .neo-table tr:hover td { background: #2a2a33 !important; }

/* Sticker pills cerah */
.sticker-tag.mint { background: #ffe9f0 !important; color: #b4124d !important; }
.sticker-tag.cyan { background: #dff4ff !important; color: #0369a1 !important; }
.sticker-tag.pink { background: #ffe4ec !important; color: #b4124d !important; }
.sticker-tag.yellow { background: #fff4b8 !important; color: #7a5c00 !important; }
[data-theme="dark"] .sticker-tag.mint { background: #3d1226 !important; color: #ff9fbc !important; }
[data-theme="dark"] .sticker-tag.cyan { background: #0c2f45 !important; color: #7dd9ff !important; }
[data-theme="dark"] .sticker-tag.pink { background: #3d1226 !important; color: #ff9fbc !important; }
[data-theme="dark"] .sticker-tag.yellow { background: #3d3a10 !important; color: #ffe066 !important; }

/* Buttons cerah brutalist */
.neo-btn-mint { background: #ffe9f0 !important; color: #b4124d !important; }
.neo-btn-cyan { background: #dff4ff !important; color: #0369a1 !important; }
.neo-btn-pink { background: #ffe4ec !important; color: #b4124d !important; }
.neo-btn-purple { background: #f3ecff !important; color: #6d28d9 !important; }
[data-theme="dark"] .neo-btn-mint { background: #3d1226 !important; color: #ff9fbc !important; }
[data-theme="dark"] .neo-btn-cyan { background: #0c2f45 !important; color: #7dd9ff !important; }
[data-theme="dark"] .neo-btn-pink { background: #3d1226 !important; color: #ff9fbc !important; }

/* Chips */
.neo-chip.mint { background: #ffe9f0 !important; color: #b4124d !important; }
[data-theme="dark"] .neo-chip.mint { background: #3d1226 !important; color: #ff9fbc !important; }

/* Stat cards */
.activity-stat-card.card-mint { background: #ffffff !important; }
.activity-stat-card.card-cyan { background: #ffffff !important; }
.activity-stat-card.card-yellow { background: #ffffff !important; }
.activity-stat-icon.mint { background: #ff5b89 !important; color: #0f0f12 !important; }
[data-theme="dark"] .overview-stat-box:nth-child(1),
[data-theme="dark"] .activity-stat-card.card-mint { background: #1d1622 !important; }
[data-theme="dark"] .overview-stat-box:nth-child(2),
[data-theme="dark"] .activity-stat-card.card-cyan { background: #101c28 !important; }
[data-theme="dark"] .overview-stat-box:nth-child(3),
[data-theme="dark"] .activity-stat-card.card-yellow { background: #221d10 !important; }
[data-theme="dark"] .metric-card-requests span:first-child { color: #ff9fbc !important; }
[data-theme="dark"] .overview-stat-box:nth-child(2) div:first-child { color: #7dd9ff !important; }

/* Status pill success: pink-scheme, no green */
.neo-status-pill.success { background: #ffd400 !important; color: #0f0f12 !important; }

/* Mobile dock brutalist */
.neo-mobile-dock { border-radius: 0 !important; }
[data-theme="dark"] .neo-mobile-dock { background: rgba(12,12,16,.96) !important; border-color: #f2f2f7 !important; }

/* Focus ring brutalist */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid #0f0f12 !important;
  outline-offset: 2px !important;
}
[data-theme="dark"] button:focus-visible, [data-theme="dark"] a:focus-visible,
[data-theme="dark"] input:focus-visible, [data-theme="dark"] select:focus-visible,
[data-theme="dark"] textarea:focus-visible {
  outline: 3px solid #ffd400 !important;
}

/* Smooth view transitions (GPU-only) */
.view-section { will-change: opacity, transform; }
.view-section.active { animation: viewSlideIn 0.18s ease-out; }
@keyframes viewSlideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view-section.active { animation: none; }
}

/* Font stack apply */
body, button, input, select, textarea { font-family: var(--font-main); }
.neo-code-block, .model-id-label, code, pre { font-family: var(--font-mono) !important; }
