/* ============================================================
   Skillbits LMS ERP — App Stylesheet v1.2
   Full-width layout, responsive sidebar
   ============================================================ */

:root {
  --sb-sidebar-w:    260px;
  --sb-sidebar-bg:   #1a1d2e;
  --sb-topbar-h:     58px;
  --sb-topbar-bg:    #1a1d2e;
  --sb-accent:       #6c63ff;
  --sb-accent-dark:  #574fd6;
  --sb-success:      #28c76f;
  --sb-warning:      #ff9f43;
  --sb-danger:       #ea5455;
  --sb-info:         #00cfe8;
  --sb-muted:        #8a8da0;
  --sb-shadow:       0 4px 24px rgba(0,0,0,.08);
  --sb-bg:           #f4f5fa;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--sb-bg);
  color: #344050;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT — Sidebar + Main
   ══════════════════════════════════════════════════════════════ */

/* Full-page wrapper */
.sb-body {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sb-sidebar {
  width: var(--sb-sidebar-w);
  flex-shrink: 0;
  background: var(--sb-sidebar-bg);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

/* Collapsed (desktop toggle) */
.sb-sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sb-sidebar-w)));
}

/* Brand area */
.sb-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sb-brand-icon {
  width: 38px; height: 38px;
  background: var(--sb-accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; color: #fff;
  flex-shrink: 0;
}
.sb-brand-text .name {
  font-weight: 700; font-size: .9rem;
  color: #fff; line-height: 1.2;
}
.sb-brand-text .sub {
  font-size: .68rem; color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: .05em;
}

/* User panel in sidebar */
.sb-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sb-user .name  { font-size: .825rem; font-weight: 600; color: #fff; }
.sb-user .role  { font-size: .68rem; color: rgba(255,255,255,.45); text-transform: capitalize; }

/* Avatar */
.sb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--sb-accent);
  color: #fff;
  font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-avatar-sm { width: 30px; height: 30px; font-size: .75rem; }

/* Nav scroll area */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .5rem .6rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.sb-nav .nav-section {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.3);
  padding: .9rem .6rem .3rem;
  font-weight: 700;
}

.sb-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: rgba(255,255,255,.6);
  border-radius: 8px;
  padding: .55rem .75rem;
  margin-bottom: 1px;
  font-size: .855rem;
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.sb-nav .nav-link i { font-size: .95rem; min-width: 1rem; flex-shrink: 0; }
.sb-nav .nav-link:hover  { background: rgba(255,255,255,.08); color: #fff; }
.sb-nav .nav-link.active { background: var(--sb-accent); color: #fff; font-weight: 600; }

/* Sidebar footer */
.sb-footer {
  padding: .85rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

/* ── Main wrapper ─────────────────────────────────────────── */
.sb-main {
  flex: 1;
  min-width: 0;           /* prevent flex blowout */
  margin-left: var(--sb-sidebar-w);
  display: flex;
  flex-direction: column;
  transition: margin-left .25s cubic-bezier(.4,0,.2,1);
}
.sb-main.sidebar-collapsed { margin-left: 0; }

/* ── Topbar ───────────────────────────────────────────────── */
.sb-topbar {
  height: var(--sb-topbar-h);
  min-height: var(--sb-topbar-h);
  background: var(--sb-topbar-bg);
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  position: sticky; top: 0;
  z-index: 1030;
  flex-shrink: 0;
}
.sb-topbar .breadcrumb { margin: 0; flex: 1; min-width: 0; }
.sb-topbar .breadcrumb-item { font-size: .825rem; }
.sb-topbar .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.3); }
.sb-topbar .breadcrumb-item a { color: rgba(255,255,255,.55); text-decoration: none; }
.sb-topbar .breadcrumb-item.active { color: rgba(255,255,255,.9); }
.sb-topbar .btn-link { color: rgba(255,255,255,.8); text-decoration: none; }
.sb-topbar .btn-link:hover { color: #fff; }

/* ── Page content ─────────────────────────────────────────── */
.sb-content {
  flex: 1;
  padding: 1.5rem 1.75rem;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════════ */

/* ── Cards ────────────────────────────────────────────────── */
.card {
  border: 0;
  border-radius: 12px;
  box-shadow: var(--sb-shadow);
  width: 100%;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f1f5;
  border-radius: 12px 12px 0 0 !important;
  padding: .9rem 1.25rem;
}
.card-body { padding: 1.25rem; }

/* Stat cards */
.stat-card {
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .9rem;
  box-shadow: var(--sb-shadow);
  width: 100%;
}
.stat-card .stat-icon {
  width: 50px; height: 50px;
  border-radius: 10px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-card .stat-value  { font-size: 1.65rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label  { font-size: .77rem; opacity: .8; margin-top: .2rem; }
.stat-card .stat-change { font-size: .72rem; opacity: .7; margin-top: .15rem; }

/* ── Tables ───────────────────────────────────────────────── */
.table {
  width: 100%;
  margin-bottom: 0;
}
.table thead th {
  background: #f8f9fc;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6e7d9a;
  font-weight: 700;
  border-bottom: 2px solid #e9ecef;
  padding: .75rem 1rem;
  white-space: nowrap;
}
.table td {
  vertical-align: middle;
  font-size: .855rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid #f0f1f5;
}
.table-hover tbody tr:hover { background: #f8f9fc; }
.table tbody tr:last-child td { border-bottom: 0; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { font-weight: 500; letter-spacing: .02em; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-accent          { background: var(--sb-accent); color: #fff; border: 0; }
.btn-accent:hover    { background: var(--sb-accent-dark); color: #fff; }
.btn-accent:disabled { background: #adb5bd; color: #fff; }

/* ── Form elements ────────────────────────────────────────── */
.form-label  { font-size: .845rem; font-weight: 500; color: #495057; margin-bottom: .35rem; }
.form-control,
.form-select {
  font-size: .875rem;
  border-color: #dee2e6;
  border-radius: 8px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--sb-accent);
  box-shadow: 0 0 0 .2rem rgba(108,99,255,.15);
}
.required::after { content: ' *'; color: var(--sb-danger); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { border: 0; border-radius: 8px; }

/* ── Pagination ───────────────────────────────────────────── */
.page-link { border-radius: 6px !important; margin: 0 2px; font-size: .825rem; }
.page-item.active .page-link { background: var(--sb-accent); border-color: var(--sb-accent); }

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE — Full width, split layout
   ══════════════════════════════════════════════════════════════ */

body.login-page {
  margin: 0;
  padding: 0;
  background: var(--sb-bg);
  min-height: 100vh;
  display: flex;
}

.login-outer {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left panel — branding */
.login-left {
  flex: 1;
  background: linear-gradient(145deg, #1a1d2e 0%, #2d2b55 60%, #1a1d2e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(108,99,255,.12);
  top: -100px; right: -100px;
}
.login-left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(108,99,255,.08);
  bottom: -80px; left: -80px;
}
.login-left-inner { position: relative; z-index: 1; max-width: 420px; text-align: center; }
.login-brand-icon {
  width: 80px; height: 80px;
  background: var(--sb-accent);
  border-radius: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: #fff;
  margin-bottom: 1.5rem;
  box-shadow: 0 12px 40px rgba(108,99,255,.4);
}
.login-brand-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .5rem;
}
.login-brand-tag {
  font-size: .95rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 3rem;
}
.login-features { text-align: left; }
.login-feature-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .7rem 0;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.login-feature-item:last-child { border: 0; }
.login-feature-item i {
  width: 36px; height: 36px;
  background: rgba(108,99,255,.25);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: #a99cff;
  flex-shrink: 0;
}

/* Right panel — form */
.login-right {
  width: 480px;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 3.5rem;
  box-shadow: -8px 0 40px rgba(0,0,0,.08);
}
.login-right-inner { width: 100%; max-width: 380px; }

.login-form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1d2e;
  margin-bottom: .35rem;
}
.login-form-sub {
  font-size: .875rem;
  color: #6c757d;
  margin-bottom: 1.75rem;
}

/* Tab switcher */
.login-tabs {
  display: flex;
  background: #f4f5fa;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.5rem;
}
.login-tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: #6c757d;
  border-radius: 7px;
  padding: .55rem .5rem;
  font-size: .845rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.login-tab-btn.active {
  background: var(--sb-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,99,255,.35);
}

/* OTP digit boxes */
.otp-digit {
  width: 48px !important;
  height: 52px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 8px;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE OVERLAY
   ══════════════════════════════════════════════════════════════ */
.sb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1039;
  backdrop-filter: blur(2px);
}
.sb-overlay.show { display: block; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  /* Sidebar hidden off-screen on tablet/mobile */
  .sb-sidebar {
    transform: translateX(calc(-1 * var(--sb-sidebar-w)));
  }
  .sb-sidebar.show {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .sb-main {
    margin-left: 0 !important;
  }
  .sb-content {
    padding: 1rem;
  }

  /* Login — stack on mobile */
  .login-left  { display: none; }
  .login-right { width: 100%; padding: 2rem 1.5rem; box-shadow: none; }
  .login-right-inner { max-width: 100%; }
}

@media (max-width: 576px) {
  .stat-card { padding: .9rem 1rem; }
  .stat-card .stat-value { font-size: 1.35rem; }
  .stat-card .stat-icon  { width: 40px; height: 40px; font-size: 1.15rem; }
}

/* ══════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════ */
.text-accent { color: var(--sb-accent) !important; }
.bg-accent   { background: var(--sb-accent) !important; }
.cursor-pointer { cursor: pointer; }
.fs-7 { font-size: .8rem; }
.min-w-0 { min-width: 0; }
.gap-1 { gap: .25rem; }
