@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --bg-main: #f8fafc;
  --sidebar-width: 270px;
  --sidebar-bg: #064e3b; /* Deep Emerald Green */
  --sidebar-hover: #047857;
  --topbar-height: 70px;
  --topbar-bg: #ffffff;
  
  --emerald-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
  --blue-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --purple-gradient: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  --orange-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --teal-gradient: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);

  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-dark);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Layout Wrapper */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  background: linear-gradient(180deg, #064e3b 0%, #022c22 100%);
  color: #ffffff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1040;
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  padding: 1rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a7f3d0;
  padding: 0.75rem 1rem 0.25rem;
  font-weight: 700;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  text-decoration: none;
  border-radius: 0.625rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.925rem;
  transition: all 0.2s ease;
}

.sidebar-nav-item i {
  width: 24px;
  font-size: 1.1rem;
  margin-right: 0.75rem;
  color: #34d399;
  transition: color 0.2s ease;
}

.sidebar-nav-item:hover, .sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.sidebar-nav-item.active i, .sidebar-nav-item:hover i {
  color: #10b981;
}

/* Submenu & Dropdown Styling */
.sidebar-nav-item.dropdown-toggle::after {
  display: none !important;
}

.sidebar-nav-item .sidebar-arrow {
  transition: transform 0.25s ease, color 0.25s ease;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav-item[aria-expanded="true"] .sidebar-arrow {
  transform: rotate(180deg);
  color: #34d399;
}

.sidebar-submenu {
  list-style: none;
  padding-left: 0.75rem;
  margin: 0.2rem 0 0.5rem 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.sidebar-submenu-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  margin-bottom: 0.15rem;
  transition: all 0.2s ease;
}

.sidebar-submenu-item i {
  font-size: 0.95rem;
  width: 20px;
  color: #a7f3d0;
  margin-right: 0.6rem;
  transition: color 0.2s ease;
}

.sidebar-submenu-item:hover, .sidebar-submenu-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.sidebar-submenu-item.active i, .sidebar-submenu-item:hover i {
  color: #34d399;
}

/* Main Content Area */
.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Navbar */
.app-navbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.content-body {
  padding: 1.75rem;
  flex-grow: 1;
}

/* Gradient Stat Cards */
.card-gradient-emerald {
  background: var(--emerald-gradient);
  color: #ffffff;
}

.card-gradient-blue {
  background: var(--blue-gradient);
  color: #ffffff;
}

.card-gradient-purple {
  background: var(--purple-gradient);
  color: #ffffff;
}

.card-gradient-orange {
  background: var(--orange-gradient);
  color: #ffffff;
}

.card-stat {
  border: none;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.12);
}

.card-stat-icon {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  font-size: 3.5rem;
  opacity: 0.2;
}

/* Glassmorphism utility */
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1rem;
}

/* Custom Toast Alert Styling */
.custom-toast-alert {
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
}

/* KTS Card Template Styling (Landscape CR80 Format) */
.kts-card-box.landscape {
  width: 530px;
  height: 330px;
  border-radius: 16px;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  padding: 16px 20px;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.kts-card-box {
  width: 340px;
  height: 520px;
  border-radius: 16px;
  background: linear-gradient(135deg, #064e3b 0%, #047857 60%, #065f46 100%);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  padding: 20px;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.kts-header {
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.kts-photo-box {
  width: 110px;
  height: 140px;
  margin: 0 auto 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.kts-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Certificate and Surat Printable Layouts */
.printable-document {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}

/* Mobile Responsive Drawer */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -270px;
  }
  .app-sidebar.show {
    left: 0;
  }
  .sidebar-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    display: none;
  }
  .sidebar-backdrop.show {
    display: block;
  }
}

/* Print CSS */
@media print {
  body {
    background: #ffffff !important;
  }
  .app-sidebar, .app-navbar, .no-print, .btn, footer {
    display: none !important;
  }
  .app-main, .content-body {
    padding: 0 !important;
    margin: 0 !important;
  }
  .printable-document {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}
