/* =========================================================
   EduLabs – Trang Bảng trắng
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Dancing+Script:wght@500;700&display=swap");

body[data-page="tien-ich"].wb-page { overflow: hidden; }
.wb-page .main { height: calc(100vh * var(--vz, 1)); }
.wb-page .content { padding: 4px 14px 14px 16px; gap: 12px; flex: 1; min-height: 0; }

/* Thanh trên: phần riêng của bảng trắng */
.wb-page .topbar { gap: 16px; padding-left: 22px; white-space: nowrap; }
.wb-page .page-title { font-size: 21px; }
.wb-page .class-select { min-width: 168px; }
.wb-page .user span { white-space: nowrap; font-size: 14.5px; }
.wb-page .bell { padding: 6px 8px; }
.wb-page .topbar .vsep.first { margin: 0 -4px; }
.wb-doc { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border: 1.4px solid var(--border);
  border-radius: 10px; font-size: 15.5px; color: var(--text-strong); background: #fff; max-width: 320px; }
.wb-doc .icon { width: 22px; height: 22px; color: var(--brand-600); }
.wb-doc input { border: 0; outline: 0; font: inherit; color: inherit; width: 222px; font-size: 14.5px; background: transparent; letter-spacing: -.3px; }
.wb-doc button { border: 0; background: none; padding: 0; color: var(--text-strong); display: grid; }
.wb-saved { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 8px;
  background: #e3f6ea; color: #13853f; font-size: 13.5px; font-weight: 500; transition: opacity .2s; }
.wb-saved .icon { width: 20px; height: 20px; fill: #1fae55; stroke: #fff; }
.wb-page .topbar .btn-md { height: 40px; font-size: 15.5px; font-weight: 500; }

.crumb { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-strong); margin: 0 0 -2px 4px; }
.crumb .icon { width: 20px; height: 20px; color: var(--brand-600); }
.crumb a:hover { color: var(--cta-500); }

/* Sidebar thu gọn */
.collapse-btn { position: absolute; top: 22px; right: 14px; width: 34px; height: 34px; border: 0; background: none; color: var(--text-strong); border-radius: 8px; display: grid; place-items: center; }
.collapse-btn:hover { background: rgba(255,255,255,.6); }
.collapse-btn .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.sidebar { position: sticky; }
.app.mini .sidebar { width: 76px; padding: 14px 10px; }
.app.mini .sidebar .logo span, .app.mini .nav-group-title { display: none; }
.app.mini .nav-item { font-size: 0; gap: 0; justify-content: center; padding: 0; }
.app.mini .logo { padding: 4px 0 0; justify-content: center; }
.app.mini .collapse-btn { position: static; margin: 0 auto 8px; transform: rotate(180deg); }
.app.mini { background: linear-gradient(90deg, var(--sidebar-bot) 76px, var(--bg-app) 0); }

/* Thanh công cụ trên */
.wb-bar { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--border-soft); border-radius: 14px;
  box-shadow: var(--shadow-sm); height: 58px; padding: 0 12px; }
.ibtn { width: 54px; height: 38px; border: 1.2px solid var(--border); border-radius: 9px; background: #fff; color: var(--text-strong); display: grid; place-items: center; }
.ibtn .icon { width: 22px; height: 22px; stroke-width: 2; }
.ibtn:hover:not(:disabled) { background: #f0f6ff; }
.ibtn:disabled { opacity: .4; cursor: default; }
.plain-btn { display: inline-flex; align-items: center; gap: 12px; border: 0; background: none; font-size: 15px; color: var(--text-strong); height: 38px; padding: 0 10px; border-radius: 8px; }
.plain-btn .icon { width: 24px; height: 24px; }
.plain-btn:hover { background: #f3f6fc; }
.zoom { display: inline-flex; align-items: center; border: 1.2px solid var(--border); border-radius: 9px; height: 38px; overflow: hidden; background: #fff; }
.zoom button { width: 42px; height: 100%; border: 0; background: none; color: var(--text-strong); display: grid; place-items: center; }
.zoom button:hover { background: #f0f6ff; }
.zoom .icon { width: 20px; height: 20px; stroke-width: 2.2; }
.zoom span { min-width: 76px; text-align: center; font-size: 14.5px; color: var(--text-strong); }

/* Khu vực bảng */
.wb-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 244px; gap: 12px; }
.wb-board { position: relative; background: #fff; border: 1px solid var(--border-soft); border-radius: 14px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.wb-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; }
.wb-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wb-stage.t-pen, .wb-stage.t-hl, .wb-stage.t-shape, .wb-stage.t-line { cursor: crosshair; }
.wb-stage.t-text { cursor: text; }
.wb-stage.t-eraser { cursor: cell; }
.wb-stage.t-hand { cursor: grab; }
.wb-board:fullscreen { border-radius: 0; }

.wb-tools { position: absolute; left: 10px; top: 12px; z-index: 5; background: #fff; border: 1px solid var(--border-soft); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; width: 84px; }
.wb-tools button { white-space: nowrap; border: 0; background: none; border-radius: 10px; height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 13.5px; color: var(--text-strong); letter-spacing: -.3px; }
.wb-tools button .icon { width: 28px; height: 28px; stroke-width: 1.7; }
.wb-tools button:hover { background: #f1f5fd; }
.wb-tools button.on { background: var(--grad-cta); color: #fff; box-shadow: 0 3px 10px rgba(36,116,253,.3); }
.wb-tools .tt { font-size: 20.5px; font-weight: 500; line-height: 28px; height: 28px; }

.wb-pop { position: absolute; left: 100px; z-index: 6; background: #fff; border: 1px solid var(--border-soft); border-radius: 14px; box-shadow: var(--shadow-md);
  padding: 12px 14px; min-width: 182px; display: none; }
.wb-pop.show { display: block; }
.wb-pop h6 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.wb-pop .sec + .sec { border-top: 1px solid var(--border-soft); margin-top: 10px; padding-top: 10px; }
.swatches { display: grid; grid-template-columns: repeat(5, 27px); gap: 10px 8px; }
.swatches button { width: 27px; height: 27px; border-radius: 50%; border: 0; padding: 0; box-shadow: inset 0 0 0 2px rgba(0,0,0,.05); }
.swatches button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cta-500); }
.sizes { display: flex; gap: 14px; }
.sizes button { width: 36px; height: 36px; border-radius: 50%; border: 1.2px solid var(--border); background: #fff; display: grid; place-items: center; }
.sizes button i { display: block; border-radius: 50%; background: var(--text-strong); }
.sizes button.on { border: 2px solid var(--cta-500); }
.sizes button.on i { background: var(--cta-500); }
.kinds { display: flex; gap: 8px; }
.kinds button { width: 42px; height: 38px; border: 1.2px solid var(--border); border-radius: 8px; background: #fff; display: grid; place-items: center; color: var(--text-strong); }
.kinds button.on { border: 2px solid var(--cta-500); color: var(--cta-500); background: #eef4ff; }
.kinds .icon { width: 22px; height: 22px; stroke-width: 2; }
.wb-pop label.sw { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-strong); cursor: pointer; }

.wb-text { position: absolute; z-index: 7; border: 1.5px dashed var(--cta-500); background: rgba(255,255,255,.85); outline: 0; resize: none; overflow: hidden;
  font-family: "Dancing Script", cursive; line-height: 1.11; padding: 2px 4px; min-width: 60px; white-space: pre; }

.wb-foot { display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 12px; border-top: 1px solid var(--border-soft); }
.wb-foot .ibtn { width: 44px; }
.page-sel { position: relative; }
.page-sel select { appearance: none; height: 38px; border: 1.2px solid var(--border); border-radius: 9px; padding: 0 42px 0 30px; font: inherit; font-size: 14.5px; color: var(--text-strong);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2550' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center/18px no-repeat; cursor: pointer; }
.wb-foot .fit { margin-left: 0; height: 38px; border: 1.2px solid var(--border); border-radius: 9px; background: #fff; display: inline-flex; align-items: center; gap: 12px; padding: 0 16px; font-size: 14.5px; color: var(--text-strong); }
.wb-foot .fit .icon { width: 22px; height: 22px; }

/* Danh sách trang */
.wb-pages { background: #fff; border: 1px solid var(--border-soft); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 12px 10px; display: flex; flex-direction: column; min-height: 0; }
.wb-pages h3 { margin: 0 6px 14px; display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; color: var(--text-strong); }
.wb-pages h3 button { border: 0; background: none; color: var(--text-strong); display: grid; padding: 4px; border-radius: 6px; }
.wb-pages h3 .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.thumbs { display: flex; flex-direction: column; gap: 18px; overflow-y: auto; padding: 2px; }
.thumb { position: relative; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 9.5; background: #fff; flex-shrink: 0; }
.thumb.on { border: 2px solid var(--cta-500); box-shadow: 0 0 0 2px rgba(43,123,254,.15); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .no { position: absolute; left: 6px; top: 6px; min-width: 28px; height: 28px; border-radius: 7px; background: #8a94b3; color: #fff; font-size: 13.5px; font-weight: 600; display: grid; place-items: center; }
.thumb.on .no { background: var(--grad-cta); }
.thumb .dots { position: absolute; right: 6px; top: 4px; border: 0; background: rgba(255,255,255,.8); border-radius: 6px; width: 32px; height: 26px; display: grid; place-items: center; color: var(--text-strong); }
.thumb .dots .icon { width: 22px; height: 22px; }
.thumb .menu { position: absolute; right: 6px; top: 32px; background: #fff; border: 1px solid var(--border-soft); border-radius: 10px; box-shadow: var(--shadow-md); padding: 4px; display: none; z-index: 2; }
.thumb .menu.show { display: block; }
.thumb .menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; font-size: 13px; border-radius: 6px; color: var(--text-strong); white-space: nowrap; }
.thumb .menu button:hover { background: #f1f5fd; }
.thumb .menu button.del { color: #d22c4a; }
.add-page { margin-top: 18px; height: 44px; border: 1.5px solid var(--cta-500); border-radius: 10px; background: #fff; color: var(--cta-500); font-size: 15.5px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-shrink: 0; }
.add-page .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.wb-main.no-pages { grid-template-columns: 1fr 0; }
.wb-main.no-pages .wb-pages { display: none; }
.show-pages { display: none; position: absolute; right: 12px; top: 12px; z-index: 5; }
.wb-main.no-pages .show-pages { display: grid; }
