@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@6..144,1..1000&display=swap');
:root {
  --font-main: 'Google Sans Flex', sans-serif;
  --primary: #10b981;             /* Emerald Green */
  --primary-dark: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  
  --secondary: #0f172a;           /* Dark Slate */
  --secondary-light: #1e293b;
  
  --sidebar-bg: #e2dfdf75;          /* Deep Green */
  --sidebar-hover: #4baf7028;
  --sidebar-active: #4baf70;
  --sidebar-width: 260px;
  
  --bg-body: #f8fafc;             /* Very Light Blue/Grey */
  --card-bg: #ffffff;
  --text-main: #0f172a;           /* Dark slate text */
  --text-muted: #64748b;          /* Slate gray text */
  --border-color: #e2e8f0;        /* Cool gray border */
  
  /* Status Colors */
  --color-success: #10b981;
  --color-warning: #ef4444;
  --color-warning: #d97706;
  --color-danger: #ef4444;
  --color-info: #06b6d4;
  
  --transition-speed: 0.25s;
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.02), 0 2px 8px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* Sidebar Navigasi (Desktop) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 9px 18px;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: all var(--transition-speed) ease;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-bottom: 0px;
  padding: 0 8px;
}

.sidebar-header img.logo-icon {
  width: 50px;
  height: 52px;
  object-fit: contain;
}

.sidebar-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #3a3838;
  letter-spacing: -0.5px;
}

.sidebar hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.409);
  margin-bottom: 24px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  color: rgb(0, 0, 0);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all var(--transition-speed) ease;
}

.nav-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(1);
  opacity: 10;
  transition: all var(--transition-speed) ease;
}

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

.nav-link:hover img {
  opacity: 1;
}

.nav-link.active {
  background-color: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.nav-link.active img {
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(0, 0, 0, 0.537);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  width: 100%;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgb(14, 14, 14);
  object-fit: cover;
}

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

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-speed) ease;
  background: transparent;
  text-decoration: none;
}

.logout-btn:hover {
  background-color: var(--sidebar-hover);
}

.logout-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.6;
  filter: brightness(0);
  transition: opacity var(--transition-speed) ease;
}

.logout-btn:hover img {
  opacity: 1;
}

/* Bottom Navigation Bar (Mobile only) */
.bottom-nav {
  display: none;
}

/* Main Content Area */
.main-contentt {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 20px;
  min-height: 100vh;
  box-sizing: border-box;
  transition: all var(--transition-speed) ease;
}

/* Main Content reges */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px;
  min-height: 100vh;
  box-sizing: border-box;
  transition: all var(--transition-speed) ease;
}


/* Header & Title bar */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.title-section h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.title-section p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Cards & Containers */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

/* Stats Grid for Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-value .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-trend {
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: var(--color-success); }
.trend-down { color: var(--color-danger); }
.trend-stable { color: var(--color-warning); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.25px;
}

.badge-success { background-color: var(--primary-light); color: var(--color-success); }
.badge-warning { background-color: #fffbeb; color: var(--color-warning); }
.badge-danger { background-color: #fef2f2; color: var(--color-danger); }
.badge-info { background-color: #ecfeff; color: #0891b2; }

/* Table Elements */
.table-wrapper {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  margin-top: 16px;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 16px 24px;
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1.5px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 14px;
  vertical-align: middle;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tr:hover td {
  background-color: #f8fafc;
}

.gender-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: 14px;
  background-color: #f8fafc;
  color: var(--text-main);
  transition: all var(--transition-speed) ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

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

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--border-radius-sm);
}

/* Simple Styling untuk Login Halaman */
.login-body {
  background: linear-gradient(135deg, rgba(119, 223, 150, 0.614), rgba(255, 255, 255, 0.637)),
  url('../assets/images/lglogin.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: var(--border-radius-lg);
  box-shadow: 10 20px 40px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 450px;
  text-align: center;
  border: 1px solid rgba(0, 255, 0, 0.541);
}

.login-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 16px;
}

.login-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--secondary);
}

.login-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 30px;
}

.input-icon-group {
  position: relative;
  margin-bottom: 20px;
}

.input-icon-group img {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  opacity: 0.5;
}

.input-icon-group .form-control {
  padding-left: 50px;
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.input-icon-group .form-control:focus {
  background-color: #ffffff;
  border-color: var(--primary);
}

/* Notifications card */
.notif-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 6px solid var(--border-color);
  transition: transform var(--transition-speed) ease;
}

.notif-card:hover {
  transform: translateX(4px);
}

.notif-kritis { border-left-color: var(--color-danger); }
.notif-warning { border-left-color: var(--color-warning); }
.notif-info { border-left-color: var(--color-info); }

/* Details Page specific grids */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

@media (max-width: 992px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.info-table tr:last-child td {
  border-bottom: none;
}

.info-table td.label {
  font-weight: 500;
  color: var(--text-muted);
  width: 40%;
}

.info-table td.value {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

/* Charts */
.chart-container {
  height: 320px;
  position: relative;
  width: 100%;
}

/* Search bar on List pages */
.filter-bar {
  background-color: var(--card-bg);
  padding: 16px 24px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-wrapper input {
  padding-left: 44px;
}

.search-input-wrapper::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.6;
}

.filter-select {
  width: auto;
  min-width: 140px;
}

/* Msg Alert Boxes */
.msg-box {
  padding: 16px;
  border-radius: var(--border-radius-md);
  margin-bottom: 24px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  display: none;
}

.msg-success {
  background-color: var(--primary-light);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.2);
}

.msg-error {
  background-color: #fef2f2;
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding: 0 8px;
}

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

.pagination-buttons {
  display: flex;
  gap: 6px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
  transition: all var(--transition-speed) ease;
}

.page-btn:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

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

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .sidebar {
    display: none; /* Hide sidebar on mobile */
  }
  
    .main-content {
    margin-left: 0;
    padding: 20px 16px 80px 16px;
    /* Tambahan baru: */
    min-width: 0; 
    max-width: 100vw;
  }
  
  /* Bottom Nav (Mobile Navigation Bar) */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
  }
  
  .bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 8px;
    font-weight: 500;
    gap: 4px;
    height: 100%;
    flex: 1;
    transition: all var(--transition-speed) ease;
  }
  
  .bottom-nav-link img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.6;
    transition: all var(--transition-speed) ease;
  }
  
  .bottom-nav-link:hover {
    color: var(--primary);
  }
  
  .bottom-nav-link.active {
    color: var(--primary);
    font-weight: 600;
  }
  
  .bottom-nav-link.active img {
    opacity: 1;
    /* Apply color overlay to represent var(--primary) emerald green */
    filter: invert(56%) sepia(85%) saturate(417%) hue-rotate(113deg) brightness(91%) contrast(88%);
  }
  
  .header-bar {
    margin-bottom: 24px;
  }
  
  .title-section h2 {
    font-size: 24px;
  }
  
  .card {
    padding: 18px;
    margin-bottom: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .custom-table th, .custom-table td {
    padding: 12px 14px;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }
  
  .search-input-wrapper {
    width: 100%;
  }
  
  .filter-select {
    width: 100%;
  }

  .filter-group {
  width: 100%;
  justify-content: flex-start;
}
.filter-group label {
  flex: 0 0 95px; /* Mengunci lebar label agar semua baris select sejajar rapi */
}
.filter-select {
  flex: 1;        /* Membiarkan kotak select memanjang mengisi penuh sisa ruang di kanannya */
  width: 100%;
}
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}