/* BOBOK Guru LMS - app.css
   One design pattern everywhere: BOBOK deep blue / primary blue / accent yellow, Inter, cards with depth. */
:root {
  --bg: #F3F5FB; --card: #FFFFFF; --ink: #1B1F3B; --muted: #6B7194; --line: #E6E9F4; --soft: #EEF1F8;
  --deep: #1A2980; --primary: #2B4DC9; --light: #5B8DEF; --yellow: #F5A623;
  --green: #13865B; --green-bg: #E6F7F1; --amber: #C77700; --amber-bg: #FFF4DF; --red: #C62828; --red-bg: #FDEAEA; --purple: #6D3BC6; --purple-bg: #F1EAFB;
  --blue-bg: #E8EDFB;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(26,41,128,.08), 0 1px 2px rgba(26,41,128,.06);
  --shadow-lg: 0 18px 44px rgba(26,41,128,.14);
  --side-w: 76px; --side-w-open: 248px; --top-h: 72px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; }
a { color: var(--primary); text-decoration: none; } a:hover { color: var(--deep); }
h1,h2,h3,h4 { letter-spacing: -.02em; font-weight: 800; }
.muted { color: var(--muted); }
.fw-800 { font-weight: 800; } .fw-700 { font-weight: 700; } .fw-600 { font-weight: 600; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-15 { font-size: 15px; }

/* ---------- layout ---------- */
.lms-shell { display: flex; min-height: 100vh; }
.lms-side { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 1030; display: flex; flex-direction: column; align-items: stretch; padding: 18px 14px; gap: 6px;
  background: linear-gradient(180deg, #1A2980 0%, #121B5C 100%); box-shadow: 6px 0 28px rgba(18,27,92,.28); transition: width .18s ease; overflow: hidden; }
.lms-side:hover { width: var(--side-w-open); }
.lms-side .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 0 3px; }
.lms-side .logo { width: 44px; height: 44px; flex-shrink: 0; object-fit: contain; display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.lms-side .brand-text { color: #fff; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.lms-side .brand-text b { display: block; font-size: 15px; } .lms-side .brand-text span { font-size: 11px; opacity: .75; }
.lms-side:hover .brand-text { opacity: 1; }
.lms-side .nav-item { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 13px; border-radius: 14px; color: rgba(255,255,255,.62); white-space: nowrap; font-weight: 600; font-size: 14px; }
.lms-side .nav-item i { font-size: 21px; flex-shrink: 0; width: 22px; text-align: center; }
.lms-side .nav-item span { opacity: 0; transition: opacity .15s; }
.lms-side:hover .nav-item span { opacity: 1; }
.lms-side .nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.lms-side .nav-item.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 6px 14px rgba(0,0,0,.18); }
.lms-side .nav-item .badge-count { margin-left: auto; background: var(--yellow); color: var(--deep); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 7px; }
.lms-side .spacer { flex: 1; }
.lms-main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.lms-top { height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.lms-top .crumbs { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.lms-top .crumbs b { color: var(--ink); }
.lms-top .search { flex: 1; max-width: 440px; height: 42px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--muted); font-size: 14px; }
.lms-top .search input { border: 0; background: transparent; outline: 0; flex: 1; font: inherit; color: var(--ink); }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; color: #3B4270; border: 0; position: relative; font-size: 19px; }
.iconbtn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px #fff; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--light)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; box-shadow: 0 6px 14px rgba(43,77,201,.35); flex-shrink: 0; }
.avatar.gold { background: linear-gradient(135deg, #F5A623, #F7C25E); color: var(--deep); }
.avatar.deep { background: linear-gradient(135deg, var(--deep), var(--primary)); }
.lms-content { padding: 26px 32px 40px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; } .page-head p { margin: 6px 0 0; color: var(--muted); }

/* ---------- cards ---------- */
.card-x { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-x.hero { background: linear-gradient(120deg, #1A2980 0%, #2B4DC9 60%, #3D63E0 100%); color: #fff; position: relative; overflow: hidden; }
.card-x.hero .orb { position: absolute; border-radius: 50%; pointer-events: none; }
.kpi { height: 100%; background: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(26,41,128,.07); padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.kpi .kico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.kpi .kval { font-size: 22px; font-weight: 800; line-height: 1; } .kpi .klbl { color: var(--muted); font-size: 12px; margin-top: 4px; }
.bg-blue { background: var(--blue-bg); color: var(--primary); } .bg-amber { background: var(--amber-bg); color: var(--amber); }
.bg-green { background: var(--green-bg); color: var(--green); } .bg-purple { background: var(--purple-bg); color: var(--purple); }
.bg-red { background: var(--red-bg); color: var(--red); } .bg-soft { background: var(--bg); color: var(--muted); }

/* ---------- pills, buttons, bars ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1; }
.pill .dot-s { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.btn-x { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 700; font-size: 14px; border: 0; font-family: inherit; cursor: pointer; transition: transform .08s, box-shadow .15s, opacity .15s; white-space: nowrap; }
.btn-x:active { transform: translateY(1px); } .btn-x:disabled { opacity: .65; cursor: not-allowed; }
.btn-x.sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-y { background: var(--yellow); color: var(--deep); box-shadow: 0 8px 20px rgba(245,166,35,.38); }
.btn-b { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(43,77,201,.3); }
.btn-d { background: var(--deep); color: #fff; box-shadow: 0 8px 20px rgba(26,41,128,.3); }
.btn-g { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(19,134,91,.3); }
.btn-soft { background: var(--bg); color: #3B4270; } .btn-soft:hover { background: var(--soft); }
.btn-light { background: var(--blue-bg); color: var(--primary); }
.btn-danger-soft { background: var(--red-bg); color: var(--red); }
.btn-x .spin { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-x.loading .spin { display: inline-block; } .btn-x.loading .lbl { opacity: .8; }
.btn-x .lbl { display: inline; margin: 0; font-size: inherit; color: inherit; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 8px; border-radius: 999px; background: #E9EDFA; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--light)); transition: width .4s ease; }
.bar > i.green { background: var(--green); }

/* ---------- forms ---------- */
.lbl { font-size: 12px; font-weight: 700; color: #3B4270; display: block; margin-bottom: 6px; }
.inp, .sel, .ta { height: 44px; border-radius: 11px; border: 1.5px solid #E1E5F2; background: #fff; padding: 0 14px; font-size: 14px; font-family: inherit; color: var(--ink); width: 100%; outline: 0; transition: border-color .15s, box-shadow .15s; }
.ta { height: auto; padding: 10px 14px; resize: vertical; min-height: 90px; }
.inp:focus, .sel:focus, .ta:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,77,201,.12); }
.inp.is-invalid { border-color: var(--red); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field-err { font-size: 12px; color: var(--red); margin-top: 6px; display: none; }
.sw { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #D5DBEE; transition: background .15s; cursor: pointer; flex-shrink: 0; display: inline-block; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw.on { background: var(--primary); } .sw.on::after { left: 21px; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 9px 0; border-top: 1px solid var(--soft); gap: 12px; }
.setting-row:first-child { border-top: 0; }
.panel { padding: 16px; border-radius: 14px; background: #F8FAFF; border: 1.5px solid var(--line); }
.panel.amber { background: #FFF9EE; border-color: #F5E1B8; } .panel.amber .setting-row { border-color: #F5E1B8; }
.panel-title { font-size: 13px; font-weight: 800; margin-bottom: 8px; }

/* ---------- tables ---------- */
.table-x { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-x th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--soft); white-space: nowrap; }
.table-x td { padding: 12px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.table-x tr:hover td { background: #FAFBFE; }
.table-wrap { overflow-x: auto; }

/* ---------- tabs ---------- */
.tabs-x { display: flex; gap: 20px; border-bottom: 1px solid var(--soft); padding: 0 4px; overflow-x: auto; }
.tabs-x .tab { padding: 12px 2px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; }
.tabs-x .tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane-x { display: none; } .tab-pane-x.active { display: block; }

/* ---------- tree (course builder) ---------- */
.tree .tn { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; font-size: 13px; cursor: pointer; color: var(--ink); user-select: none; }
.tree .tn:hover { background: var(--bg); }
.tree .tn.on { background: var(--blue-bg); color: var(--deep); font-weight: 700; }
.tree .tn .tag { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; }
.tree .tn.locked { color: var(--amber); }
.tree .tn .code { font-size: 11px; font-weight: 800; color: var(--muted); width: 30px; flex-shrink: 0; }
.tree .tn.on .code { color: var(--primary); }
.tree .tn .st { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #D5DBEE; }
.tree .tn .st.ok { background: var(--green); } .tree .tn .st.warn { background: var(--yellow); }
.tree .grp { margin-left: 18px; border-left: 1.5px dashed var(--line); padding-left: 6px; }
.beat-box { padding: 10px 12px; border-radius: 11px; border: 1.5px solid #E1E5F2; }
.beat-box.on { border-color: var(--primary); background: #F8FAFF; }
.beat-box .bt { font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.beat-box input { width: 100%; border: 0; border-bottom: 1px dashed #D5DBEE; font: inherit; font-weight: 700; font-size: 13px; padding: 2px 0; outline: 0; background: transparent; margin-top: 2px; }
.tagwrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tagwrap .tg { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-bg); color: var(--primary); font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 999px; }
.tagwrap .tg b { cursor: pointer; opacity: .7; } .tagwrap .tg b:hover { opacity: 1; }
.tagwrap .tg-add { background: var(--bg); color: var(--muted); border: 1.5px dashed #D5DBEE; }
.tagwrap .tg-add input { border: 0; background: transparent; outline: 0; font: inherit; width: 90px; }

/* ---------- modal (custom, premium) ---------- */
.modal-x .modal-content { border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-x .modal-header { border-bottom: 1px solid var(--soft); padding: 20px 24px 14px; }
.modal-x .modal-title { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.modal-x .modal-body { padding: 20px 24px; } .modal-x .modal-footer { border-top: 1px solid var(--soft); padding: 14px 24px 20px; gap: 10px; }
.modal-x .modal-backdrop { background: rgba(26,41,128,.45); }

/* ---------- toasts / alerts ---------- */
.toast-x { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast-x .t { background: #1B1F3B; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.25); display: flex; align-items: center; gap: 10px; animation: pop .18s ease; max-width: 380px; }
.toast-x .t.ok { background: var(--green); } .toast-x .t.err { background: var(--red); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty i { font-size: 40px; color: #C9D0E6; display: block; margin-bottom: 10px; }

/* ---------- swal theme ---------- */
.swal2-popup { border-radius: 20px !important; font-family: inherit !important; padding: 28px !important; }
.swal2-title { font-weight: 800 !important; letter-spacing: -.01em !important; font-size: 20px !important; color: var(--ink) !important; }
.swal2-html-container { color: var(--muted) !important; font-size: 14px !important; }
.swal2-styled.swal2-confirm { background: var(--primary) !important; border-radius: 12px !important; font-weight: 700 !important; box-shadow: 0 8px 20px rgba(43,77,201,.3) !important; }
.swal2-styled.swal2-cancel { background: var(--bg) !important; color: #3B4270 !important; border-radius: 12px !important; font-weight: 700 !important; }
.swal2-styled.swal2-confirm.danger { background: var(--red) !important; box-shadow: 0 8px 20px rgba(198,40,40,.3) !important; }

/* ---------- responsive ---------- */
@media (max-width: 1199.98px) {
  .lms-content { padding: 20px 22px 36px; } .lms-top { padding: 0 22px; }
}
@media (max-width: 991.98px) {
  :root { --side-w: 0px; }
  .lms-side { transform: translateX(-100%); width: var(--side-w-open); transition: transform .2s ease; }
  .lms-side.open { transform: none; } .lms-side .nav-item span, .lms-side .brand-text { opacity: 1; }
  .lms-side-backdrop { position: fixed; inset: 0; background: rgba(26,41,128,.45); z-index: 1029; display: none; }
  .lms-side-backdrop.show { display: block; }
  .lms-main { margin-left: 0; }
  .lms-top .search { display: none; }
  .menu-btn { display: grid !important; }
  .page-head h1 { font-size: 22px; }
}
.menu-btn { display: none; }
@media (max-width: 575.98px) {
  .lms-content { padding: 16px 16px 32px; } .lms-top { padding: 0 16px; height: 64px; }
  .card-x { padding: 16px; border-radius: 16px; }
  .btn-x { height: 42px; }
}
