:root {
  --primary-color: #d4af37;
  --primary-dark: #aa8c2c;
  --bg-main: #0b0f19;
  --sidebar-bg: #131b2e;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #d4af37;
  --sidebar-active-bg: #1e293b;
  --border-color: rgba(212, 175, 55, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  font-family: system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main) !important;
  color: var(--text-main) !important;
  overflow: hidden;
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-main) !important;
}

.app-sidebar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background-color: var(--sidebar-bg);
  color: white;
  display: flex;
  flex-direction: row;
  align-items: center;
  z-index: 1000;
  box-sizing: border-box;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 6px rgba(0,0,0,0.3);
}

.sidebar-brand {
  display: none;
}

.sidebar-badge {
  font-size: 9px;
  background: var(--sidebar-active);
  color: #0b0f19;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.sidebar-nav {
  display: flex;
  flex-direction: row;
  height: 100%;
  align-items: center;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 4px;
  gap: 2px;
  box-sizing: border-box;
}
.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 64px;
  flex-shrink: 0;
  font-size: 9px;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: background 0.2s;
}

.nav-link span:first-child {
  font-size: 15px;
  margin-bottom: 2px;
}

.nav-link.active {
  color: var(--sidebar-active);
  font-weight: 600;
  background-color: var(--sidebar-active-bg);
}

.sidebar-footer {
  display: none;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  height: 100%;
  padding-bottom: 70px;
  background-color: var(--bg-main) !important;
}

.app-topbar {
  background: var(--sidebar-bg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.topbar-title {
  font-size: 16px;
  color: var(--text-main);
  margin: 0;
  font-weight: 600;
}

.topbar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: rgba(212, 175, 55, 0.1);
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
}

.app-content-outlet {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: var(--bg-main) !important;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Memaksa SEMUA kartu, kontainer, dan kotak putih inline agar menjadi gelap elegan */
.card, 
div[class*="card"], 
.app-content-outlet div[style*="background: white"],
.app-content-outlet div[style*="background:#fff"],
.app-content-outlet div[style*="background: #fff"],
.app-content-outlet div[style*="background: #ffffff"],
.app-content-outlet div[style*="background:white"] {
  background-color: var(--sidebar-bg) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
}

/* Memperjelas SELURUH teks, paragraf, label, dan keterangan di dalam kartu agar sangat terang */
.card p, .card span, .card label, .card small,
.app-content-outlet span, .app-content-outlet p, .app-content-outlet div {
  color: #f8fafc !important;
}

.card small, .app-content-outlet small, .topbar-subtitle {
  color: #94a3b8 !important;
}

.card h2, .card h1, .card h3 {
  color: #f8fafc !important;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main) !important;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 13px;
  background-color: #1e293b !important;
  color: #f8fafc !important;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.btn-primary {
  background-color: var(--primary-color);
  color: #0b0f19;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  transition: background 0.2s;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: #ffffff;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-weight: bold;
  text-align: left;
}

/* ==========================================
   RESPONSIF DESKTOP / LAYAR LEBAR (>= 768px)
   ========================================== */
@media (min-width: 768px) {
  .app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 100vh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .app-sidebar {
    position: relative;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-top: none;
    border-right: 1px solid var(--border-color);
  }

  .app-main {
    grid-column: 2;
    grid-row: 1;
    height: 100vh;
    height: 100dvh;
    padding-bottom: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .sidebar-brand {
    display: flex;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    color: var(--sidebar-active);
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .sidebar-footer {
    display: block;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
    flex-shrink: 0;
  }

  .sidebar-nav {
    flex-direction: column;
    height: auto;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px 12px;
    flex: unset;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-link {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 14px;
    height: auto;
    font-size: 13px;
    min-width: auto;
    flex-shrink: unset;
    white-space: normal;
    border-radius: 6px;
  }

  .nav-link span:first-child {
    font-size: 16px;
    width: 20px;
    text-align: center;
    margin-bottom: 0;
  }

  .app-topbar {
    padding: 16px 32px;
  }

  .app-content-outlet {
    padding: 32px;
  }

  .card, div[class*="card"] {
    padding: 24px;
  }

  #btn-logout-mobile {
    display: none !important;
  }
}
