/* ========================================================
   BAYU ASIH SUPERAPP - PREMIUM GREEN THEME
   ======================================================== */

:root {
  /* Green Theme Colors */
  --ba-gradient-start: #059669; /* Deep Emerald */
  --ba-gradient-end: #34d399;   /* Bright Mint */
  
  --ba-primary: #10b981;
  --ba-primary-dark: #047857;
  --ba-primary-light: #d1fae5;
  
  --ba-bg-light: #f4fdf8;
  --ba-bg-card: #ffffff;
  --ba-border: #e2e8f0;
  --ba-text-main: #1e293b;
  --ba-header-bg: rgba(255, 255, 255, 0.8);
  --ba-card-shadow: 0 4px 15px rgba(16, 185, 129, 0.08);
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] {
  --ba-bg-light: #0f172a;
  --ba-bg-card: #1e293b;
  --ba-border: #334155;
  --ba-text-main: #f8fafc;
  --ba-header-bg: rgba(30, 41, 59, 0.8);
  --ba-card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --ba-gradient-start: #34d399; /* Lighter in dark mode */
  --ba-gradient-end: #6ee7b7;
}

/* Base Overrides */
body {
  background-color: var(--ba-bg-light) !important;
  color: var(--ba-text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Text Gradient Utility */
.text-gradient-primary {
  background: linear-gradient(135deg, var(--ba-gradient-start), var(--ba-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header Styling */
.app-header {
  background: var(--ba-header-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ba-border) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* --- User Role Header Branding --- */
.header-brand-user {
  transition: opacity 0.2s ease;
}
.header-brand-user:hover {
  opacity: 0.85;
}
.header-brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ba-bg-card);
  border: 1px solid var(--ba-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(16,185,129,0.1);
  flex-shrink: 0;
}
.header-brand-logo img {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.header-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.header-brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ba-text-main);
  letter-spacing: -0.3px;
}
.header-brand-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ba-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* --- Header Action Buttons --- */
.header-action-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--ba-border) !important;
  background: var(--ba-bg-card) !important;
  color: var(--ba-text-main) !important;
  transition: all 0.2s ease;
}
.header-action-btn:hover {
  background: var(--ba-primary-light) !important;
  border-color: var(--ba-primary) !important;
  color: var(--ba-primary) !important;
}
[data-bs-theme="dark"] .header-action-btn:hover {
  background: rgba(16,185,129,0.1) !important;
}

/* --- Header Divider --- */
.header-divider {
  width: 1px;
  height: 24px;
  background: var(--ba-border);
  margin: 0 0.5rem;
  flex-shrink: 0;
}

/* --- User Dropdown Trigger --- */
.header-user-dropdown {
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  transition: background 0.2s ease;
}
.header-user-dropdown:hover {
  background: rgba(16,185,129,0.05);
}
.header-user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ba-text-main);
  line-height: 1.2;
}
.header-user-role-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ba-primary);
  letter-spacing: 0.5px;
}

/* --- Avatar --- */
.header-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: visible;
  flex-shrink: 0;
}
.header-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ba-border);
  transition: border-color 0.2s ease;
}
.header-user-dropdown:hover .header-avatar img {
  border-color: var(--ba-primary);
}
.header-avatar-status {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--ba-bg-card);
  z-index: 2;
}

/* --- Dropdown Menu --- */
.header-dropdown-menu {
  width: 240px;
  border-radius: 16px;
  border: 1px solid var(--ba-border);
  background: var(--ba-bg-card);
  box-shadow: 0 12px 35px rgba(0,0,0,0.1);
  padding: 0.5rem;
  overflow: hidden;
}
[data-bs-theme="dark"] .header-dropdown-menu {
  box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}
.header-dropdown-profile {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem;
  border-radius: 12px;
  background: var(--ba-bg-light);
}
[data-bs-theme="dark"] .header-dropdown-profile {
  background: rgba(15,23,42,0.5);
}
.header-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.header-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.header-dropdown-menu .dropdown-item {
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.header-dropdown-menu .dropdown-item:hover {
  background: rgba(16,185,129,0.08);
  color: var(--ba-primary-dark);
}
.header-dropdown-menu .dropdown-divider {
  border-color: var(--ba-border);
  margin: 0.3rem 0;
}

/* Sidebar Styling */
.app-menubar {
  background: var(--ba-bg-card) !important;
  border-right: 1px solid var(--ba-border) !important;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.02) !important;
}

.menu-link.active {
  background: linear-gradient(135deg, var(--ba-gradient-start), var(--ba-gradient-end)) !important;
  color: white !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3) !important;
  border-radius: 10px;
}
.menu-link.active i {
  color: white !important;
}

/* Sidebar Hover Fix */
.menu-link:hover:not(.active) {
  background: var(--ba-primary-light) !important;
  color: var(--ba-primary-dark) !important;
  border-radius: 10px;
}
[data-bs-theme="dark"] .menu-link:hover:not(.active) {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #34d399 !important;
}
.menu-link:hover:not(.active) i {
  color: var(--ba-primary) !important;
}
[data-bs-theme="dark"] .menu-link:hover:not(.active) i {
  color: #34d399 !important;
}

/* Sidebar Menu Heading */
.menu-heading .menu-label {
  color: var(--ba-primary) !important;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Hide text logo when sidebar is minimized */
[data-app-sidebar="mini"] .app-navbar-brand h4 {
  display: none !important;
}

/* =====================================================
   DASHBOARD HERO
   ===================================================== */
.dashboard-hero {
  padding: 2rem 0 0;
}
.hero-logo-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background: var(--ba-bg-card);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15),
              inset 0 0 0 2px rgba(16, 185, 129, 0.12);
  animation: heroFloat 4s ease-in-out infinite;
}
.hero-logo-ring img {
  height: 55px;
  width: auto;
  object-fit: contain;
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); box-shadow: 0 8px 32px rgba(16,185,129,0.15), inset 0 0 0 2px rgba(16,185,129,0.12); }
  50%      { transform: translateY(-8px); box-shadow: 0 16px 48px rgba(16,185,129,0.25), inset 0 0 0 2px rgba(16,185,129,0.2); }
}

/* =====================================================
   GROUP HEADERS
   ===================================================== */
.app-group-header {
  position: relative;
}
.group-indicator {
  width: 5px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--ba-gradient-start), var(--ba-gradient-end));
  flex-shrink: 0;
}
.app-group-header h5 {
  color: var(--ba-text-main);
  font-size: 1.15rem;
}
.group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ba-primary);
  background: var(--ba-primary-light);
}
[data-bs-theme="dark"] .group-count {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.group-line {
  height: 1px;
  background: linear-gradient(90deg, var(--ba-border), transparent);
}

/* =====================================================
   LAUNCHER CARDS — PREMIUM GLASS DESIGN
   ===================================================== */
.launcher-card {
  position: relative;
  border-radius: 20px;
  background: var(--ba-bg-card);
  border: 1px solid var(--ba-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  animation: cardFadeIn 0.5s ease both;
}
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Top gradient bar --- */
.launcher-card-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--card-accent), var(--card-accent-light));
  flex-shrink: 0;
  transition: height 0.3s ease;
}
.launcher-card:hover .launcher-card-bar {
  height: 6px;
}

/* --- Body --- */
.launcher-card-body {
  padding: 1.5rem 1.4rem 1.2rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* --- Floating initial --- */
.launcher-card-initial {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  color: var(--card-accent);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}
[data-bs-theme="dark"] .launcher-card-initial {
  opacity: 0.1;
}
.launcher-card:hover .launcher-card-initial {
  opacity: 0.12;
  transform: scale(1.15) rotate(-6deg);
}
[data-bs-theme="dark"] .launcher-card:hover .launcher-card-initial {
  opacity: 0.18;
}

/* --- Content --- */
.launcher-card-content {
  position: relative;
  z-index: 1;
  flex-grow: 1;
}
.launcher-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ba-text-main);
  margin-bottom: 0.4rem;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.launcher-card-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Footer / CTA --- */
.launcher-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--ba-border);
  position: relative;
  z-index: 1;
}
.launcher-card-cta {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--card-accent);
  transition: letter-spacing 0.3s ease;
}
.launcher-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--card-accent-bg);
  color: var(--card-accent);
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.launcher-card:hover .launcher-card-cta {
  letter-spacing: 1.2px;
}
.launcher-card:hover .launcher-card-arrow {
  background: var(--card-accent);
  color: white;
  transform: translateX(4px);
}

/* --- Decorative orb --- */
.launcher-card-orb {
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-accent-light), transparent 70%);
  opacity: 0;
  transition: all 0.5s ease;
  z-index: 0;
  pointer-events: none;
}
.launcher-card:hover .launcher-card-orb {
  opacity: 0.15;
  transform: scale(1.4);
}
[data-bs-theme="dark"] .launcher-card:hover .launcher-card-orb {
  opacity: 0.1;
}

/* --- Hover lift --- */
.launcher-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08),
              0 0 0 1px var(--card-accent-bg);
  border-color: var(--card-accent);
}
[data-bs-theme="dark"] .launcher-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(16, 185, 129, 0.15);
}

/* =====================================================
   LEGACY STYLES KEPT
   ===================================================== */
[data-bs-theme="dark"] .superapp-card h6 {
  color: #f8fafc !important;
}
[data-bs-theme="dark"] .superapp-card small {
  color: #94a3b8 !important;
}

/* Auth Page Premium Look */
.auth-cover-wrapper {
  background: linear-gradient(135deg, var(--ba-bg-light) 0%, var(--ba-primary-light) 100%);
}
[data-bs-theme="dark"] .auth-cover-wrapper {
  background: linear-gradient(135deg, #0f172a 0%, #064e3b 100%);
}

.auth-inner {
  background: var(--ba-bg-card) !important;
  backdrop-filter: blur(10px);
  border: 1px solid var(--ba-border);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 3rem !important;
}
[data-bs-theme="dark"] .auth-inner {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Inputs & Buttons */
.form-control {
  border-radius: 10px;
  border: 1px solid var(--ba-border);
  padding: 0.75rem 1rem;
  background-color: var(--ba-bg-light);
  color: var(--ba-text-main);
  transition: all 0.2s ease;
}
[data-bs-theme="dark"] .form-control {
  background-color: #0f172a;
}
.form-control:focus {
  border-color: var(--ba-primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--ba-gradient-start), var(--ba-gradient-end));
  border: none;
  border-radius: 10px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  transition: all 0.3s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
  color: #ffffff;
}

/* Badges */
.badge {
  padding: 0.4em 0.8em;
  border-radius: 6px;
  font-weight: 600;
}

/* Tables */
.table {
  border-collapse: separate;
  border-spacing: 0 8px;
}
.table tbody tr {
  background: var(--ba-bg-card);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  transition: transform 0.2s;
}
[data-bs-theme="dark"] .table tbody tr {
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.table td, .table th {
  border: none;
  padding: 1rem;
  color: var(--ba-text-main);
  background: transparent !important;
}
.table td:first-child, .table th:first-child { border-radius: 10px 0 0 10px; }
.table td:last-child, .table th:last-child { border-radius: 0 10px 10px 0; }

/* User Layout Overrides (No Sidebar) */
.layout-user-role .app-wrapper {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}
.layout-user-role .app-header,
.layout-user-role .footer-wrapper {
  left: 0 !important;
  margin-left: 0 !important;
  width: 100% !important;
}
.layout-user-role .app-header .app-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Theme Glow Background - Greenish */
.theme-glow-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: -1;
  background-color: var(--ba-bg-light);
  transition: background-color 0.3s ease;
}
.theme-glow-bg::before, .theme-glow-bg::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s infinite alternate;
}
.theme-glow-bg::before {
  background: linear-gradient(to right, rgba(16, 185, 129, 0.4), rgba(52, 211, 153, 0.3));
  top: -200px;
  left: -100px;
}
.theme-glow-bg::after {
  background: linear-gradient(to right, rgba(4, 120, 87, 0.3), rgba(16, 185, 129, 0.3));
  bottom: -200px;
  right: -100px;
  animation-delay: -10s;
}

[data-bs-theme="dark"] .theme-glow-bg::before {
  background: linear-gradient(to right, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
}
[data-bs-theme="dark"] .theme-glow-bg::after {
  background: linear-gradient(to right, rgba(4, 120, 87, 0.15), rgba(16, 185, 129, 0.1));
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(100px, 50px) rotate(180deg); }
  100% { transform: translate(0, 100px) rotate(360deg); }
}

/* Enhance Page Header */
.app-page-title {
  font-weight: 800 !important;
  letter-spacing: -0.5px;
  color: var(--ba-text-main) !important;
}
.layout-user-role .app-page-head {
  padding-top: 1rem;
}

/* Dashboard Animations */
.logo-bounce {
  animation: logoBounce 3s ease-in-out infinite;
}
@keyframes logoBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(16, 185, 129, 0.3) !important; }
}
