/* Stylesheet SPP BHP Billing ISR Komdigi */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  --font-family-sans-serif: 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --color-primary: #2962ff;
  --color-primary-dark: #1e4fd6;
  --color-primary-light: #e8eeff;
  --color-success: #0bb7af;
  --color-success-light: #e6fffa;
  --color-danger: #f64e60;
  --color-danger-light: #ffe2e5;
  --color-warning: #fbcd00;
  --color-warning-light: #fff8dd;
  --color-info: #35b1e8;
  --color-info-light: #e5f5fc;
  --color-dark: #272b34;
  --color-gray-dark: #323743;
  --color-gray-light: #f4f6fa;
  --color-border: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-sans-serif);
  background-color: #f4f6fa;
  color: #334155;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   LOGIN PAGE STYLES (Identik dengan billing-isr.komdigi.go.id/login)
   ========================================================================== */
.login-container {
  min-height: 100vh;
  display: flex;
  width: 100%;
}

.login-left-pane {
  flex: 1;
  background-image: url('assets/radio-tower-bg.097bc8db.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.login-left-pane::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(10, 25, 47, 0.82) 0%, rgba(20, 60, 120, 0.75) 100%);
  z-index: 1;
}

.login-left-content {
  position: relative;
  z-index: 2;
  max-width: 580px;
  text-align: center;
  color: #ffffff;
}

.login-left-content img {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.login-left-content img:hover {
  transform: scale(1.02);
}

.login-title-h2 {
  font-size: clamp(1.25rem, 2.0vw, 1.75rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.login-subtitle-h4 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #93c5fd;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.login-quote {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #e2e8f0;
  text-align: justify;
  text-justify: inter-word;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #38bdf8;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-right-pane {
  flex: 1;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 440px;
}

.btn-primary-komdigi {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 1.5px;
  transition: all 0.25s ease;
}

.btn-primary-komdigi:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: 0 4px 14px rgba(41, 98, 255, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   DASHBOARD MAIN LAYOUT (STATIC SIDEBAR & STATIC FILTER TARGET)
   ========================================================================== */
#dashboardSection {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.app-header {
  height: 68px;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}

.sidebar {
  width: 260px;
  background-color: #0f172a;
  height: 100%;
  max-height: 100%;
  color: #94a3b8;
  transition: all 0.3s ease;
  flex-shrink: 0;
  overflow-y: auto;
}

#globalFilterSection {
  flex-shrink: 0;
  z-index: 20;
}

#mainScrollableContent {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  color: #cbd5e1;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: 8px;
  margin: 0.25rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-nav-item.active {
  background: linear-gradient(90deg, #2962ff 0%, #1e4fd6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(41, 98, 255, 0.35);
}

.sidebar-nav-item i {
  font-size: 1.15rem;
  width: 24px;
  margin-right: 0.75rem;
}

/* KPI Cards */
.kpi-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.kpi-blue::after { background-color: var(--color-primary); }
.kpi-card.kpi-green::after { background-color: var(--color-success); }
.kpi-card.kpi-red::after { background-color: var(--color-danger); }
.kpi-card.kpi-amber::after { background-color: var(--color-warning); }
.kpi-card.kpi-purple::after { background-color: #8b5cf6; }

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-paid {
  background-color: var(--color-success-light);
  color: #0d9488;
  border: 1px solid #99f6e4;
}

.badge-not-paid {
  background-color: var(--color-danger-light);
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.badge-reminder {
  background-color: var(--color-warning-light);
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-annual {
  background-color: var(--color-primary-light);
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-new {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-renewal {
  background-color: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.badge-additional {
  background-color: #f0fdfa;
  color: #0d9488;
  border: 1px solid #99f6e4;
}

/* Tables */
.spp-table th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.spp-table td {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

.spp-table tbody tr:hover {
  background-color: #f8faff;
}

/* SPP Invoice Print Slip & AI Executive Report */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm 15mm 12mm;
  }

  body.printing-ai-report {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.printing-ai-report * {
    visibility: hidden;
  }
  body.printing-ai-report #aiPrintReportModal,
  body.printing-ai-report #aiPrintReportModalContent,
  body.printing-ai-report #aiPrintReportModalContent * {
    visibility: visible;
  }
  body.printing-ai-report #aiPrintReportModal {
    position: static !important;
    display: block !important;
    inset: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
  }
  body.printing-ai-report #aiPrintReportModal > div {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.printing-ai-report #aiPrintReportModalContent {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    color: #0f172a !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.printing-ai-report #aiPrintReportModalContent img {
    max-width: 100% !important;
    height: auto !important;
  }

  body.printing-ai-report table {
    page-break-inside: auto;
  }

  body.printing-ai-report tr,
  body.printing-ai-report .avoid-page-break,
  body.printing-period-report tr,
  body.printing-period-report .avoid-page-break {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.printing-period-report #periodIsrPrintModal {
    display: block !important;
    position: static !important;
    background: #ffffff !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  body.printing-period-report #periodIsrPrintModal > div {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.printing-period-report #periodIsrPrintModalContent {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    color: #0f172a !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body:not(.printing-ai-report):not(.printing-period-report) * {
    visibility: hidden;
  }
  body:not(.printing-ai-report):not(.printing-period-report) #sppModalContent, 
  body:not(.printing-ai-report):not(.printing-period-report) #sppModalContent * {
    visibility: visible;
  }
  body:not(.printing-ai-report):not(.printing-period-report) #sppModalContent {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    box-shadow: none;
    border: none;
  }
  .no-print {
    display: none !important;
  }
}

/* AI Component Styles */
.ai-badge-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.ai-card-glow {
  box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.12), 0 2px 6px -1px rgba(168, 85, 247, 0.08);
}

.ai-chat-user {
  background: #2962ff;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.ai-chat-bot {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   ICON KHUSUS TANYA AI & ANIMASI VOICE RECOGNITION
   ========================================================================== */
.tanya-ai-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #06b6d4 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.tanya-ai-icon-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.6);
}

.tanya-ai-pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #ffffff;
}

/* Pastikan warna teks Tanya AI putih bersih saat tab aktif */
#aiPillarChatText.text-white,
#btnAiPillarChat.active #aiPillarChatText {
  color: #ffffff !important;
}

/* Voice Recognition Recording Waves Animation */
.ai-voice-recording-btn {
  background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%) !important;
  animation: pulse-voice-red 1.5s infinite;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.65) !important;
}

@keyframes pulse-voice-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Subtle bounce animation for floating mascot */
@keyframes bounce-subtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.animate-bounce-subtle {
  animation: bounce-subtle 3s ease-in-out infinite;
}

/* Smooth floating animation for Pesut mascot */
@keyframes pesut-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(2deg);
  }
}

.pesut-mascot-float {
  animation: pesut-float 3s ease-in-out infinite;
}

/* Floating AI Window Custom Styling */
#aiFloatingChatWindow {
  box-shadow: 0 20px 40px -12px rgba(88, 28, 135, 0.35), 0 0 0 1px rgba(168, 85, 247, 0.2);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
