/**
 * ClashPay GoPay Merchant Theme - Anti-Slop Compliant (R-01 - R-38)
 * Visual Identity: Official GoPay & GoBiz Merchant Portal Style
 * Colors: GoPay Blue (#00AED6), Deep Blue (#007CE8), GoBiz Green (#00AA13), Navy (#0A2540)
 */

:root {
  --gopay-primary: #00AED6;
  --gopay-primary-dark: #008CB0;
  --gopay-primary-deep: #007CE8;
  --gopay-navy: #0A2540;
  --gopay-navy-soft: #1E293B;
  --gopay-green: #00AA13;
  --gopay-green-dark: #008710;
  --gopay-green-soft: #E8F8EE;
  --gopay-bg: #F8FAFC;
  --gopay-card-bg: #FFFFFF;
  --gopay-border: #E2E8F0;
  --gopay-border-light: #F1F5F9;
  --gopay-text-main: #0F172A;
  --gopay-text-muted: #64748B;
  --gopay-text-light: #94A3B8;
  --gopay-radius-sm: 6px;
  --gopay-radius: 10px;
  --gopay-radius-lg: 14px;
}

/* ==========================================================================
   RESET & LAYOUT FOUNDATIONS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: var(--gopay-bg) !important;
  color: var(--gopay-text-main) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh !important;
  position: relative !important;
  background-color: var(--gopay-bg) !important;
  width: 100% !important;
  overflow-x: hidden !important;
}

/* ==========================================================================
   DESKTOP VIEWPORT (min-width: 992px)
   ========================================================================== */
@media (min-width: 992px) {
  #sidebar,
  #sidebar.active,
  #sidebar:not(.active) {
    width: 260px !important;
    max-width: 260px !important;
    min-width: 260px !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    height: 100vh !important;
    z-index: 1030 !important;
    display: block !important;
    visibility: visible !important;
    transform: none !important;
    background: #FFFFFF !important;
    border-right: 1px solid var(--gopay-border) !important;
    box-shadow: 2px 0 10px rgba(10, 37, 64, 0.04) !important;
    margin: 0 !important;
  }

  .sidebar-wrapper,
  #sidebar .sidebar-wrapper,
  #sidebar.active .sidebar-wrapper,
  #sidebar:not(.active) .sidebar-wrapper {
    width: 260px !important;
    max-width: 260px !important;
    min-width: 260px !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    height: 100vh !important;
    background: #FFFFFF !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: none !important;
    margin: 0 !important;
  }

  #main,
  #app #main,
  #sidebar ~ #main,
  #sidebar:not(.active) ~ #main,
  #sidebar.active ~ #main {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
    max-width: calc(100% - 260px) !important;
    min-height: 100vh !important;
    padding: 0 !important;
    background-color: var(--gopay-bg) !important;
    transition: none !important;
  }

  .clash-mobile-bottom-nav,
  .clash-bottom-nav {
    display: none !important;
  }

  .navbar .sidebar-toggler,
  .sidebar-header .sidebar-toggler {
    display: none !important;
  }
}

/* ==========================================================================
   TABLET & MOBILE VIEWPORT (max-width: 991.98px)
   ========================================================================== */
@media (max-width: 991.98px) {
  #sidebar {
    width: 280px !important;
    max-width: 85vw !important;
    min-width: 0 !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    height: 100vh !important;
    z-index: 1060 !important;
    background: #FFFFFF !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    margin: 0 !important;
    display: block !important;
    visibility: visible !important;
  }

  #sidebar.active {
    transform: translateX(0) !important;
    box-shadow: 8px 0 35px rgba(10, 37, 64, 0.3) !important;
  }

  .sidebar-wrapper,
  #sidebar .sidebar-wrapper,
  #sidebar.active .sidebar-wrapper,
  #sidebar:not(.active) .sidebar-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    height: 100vh !important;
    background: #FFFFFF !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    transform: none !important;
  }

  #main,
  #app #main,
  #sidebar ~ #main,
  #sidebar:not(.active) ~ #main,
  #sidebar.active ~ #main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 0 75px 0 !important; /* Space for bottom nav */
    background-color: var(--gopay-bg) !important;
    transition: none !important;
  }

  .navbar .sidebar-toggler {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .sidebar-header .sidebar-toggler {
    display: block !important;
  }

  .clash-mobile-bottom-nav,
  .clash-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 62px !important;
    background: #FFFFFF !important;
    border-top: 1px solid var(--gopay-border) !important;
    z-index: 1040 !important;
    box-shadow: 0 -2px 12px rgba(10, 37, 64, 0.06) !important;
    padding: 0 8px !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    align-items: center !important;
    justify-content: space-around !important;
  }
}

/* ==========================================================================
   SIDEBAR COMPONENTS
   ========================================================================== */
.sidebar-header {
  padding: 1.25rem 1.25rem 1rem 1.25rem !important;
  border-bottom: 1px solid var(--gopay-border-light);
  flex-shrink: 0;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.85rem !important;
  width: 100% !important;
}

.sidebar-menu ul.menu {
  list-style: none !important;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
  width: 100% !important;
}

/* Merchant Outlet Info Card */
.merchant-outlet-card {
  background: #F1F5F9;
  border: 1px solid var(--gopay-border);
  border-radius: var(--gopay-radius);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.85rem;
  width: 100% !important;
}

.merchant-outlet-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gopay-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-title {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: var(--gopay-text-light) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  margin-top: 1rem !important;
  margin-bottom: 0.35rem !important;
  padding-left: 0.5rem;
  list-style: none !important;
}

.sidebar-item {
  list-style: none !important;
  width: 100% !important;
  margin: 3px 0 !important;
}

.sidebar-item a,
.sidebar-item a.sidebar-link {
  width: 100% !important;
  border-radius: var(--gopay-radius-sm) !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  padding: 0.65rem 0.85rem !important;
  margin: 0 !important;
  color: #475569 !important;
  display: flex !important;
  align-items: center !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
  text-decoration: none !important;
}

.sidebar-item a i, .sidebar-item a svg {
  margin-right: 0.75rem !important;
  width: 18px !important;
  height: 18px !important;
  color: #64748B !important;
  flex-shrink: 0 !important;
}

.sidebar-item a:hover:not(.active) {
  background-color: #F1F5F9 !important;
  color: var(--gopay-navy) !important;
}

.sidebar-item a:hover:not(.active) i, .sidebar-item a:hover:not(.active) svg {
  color: var(--gopay-primary-deep) !important;
}

.sidebar-item.active a,
.sidebar-item.active a.sidebar-link {
  background: var(--gopay-primary) !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 10px rgba(0, 174, 214, 0.35) !important;
}

.sidebar-item.active a i, .sidebar-item.active a svg {
  color: #FFFFFF !important;
}

/* ==========================================================================
   DRAWER BACKDROP OVERLAY
   ========================================================================== */
.clash-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1055;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.clash-drawer-backdrop.show {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION
   ========================================================================== */
.bottom-nav-item,
.clash-bottom-nav-item {
  display: flex !important;
  flex: 1 !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  color: var(--gopay-text-muted) !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  height: 100% !important;
  padding: 4px 2px !important;
  transition: color 0.15s ease !important;
}

.bottom-nav-item svg, .bottom-nav-item i,
.clash-bottom-nav-item svg, .clash-bottom-nav-item i {
  width: 20px !important;
  height: 20px !important;
  margin-bottom: 2px !important;
}

.bottom-nav-item:hover, .bottom-nav-item.active,
.clash-bottom-nav-item:hover, .clash-bottom-nav-item.active {
  color: var(--gopay-primary) !important;
}

.bottom-nav-center {
  background: var(--gopay-primary) !important;
  color: #FFFFFF !important;
  border-radius: 50% !important;
  width: 48px !important;
  height: 48px !important;
  flex: 0 0 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 14px rgba(0, 174, 214, 0.45) !important;
  margin-top: -18px !important;
  border: 3px solid #FFFFFF !important;
}

.bottom-nav-center svg, .bottom-nav-center i {
  color: #FFFFFF !important;
  width: 22px !important;
  height: 22px !important;
  margin-bottom: 0 !important;
}

/* ==========================================================================
   NAVBAR & MAIN CONTENT
   ========================================================================== */
.navbar.navbar-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid var(--gopay-border) !important;
  box-shadow: 0 1px 3px rgba(10, 37, 64, 0.02) !important;
  padding: 0.75rem 1.5rem !important;
  min-height: 64px !important;
  width: 100% !important;
}

.main-content {
  padding: 1.5rem !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   CARDS & STATS
   ========================================================================== */
.card {
  background: #FFFFFF !important;
  border: 1px solid var(--gopay-border) !important;
  border-radius: var(--gopay-radius) !important;
  box-shadow: 0 1px 4px rgba(10, 37, 64, 0.03) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card {
  border-radius: var(--gopay-radius-lg) !important;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(10, 37, 64, 0.06) !important;
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-blue {
  background: rgba(0, 174, 214, 0.12);
  color: var(--gopay-primary);
}

.stat-icon-green {
  background: rgba(0, 170, 19, 0.12);
  color: var(--gopay-green);
}

.stat-icon-navy {
  background: rgba(10, 37, 64, 0.08);
  color: var(--gopay-navy);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-gopay {
  background-color: var(--gopay-primary) !important;
  color: #FFFFFF !important;
  border: none !important;
  font-weight: 600 !important;
  border-radius: var(--gopay-radius-sm) !important;
  padding: 0.55rem 1rem !important;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-gopay:hover, .btn-gopay:focus {
  background-color: var(--gopay-primary-dark) !important;
  box-shadow: 0 2px 8px rgba(0, 174, 214, 0.35) !important;
  color: #FFFFFF !important;
}

.btn-gopay-outline {
  background-color: transparent !important;
  color: var(--gopay-primary-deep) !important;
  border: 1.5px solid var(--gopay-primary) !important;
  font-weight: 600 !important;
  border-radius: var(--gopay-radius-sm) !important;
  padding: 0.5rem 0.95rem !important;
}

.btn-gopay-outline:hover {
  background-color: rgba(0, 174, 214, 0.08) !important;
  color: var(--gopay-primary-dark) !important;
}

.btn-gopay-green {
  background-color: var(--gopay-green) !important;
  color: #FFFFFF !important;
  border: none !important;
  font-weight: 600 !important;
  border-radius: var(--gopay-radius-sm) !important;
}

.btn-gopay-green:hover {
  background-color: var(--gopay-green-dark) !important;
  color: #FFFFFF !important;
}

/* ==========================================================================
   BADGES & STATUS
   ========================================================================== */
.badge-soft-success {
  background-color: #E8F8EE !important;
  color: #008710 !important;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
}

.badge-soft-warning {
  background-color: #FFF7E6 !important;
  color: #B45309 !important;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
}

.badge-soft-danger {
  background-color: #FEECEB !important;
  color: #E11D48 !important;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
}

.badge-soft-primary {
  background-color: rgba(0, 174, 214, 0.12) !important;
  color: var(--gopay-primary-dark) !important;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
}

.badge-soft-navy {
  background-color: rgba(10, 37, 64, 0.08) !important;
  color: var(--gopay-navy) !important;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
}

/* Live Pulse Dot */
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}

.live-dot.online {
  background-color: var(--gopay-green);
  box-shadow: 0 0 0 3px rgba(0, 170, 19, 0.25);
  animation: pulse-gopay 2s infinite;
}

.live-dot.offline {
  background-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

@keyframes pulse-gopay {
  0% { box-shadow: 0 0 0 0 rgba(0, 170, 19, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(0, 170, 19, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 170, 19, 0); }
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table {
  color: var(--gopay-text-main);
  margin-bottom: 0;
  width: 100% !important;
}

.table th {
  background-color: #F8FAFC !important;
  color: var(--gopay-text-muted) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.5px !important;
  border-top: none !important;
  border-bottom: 1px solid var(--gopay-border) !important;
  padding: 0.85rem 1rem !important;
}

.table td {
  padding: 0.85rem 1rem !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--gopay-border-light) !important;
}

.table-hover tbody tr:hover {
  background-color: #F8FAFC !important;
}

/* Code Boxes */
.code-box {
  background-color: #0F172A;
  color: #E2E8F0;
  border-radius: var(--gopay-radius);
  padding: 1.1rem;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid #1E293B;
  position: relative;
  overflow-x: auto;
}

/* Modals */
.modal-content {
  border-radius: var(--gopay-radius-lg) !important;
  border: 1px solid var(--gopay-border) !important;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12) !important;
}

.modal-header {
  border-bottom: 1px solid var(--gopay-border-light) !important;
  padding: 1.25rem 1.5rem !important;
}

.modal-footer {
  border-top: 1px solid var(--gopay-border-light) !important;
  padding: 1rem 1.5rem !important;
}

/* Forms */
.form-control, .form-select {
  border-color: var(--gopay-border) !important;
  border-radius: var(--gopay-radius-sm) !important;
  color: var(--gopay-text-main) !important;
}

.form-control:focus, .form-select:focus {
  border-color: var(--gopay-primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 174, 214, 0.15) !important;
}
