/* ==========================================================================
   LMS SMPN 167 — gaya tampilan meniru tema "New Learning" (mb2nl) yang
   dipakai Moodle sekolah: warna aksen #005eb8, header terang, judul halaman
   di pita gelap bergelombang, kartu kursus, daftar topik berlipat.
   Satu berkas, tanpa framework CSS.
   ========================================================================== */

:root {
  --accent1: #005eb8;
  --accent1-dark: #004a91;
  --accent2: #27323a;
  --accent3: #faa307;
  --link: #0083fa;
  --link-h: #00529e;
  --heading: #242027;
  --text: #4a4f55;
  --muted: #7b8691;
  --border: #e3e8ec;
  --bg: #f4f7f8;
  --card: #ffffff;
  --success: #25a18e;
  --danger: #eb455f;
  --warning: #ff7000;
  --info: #005eb8;
  --theader1: #001d62;
  --theader2: #204c96;
  --footer: #041336;
  --radius: 8px;
  --shadow: 0 2px 14px rgba(0, 29, 98, .07);
  --container: 1270px;
  --font: "Roboto Flex", "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-weight: 400; color: var(--text); background: #fff; line-height: 1.6; }
body.bg-soft { background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-h); }
h1, h2, h3, h4, h5, h6 { color: var(--heading); font-weight: 600; line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.3rem; } h4 { font-size: 1.12rem; } h5 { font-size: 1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
small, .small { font-size: .87rem; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.d-flex { display: flex; } .ai-c { align-items: center; } .jc-sb { justify-content: space-between; } .gap { gap: .75rem; } .wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0 } .mb-0 { margin-bottom: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem } .mb-3 { margin-bottom: 1.5rem }
.ml-auto { margin-left: auto; } .text-c { text-align: center; } .text-r { text-align: right; } .nowrap { white-space: nowrap; }

/* ----------------------------------------------------------------- Header */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header .bar { display: flex; align-items: center; height: 70px; gap: 1.5rem; max-width: none; padding: 0 2rem; }
.logo { display: flex; align-items: center; gap: .6rem; color: var(--heading); }
.logo img { height: 48px; width: auto; }
.logo span { font-weight: 800; font-style: italic; font-size: .82rem; line-height: 1.15; letter-spacing: .01em; color: #111; text-transform: uppercase; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.main-nav > a, .main-nav .dd > button { color: var(--heading); font-weight: 700; padding: .55rem .7rem; border-radius: 6px; font-size: 1rem; background: none; border: 0; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: .3rem; }
.main-nav > a:hover, .main-nav > a.active, .main-nav .dd > button:hover { color: var(--accent1); }
.hdr-tools { display: flex; align-items: center; gap: .6rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--heading); font-size: 1.35rem; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--bg); color: var(--accent1); }
.icon-btn.primary { background: var(--accent1); color: #fff; width: 44px; height: 44px; border-radius: 22px; width: auto; padding: 0 1.1rem; font-size: 1.15rem; }
.icon-btn.primary:hover { background: var(--accent1-dark); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--accent1); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: none; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar.sm { width: 28px; height: 28px; font-size: .72rem; }
.menu-toggle { display: none; }

.dd { position: relative; }
.dd-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.1); min-width: 230px; padding: .4rem 0; z-index: 60; }
.dd.open .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem; color: var(--heading); width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--bg); color: var(--accent1); }
.dd-menu .dd-head { padding: .6rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.dd-menu .dd-head b { display: block; color: var(--heading); }
.dd-menu i { font-size: 1.1rem; color: var(--muted); }

/* ------------------------------------------------------- Pita judul (wave) */
.page-header { background: linear-gradient(110deg, var(--theader1), var(--theader2)); color: #fff; position: relative; padding: 2.6rem 0 4.2rem; overflow: hidden; }
.page-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 48px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path fill='%23ffffff' d='M0,40 C240,80 480,0 720,30 C960,60 1200,70 1440,20 L1440,80 L0,80 Z'/></svg>") bottom/100% 100% no-repeat; }
body.bg-soft .page-header::after { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'><path fill='%23f4f7f8' d='M0,40 C240,80 480,0 720,30 C960,60 1200,70 1440,20 L1440,80 L0,80 Z'/></svg>"); }
.page-header::before { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.05); }
.page-header h1 { color: #fff; font-size: 2rem; margin: 0 0 .5rem; font-weight: 600; position: relative; }
.page-header .sub { color: rgba(255,255,255,.8); position: relative; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; font-size: .9rem; position: relative; }
.breadcrumb li { color: rgba(255,255,255,.75); }
.breadcrumb li + li::before { content: "/"; margin-right: .35rem; opacity: .6; }
.breadcrumb a { color: #fff; }
.breadcrumb a:hover { text-decoration: underline; }
.page-header .hdr-actions { position: absolute; right: 20px; top: 50%; transform: translateY(-60%); display: flex; gap: .5rem; }
.page-header .container { position: relative; }

/* ------------------------------------------------------------ Tata letak */
.page { padding: 2rem 0 3.5rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.layout.left { grid-template-columns: 280px minmax(0, 1fr); }
.sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1.25rem; }

/* ---------------------------------------------------------------- Kartu */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.4rem; }
.card-title { font-size: 1.1rem; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }
.block { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.block-title { padding: .85rem 1.2rem; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--heading); font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .5rem; }
.block-body { padding: 1rem 1.2rem; }

/* ---------------------------------------------------------------- Tombol */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .62rem 1.25rem; font: 600 .95rem/1.2 var(--font); border-radius: 6px; border: 1px solid transparent; cursor: pointer; transition: background .15s, color .15s, border-color .15s; text-align: center; white-space: nowrap; }
.btn-primary { background: var(--accent1); color: #fff; }
.btn-primary:hover { background: var(--accent1-dark); color: #fff; }
.btn-secondary { background: #4c6272; color: #fff; }
.btn-secondary:hover { background: #3c4f5c; color: #fff; }
.btn-inverse { background: var(--accent2); color: #fff; }
.btn-light { background: #fff; color: var(--heading); border-color: var(--border); }
.btn-light:hover { border-color: var(--accent1); color: var(--accent1); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d63a52; color: #fff; }
.btn-link { background: none; color: var(--link); padding-left: 0; padding-right: 0; }
.btn-sm { padding: .38rem .8rem; font-size: .85rem; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-google { background: #fff; color: #3c4043; border: 1px solid #dadce0; padding: .8rem 1.4rem; font-weight: 600; }
.btn-google:hover { background: #f8faff; border-color: #c6dafc; color: #3c4043; }
.btn-google svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------- Formulir */
.form-group { margin-bottom: 1.1rem; }
label, .label { display: block; font-weight: 600; color: var(--heading); margin-bottom: .35rem; font-size: .95rem; }
.form-control, input[type=text], input[type=email], input[type=number], input[type=url], input[type=search], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; padding: .6rem .8rem; border: 1px solid #ced6dd; border-radius: 6px; font: 400 .95rem/1.4 var(--font); color: var(--heading); background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.form-control:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent1); box-shadow: 0 0 0 3px rgba(0,94,184,.15); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.help { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.check input { width: 18px; height: 18px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; color: var(--accent1); padding: 0 .4rem; }

/* ---------------------------------------------------------------- Alert */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.2rem; border-left: 4px solid; display: flex; gap: .6rem; align-items: flex-start; }
.alert i { font-size: 1.2rem; line-height: 1.3; }
.alert-success { background: #e6f6f3; border-color: var(--success); color: #19695d; }
.alert-danger { background: #fdecef; border-color: var(--danger); color: #a32035; }
.alert-warning { background: #fff3e8; border-color: var(--warning); color: #9a4300; }
.alert-info { background: #e8f1fb; border-color: var(--info); color: #004a91; }

.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .18rem .55rem; border-radius: 20px; font-size: .76rem; font-weight: 600; background: var(--bg); color: var(--accent2); line-height: 1.4; }
.badge-primary { background: #e1edf9; color: var(--accent1); }
.badge-success { background: #e2f4f1; color: #187a6b; }
.badge-danger { background: #fde7eb; color: #c22a43; }
.badge-warning { background: #fff0e0; color: #b45200; }
.badge-dark { background: var(--accent2); color: #fff; }

/* ---------------------------------------------------------------- Tabel */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; background: #fff; font-size: .93rem; }
.table th, .table td { padding: .7rem .85rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { background: var(--bg); color: var(--heading); font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: #fafcfd; }
.table.generaltable th { width: 35%; background: #f7f9fa; font-weight: 600; color: var(--heading); }
.table .cell-ok { background: #e6f6f3; }
.table .cell-late { background: #fdecef; }
.table.sticky-first td:first-child, .table.sticky-first th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }

/* ---------------------------------------------------------- Kartu kursus */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.course-card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.course-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,29,98,.12); }
.course-card .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--theader1), var(--accent1)); position: relative; display: block; overflow: hidden; }
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-card .thumb .initial { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.9); font-size: 2.4rem; font-weight: 800; letter-spacing: .03em; }
.course-card .thumb .cat { position: absolute; left: 12px; bottom: 12px; background: rgba(255,255,255,.95); color: var(--accent1); font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 4px; }
.course-card .body { padding: 1rem 1.15rem 1.15rem; flex: 1; display: flex; flex-direction: column; }
.course-card h3 { font-size: 1.05rem; margin: 0 0 .35rem; }
.course-card h3 a { color: var(--heading); }
.course-card h3 a:hover { color: var(--accent1); }
.course-card .meta { font-size: .85rem; color: var(--muted); display: flex; gap: .9rem; flex-wrap: wrap; margin-bottom: .8rem; }
.course-card .meta i { margin-right: .2rem; }
.course-card .foot { margin-top: auto; }
.progress { height: 6px; background: #e5ebef; border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--success); border-radius: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.course-card.hidden-course { opacity: .65; }

/* ----------------------------------------------------- Halaman kursus */
.course-section { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.course-section.is-hidden { opacity: .7; border-style: dashed; }
.section-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; cursor: pointer; user-select: none; }
.section-head .num { width: 34px; height: 34px; border-radius: 50%; background: #e1edf9; color: var(--accent1); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-size: .9rem; }
.section-head h3 { margin: 0; font-size: 1.12rem; flex: 1; }
.section-head .chev { font-size: 1.4rem; color: var(--muted); transition: transform .2s; }
.course-section.collapsed .chev { transform: rotate(-90deg); }
.course-section.collapsed .section-body { display: none; }
.section-body { padding: 0 1.25rem 1rem; }
.section-summary { padding: .2rem 0 .8rem; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.section-summary:empty { display: none; }
.activity { display: flex; align-items: center; gap: .9rem; padding: .7rem .4rem; border-bottom: 1px solid #eef2f5; }
.activity:last-child { border-bottom: 0; }
.activity .act-icon { width: 42px; height: 42px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; color: #fff; flex: none; }
.activity .act-main { flex: 1; min-width: 0; }
.activity .act-type { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.activity .act-name { font-weight: 600; color: var(--heading); display: block; }
.activity .act-name:hover { color: var(--accent1); }
.activity .act-dates { font-size: .83rem; color: var(--muted); margin-top: .15rem; }
.activity .act-dates b { color: var(--text); font-weight: 600; }
.activity.is-hidden .act-name { color: var(--muted); }
.activity.label-act { display: block; padding: .6rem .4rem; }
.compl { flex: none; font-size: .78rem; border: 1px solid var(--border); border-radius: 20px; padding: .2rem .65rem; color: var(--muted); display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.compl.done { background: #e2f4f1; border-color: #bfe6df; color: #187a6b; }
.edit-tools { display: flex; gap: .15rem; flex: none; }
.edit-tools a, .edit-tools button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--muted); border: 0; background: none; cursor: pointer; font-size: 1.05rem; }
.edit-tools a:hover, .edit-tools button:hover { background: var(--bg); color: var(--accent1); }
.edit-tools .danger:hover { color: var(--danger); }
.add-activity { margin-top: .6rem; }
.add-activity summary { cursor: pointer; color: var(--accent1); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: .35rem; padding: .4rem 0; }
.add-activity summary::-webkit-details-marker { display: none; }
.add-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; padding: .6rem 0; }
.add-grid a { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .9rem .5rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--heading); font-weight: 600; font-size: .88rem; text-align: center; }
.add-grid a:hover { border-color: var(--accent1); color: var(--accent1); }
.add-grid a i { font-size: 1.6rem; }

.toc { list-style: none; margin: 0; padding: 0; }
.toc li a { display: flex; gap: .5rem; align-items: baseline; padding: .45rem 0; color: var(--text); border-bottom: 1px dashed var(--border); font-size: .93rem; }
.toc li:last-child a { border-bottom: 0; }
.toc li a:hover { color: var(--accent1); }
.toc li a .n { color: var(--accent1); font-weight: 700; min-width: 1.4rem; }
.toc li.sub a { padding-left: 1.4rem; font-size: .88rem; }
.toc li.active a { color: var(--accent1); font-weight: 600; }

.course-hero-progress { background: rgba(255,255,255,.12); border-radius: 30px; padding: .35rem .9rem; display: inline-flex; gap: .6rem; align-items: center; font-size: .88rem; margin-top: .8rem; position: relative; }
.course-hero-progress .progress { width: 140px; background: rgba(255,255,255,.25); }

/* ---------------------------------------------------------- Aktivitas */
.activity-header { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.4rem; }
.activity-header .act-icon { width: 54px; height: 54px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; color: #fff; flex: none; }
.activity-dates { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .9rem; margin-bottom: 1.2rem; padding: .8rem 1rem; background: var(--bg); border-radius: var(--radius); }
.activity-dates b { color: var(--heading); }
.content-box { line-height: 1.75; color: #3a3f44; overflow-wrap: anywhere; }
.content-box img { border-radius: 4px; }
.content-box iframe { max-width: 100%; border: 0; border-radius: 6px; }
.content-box table { border-collapse: collapse; max-width: 100%; }
.content-box table td, .content-box table th { border: 1px solid var(--border); padding: .4rem .6rem; }
.content-box blockquote { border-left: 4px solid var(--accent1); margin: 1rem 0; padding: .5rem 1rem; background: var(--bg); }
.embed-frame { width: 100%; aspect-ratio: 4/3; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.file-list li:last-child { border-bottom: 0; }
.file-list li i { font-size: 1.3rem; color: var(--accent1); }
.file-list li .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropzone { border: 2px dashed #b8c6d1; border-radius: var(--radius); padding: 1.6rem; text-align: center; background: #fafcfd; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent1); background: #eef5fc; }
.dropzone i { font-size: 2.2rem; color: var(--accent1); }
.upload-item { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; font-size: .9rem; }
.upload-item .progress { flex: 1; }
.upload-item .progress > span { background: var(--accent1); transition: width .2s; }

/* ---------------------------------------------------------------- Forum */
.discussion-list .row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 90px; gap: 1rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.discussion-list .row.head { font-weight: 600; color: var(--heading); background: var(--bg); font-size: .9rem; }
.post { display: flex; gap: .9rem; padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-bottom: .9rem; }
.post .post-main { flex: 1; min-width: 0; }
.post .post-head { font-size: .88rem; color: var(--muted); margin-bottom: .5rem; }
.post .post-head b { color: var(--heading); font-size: .95rem; }
.post.reply { margin-left: 2.2rem; background: #fbfcfd; }
.post.first { border-left: 4px solid var(--accent1); }

/* ------------------------------------------------------------- Tab */
.tabs { display: flex; gap: .2rem; border-bottom: 2px solid var(--border); margin-bottom: 1.4rem; overflow-x: auto; }
.tabs a { padding: .7rem 1.1rem; color: var(--text); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active, .tabs a:hover { color: var(--accent1); border-bottom-color: var(--accent1); }

/* -------------------------------------------------------- Dasbor */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: flex; gap: .9rem; align-items: center; box-shadow: var(--shadow); }
.stat i { width: 46px; height: 46px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; background: var(--accent1); flex: none; }
.stat b { display: block; font-size: 1.45rem; color: var(--heading); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .date { flex: none; width: 52px; text-align: center; background: var(--bg); border-radius: 6px; padding: .3rem 0; line-height: 1.15; }
.timeline .date b { display: block; font-size: 1.2rem; color: var(--accent1); }
.timeline .date span { font-size: .72rem; text-transform: uppercase; color: var(--muted); }
.timeline a { font-weight: 600; color: var(--heading); }
.timeline a:hover { color: var(--accent1); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty > i { font-size: 2.6rem; display: block; margin-bottom: .4rem; color: #c2ccd4; }

/* ---------------------------------------------------------------- Kalender */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.cal th { background: var(--bg); padding: .5rem; font-size: .85rem; color: var(--heading); }
.cal td { border: 1px solid var(--border); height: 105px; vertical-align: top; padding: .35rem; font-size: .8rem; }
.cal td.other { background: #fafbfc; color: #b6c0c8; }
.cal td.today { background: #eef5fc; }
.cal td .d { font-weight: 700; color: var(--heading); }
.cal td.today .d { color: #fff; background: var(--accent1); border-radius: 50%; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.cal .ev { display: block; margin-top: .2rem; padding: .1rem .35rem; border-radius: 4px; background: #fde7eb; color: #a32035; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.open { background: #e2f4f1; color: #187a6b; }

/* ---------------------------------------------------------------- Pager */
.pager { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; list-style: none; padding: 0; }
.pager a, .pager span { display: inline-block; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 6px; color: var(--heading); }
.pager .active a, .pager .active span { background: var(--accent1); color: #fff; border-color: var(--accent1); }

/* ---------------------------------------------------------------- Login */
.login-wrap { min-height: calc(100vh - 71px); display: flex; align-items: center; justify-content: center; padding: 3rem 1rem; background: linear-gradient(135deg, #1a237e 0%, #1976d2 100%); position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'><path fill='%23ffffff' fill-opacity='0.1' d='M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,192C1248,192,1344,128,1392,96L1440,64L1440,320L0,320Z'/></svg>") bottom/cover no-repeat; }
.login-box { background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 2.6rem 2.4rem; width: 100%; max-width: 430px; text-align: center; position: relative; }
.login-box img.logo-big { height: 84px; margin-bottom: 1rem; }
.login-box h1 { font-size: 1.5rem; margin-bottom: .3rem; }

/* ---------------------------------------------------------------- Footer */
.site-footer { background: var(--footer); color: rgba(255,255,255,.7); padding: 1.6rem 0; font-size: .88rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.site-footer a { color: rgba(255,255,255,.85); }

.to-top { position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent1); color: #fff; border: 0; font-size: 1.3rem; display: none; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.2); z-index: 40; }
.to-top.show { display: inline-flex; }

/* ---------------------------------------------------------------- Edit mode switch */
.switch { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--heading); cursor: pointer; font-size: .92rem; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 22px; background: #c5d0d8; position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch input:checked { background: var(--success); }
.switch input:checked::after { left: 21px; }

/* ---------------------------------------------------------------- Responsif */
@media (max-width: 1100px) {
  .layout, .layout.left { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .layout.left .sidebar { order: 2; }
}
@media (max-width: 900px) {
  .site-header .bar { padding: 0 1rem; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .main-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: .5rem 1rem 1rem; border-bottom: 1px solid var(--border); box-shadow: 0 10px 20px rgba(0,0,0,.06); }
  .main-nav.open { display: flex; }
  .main-nav > a { padding: .7rem .4rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .page-header { padding: 1.8rem 0 3.4rem; }
  .page-header h1 { font-size: 1.55rem; }
  .page-header .hdr-actions { position: static; transform: none; margin-top: 1rem; }
  .discussion-list .row { grid-template-columns: 1fr; gap: .2rem; }
  .discussion-list .row.head { display: none; }
  .post.reply { margin-left: 1rem; }
  .cal td { height: 70px; }
  .cal .ev { font-size: .68rem; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .logo span { display: none; }
  .activity { flex-wrap: wrap; }
  .activity .act-main { flex: 1 1 calc(100% - 60px); }
  .activity .compl { margin-left: 56px; }
  .login-box { padding: 2rem 1.4rem; }
  .table.generaltable th { width: 42%; }
}
@media print {
  .site-header, .site-footer, .page-header::after, .no-print, .to-top { display: none !important; }
  .page-header { background: none; color: #000; padding: 0 0 1rem; }
  .page-header h1, .breadcrumb a, .breadcrumb li { color: #000; }
}
.edit-tools form, .inline-form { display: inline; margin: 0; }
.matrix td, .matrix th { text-align: center; padding: .45rem .5rem; }
.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 180px; font-weight: 500; font-size: .8rem; vertical-align: bottom; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .ok { color: var(--success); font-size: 1.1rem; }
.matrix .no { color: #d0d7dd; }
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; list-style: none; padding: 0; }
.pagination a, .pagination span { display: inline-block; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 6px; color: var(--heading); background: #fff; }
.pagination .active a, .pagination .active span { background: var(--accent1); color: #fff; border-color: var(--accent1); }
@media (max-width: 560px) {
  .section-head { flex-wrap: wrap; padding: .9rem 1rem; }
  .section-head .edit-tools { order: 3; width: 100%; justify-content: flex-end; }
  .section-body { padding: 0 1rem 1rem; }
  .activity .edit-tools { width: 100%; justify-content: flex-end; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Responsif: teks panjang (nama, email, judul) tidak boleh melebarkan halaman */
h1, h2, h3, h4, h5, .muted, .small, .act-name, .fname, td, .breadcrumb li { overflow-wrap: break-word; word-break: normal; }
.d-flex > *, .stat > div, .activity .act-main, .post .post-main { min-width: 0; }
.table td, .table th { overflow-wrap: normal; }
@media (max-width: 400px) {
  .page-header h1 { font-size: 1.35rem; }
  .btn-lg { padding: .75rem 1.2rem; font-size: 1rem; }
  .avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }
  .card-body { padding: 1.1rem; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .8rem .9rem; }
  .stat i { width: 36px; height: 36px; font-size: 1.1rem; }
  .stat b { font-size: 1.25rem; }
  .stat span { font-size: .78rem; line-height: 1.3; display: block; }
}

/* Perangkat sentuh: target ketuk minimal ±40px */
@media (pointer: coarse) {
  .edit-tools a, .edit-tools button { width: 40px; height: 40px; font-size: 1.15rem; }
  .toc li a { padding: .6rem 0; }
  .dd-menu a, .dd-menu button { padding: .7rem 1rem; }
  .check input { width: 22px; height: 22px; }
}

/* Konten buatan guru (impor Moodle, tempelan Word, dll.) tidak boleh melebarkan halaman di HP */
.content-box table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.content-box pre { max-width: 100%; overflow-x: auto; white-space: pre; }
.content-box img, .content-box video { max-width: 100% !important; height: auto !important; }
.content-box iframe { width: 100%; }
.content-box iframe[src*="youtube"], .content-box iframe[src*="drive.google"], .content-box iframe[src*="docs.google"], .content-box iframe[src*="canva"] { aspect-ratio: 16 / 9; height: auto !important; }
.content-box [style*="width"] { max-width: 100% !important; }
