:root {
  --primary: #0b2a4a;
  --accent: #1f6feb;
  --text: #121212;
  --muted: #6b7280;
  --bg: #f5f7fb;
  --sidebar-width: 280px;
}
html,
body {
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
.bg-cover {
  position: absolute;
  inset: 0;
  background: url("img/IMG-20250814-WA0014.jpg") center/cover no-repeat;
  filter: brightness(0.6);
}
.login-card {
  max-width: 520px;
  width: 100%;
  z-index: 2;
  border: 0;
  border-radius: 16px;
  background: #ffffffcc;
  backdrop-filter: blur(6px);
}
.login-card h1 {
  letter-spacing: 1px;
}

/* Sidebar Core */
.sidebar {
  width: var(--sidebar-width);
  min-width: 60px; /* Min width for collapsed icon view */
  max-width: 500px;
  height: 100vh;
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1030;
}
.sidebar-transition {
  transition: width 0.3s ease, margin-left 0.3s ease, left 0.3s ease;
}
.sidebar .logo {
  height: 36px;
  width: auto;
  transition: opacity 0.2s;
}
.sidebar .nav-link {
  color: #cfe4ff;
  border-radius: 10px;
  margin: 0.2rem 0;
  padding: 0.7rem 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateX(4px);
}
.sidebar .nav-link.active {
  background: #113a67;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.sidebar .nav-text {
  margin-left: 0.5rem;
  opacity: 1;
  transition: opacity 0.2s;
}

/* Resizer */
.resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 1031;
  transition: background 0.2s;
}
.resizer:hover,
.resizer.active {
  background: rgba(255, 255, 255, 0.2);
  border-right: 2px solid var(--accent);
}

/* Mobile & Responsive */
@media (max-width: 768px) {
  .login-card {
    width: 383px !important;
  }
  .sidebar {
    position: fixed;
    left: calc(var(--sidebar-width) * -1);
    height: 100%;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
  }
  .sidebar.show {
    left: 0;
  }
  .resizer {
    display: none; /* Disable resize on mobile */
  }
  .sidebar .logo {
    display: block !important;
  }
  .sidebar .nav-text {
    opacity: 1 !important;
    display: inline !important;
  }
  /* Overlay when sidebar is open on mobile */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1029;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
  }
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
}

/* Collapsed State (Desktop) */
.sidebar.collapsed {
  width: 70px !important;
}
.sidebar.collapsed .nav-text,
.sidebar.collapsed .logo,
.sidebar.collapsed .fw-bold {
  opacity: 0;
  display: none;
}
.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 0.7rem 0;
}
.sidebar.collapsed .nav-link:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.1);
}
.sidebar.collapsed .bi {
  margin-right: 0 !important;
  font-size: 1.2rem;
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid #e6e9ef;
}
.content-area {
  min-height: calc(100vh - 64px);
}
.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  filter: brightness(0.9);
}
.hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
}
.hero .caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  color: #fff;
}
.card-materi {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
.subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 992px) {
  .subgrid {
    grid-template-columns: 1fr;
  }
}
.docx-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e6e9ef;
}
.docx-box .title {
  font-weight: 700;
}

/* Enhanced Styles */
.list-group-item {
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 8px;
  border-radius: 8px !important;
}
.list-group-item:hover {
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--accent);
}
.font-monospace {
  font-family: "Traditional Arabic", "Scheherazade", monospace;
  font-size: 1.4em;
  line-height: 1.6;
}
.card {
  border-radius: 12px;
  overflow: hidden;
}
.btn {
  border-radius: 8px;
  font-weight: 500;
}

/* Hover Card for Selection Pages */
.hover-card {
  transition: all 0.3s ease;
  border-width: 2px;
}
.hover-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

