/* ------------------------------------------------------------------
   LMS – application styles
   Uses CSS variables so light/dark themes are a one-line switch.
   ------------------------------------------------------------------ */

:root {
  --lms-primary:     #4f46e5;
  --lms-primary-rgb: 79,70,229;
  --lms-secondary:   #0ea5e9;
  --lms-sidebar-w:   260px;
  --lms-navbar-h:    60px;
  --lms-radius:      12px;
  --lms-bg:          #f4f6fb;
  --lms-surface:     #ffffff;
  --lms-border:      #e5e7eb;
  --lms-text:        #1f2937;
  --lms-muted:       #6b7280;
}

[data-bs-theme="dark"] {
  --lms-bg:      #0f172a;
  --lms-surface: #1e293b;
  --lms-border:  #334155;
  --lms-text:    #e2e8f0;
  --lms-muted:   #94a3b8;
}

* { box-sizing: border-box; }

body.app-body {
  margin: 0;
  background: var(--lms-bg);
  color: var(--lms-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

/* ---------- Wrapper ---------- */
.app-wrapper { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: var(--lms-sidebar-w);
  background: var(--lms-surface);
  border-right: 1px solid var(--lms-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  height: var(--lms-navbar-h);
  border-bottom: 1px solid var(--lms-border);
  color: var(--lms-primary);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .5rem; }
.sidebar-nav .nav-link {
  color: var(--lms-text);
  border-radius: var(--lms-radius);
  padding: .55rem .8rem;
  display: flex; align-items: center; gap: .6rem;
  font-size: .92rem;
}
.sidebar-nav .nav-link:hover { background: rgba(var(--lms-primary-rgb), .08); color: var(--lms-primary); }
.sidebar-nav .nav-link.active { background: var(--lms-primary); color: #fff; }
.sidebar-nav .nav-section {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--lms-muted); padding: 1rem .8rem .25rem;
}
.sidebar-footer { padding: .75rem 1rem; border-top: 1px solid var(--lms-border); }

/* ---------- Main ---------- */
.app-main {
  flex: 1;
  margin-left: var(--lms-sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-navbar {
  height: var(--lms-navbar-h);
  background: var(--lms-surface);
  border-bottom: 1px solid var(--lms-border);
  padding: 0 1rem;
  position: sticky; top: 0; z-index: 1030;
}
.navbar-title { font-weight: 600; font-size: 1.05rem; }
.nav-icon-btn { color: var(--lms-text); text-decoration: none; font-size: 1.15rem; }
.nav-icon-btn:hover { color: var(--lms-primary); }
.nav-user-btn { color: var(--lms-text); text-decoration: none; font-weight: 500; }

.app-breadcrumb {
  padding: .6rem 1.25rem;
  background: transparent;
  font-size: .85rem;
}
.app-breadcrumb .breadcrumb-item a { color: var(--lms-muted); text-decoration: none; }
.app-breadcrumb .breadcrumb-item a:hover { color: var(--lms-primary); }

.app-content { flex: 1; padding: 1rem 1.25rem 2rem; }

.app-footer {
  display: flex; align-items: center;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--lms-border);
  background: var(--lms-surface);
  font-size: .8rem; color: var(--lms-muted);
}

/* ---------- Cards / stat tiles ---------- */
.card { border: 1px solid var(--lms-border); border-radius: var(--lms-radius); background: var(--lms-surface); color: var(--lms-text); }
.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.4rem;
  background: rgba(var(--lms-primary-rgb), .12); color: var(--lms-primary);
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: var(--lms-muted); font-size: .82rem; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
}