/* ==========================================================================
   JAVA.NET ISP CLOUD BILLING & OSS/BSS ENGINE - CORE STYLESHEET
   Design System: Modern Clean ISP Dashboard, Dark/Light Hybrid, Mobile-First
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-dark: #1e40af;
  --secondary: #0f172a;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --topbar-bg: #1e293b;
  --topbar-border: #334155;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  /* Status Colors */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --info: #06b6d4;
  --info-bg: #ecfeff;
  --info-border: #a5f3fc;
  --purple: #8b5cf6;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  --sidebar-width: 220px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 40px;
  --footer-height: 40px;
  --transition-speed: 0.25s;
}

/* Reset & Global */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Layout Architecture */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar Styles */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  transition: transform var(--transition-speed) ease, width var(--transition-speed) ease;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.sidebar-header,
.sidebar-brand {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  background-color: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-logo,
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  max-width: 65%;
  flex-shrink: 1;
}

.sidebar-header img,
.sidebar-logo img,
.brand-logo img,
.sidebar-logo-img {
  height: 34px !important;
  max-height: 36px !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain !important;
  display: block !important;
}

@media (max-width: 768px) {

  .sidebar-header img,
  .sidebar-logo img,
  .brand-logo img,
  .sidebar-logo-img {
    height: 32px !important;
    max-height: 34px !important;
    max-width: 130px !important;
  }
}

.brand-logo i,
.sidebar-logo i {
  color: #38bdf8;
  font-size: 1.15rem;
}

.brand-tag,
.brand-version {
  font-size: 0.58rem;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: white;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-user,
.sidebar-user-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
  padding: 0.45rem 0.55rem !important;
  margin: 0.35rem 0.45rem 0.35rem 0.45rem !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
}

.sidebar-user-header {
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  width: 100% !important;
}

.user-avatar-wrapper {
  display: flex !important;
  align-items: center !important;
}

.user-avatar {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  border: 1.5px solid rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

/* Foto profil di avatar sidebar (tbl_users.profile_img) */
.user-avatar .user-avatar-img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}

/* Fallback ikon per-role bila foto profil gagal dimuat.
   CATATAN: tanpa !important pada display agar toggle inline (none/flex) bisa bekerja. */
.user-avatar .user-avatar-fallback {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.user-info {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.user-name {
  font-weight: 800 !important;
  color: #ffffff !important;
  font-size: 0.78rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.15 !important;
}

.user-role {
  font-size: 0.65rem !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-top: 1px !important;
}

.user-status-dot {
  width: 6px !important;
  height: 6px !important;
  background-color: #10b981 !important;
  border-radius: 50% !important;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.8) !important;
  display: inline-block !important;
}

.sidebar-balance-box {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px !important;
  padding: 0.25rem 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.sidebar-balance-icon {
  color: #10b981 !important;
  font-size: 0.8rem !important;
  display: flex !important;
  align-items: center !important;
}

.sidebar-balance-text {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 800 !important;
  font-size: 0.78rem !important;
  color: #ffffff !important;
  letter-spacing: -0.02em !important;
  white-space: nowrap !important;
}

.btn-sidebar-topup {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  width: 100% !important;
  padding: 0.28rem 0.5rem !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 5px !important;
  font-weight: 800 !important;
  font-size: 0.66rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3) !important;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  height: 25px !important;
}

.btn-sidebar-topup:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.45) !important;
  transform: translateY(-1px) !important;
}

.btn-sidebar-topup:active {
  transform: translateY(0) !important;
}

.sidebar-nav,
.sidebar-menu-wrapper {
  flex: 1 1 auto;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0.2rem 0.35rem 1.5rem 0.35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;
  /* Firefox */
  -ms-overflow-style: none !important;
  /* IE and Edge */
}

.sidebar-nav::-webkit-scrollbar,
.sidebar-menu-wrapper::-webkit-scrollbar {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
}

.menu-heading {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 0.45rem 0.55rem 0.15rem 0.55rem;
}

.nav-item {
  margin-bottom: 1px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.5rem;
  border-radius: 5px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.nav-link i {
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
  color: #94a3b8;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.nav-link:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.nav-link:hover i {
  color: #38bdf8;
}

.nav-link.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.nav-link.active i {
  color: #ffffff;
}

/* ===== Submenu (indent) di bawah menu induk, mis. submenu "Data Keuangan" ===== */
.nav-sub-item {
  margin-bottom: 1px;
  padding-left: 1.15rem;
}

.nav-sub-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.5rem;
  border-radius: 5px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.nav-sub-link i {
  font-size: 0.7rem;
  width: 14px;
  text-align: center;
  color: #94a3b8;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.nav-sub-link:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.nav-sub-link:hover i {
  color: #38bdf8;
}

.nav-sub-link.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.nav-sub-link.active i {
  color: #ffffff;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.58rem;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--primary);
  color: white;
}

.badge-success {
  background-color: var(--success);
  color: white;
}

.badge-warning {
  background-color: var(--warning);
  color: white;
}

.badge-danger {
  background-color: var(--danger);
  color: white;
}

/* Badge netral (abu-abu) — dipakai badge yg selalu tampil angka 0
   (mis. Proses Withdraw) agar tidak terkesan alarm saat tidak ada antrian. */
.badge-muted {
  background-color: #e2e8f0;
  color: #64748b;
}

.badge-purple {
  background-color: var(--purple);
  color: white;
}

/* Badge saldo Rek. Utama & Rek. Fee di menu sidebar.
   Nominal ditampilkan PENUH (bukan ringkas) & TIDAK bold (font-weight:400),
   font kecil + nowrap agar muat di baris menu. */
.badge-rek-saldo,
.badge-rek-fee {
  margin-left: auto;
  font-size: 0.56rem;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  font-weight: 400;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-rek-saldo {
  background-color: rgba(2, 132, 199, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(2, 132, 199, 0.35);
}

.badge-rek-fee {
  background-color: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Saat menu aktif (nav-link.active) pastikan teks tetap terbaca */
.nav-link.active .badge-rek-saldo {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.nav-link.active .badge-rek-fee {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Sidebar Footer Action */
.sidebar-footer {
  padding: 0.35rem 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.btn-logout {
  width: 100%;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.5);
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  transition: margin-left var(--transition-speed) ease;
}

/* Topbar Header */
.app-topbar {
  height: var(--topbar-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.6rem;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s;
  font-size: 0.78rem;
}

.btn-sidebar-toggle:hover {
  background-color: #f1f5f9;
  color: var(--primary);
}

.topbar-search {
  position: relative;
  width: 240px;
}

.topbar-search input {
  width: 100%;
  height: 26px;
  padding: 0 0.75rem 0 2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  background-color: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.topbar-search input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  width: 300px;
}

.topbar-search i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Kompaksi global tombol & badge di topbar (menyeragamkan tombol aksi
   antar-modul; `!important` menang atas inline padding/font-size lokal
   yang lebih tebal, lihat finance.php & swap_modem.php). */
.app-topbar .topbar-right .btn {
  padding: 0.3rem 0.6rem !important;
  font-size: 0.72rem !important;
  line-height: 1.15;
}

.app-topbar .topbar-right .btn i {
  font-size: 0.72rem;
}

.app-topbar .topbar-right .system-badge {
  padding: 0.08rem 0.42rem !important;
  font-size: 0.6rem !important;
}

.system-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: 600;
}

.badge-mikrotik-api {
  background-color: var(--success-bg);
  color: #065f46;
  border: 1px solid var(--success-border);
}

.badge-genieacs {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.topbar-action-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  font-size: 0.78rem;
}

.topbar-action-btn:hover {
  background-color: #f1f5f9;
  color: var(--primary);
}

/* ===== Topbar Profile Menu (avatar bulat + dropdown detail profil & saldo) ===== */
.topbar-profile {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.topbar-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.15s;
}

.topbar-avatar:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-avatar span {
  line-height: 1;
}

.tp-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 268px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  padding: 0.55rem;
  z-index: 1200;
  display: none;
}

.tp-menu.open {
  display: block;
  animation: tpFadeIn 0.14s ease-out;
}

@keyframes tpFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem 0.55rem;
  border-bottom: 1px solid var(--border-color);
}

.tp-head-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1rem;
}

.tp-head-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tp-head-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.tp-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.tp-role {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 1px;
}

.tp-balances {
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.tp-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tp-balance-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.tp-balance-label i {
  color: var(--primary);
  font-size: 0.7rem;
}

.tp-balance-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.tp-fee-val {
  color: #0d9488;
}

.tp-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.45rem;
}

.tp-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.12s;
  box-sizing: border-box;
}

.tp-btn-edit {
  background: #f0f9ff;
  color: var(--primary);
}

.tp-btn-edit:hover {
  background: #e0f2fe;
}

.tp-btn-out {
  color: #dc2626;
}

.tp-btn-out:hover {
  background: #fef2f2;
}

/* Tombol "Check Diagnosa Pelanggan" (header) — soft aksen ungu pill, selalu tampil (termasuk mobile)
   Gaya menyatu dgn topbar putih & badge sistem (tint tipis + border lembut + teks gelap). */
.topbar-diag-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid #ddd6fe;
  background: #faf5ff;
  color: #6d28d9;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-diag-btn:hover {
  background: #f3e8ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.topbar-diag-btn i {
  font-size: 0.72rem;
}

/* Label panjang ("Checkup Diagnosa Pelanggan . . .") — jangan meluber; potong dgn ellipsis bila ruang sempit */
.topbar-diag-btn .topbar-diag-label {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--danger);
  color: white;
  font-size: 0.55rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1.5px solid white;
}

/* ===== Topbar "Perlu Tindakan" (bell) — panel dropdown role-scoped =====
   Diisi oleh js/task_alerts.js (lihat plans/plan_topbar_task_alerts.md).
   Gaya kompak, senada dgn .tp-menu. Badge angka memakai .action-badge di atas. */
.task-alert-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.task-alert-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  z-index: 1200;
  display: none;
  overflow: hidden;
}

.task-alert-panel.open {
  display: block;
  animation: tpFadeIn 0.14s ease-out;
}

.ta-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}

.ta-head i {
  color: var(--primary);
}

.ta-head-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* R5: penanda konteks sesi, mis. "— NOC · sugeng" (bukan huruf kapital semua). */
.ta-meta {
  flex: 0 0 auto;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  opacity: 0.85;
}

.ta-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.3rem;
}

.ta-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.78rem;
  transition: background 0.12s;
}

.ta-item:hover {
  background: #f1f5f9;
}

.ta-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: #eef2f7;
  color: var(--text-muted);
}

.ta-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-count {
  flex-shrink: 0;
  min-width: 20px;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  background: #e2e8f0;
  color: #475569;
}

/* Warna severity item */
.ta-item.ta-danger .ta-icon {
  background: #fee2e2;
  color: #dc2626;
}

.ta-item.ta-danger .ta-count {
  background: #fee2e2;
  color: #b91c1c;
}

.ta-item.ta-warning .ta-icon {
  background: #fef3c7;
  color: #d97706;
}

.ta-item.ta-warning .ta-count {
  background: #fef3c7;
  color: #b45309;
}

.ta-item.ta-info .ta-icon {
  background: #dbeafe;
  color: #2563eb;
}

.ta-item.ta-info .ta-count {
  background: #dbeafe;
  color: #1d4ed8;
}

.ta-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ta-empty i {
  color: #16a34a;
}

/* HP view: panel menyesuaikan lebar layar */
@media (max-width: 640px) {
  .task-alert-panel {
    width: min(92vw, 320px);
  }

  .ta-list {
    max-height: 55vh;
  }
}

/* Page Content Body */
.app-content {
  flex: 1;
  padding: 0.75rem 1rem;
  min-width: 0;
  width: 100%;
}

/* Header Page Title */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.page-title i {
  color: var(--primary);
  font-size: 1.05rem;
}

/* Username kecil di header. 18-Sep-2026: DIPINDAH dari baris judul (samping Nama Lengkap)
   ke KANAN breadcrumb → "Home / Dashboard - <username>" (jadi flex-item .page-breadcrumb,
   jarak antar item diatur gap breadcrumb, bukan margin lagi).
   Ukuran dipisah per device: PC lebih besar, HP lebih kecil.
   text-size-adjust dipaksa 100% agar mobile TIDAK memperbesar otomatis. */
.page-title-username {
  /* font 10px -> 12px (+2) sesuai permintaan */
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .2px;
  color: var(--text-muted);
  opacity: .85;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.page-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.page-breadcrumb a:hover {
  color: var(--primary);
}

/* ==========================================================
   DASHBOARD HEADER (.dash-header) — 18-Sep-2026
   Perbaikan HP View: tombol aksi (PPPoE/Hotspot/Voucher) TIDAK lagi
   di baris 1 (menutupi judul). Kini:
     baris 1 = Nama+username (kiri) + Total Fee diterima dari Javanet (kanan)
     baris 2 = breadcrumb Home / Dashboard
     baris 3 = tombol aksi, mampat
   Semua selector di-scope ke .dash-header agar halaman lain tak terpengaruh.
   ========================================================== */
.page-header.dash-header {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.dash-header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  width: 100%;
}

.dash-header-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Badge info Total Fee (align kanan sejajar Nama/username) */
.dash-header-fee {
  display: inline-flex;
  /* 18-Sep-2026: 2 baris (rata kanan, mampat) —
     baris 1: "Total Fee yg sudah diterima dari" (6px)
     baris 2: "Javanet :" (6px) + nominal (7px)
     18-Sep-2026 (revisi): warna BG pink/ungu (#7c3aed) -> SMOOTH GREEN (emerald). */
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  line-height: 1;
  margin-left: auto;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.13), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.28);
  white-space: nowrap;
}

.dash-header-fee .dash-fee-label {
  font-size: 6px;
  line-height: 1.15;
  font-weight: 600;
  color: var(--text-muted);
}

.dash-header-fee .dash-fee-label i {
  color: #10b981;
}

/* Baris 2: "dari Javanet :" + nominal, sebaris (baseline sejajar) */
.dash-header-fee .dash-fee-line2 {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22rem;
  white-space: nowrap;
}

.dash-header-fee .dash-fee-src {
  font-size: 6px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Nominal + ikon uang (ikon "sebelum text Rp") — inline-flex agar sejajar rapi */
.dash-header-fee .dash-fee-val {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  font-size: 7px;
  line-height: 1.15;
  font-weight: 800;
  color: #047857;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.2px;
}

.dash-header-fee .dash-fee-val i {
  font-size: 7px;
  color: #10b981;
}

/* Baris tombol aksi: tepat di bawah breadcrumb, tetap mampat */
.page-header.dash-header .card-toolbar.dash-header-actions {
  width: 100%;
  gap: 0.35rem;
}

/* Tombol Rekening (Rek. Utama / Rek. Fee) — DIPINDAH 18-Sep-2026 dari panel
   "Pintasan Cepat Operasional" ke KANAN tombol PPPoE/Hotspot/Voucher.
   Dibungkus grup + margin-left:auto agar selalu menempel di ujung kanan toolbar. */
.page-header.dash-header .card-toolbar.dash-header-actions .dash-rek-group {
  margin: 0 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* 4-Pillar Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.stat-card {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.icon-blue {
  background-color: var(--primary-light);
  color: var(--primary);
}

.icon-cyan {
  background-color: #e0f2fe;
  color: #0284c7;
}

.icon-green {
  background-color: var(--success-bg);
  color: var(--success);
}

.icon-orange {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.icon-red {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.icon-purple {
  background-color: #f3e8ff;
  color: var(--purple);
}

/* Exact Dashboard Cards matching User Screenshot */
.stat-card-custom {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  height: 64px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card-custom:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon-block {
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ffffff;
  flex-shrink: 0;
}

.bg-cyan {
  background-color: #00a8e8;
}

.bg-green {
  background-color: #00a86b;
}

.bg-orange {
  background-color: #f59e0b;
}

.bg-red {
  background-color: #dc2626;
}

.stat-text-block {
  flex: 1;
  padding: 0.4rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #ffffff;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

/* Main Card Table Wrapper */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 0.75rem;
  min-width: 0;
  width: 100%;
}

.card-header {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

/* Button Component Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.3;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-outline {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 0.22rem 0.5rem;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
}

.btn-icon-only {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Filters & Search Toolbar (Default & Compact) */
.filter-bar {
  padding: 1rem 1.5rem;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

/* 1-Row Ultra-Compact Toolbar (Exact Mockup User) */
.filter-bar-compact {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0.4rem 0.6rem !important;
  background-color: #ffffff !important;
  border-bottom: 1px solid var(--border-color) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.view-mode-toggle,
.mobile-toggle-compact {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  padding: 0 0.55rem !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  height: 30px !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease-in-out !important;
}

.view-mode-toggle:hover,
.mobile-toggle-compact:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}

.view-mode-toggle input[type="checkbox"],
.mobile-toggle-compact input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  cursor: pointer !important;
  accent-color: #2563eb !important;
  pointer-events: none !important;
}

.view-mode-toggle .mode-icon-wrap,
.mobile-toggle-compact .mode-icon-wrap {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.85rem !important;
}

.view-mode-toggle .mode-text,
.mobile-toggle-compact .mode-text {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  color: #1e293b !important;
  min-width: 18px !important;
  line-height: 1 !important;
}

/* Checked (PC Mode) */
.view-mode-toggle.is-pc,
.mobile-toggle-compact.is-pc {
  border-color: #93c5fd !important;
  background: #f0f7ff !important;
}

.view-mode-toggle.is-pc .mode-icon-wrap,
.mobile-toggle-compact.is-pc .mode-icon-wrap {
  color: #2563eb !important;
}

.view-mode-toggle.is-pc .mode-text,
.mobile-toggle-compact.is-pc .mode-text {
  color: #1d4ed8 !important;
}

/* Unchecked (HP Mode) */
.view-mode-toggle.is-hp,
.mobile-toggle-compact.is-hp {
  border-color: #a7f3d0 !important;
  background: #f0fdf4 !important;
}

.view-mode-toggle.is-hp .mode-icon-wrap,
.mobile-toggle-compact.is-hp .mode-icon-wrap {
  color: #059669 !important;
}

.view-mode-toggle.is-hp .mode-text,
.mobile-toggle-compact.is-hp .mode-text {
  color: #047857 !important;
}

.search-input-wrapper {
  flex: 1 !important;
  min-width: 0 !important;
}

.form-input-compact {
  width: 100% !important;
  height: 30px !important;
  padding: 0 0.55rem !important;
  font-size: 0.8rem !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  line-height: 1 !important;
}

.form-input-compact:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.form-select-compact {
  height: 30px !important;
  padding: 0 1.25rem 0 0.55rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  background-color: #ffffff !important;
  color: #334155 !important;
  flex-shrink: 0 !important;
  outline: none !important;
  cursor: pointer !important;
  appearance: auto !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
}

.btn-refresh-compact {
  height: 30px !important;
  width: 30px !important;
  min-width: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  background-color: #ffffff !important;
  color: #334155 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  font-size: 0.8rem !important;
  transition: all 0.15s ease !important;
}

.btn-refresh-compact:hover {
  background-color: #f8fafc !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.btn-refresh-compact:hover {
  background-color: #f8fafc !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.filter-left,
.filter-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.form-select,
.form-input {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* View Mode Toggle Switcher */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.view-mode-toggle:hover {
  background-color: #f8fafc;
  border-color: var(--primary);
}

.view-mode-toggle input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Modern Data Table Container with Smooth Horizontal Scrollbar (Mode PC Default) */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
  display: block;
}

.table-responsive::-webkit-scrollbar {
  height: 10px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.data-table {
  width: 100%;
  min-width: 1450px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

/* Mode HP Card Stack Layout (Active when .mode-hp is toggled) */
.table-responsive.mode-hp {
  overflow-x: visible !important;
  display: block !important;
}

.table-responsive.mode-hp .data-table {
  min-width: 100% !important;
  width: 100% !important;
}

.table-responsive.mode-hp .data-table thead {
  display: none !important;
}

.table-responsive.mode-hp .data-table,
.table-responsive.mode-hp .data-table tbody,
.table-responsive.mode-hp .data-table tr,
.table-responsive.mode-hp .data-table td {
  display: block !important;
  width: 100% !important;
}

.table-responsive.mode-hp .data-table tr {
  margin-bottom: 1.25rem !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: var(--radius-lg) !important;
  background-color: #ffffff !important;
  padding: 1rem !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

.table-responsive.mode-hp .data-table td {
  padding: 0.6rem 0.25rem !important;
  border-bottom: 1px dashed #e2e8f0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.table-responsive.mode-hp .data-table td::before {
  content: attr(data-label);
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  margin-right: 0.5rem !important;
}

.table-responsive.mode-hp .data-table td:last-child {
  border-bottom: none !important;
  padding-top: 0.75rem !important;
}

.table-responsive.mode-hp .action-group {
  width: 100% !important;
  justify-content: flex-end !important;
}

.data-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
}

.sortable-th {
  cursor: pointer;
  transition: all 0.15s;
}

.sortable-th:hover {
  background-color: #e2e8f0 !important;
  color: var(--primary) !important;
}

.sort-icon {
  font-size: 0.7rem;
  margin-left: 4px;
  color: #94a3b8;
  transition: transform 0.15s, color 0.15s;
}

.sort-icon.active-asc {
  color: var(--primary);
  transform: rotate(180deg);
}

.sort-icon.active-desc {
  color: var(--primary);
  transform: rotate(0deg);
}

.data-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
  font-size: 0.82rem;
}

/* Tabel checklist audit di modal Procurement (#auditItemsChecklist).
   Bukan .data-table agar tidak kena min-width:1450px / min-width:1250px !important
   sehingga tabel auto-fit di dalam modal (tak terpotong / isi tak hilang). */
.audit-chk-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0;
}

.audit-chk-table th,
.audit-chk-table td {
  word-break: break-word;
}

.audit-chk-table tbody tr:nth-child(even) {
  background-color: #fbfcfe;
}

.audit-chk-table tbody tr:hover {
  background-color: #eef2ff;
}

/* Tabel Key-Value panel DR (settings > tabDrSettings) — 2 kolom label/nilai.
   Netralkan min-width:1450px milik .data-table & aktifkan word-wrap agar
   teks panjang (Last_SQL_Error) tidak keluar dari box. */
.data-table.dr-kv {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed;
}

.data-table.dr-kv td {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.data-table.dr-kv td:last-child {
  text-align: right;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.data-table tbody tr:nth-child(even) {
  background-color: #fbfcfe;
}

.data-table tbody tr:hover {
  background-color: #eef2ff !important;
  /* Soft highlight saat kursor hover */
}

/* User Identity Cell */
.user-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-username {
  font-weight: 700;
  color: var(--primary);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
}

.user-member-id {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.customer-name {
  font-weight: 600;
  color: var(--text-main);
}

.customer-address {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Badges for PPPoE status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-online {
  background-color: var(--success-bg);
  color: #065f46;
  border: 1px solid var(--success-border);
}

.badge-offline {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-suspended {
  background-color: var(--danger-bg);
  color: #991b1b;
  border: 1px solid var(--danger-border);
}

/* Optical Rx Power Badge (GenieACS TR-069) */
.rx-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
}

.rx-good {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.rx-warning {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.rx-critical {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Mini Action Controls (GenieACS & Billing) */
.action-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-mini-control {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-mini-control:hover {
  background-color: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-mini-reboot:hover {
  color: #0284c7;
  border-color: #0284c7;
  background-color: #e0f2fe;
}

.btn-mini-wifi:hover {
  color: #7c3aed;
  border-color: #7c3aed;
  background-color: #f5f3ff;
}

.btn-mini-wan:hover {
  color: #d97706;
  border-color: #d97706;
  background-color: #fef3c7;
}

.btn-mini-wa:hover {
  color: #059669;
  border-color: #10b981;
  background-color: #d1fae5;
}

.btn-mini-print:hover {
  color: #4338ca;
  border-color: #6366f1;
  background-color: #e0e7ff;
}

.btn-mini-renew:hover {
  color: #059669;
  border-color: #059669;
  background-color: #d1fae5;
}

.btn-mini-edit:hover {
  color: #2563eb;
  border-color: #2563eb;
  background-color: #dbeafe;
}

.btn-mini-delete:hover {
  color: #dc2626;
  border-color: #dc2626;
  background-color: #fee2e2;
}

/* Table Pagination Bar */
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background-color: #f8fafc;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}

.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.page-item:not(.active):not(.disabled) .page-link:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

/* Footer Bottom Bar */
.app-footer {
  height: var(--footer-height);
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

.system-status-dots {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-dot-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

/* Modal Windows */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background-color: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-backdrop.show .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 0.85rem 1.15rem;
}

.modal-footer {
  padding: 0.65rem 1.15rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  background-color: #f8fafc;
}

/* Form Grid & Inputs inside Modals */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.form-label span.req {
  color: var(--danger);
}

.form-help {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Toast Notifications (Always on Top of All Modals & Dialogs) */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000005 !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.15rem;
  background-color: var(--secondary, #1e293b);
  color: white;
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  animation: slideInRight 0.25s ease;
  min-width: 280px;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-success {
  background-color: #065f46;
  border-left: 4px solid #10b981;
}

.toast-danger {
  background-color: #991b1b;
  border-left: 4px solid #ef4444;
}

.toast-info {
  background-color: #1e3a8a;
  border-left: 4px solid #3b82f6;
}

.toast-warning {
  background-color: #78350f;
  border-left: 4px solid #f59e0b;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   ANIMASI DIAGNOSA CLIENT (Hybrid: scanner steps saat loading + hasil berundak)
   ========================================================================== */

/* --- Loading gaya Log Terminal Berjalan (Opsi B) --- */
.diag-loading-wrap {
  text-align: center;
  padding: 1rem 0.6rem 0.8rem;
}

/* baris judul: spinner ungu + teks, sejajar tengah */
.diag-loading-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* lingkaran ungu berputar di kiri judul */
.diag-loading-spin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #ddd6fe;
  border-top-color: #7c3aed;
  flex-shrink: 0;
  animation: diagSpin 0.8s linear infinite;
}

.diag-loading-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
}

.diag-loading-sub {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 2px;
  margin-bottom: 0.7rem;
}

/* kotak terminal gelap */
.diag-term {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.25);
  max-width: 460px;
  margin: 0 auto;
}

/* header bar terminal (titik merah/kuning/hijau + judul) */
.diag-term-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #111a2e;
  border-bottom: 1px solid #1e293b;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.66rem;
  color: #64748b;
  letter-spacing: 0.2px;
}

.diag-term-head i {
  color: #7c3aed;
  font-size: 0.7rem;
}

/* body scrollable */
.diag-term-body {
  padding: 10px 12px;
  max-height: 240px;
  overflow-y: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.diag-term-body::-webkit-scrollbar {
  width: 6px;
}

.diag-term-body::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

/* satu baris log */
.diag-term-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diag-term-line .t-prompt {
  color: #7c3aed;
  font-weight: 700;
  flex-shrink: 0;
}

.diag-term-line .t-text {
  color: #cbd5e1;
  flex-shrink: 0;
}

.diag-term-line .t-dots {
  color: #475569;
  letter-spacing: 1px;
  flex: 1;
  overflow: hidden;
}

.diag-term-line .t-result {
  color: #64748b;
  font-weight: 700;
  flex-shrink: 0;
}

/* baris aktif: teks terang + kursor berkedip */
.diag-term-line.active .t-text {
  color: #f1f5f9;
  font-weight: 700;
}

.diag-term-line.active .t-dots {
  color: #a78bfa;
}

.diag-term-line.active .t-result::after {
  content: "▌";
  color: #7c3aed;
  margin-left: 2px;
  animation: diagBlink 0.8s steps(1) infinite;
}

/* baris selesai: teks hijau + OK hijau */
.diag-term-line.done .t-text {
  color: #4ade80;
}

.diag-term-line.done .t-dots {
  color: #334155;
}

.diag-term-line.done .t-result.ok {
  color: #22c55e;
}

@keyframes diagBlink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* putaran lingkaran ungu (spinner judul) */
@keyframes diagSpin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Hasil beranimasi berundak --- */
.diag-anim {
  opacity: 0;
  animation: diagFadeUp 0.35s ease forwards;
}

.diag-pop {
  opacity: 0;
  animation: diagPop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4) forwards;
}

@keyframes diagFadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes diagPop {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .toast-container {
    top: 1rem !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 1.5rem) !important;
    max-width: 420px !important;
    align-items: center !important;
    z-index: 1000005 !important;
  }

  .toast {
    width: 100% !important;
    min-width: unset !important;
    font-size: 0.76rem !important;
    padding: 0.6rem 0.85rem !important;
    border-radius: 7px !important;
  }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES (Smartphones < 992px)
   ========================================================================== */

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1030;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.show-mobile {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .topbar-search {
    display: none;
    /* Hide search bar on small mobile headers */
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-content {
    padding: 0.5rem 0.6rem;
    width: 100%;
    max-width: 100%;
  }

  /* Compact Mobile Page Header & Action Buttons */
  .page-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.35rem !important;
    margin-bottom: 0.5rem !important;
  }

  .page-title {
    font-size: 1rem !important;
    gap: 0.35rem !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
  }

  .page-title i {
    font-size: 0.95rem !important;
  }

  /* Username (kini di kanan breadcrumb "Home / Dashboard - <username>"):
     di HP lebih kecil dari PC. 18-Sep-2026: 7px -> 9px (+2). */
  .page-title-username {
    font-size: 9px !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* Topbar profile dropdown di HP: compact, tidak overflow layar */
  .topbar-avatar {
    width: 30px;
    height: 30px;
  }

  .tp-menu {
    width: min(280px, calc(100vw - 20px));
    right: -4px;
    padding: 0.5rem;
  }

  .tp-name {
    font-size: 0.8rem;
  }

  .tp-balance-val {
    font-size: 0.72rem;
  }

  .tp-balance-label {
    font-size: 0.63rem;
  }

  .tp-btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.5rem;
  }

  .page-breadcrumb {
    font-size: 0.66rem !important;
    gap: 0.25rem !important;
    margin-top: 1px !important;
  }

  .card-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.25rem !important;
    flex-shrink: 0 !important;
  }

  .card-toolbar .btn {
    padding: 0.25rem 0.45rem !important;
    font-size: 0.66rem !important;
    font-weight: 600 !important;
    gap: 0.2rem !important;
    border-radius: 5px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
  }

  .card-toolbar .btn i {
    font-size: 0.65rem !important;
  }

  /* Dashboard header versi HP: judul+info fee (baris 1), breadcrumb (baris 2),
     tombol aksi mampat (baris 3). Selector 2-kelas (.page-header.dash-header)
     menang dari override mobile .page-header biasa. */
  .page-header.dash-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.3rem !important;
    margin-bottom: 0.5rem !important;
  }

  .page-header.dash-header .dash-header-main {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.25rem 0.5rem !important;
  }

  .page-header.dash-header .dash-header-fee {
    margin-left: auto !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 0 !important;
    line-height: 1 !important;
    padding: 0.16rem 0.4rem !important;
    border-radius: 5px !important;
  }

  .page-header.dash-header .dash-header-fee .dash-fee-label,
  .page-header.dash-header .dash-header-fee .dash-fee-src {
    font-size: 6px !important;
  }

  .page-header.dash-header .dash-header-fee .dash-fee-val {
    font-size: 7px !important;
  }

  /* Tombol aksi header (HP View): PAKSA SATU ROW —
     PPPoE  Hotspot  Voucher  Rek. Utama  Rek. Fee, distribusi merata (justify).
     18-Sep-2026: sebelumnya wrap → grup Rekening turun ke baris kedua.
     .dash-rek-group di-set display:contents agar 5 tombol jadi sibling sejajar,
     sehingga `justify-content: space-between` membagi rata seluruh lebar. */
  .page-header.dash-header .card-toolbar.dash-header-actions {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.2rem !important;
  }

  .page-header.dash-header .card-toolbar.dash-header-actions .dash-rek-group {
    display: contents !important;
    margin: 0 !important;
  }

  .page-header.dash-header .card-toolbar.dash-header-actions .btn {
    flex: 0 0 auto !important;
    gap: 0.2rem !important;
    padding: 0.2rem 0.32rem !important;
    font-size: 0.6rem !important;
    white-space: nowrap !important;
  }

  .page-header.dash-header .card-toolbar.dash-header-actions .btn i {
    font-size: 0.62rem !important;
  }

  /* Compact Mobile Stat Cards */
  .colorful-dashboard-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.35rem !important;
    margin-bottom: 0.5rem !important;
  }

  .colorful-card {
    min-height: 72px !important;
    border-radius: 6px !important;
  }

  .colorful-card-body {
    padding: 0.45rem 0.6rem 0.35rem 0.6rem !important;
  }

  .colorful-card-val {
    font-size: 1.05rem !important;
    margin-bottom: 0.1rem !important;
  }

  .colorful-card-label {
    font-size: 0.65rem !important;
    gap: 3px !important;
  }

  .colorful-card-sub {
    font-size: 0.58rem !important;
    margin-top: 1px !important;
  }

  /* Baris detail rincian paket (chip Rp100/Rp150/... ) di HP view - 0.34->0.46rem. */
  .colorful-card-sub .dash-nr-detail {
    font-size: 0.46rem !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
  }

  .colorful-card-watermark {
    font-size: 1.85rem !important;
    right: 0.35rem !important;
  }

  .colorful-card-footer {
    padding: 0.18rem 0.5rem !important;
    font-size: 0.6rem !important;
  }

  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.35rem !important;
  }

  /* Telemetri mobile: padatkan agar label + nilai TIDAK turun baris (wrapping) */
  .telemetry-strip-grid {
    display: grid !important;
    /* minmax(0,1fr) -> kolom boleh menyusut, isi tidak memaksa melebar */
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.3rem !important;
    margin-bottom: 0.5rem !important;
  }

  .telemetry-badge-item {
    border-radius: 5px !important;
    min-width: 0 !important;
  }

  .telemetry-tag {
    padding: 0.18rem 0.32rem !important;
    font-size: 0.54rem !important;
    letter-spacing: 0 !important;
    gap: 3px !important;
  }

  .telemetry-val {
    padding: 0.18rem 0.32rem !important;
    font-size: 0.6rem !important;
    min-width: 0 !important;
    white-space: nowrap !important;
  }

  .system-badge-hide-mobile {
    display: none;
  }

  /* Topbar kanan: izinkan wrap agar tombol Diagnosa (teks panjang) tidak meluber ke luar layar */
  .topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.25rem;
  }

  /* Tombol Diagnosa: tetap tampilkan teks lengkap di mobile (pill), font lebih kecil agar muat */
  .topbar-diag-btn {
    height: 26px;
    padding: 0 0.5rem;
    font-size: 0.62rem;
    max-width: 100%;
    flex-shrink: 1;
    min-width: 0;
  }

  .topbar-diag-btn .topbar-diag-label {
    display: inline;
    max-width: 150px;
  }

  .card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar-compact {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0.45rem 0.6rem !important;
    width: 100% !important;
  }

  .filter-bar-compact .form-input-compact {
    height: 30px !important;
    font-size: 0.78rem !important;
    padding: 0 0.45rem !important;
  }

  .filter-bar-compact .form-select-compact {
    height: 30px !important;
    font-size: 0.78rem !important;
    padding: 0 1.1rem 0 0.4rem !important;
    max-width: 85px !important;
  }

  .filter-bar-compact .btn-refresh-compact {
    height: 30px !important;
    width: 30px !important;
    min-width: 30px !important;
  }

  .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
  }

  .data-table {
    min-width: 1250px !important;
  }
}

/* =========================================================================
   COLORFUL DASHBOARD STAT CARDS & TELEMETRY STRIP (MATCHING REFERENCE)
   ========================================================================= */
.colorful-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.colorful-card {
  border-radius: 7px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-decoration: none;
  min-height: 82px;
}

.colorful-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.colorful-card-body {
  padding: 0.6rem 0.8rem 0.45rem 0.8rem;
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.colorful-card-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  font-family: 'JetBrains Mono', sans-serif;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.colorful-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.colorful-card-sub {
  font-size: 0.64rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 1px;
  z-index: 2;
}

/* Footer kartu "Income Hari Ini" => 2 BARIS tanpa pemisah "|" (18-Sep-2026).
   Dipakai oleh #dashIncomeMonth: tiap <span> anak = 1 baris (rapi, hemat lebar,
   teks panjang tidak terpotong). Kartu lain tidak terpengaruh. */
.colorful-card-sub.dash-2row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.3;
}

/* Kartu "GenieACS TR-069" (18-Sep-2026): 3 baris info ringkas
   (Online/Warn/Off | RX & vendor | Pelanggan PPPoE). Font & spasi dibuat lebih kecil
   supaya tinggi kartu tidak menambah tinggi baris grid di sekitarnya. Hanya id terkait.
   Kartu "PPP Online (Dialup)" (18-Sep-2026) memakai gaya ringkas yang sama:
   4 baris rincian paket (SL-5M-100 / SL-10M-150 / MODEM-Voucher / Total). */
.colorful-card-sub.dash-2row.dash-ont-rows,
.colorful-card-sub.dash-2row.dash-ppp-rows {
  font-size: 0.58rem;
  line-height: 1.15;
  gap: 1px;
}

/* Kartu "New Registrasi Bulan Ini" (26-Sep-2026): baris detail rincian paket PPP
   (selain MODEM-VC). Font SANGAT kecil + wrap agar muat 1 kartu tanpa memotong teks. */
.colorful-card-sub .dash-nr-detail {
  display: block;
  margin-top: 1px;
  font-size: 0.5rem;
  /* 26-Sep-2026: dinaikkan 0.4->0.5rem agar chip Rp100/Rp150/... terbaca */
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.66);
  word-break: break-word;
}

.colorful-card-sub .dash-nr-detail .dash-sep {
  margin: 0 2px;
}

.colorful-card-watermark {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 1;
  transition: transform 0.25s ease, color 0.25s ease;
}

.colorful-card:hover .colorful-card-watermark {
  transform: translateY(-50%) scale(1.08);
  color: rgba(255, 255, 255, 0.3);
}

.colorful-card-footer {
  background: rgba(0, 0, 0, 0.14);
  padding: 0.25rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.15s ease;
  z-index: 2;
}

.colorful-card-footer:hover {
  background: rgba(0, 0, 0, 0.24);
  color: #ffffff;
}

/* Color Palettes (Rich, Elegant, Non-overpowering) */
.card-theme-green {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.card-theme-amber {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.card-theme-teal {
  background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
}

.card-theme-red {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.card-theme-indigo {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}

.card-theme-sky {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
}

.card-theme-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

.card-theme-orange {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
}

.card-theme-emerald {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

.card-theme-blue {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.card-theme-slate {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

.card-theme-darkgreen {
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
}

/* System Hardware Telemetry Strip (Exact Screenshot Matching) */
.telemetry-strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.telemetry-badge-item {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.telemetry-tag {
  background: #94a3b8;
  color: #ffffff;
  padding: 0.28rem 0.55rem;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.telemetry-val {
  padding: 0.28rem 0.55rem;
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.72rem;
  flex: 1;
  display: flex;
  align-items: center;
  background: #f8fafc;
}

/* =========================================================================
   MOBILE VIEW CUSTOMER CARDS & FULL-SCREEN DETAIL SHEET (ULTRA COMPACT)
   ========================================================================= */
.customer-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.customer-card-mobile {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 7px !important;
  padding: 0.4rem 0.6rem !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.15s ease-in-out !important;
  cursor: pointer !important;
  position: relative !important;
  border-left: 4px solid #94a3b8 !important;
}

.customer-card-mobile.card-online {
  border-left-color: #10b981 !important;
}

.customer-card-mobile.card-isolir {
  border-left-color: #ef4444 !important;
}

.customer-card-mobile.card-warning {
  border-left-color: #f59e0b !important;
}

.customer-card-mobile:hover,
.customer-card-mobile:active {
  background: #f8fafc !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

/* Card 3-Row Structure */
.m-card-row-1 {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.35rem !important;
  margin-bottom: 0.2rem !important;
}

.m-card-user {
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  flex: 1 !important;
  min-width: 0 !important;
  line-height: 1.2 !important;
}

.m-card-user .user-fullname {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.m-card-top-right {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex-shrink: 0 !important;
}

.m-card-member-id {
  font-size: 0.65rem !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700 !important;
  color: #475569 !important;
  background: #f1f5f9 !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  border: 1px solid #e2e8f0 !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}

.badge-session {
  display: inline-flex !important;
  align-items: center !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  line-height: 1.2 !important;
}

.badge-session-on {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

.badge-session-off {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
}

.m-card-row-2 {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.35rem !important;
  font-size: 0.68rem !important;
  color: #475569 !important;
  margin-bottom: 0.2rem !important;
  padding: 0.15rem 0 !important;
  border-top: 1px dashed #f1f5f9 !important;
  line-height: 1.2 !important;
}

.m-card-addr {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  flex: 1 !important;
  min-width: 0 !important;
  font-size: 0.68rem !important;
}

.m-card-dates {
  font-size: 0.64rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  white-space: nowrap !important;
  background: #f8fafc !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  border: 1px solid #e2e8f0 !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

.m-card-row-3 {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.35rem !important;
  border-top: 1px dashed #f1f5f9 !important;
  padding-top: 0.2rem !important;
  line-height: 1.2 !important;
}

.m-card-plan {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: #2563eb !important;
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.m-card-billing {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}

.badge-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 1px 6px !important;
  border-radius: 12px !important;
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

.badge-isolir {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

.badge-lunas {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}

.badge-unpaid {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

/* Improved Bayar Sekarang CTA Button */
.btn-pay-now-improved {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 1px 7px !important;
  font-size: 0.64rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.25) !important;
  transition: all 0.15s ease-in-out !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
  height: 20px !important;
}

.btn-pay-now-improved:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35) !important;
}

.btn-pay-now-improved:active {
  transform: translateY(0) !important;
}

/* Full Screen Mobile Detail Dialog (Ultra Compact & Scrollable on PC) */
.modal-fullscreen-mobile .modal-dialog-mobile-fullscreen {
  max-width: 680px;
  width: 100%;
  margin: 1.5rem auto;
  border-radius: 8px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
}

.mobile-detail-body {
  flex: 1;
  overflow-y: auto !important;
  max-height: calc(88vh - 42px);
  padding: 0.55rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

.mobile-detail-body::-webkit-scrollbar {
  width: 6px;
}

.mobile-detail-body::-webkit-scrollbar-track {
  background: #f8fafc;
}

.mobile-detail-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.mobile-detail-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@media (max-width: 768px) {
  .modal-fullscreen-mobile {
    padding: 0 !important;
  }

  .modal-fullscreen-mobile .modal-dialog-mobile-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .mobile-detail-body {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: calc(100vh - 40px) !important;
    padding: 0.4rem 0.55rem !important;
  }
}

.mobile-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  background: #0f172a;
  color: #ffffff;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-detail-back,
.btn-detail-edit {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-detail-back:hover,
.btn-detail-edit:hover {
  background: rgba(255, 255, 255, 0.25);
}

.mobile-detail-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Detail Section Cards */
.detail-section-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.35rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.detail-section-header {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.2rem;
}

.detail-prop-table {
  width: 100%;
  font-size: 0.68rem;
  border-collapse: collapse;
}

.detail-prop-table td {
  padding: 0.12rem 0.15rem;
  vertical-align: middle;
}

.detail-prop-table td.prop-label {
  width: 36%;
  color: #64748b;
  font-weight: 600;
  font-size: 0.65rem;
}

.detail-prop-table td.prop-val {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.68rem;
}

/* ============================================================
   COMPACT TABLE FOOTER & PAGINATION (GLOBAL)
   Menyamakan semua halaman: Show baris / info / nomor halaman kecil & rapi
   ============================================================ */
.card-footer {
  padding: 0.4rem 0.55rem !important;
  gap: 0.4rem !important;
}

.card-footer .form-select,
.card-footer select {
  font-size: 0.62rem !important;
  padding: 0.12rem 0.35rem !important;
  height: auto !important;
  min-height: 0 !important;
  width: auto !important;
  border-radius: 4px !important;
}

.pagination-info {
  font-size: 0.6rem !important;
  line-height: 1.2 !important;
}

.pagination {
  gap: 2px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.pagination .page-link,
.pagination li a,
.pagination li button,
.pagination li span,
.pagination a {
  font-size: 0.58rem !important;
  padding: 0.08rem 0.3rem !important;
  line-height: 1.2 !important;
  min-width: 0 !important;
  border-radius: 3px !important;
}

@media (max-width: 480px) {
  .card-footer {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .card-footer>div {
    justify-content: space-between !important;
    width: 100% !important;
    gap: 0.35rem !important;
  }

  .card-footer .pagination-info {
    text-align: right !important;
  }

  .card-footer .pagination {
    justify-content: center !important;
  }
}

/* =========================================================================
   DASHBOARD ANIMASI & COLORFUL ENHANCEMENT (scope: .dash-anim = index.html)
   Tren Pendapatan chart box, rekening pill, pintasan cepat
   ========================================================================= */
.dash-sep {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 4px;
  font-weight: 700;
}

/* Indikator live (pulse hijau) */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 3px;
  vertical-align: middle;
  animation: dashPulse 1.8s infinite;
}

/* Dot "live" yang dipakai DI BELAKANG angka kartu (mis. "8.852 Users Online ●") */
.colorful-card-val .live-dot {
  margin-right: 0;
  margin-left: 5px;
  width: 7px;
  height: 7px;
}

@keyframes dashPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes dashFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashSheen {
  from {
    transform: translateX(-130%) rotate(18deg);
  }

  to {
    transform: translateX(240%) rotate(18deg);
  }
}

@keyframes dashGradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* --- Entrance animation + stagger antar kartu --- */
.dash-anim .colorful-dashboard-grid>*,
.dash-anim .telemetry-badge-item,
.dash-anim .dash-shortcut {
  animation: dashFadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dash-anim .colorful-dashboard-grid>*:nth-child(1) {
  animation-delay: 0.02s;
}

.dash-anim .colorful-dashboard-grid>*:nth-child(2) {
  animation-delay: 0.06s;
}

.dash-anim .colorful-dashboard-grid>*:nth-child(3) {
  animation-delay: 0.10s;
}

.dash-anim .colorful-dashboard-grid>*:nth-child(4) {
  animation-delay: 0.14s;
}

.dash-anim .colorful-dashboard-grid>*:nth-child(5) {
  animation-delay: 0.18s;
}

.dash-anim .colorful-dashboard-grid>*:nth-child(6) {
  animation-delay: 0.22s;
}

.dash-anim .colorful-dashboard-grid>*:nth-child(7) {
  animation-delay: 0.26s;
}

.dash-anim .colorful-dashboard-grid>*:nth-child(8) {
  animation-delay: 0.30s;
}

.dash-anim .telemetry-badge-item:nth-child(1) {
  animation-delay: 0.16s;
}

.dash-anim .telemetry-badge-item:nth-child(2) {
  animation-delay: 0.20s;
}

.dash-anim .telemetry-badge-item:nth-child(3) {
  animation-delay: 0.24s;
}

.dash-anim .telemetry-badge-item:nth-child(4) {
  animation-delay: 0.28s;
}

.dash-anim .dash-shortcut {
  animation-delay: 0.34s;
}

/* Efek kilau (sheen) saat kartu di-hover */
.dash-anim .colorful-card::after {
  content: "";
  position: absolute;
  top: -60%;
  left: 0;
  width: 45%;
  height: 220%;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.22) 50%,
      rgba(255, 255, 255, 0) 100%);
  transform: translateX(-130%) rotate(18deg);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.dash-anim .colorful-card:hover::after {
  opacity: 1;
  animation: dashSheen 0.85s ease-out;
}

/* --- Kartu dengan animasi efek-hover OTOMATIS berulang (repeat) ---
   Pakai: tambahkan class `card-auto-fx` pada .colorful-card dan atur tempo lewat CSS var
   `--fx-loop` (default 3s). Contoh terpasang (18-Sep-2026):
     Card 1 PPP Online (Dialup)         -> style="--fx-loop: 6s"
     Card 4 New Registrasi Bulan Ini    -> style="--fx-loop: 4s"
   Tiap kartu independen (tempo boleh beda, tidak saling menunggu).
   Meniru efek :hover penuh -> kartu naik + shadow, ikon watermark membesar, kilau menyapu.
   1 siklus: 0-55% idle | 65-78% fase hover | 88-100% kembali idle (lalu ulang). */
@keyframes dashCardAutoLift {

  0%,
  55% {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  }

  65%,
  78% {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  }

  88%,
  100% {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  }
}

@keyframes dashCardAutoWatermark {

  0%,
  55% {
    transform: translateY(-50%) scale(1);
    color: rgba(255, 255, 255, 0.2);
  }

  65%,
  78% {
    transform: translateY(-50%) scale(1.08);
    color: rgba(255, 255, 255, 0.3);
  }

  88%,
  100% {
    transform: translateY(-50%) scale(1);
    color: rgba(255, 255, 255, 0.2);
  }
}

@keyframes dashCardAutoSheen {

  0%,
  56% {
    transform: translateX(-130%) rotate(18deg);
  }

  76%,
  100% {
    transform: translateX(240%) rotate(18deg);
  }
}

.dash-anim .colorful-card.card-auto-fx {
  /* Entrance dashFadeUp DIGABUNG dgn loop (jangan ditimpa), loop mulai setelah 1 siklus. */
  animation: dashFadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both,
    dashCardAutoLift var(--fx-loop, 3s) ease-in-out infinite;
  animation-delay: 0s, var(--fx-loop, 3s);
  will-change: transform;
}

.dash-anim .colorful-card.card-auto-fx .colorful-card-watermark {
  animation: dashCardAutoWatermark var(--fx-loop, 3s) ease-in-out infinite;
}

/* Spesifisitas 2 class => mengalahkan rule :hover (1 class) agar kilau tetap berulang. */
.dash-anim .colorful-card.card-auto-fx::after {
  opacity: 1;
  animation: dashCardAutoSheen var(--fx-loop, 3s) linear infinite;
}

/* Hover ringan pada strip telemetri */
.dash-anim .telemetry-badge-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dash-anim .telemetry-badge-item:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

/* --- [BOX 9] Chart Tren Pendapatan + Komposisi Produk + Pill Rekening --- */
.dash-chart-box {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.65rem;
  background-image: linear-gradient(120deg,
      rgba(16, 185, 129, 0.09) 0%,
      rgba(124, 58, 237, 0.07) 50%,
      rgba(2, 132, 199, 0.09) 100%);
  background-size: 220% 220%;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.dash-anim .dash-chart-box {
  animation: dashFadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both,
    dashGradientShift 14s ease-in-out infinite;
}

.dash-chart-split {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0.7rem;
  align-items: stretch;
}

.dash-chart-main {
  min-width: 0;
}

.dash-chart-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.dash-chart-title.small {
  font-size: 0.72rem;
}

.dash-chart-sub {
  font-size: 0.62rem;
  color: #64748b;
  margin: 1px 0 0.35rem 0;
}

/* Legend manual ringkas (1 baris di HP) — urut: Total, PPPoE, Voucher, Hotspot */
.dash-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  margin: 0 0 0.3rem 0;
}

.dash-legend .dlg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.dash-legend .dlg i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
  flex: 0 0 auto;
}

.dash-chart-canvas {
  position: relative;
  height: 190px;
  width: 100%;
}

/* Layer FX: animasi "line warna berjalan" di atas chart (tidak menghalangi tooltip/kursor) */
.dash-chart-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
}

/* --- Target/proyeksi di ujung garis tren (01-Okt-2026) ---
   Panah + teks kecil "Target" digambar LANGSUNG di kanvas chart oleh plugin
   `dashTargetArrow` (index.html) dan LEDAKAN di ujungnya digambar di layer FX
   (#dashChartFx). Keduanya tidak butuh CSS elemen HTML (badge overlay lama DIHAPUS
   karena sering terpotong tepi kanan chart). Sisa di bawah = penanda legenda. */

/* Item legend penanda proyeksi: garis putus-putus hijau */
.dash-legend .dlg.dlg-target {
  color: #059669;
}

.dash-legend .dlg i.dlg-dash {
  width: 12px;
  height: 0;
  border-radius: 0;
  border-top: 2px dashed #10b981;
}

/* --- [BOX 5b] Top 10 Reseller: 2 grafik (bulan berjalan + bulan kemarin), 18-Sep-2026 ---
   Bar horizontal, nominal di dalam batang, gradasi kuning->hijau, animasi shrink.
   Kotak memakai kelas .dash-chart-box agar gaya/animasi masuk konsisten.
   Di HP: menumpuk 1 kolom (lihat media query di bawah) supaya label tidak berdesakan. */
.dash-topres-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.dash-topres-cell {
  min-width: 0;
}

.dash-topres-canvas {
  position: relative;
  height: 240px;
  width: 100%;
}

@media (max-width: 768px) {
  .dash-topres-grid {
    grid-template-columns: 1fr;
  }

  .dash-topres-canvas {
    height: 220px;
  }
}

/* --- DUA PIE BERJAJAR (Omset & Volume) + ring "lingkaran berputar" --- */
.dash-legend-pie {
  justify-content: center;
  margin-bottom: 0.25rem;
}

.dash-pie-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.dash-pie-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dash-pie-title {
  font-size: 0.58rem;
  font-weight: 700;
  color: #334155;
  text-align: center;
  margin-bottom: 0.15rem;
}

/* Label periode pie (BULAN KEMARIN) — SATU BARIS dengan judul pie (17-Sep-2026).
   Dulu `display: block` sehingga "Agustus 2026" turun baris; kini inline supaya
   judul terbaca penuh: "Total Fee Agustus 2026". */
.dash-pie-period {
  display: inline;
  font-size: 0.5rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Wadah pie + cincin: area persegi agar cincin tetap bulat.
   17-Sep-2026 (rev2): kotak dikecilkan 132px -> 124px dan glow cincin dikurangi menjadi
   -4px / -8px, supaya cincin tidak "over" keluar sel. Pie isi dibuat 88% (inset 6%)
   sehingga radius pie tetap ±54,6px — mata user tidak kehilangan ukuran pie.
   Margin vertikal 0.2rem tetap dipakai agar glow tidak berdempetan dengan legend / pill. */
.dash-pie-ring {
  position: relative;
  width: 100%;
  max-width: 124px;
  aspect-ratio: 1 / 1;
  margin: 0.2rem auto;
}

/* Cincin conic-gradient berputar (CSS murni, tanpa requestAnimationFrame).
   17-Sep-2026 (rev2): pie donut = 88% kotak (inset 6%, lihat .dash-doughnut) dan cincin
   hanya digeser -4px / -8px (rev1 -6px / -12px ternyata "over" keluar sel). Pita tetap
   dibatasi mask sempit supaya tidak menabrak badan pie. */
.dash-pie-ring::before,
.dash-pie-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.dash-pie-ring::before {
  inset: -4px;
  background: conic-gradient(from 0deg,
      rgba(2, 132, 199, 0) 0deg,
      rgba(2, 132, 199, 0.85) 90deg,
      rgba(16, 185, 129, 0.85) 180deg,
      rgba(124, 58, 237, 0.85) 270deg,
      rgba(2, 132, 199, 0) 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent 88%, #000 89%);
  mask: radial-gradient(closest-side, transparent 88%, #000 89%);
  animation: dashRingSpin 6s linear infinite;
}

.dash-pie-ring::after {
  inset: -8px;
  background: conic-gradient(from 180deg,
      rgba(245, 158, 11, 0) 0deg,
      rgba(245, 158, 11, 0.55) 120deg,
      rgba(245, 158, 11, 0) 240deg,
      rgba(245, 158, 11, 0) 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent 92%, #000 93%);
  mask: radial-gradient(closest-side, transparent 92%, #000 93%);
  animation: dashRingSpin 9s linear infinite reverse;
}

/* Label tengah donut (total) */
.dash-pie-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
  z-index: 2;
}

@keyframes dashRingSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.dash-chart-side {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-left: 1px dashed #cbd5e1;
  padding-left: 0.7rem;
  min-width: 0;
}

/* Pie donut isi: 88% dari kotak ring (inset 6%) — rev2 17-Sep-2026.
   Cincin animasi di luar tetap terlihat, tetapi total glow tidak lagi "over" keluar sel. */
.dash-doughnut {
  position: absolute;
  inset: 6%;
}

.rek-pill-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.rek-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.22rem 0.45rem;
  border-radius: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.rek-pill b {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
}

.rek-utama {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}

.rek-fee {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

/* Pill rekening kini berupa tautan -> perlu reset gaya anchor + umpan balik hover */
a.rek-pill {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

a.rek-pill:hover,
a.rek-pill:focus-visible {
  transform: translateX(2px);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
  filter: saturate(1.15);
}

a.rek-pill:active {
  transform: translateX(2px) scale(0.98);
}

/* =========================================================================
   PINTASAN CEPAT OPERASIONAL — TATA LETAK RAPI (18-Sep-2026)
   Masalah lama: container `display:flex; flex-wrap:wrap` → lebar tombol
   mengikuti panjang teks, sehingga tepi KANAN baris terakhir BERGERIGI
   (kelihatan berantakan di HP).
   Solusi: CSS GRID — semua tombol LEBAR SERAGAM per kolom, tepi kiri-kanan
   lurus (rapi), isi tombol rata tengah.
   PC  : auto-fill min 148px (biasanya 5-7 kolom sejajar rapi)
   HP  : dipaksa 2 kolom (lihat @media max-width 640px & 400px di bawah)
   ========================================================================= */
.dash-shortcut-grid {
  padding: 0.55rem 0.75rem;
  display: grid;
  /* min 162px = cukup untuk label terpanjang ("Dashboard Keuangan") TANPA terpotong */
  grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
  gap: 0.35rem;
  align-items: stretch;
}

/* Tombol pintasan: isi penuh sel grid + konten rata tengah */
.dash-shortcut-grid .dash-shortcut {
  width: 100%;
  min-width: 0;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  font-size: 0.74rem;
  line-height: 1.15;
  padding: 0.34rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
}

.dash-shortcut-grid .dash-shortcut i {
  flex: 0 0 auto;
}

/* Label: kalau ruang kurang, dipotong dengan elipsis (judul lengkap ada di tooltip) */
.dash-shortcut-grid .dash-shortcut .dash-shortcut-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Pintasan cepat: hover pop halus --- */
.dash-anim .dash-shortcut {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.dash-anim .dash-shortcut:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
  background: #f8fafc;
}

/* --- Mobile: chart box jadi 1 kolom penuh --- */
@media (max-width: 900px) {
  .dash-chart-split {
    grid-template-columns: 1fr;
  }

  .dash-chart-side {
    border-left: none;
    border-top: 1px dashed #cbd5e1;
    padding-left: 0;
    padding-top: 0.45rem;
  }

  .rek-pill-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .rek-pill {
    flex: 1 1 46%;
  }
}

@media (max-width: 640px) {
  .dash-chart-box {
    padding: 0.45rem 0.5rem;
  }

  /* Naik dari 158px -> 176px: kompensasi layout.padding chart (ruang panah + teks "Target") */
  .dash-chart-canvas {
    height: 176px;
  }

  .dash-legend {
    gap: 3px 7px;
    margin-bottom: 0.22rem;
  }

  .dash-legend .dlg {
    font-size: 0.55rem;
  }

  .dash-chart-fx {
    opacity: 0.85;
  }

  .dash-pie-ring {
    max-width: 112px;
  }

  .dash-pie-title {
    font-size: 0.54rem;
  }

  .dash-pie-center {
    font-size: 0.5rem;
  }

  .dash-anim .colorful-dashboard-grid {
    gap: 0.4rem;
  }

  /* ---------------------------------------------------------------
     PINTASAN CEPAT OPERASIONAL — HP View: PAKSA 2 KOLOM SEJAJAR
     2 kolom `minmax(0,1fr)` = lebar identik & tepi lurus, bukan flex-wrap
     yang meninggalkan sisa ruang bergerigi di baris terakhir.
     Font dikecilkan + teks satu baris agar tetap mampat.
     --------------------------------------------------------------- */
  .dash-shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 0.45rem 0.5rem !important;
    gap: 0.3rem !important;
  }

  .dash-shortcut-grid .dash-shortcut {
    font-size: 0.66rem !important;
    padding: 0.3rem 0.28rem !important;
    gap: 0.25rem !important;
  }

  .dash-shortcut-grid .dash-shortcut i {
    font-size: 0.72rem !important;
  }
}

/* Hormati preferensi pengguna untuk gerak minimal */
@media (prefers-reduced-motion: reduce) {

  .dash-anim .colorful-dashboard-grid>*,
  .dash-anim .telemetry-badge-item,
  .dash-anim .dash-shortcut,
  .dash-anim .dash-chart-box,
  .live-dot,
  .dash-anim .colorful-card.card-auto-fx,
  .dash-anim .colorful-card.card-auto-fx .colorful-card-watermark {
    animation: none !important;
  }

  /* Kartu auto-fx: kilau menyapu dimatikan total saat gerak minimal diminta */
  .dash-anim .colorful-card.card-auto-fx::after {
    opacity: 0;
    animation: none !important;
  }

  /* Cincin pie: tampil statis (tanpa putaran) */
  .dash-pie-ring::before,
  .dash-pie-ring::after {
    animation: none !important;
  }

  .dash-anim .colorful-card:hover::after {
    opacity: 0;
    animation: none;
  }

  .dash-chart-fx {
    display: none;
  }

  /* Ledakan di ujung panah Target ikut dimatikan (layer FX disembunyikan di atas) */
}

/* =========================================================================
   TELEMETRI DI HP SANGAT KECIL (<=400px): rapatkan lagi agar 1 baris
   ========================================================================= */
@media (max-width: 400px) {
  .telemetry-strip-grid {
    gap: 0.22rem !important;
  }

  .telemetry-badge-item {
    min-width: 0 !important;
  }

  .telemetry-tag {
    padding: 0.14rem 0.26rem !important;
    font-size: 0.5rem !important;
    letter-spacing: 0 !important;
    gap: 2px !important;
  }

  .telemetry-val {
    padding: 0.14rem 0.26rem !important;
    font-size: 0.55rem !important;
    min-width: 0 !important;
    white-space: nowrap !important;
  }

  /* Pintasan cepat di layar sangat kecil (<=400px): tetap 2 kolom, lebih mampat */
  .dash-shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 0.4rem 0.42rem !important;
    gap: 0.24rem !important;
  }

  .dash-shortcut-grid .dash-shortcut {
    font-size: 0.6rem !important;
    padding: 0.26rem 0.2rem !important;
    gap: 0.2rem !important;
  }

  .dash-shortcut-grid .dash-shortcut i {
    font-size: 0.66rem !important;
  }
}