/* ── MEDICERTA LMS — Design System ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f0eb;
  --white: #ffffff;
  --acc: #d0866c;
  --acc-h: #c07560;
  --acc-lt: #fdf6f3;
  --ink: #1c1917;
  --mid: #78716c;
  --lt: #a8a29e;
  --bd: #e8e0d8;
  --bd2: #d4c9be;
  --gr: #16a34a;
  --gr-lt: #f0fdf4;
  --am: #d97706;
  --am-lt: #fffbeb;
  --rd: #ef4444;
  --rd-lt: #fef2f2;
  --bl: #2563eb;
  --bl-lt: #eff6ff;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; height: 100vh; overflow: hidden; background: var(--white); }

/* ── SIDEBAR ── */
.sb {
  width: 220px; flex-shrink: 0;
  background: var(--white);
  display: flex; flex-direction: column;
  padding: 28px 0 20px;
  position: relative;
  z-index: 2;
}

.sb-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px; margin-bottom: 40px;
}
.sb-logo-icon { width: 28px; height: 28px; flex-shrink: 0; }
.sb-logo-name { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -.4px; }

.sb-nav {
  flex: 1; overflow-y: auto;
  padding: 0 12px 0 0;
  display: flex; flex-direction: column; gap: 2px;
}
.sb-nav::-webkit-scrollbar { display: none; }

.ni {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 24px;
  border-radius: 0 12px 12px 0;
  font-size: 13px; font-weight: 500; color: var(--mid);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
  transition: all .15s;
  text-decoration: none;
}
.ni:hover { background: var(--bg); color: var(--ink); }
.ni.on { background: var(--bg); color: var(--acc); font-weight: 600; }

.ni-ico {
  width: 24px; height: 24px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  background: #f0e8e4; color: var(--acc);
  transition: all .15s;
}
.ni.on .ni-ico { background: var(--acc); color: #fff; }
.ni:hover:not(.on) .ni-ico { background: var(--bd); color: var(--ink); }
.ni-lbl { flex: 1; }
.ni-badge { font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 20px; background: var(--acc); color: #fff; }
.ni-badge.red { background: var(--rd); }

.sb-foot { padding: 0 0 0 24px; margin-top: auto; }
.sb-support {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: var(--lt);
  cursor: pointer; padding: 8px 0;
  text-decoration: none;
}
.sb-support:hover { color: var(--mid); }

/* ── MAIN ── */
.main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg);
  border-radius: 24px 0 0 24px;
}

/* ── TOPBAR ── */
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 32px 36px 0; flex-shrink: 0;
}
.tb-title { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }
.tb-sub { font-size: 13px; color: var(--lt); margin-top: 3px; }
.tb-right { display: flex; align-items: center; gap: 10px; margin-top: 6px; }

/* ── CONTENT ── */
.content { flex: 1; overflow-y: auto; padding: 24px 36px 32px; }
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 2px; }

/* ── CARDS ── */
.card { background: var(--white); border-radius: 16px; padding: 24px; margin-bottom: 14px; }
.card:last-child { margin-bottom: 0; }
.card-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 18px; }
.panel { background: var(--white); border-radius: 16px; padding: 20px; margin-bottom: 14px; }
.panel-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 10px; padding: 8px 14px;
  font: 500 13px/1 'Inter'; cursor: pointer; border: none;
  transition: all .15s; white-space: nowrap; text-decoration: none;
}
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-acc { background: var(--acc); color: #fff; box-shadow: 0 3px 10px rgba(208,134,108,.25); }
.btn-acc:hover { background: var(--acc-h); }
.btn-ol { background: var(--white); color: var(--ink); border: 1px solid var(--bd); }
.btn-ol:hover { border-color: var(--acc); color: var(--acc); }
.btn-ghost { background: none; color: var(--lt); border: none; padding: 6px 8px; border-radius: 7px; }
.btn-ghost:hover { color: var(--ink); background: var(--bg); }
.btn-save {
  display: flex; align-items: center; gap: 7px;
  background: var(--white); border: 1px solid var(--bd2);
  border-radius: 10px; padding: 9px 16px;
  font: 500 13px/1 'Inter'; color: var(--ink); cursor: pointer; transition: all .15s;
}
.btn-save:hover { border-color: var(--acc); color: var(--acc); }
.btn-pub {
  display: flex; align-items: center; gap: 7px;
  background: var(--acc); border: none; border-radius: 10px; padding: 9px 18px;
  font: 600 13px/1 'Inter'; color: #fff; cursor: pointer; transition: all .15s;
  box-shadow: 0 3px 10px rgba(208,134,108,.3);
}
.btn-pub:hover { background: var(--acc-h); }

/* ── FORMS ── */
.field { margin-bottom: 14px; }
.field-label { font-size: 10px; font-weight: 700; color: var(--lt); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 7px; }
.inp {
  width: 100%; border: 1px solid var(--bd); border-radius: 10px;
  padding: 10px 13px; font: 400 13px/1 'Inter'; color: var(--ink);
  background: var(--white); outline: none; transition: border-color .15s;
}
.inp:focus { border-color: var(--acc); }
.textarea {
  width: 100%; border: 1px solid var(--bd); border-radius: 10px;
  padding: 10px 13px; font: 400 13px/1.6 'Inter'; color: var(--ink);
  background: var(--white); outline: none; resize: vertical; min-height: 80px;
}
.textarea:focus { border-color: var(--acc); }
.sel {
  width: 100%; border: 1px solid var(--bd); border-radius: 10px;
  padding: 10px 13px; font: 400 13px/1 'Inter'; color: var(--ink);
  background: var(--white); outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23a8a29e' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.sel:focus { border-color: var(--acc); }
.tgl { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.tgl input { display: none; }
.tgl-t { width: 40px; height: 22px; border-radius: 11px; background: #e5e7eb; position: relative; transition: background .2s; flex-shrink: 0; }
.tgl input:checked + .tgl-t { background: var(--acc); }
.tgl-th { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.tgl input:checked + .tgl-t .tgl-th { transform: translateX(18px); }
.tgl-lbl { font-size: 13px; color: var(--ink); }

/* ── TABLE ── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 10px; font-weight: 700; color: var(--lt); text-transform: uppercase; letter-spacing: .5px; padding: 0 0 10px; text-align: left; }
.tbl td { padding: 11px 0; border-top: 1px solid #f5f0ee; font-size: 13px; color: var(--ink); vertical-align: middle; }
.tbl tbody tr { transition: all .1s; }
.tbl tbody tr:hover td { color: var(--acc); }
.tbl a { text-decoration: none; color: inherit; }

/* ── TAGS ── */
.tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 20px; padding: 3px 9px; font-size: 11px; font-weight: 600; }
.t-ok { background: var(--gr-lt); color: #15803d; }
.t-wa { background: var(--am-lt); color: #92400e; }
.t-rd { background: var(--rd-lt); color: var(--rd); }
.t-gy { background: #f5f0ee; color: var(--mid); }
.t-acc { background: var(--acc-lt); color: var(--acc); }
.t-bl { background: var(--bl-lt); color: var(--bl); }

/* ── PROGRESS ── */
.pg { display: flex; align-items: center; gap: 7px; }
.pb { height: 5px; border-radius: 3px; background: #f5f0ee; overflow: hidden; width: 60px; }
.pf { height: 100%; border-radius: 3px; }
.pp { font-size: 10px; font-weight: 600; color: var(--lt); white-space: nowrap; }
.pb-full { height: 6px; border-radius: 3px; background: #f5f0ee; overflow: hidden; }
.pf-full { height: 100%; border-radius: 3px; }

/* ── KPI ── */
.kpi { background: var(--white); border-radius: 16px; padding: 18px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.kpi-ico.acc { background: var(--acc-lt); color: var(--acc); }
.kpi-ico.gr { background: var(--gr-lt); color: var(--gr); }
.kpi-ico.am { background: var(--am-lt); color: var(--am); }
.kpi-ico.rd { background: var(--rd-lt); color: var(--rd); }
.kpi-ico.bl { background: var(--bl-lt); color: var(--bl); }
.kpi-val { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; margin-bottom: 2px; }
.kpi-lbl { font-size: 11px; color: var(--lt); }
.kpi-trend { font-size: 10px; font-weight: 600; margin-top: 4px; }
.kpi-trend.up { color: var(--gr); }
.kpi-trend.dn { color: var(--rd); }
.kpi-trend.wa { color: var(--am); }

/* ── GRIDS ── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }

/* ── MODULE LIST (builder) ── */
.mod-item {
  background: var(--white); border: 1px solid var(--bd);
  border-radius: 12px; padding: 13px 14px;
  display: flex; align-items: center; gap: 10px;
  transition: border-color .15s; margin-bottom: 8px;
}
.mod-item:last-child { margin-bottom: 0; }
.mod-item:hover { border-color: var(--acc); }
.mod-check { width: 16px; height: 16px; border: 1.5px solid var(--bd2); border-radius: 4px; flex-shrink: 0; }
.mod-ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.mod-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.mod-meta { font-size: 11px; color: var(--lt); margin-top: 2px; }
.mod-btn {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--lt); font-size: 11px; background: var(--white); transition: all .15s;
}
.mod-btn:hover { border-color: var(--acc); color: var(--acc); }
.mod-btn.red:hover { border-color: var(--rd); color: var(--rd); }
.add-section {
  background: none; border: 2px dashed var(--bd); border-radius: 12px; padding: 14px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font: 500 13px/1 'Inter'; color: var(--lt); cursor: pointer; transition: all .15s; margin-top: 8px;
}
.add-section:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-lt); }

/* ── STUDENT — COURSE CARDS ── */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.c-card {
  background: var(--white); border-radius: 16px; overflow: hidden;
  transition: all .2s; text-decoration: none; display: block;
}
.c-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(208,134,108,.15); }
.c-thumb { height: 100px; display: flex; align-items: center; justify-content: center; font-size: 36px; position: relative; }
.c-status { position: absolute; top: 10px; right: 10px; }
.c-body { padding: 14px; }
.c-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.c-meta { font-size: 11px; color: var(--lt); margin-bottom: 10px; }
.c-locked { opacity: .5; cursor: not-allowed; }
.c-locked:hover { transform: none; box-shadow: none; }

/* ── ACTIVITY ── */
.act { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f5f0ee; }
.act:last-child { border-bottom: none; }
.act-ico { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.act-t { font-size: 13px; color: var(--ink); line-height: 1.45; flex: 1; }
.act-ts { font-size: 11px; color: var(--lt); margin-top: 3px; }

/* ── FAQ ── */
.faq-item { background: var(--white); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink);
  transition: color .15s;
}
.faq-q:hover { color: var(--acc); }
.faq-a { padding: 0 18px 16px; font-size: 13px; color: var(--mid); line-height: 1.65; display: none; }
.faq-a.open { display: block; }

/* ── SETTINGS ── */
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-btn {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--mid);
  transition: all .12s; border: none; background: none; width: 100%; text-align: left;
}
.set-btn:hover { background: var(--bg); color: var(--ink); }
.set-btn.on { background: var(--bg); color: var(--acc); font-weight: 600; }
.s-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--bd); }
.s-row:last-child { border-bottom: none; }
.s-lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.s-hint { font-size: 11px; color: var(--lt); margin-top: 2px; }

/* ── CERT CARD ── */
.cert-card {
  background: linear-gradient(135deg, var(--acc) 0%, #e8a882 100%);
  border-radius: 20px; padding: 32px; color: #fff;
  position: relative; overflow: hidden; text-align: center;
}
.cert-card::before { content: ''; position: absolute; top: -40px; right: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.1); }
.cert-card::after { content: ''; position: absolute; bottom: -30px; left: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.07); }
.cert-locked { background: var(--white); border-radius: 20px; padding: 32px; text-align: center; border: 2px dashed var(--bd); }

/* ── VIGNETTE ── */
.vignette-box {
  border: 2px dashed var(--bd); border-radius: 12px; height: 100px;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  margin-bottom: 12px; cursor: pointer; background: var(--bg); transition: border-color .15s;
}
.vignette-box:hover { border-color: var(--acc); }
.btn-changer {
  width: 100%; background: var(--white); border: 1px solid var(--bd);
  border-radius: 10px; padding: 9px; font: 500 13px/1 'Inter'; color: var(--ink);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; transition: all .15s;
}
.btn-changer:hover { border-color: var(--acc); color: var(--acc); }

/* ── STABS ── */
.stabs { display: flex; border-bottom: 1.5px solid var(--bd); margin-bottom: 16px; }
.stab { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--lt); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .12s; text-decoration: none; }
.stab:hover { color: var(--ink); }
.stab.on { color: var(--acc); border-bottom-color: var(--acc); font-weight: 700; }

/* ── MISC ── */
.ph { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.ph h1 { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.4px; }
.ph p { font-size: 12px; color: var(--lt); margin-top: 3px; }
.row-btns { display: flex; gap: 8px; }
.hl-card {
  background: linear-gradient(135deg, var(--acc) 0%, #e8a882 100%);
  border-radius: 16px; padding: 22px; color: #fff; position: relative; overflow: hidden;
}
.hl-card::before { content: ''; position: absolute; top: -30px; right: -30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.1); }
.hl-lbl { font-size: 10px; font-weight: 600; opacity: .7; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.hl-val { font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-bottom: 4px; }
.hl-sub { font-size: 10px; opacity: .6; margin-bottom: 16px; }
.hl-stats { display: flex; gap: 20px; }
.hl-stat-val { font-size: 18px; font-weight: 800; display: block; }
.hl-stat-lbl { font-size: 10px; opacity: .65; }
.av { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 20px; right: 24px; z-index: 999;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 11px 16px;
  font: 500 13px/1 'Inter'; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0; transform: translateY(5px); transition: all .22s; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
}
.toast.on { opacity: 1; transform: translateY(0); }

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.login-box {
  background: var(--white); border-radius: 20px; padding: 40px; width: 380px;
  box-shadow: 0 8px 32px rgba(66,57,45,.08);
}
.login-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 28px; }
.login-h { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.login-s { font-size: 13px; color: var(--lt); margin-bottom: 22px; }
.login-btn {
  width: 100%; background: var(--acc); color: #fff; border: none; border-radius: 10px;
  padding: 12px; font: 600 14px/1 'Inter'; cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 14px rgba(208,134,108,.3);
}
.login-btn:hover { background: var(--acc-h); }
.login-err { background: var(--rd-lt); border: 1px solid #fca5a5; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--rd); margin-bottom: 12px; }
.demo-row {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--bd); border-radius: 10px; cursor: pointer;
  margin-bottom: 6px; transition: all .15s;
}
.demo-row:hover { border-color: var(--acc); background: var(--acc-lt); }
