/* =========================================================
   NOTEBOOK.CSS – Đợt 4a: Sổ tay khởi nghiệp (hub trung tâm)
   Tổng quan (streak/tiến độ/analytics/launcher) + Thành tích (badge/quiz).
   Tái dùng khung .rd-drawer/.rd-tabs/.rd-chip... của marks.css.
   ========================================================= */

.rd-drawer.rd-nb { width: min(440px, 94vw); }
@media (max-width: 820px) { .rd-drawer.rd-nb { width: 100%; } }

/* hero streak */
.rd-nb-hero {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--brand-soft), var(--paper));
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
}
.rd-nb-hero__fire { font-size: 34px; line-height: 1; }
.rd-nb-hero__n { font-size: 26px; font-weight: 800; color: var(--brand); font-family: var(--font-sans); }
.rd-nb-hero__lb { font-size: 13px; color: var(--ink-soft); }

/* tiêu đề mục nhỏ */
.rd-nb-lb { font-family: var(--font-sans); font-weight: 800; font-size: 13px; color: var(--brand); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .3px; }
.rd-nb-lb:first-child { margin-top: 4px; }

/* tiến độ đọc */
.rd-nb-prog__bar { height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); overflow: hidden; }
.rd-nb-prog__fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; transition: width .4s; }
.rd-nb-prog__txt { font-size: 13px; color: var(--ink-soft); margin-top: 5px; }

/* launcher các công cụ */
.rd-launch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rd-launch button {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--ink); border-radius: 12px;
  cursor: pointer; font-size: 12px; font-family: var(--font-sans); text-align: center; transition: background .12s, transform .1s;
}
.rd-launch button:hover { background: var(--brand-soft); }
.rd-launch button:active { transform: scale(.96); }
.rd-launch button .ic { font-size: 22px; line-height: 1; }

/* analytics - đoạn dừng lâu */
.rd-dwell { display: flex; flex-direction: column; gap: 7px; }
.rd-dwell__item { font-size: 13px; line-height: 1.45; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 9px 9px 0; cursor: pointer; }
.rd-dwell__item:hover { background: var(--brand-soft); }
.rd-dwell__chap { font-size: 11px; color: var(--ink-soft); }

/* badges */
.rd-badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.rd-badge { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); }
.rd-badge.locked { opacity: .5; filter: grayscale(.7); }
.rd-badge.got { border-color: var(--brand); background: linear-gradient(135deg, var(--brand-soft), var(--paper)); }
.rd-badge__ic { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.rd-badge__t { font-size: 13px; font-weight: 700; font-family: var(--font-sans); }
.rd-badge__d { font-size: 11px; color: var(--ink-soft); line-height: 1.35; }

/* quiz results */
.rd-qres { display: flex; flex-direction: column; gap: 7px; }
.rd-qres__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 11px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.rd-qres__row b { color: var(--brand); }

/* =========================================================
   ĐỢT 4b – TAB SA BÀN (Business Model Canvas mini)
   ========================================================= */
.rd-cv-intro { font-size: 13px; line-height: 1.55; color: var(--ink-soft); background: var(--bg-2); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 0 9px 9px 0; padding: 9px 11px; margin-bottom: 14px; }

.rd-cv-fields { display: flex; flex-direction: column; gap: 11px; }
.rd-cv-field { display: flex; flex-direction: column; gap: 5px; border-radius: 10px; padding: 4px; transition: background .3s; }
.rd-cv-field > label { display: flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-weight: 700; font-size: 13px; color: var(--ink); }
.rd-cv-field__n { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.rd-cv-field textarea { width: 100%; resize: vertical; min-height: 46px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13.5px; line-height: 1.5; background: var(--paper); color: var(--ink); }
.rd-cv-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
@keyframes rd-cv-flash { 0% { background: var(--brand-soft); } 100% { background: transparent; } }
.rd-cv-field.rd-cv-flash { animation: rd-cv-flash 1.7s ease-out; }
.rd-cv-field.rd-cv-flash textarea { border-color: var(--brand); }

.rd-cv-acts { display: flex; gap: 8px; margin: 16px 0 4px; }
.rd-cv-acts .rd-st-aibtn { flex: 1; justify-content: center; }

/* ----- Modal "Xem dạng sa bàn" ----- */
.rd-cv-ov { position: fixed; inset: 0; z-index: 119; background: rgba(40, 30, 10, .5); display: none; }
.rd-cv-ov.show { display: block; }
.rd-cv-modal { position: fixed; inset: 0; z-index: 120; display: none; flex-direction: column; background: var(--bg-1, var(--paper)); }
.rd-cv-modal.show { display: flex; }
.rd-cv-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--paper); }
.rd-cv-modal__head h3 { margin: 0; font-size: 17px; color: var(--brand); font-family: var(--font-sans); }
.rd-cv-modal__acts { display: flex; align-items: center; gap: 8px; }
.rd-cv-modal__scroll { flex: 1; overflow: auto; padding: 18px; display: flex; justify-content: center; align-items: flex-start; }
.rd-cv-board { width: 100%; max-width: 1120px; min-width: 700px; }
.rd-cv-top { display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 1fr; gap: 8px;
  grid-template-areas: "partners activities value relationships segments" "partners resources value channels segments"; }
.rd-cv-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; grid-template-areas: "costs revenue"; }
.area-partners { grid-area: partners; } .area-activities { grid-area: activities; } .area-resources { grid-area: resources; }
.area-value { grid-area: value; } .area-relationships { grid-area: relationships; } .area-channels { grid-area: channels; }
.area-segments { grid-area: segments; } .area-costs { grid-area: costs; } .area-revenue { grid-area: revenue; }
.rd-cv-cell { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; background: var(--paper); min-height: 116px; }
.rd-cv-cell.area-value { background: linear-gradient(135deg, var(--brand-soft), var(--paper)); border-color: var(--brand); }
.rd-cv-cell h5 { margin: 0; font-family: var(--font-sans); font-size: 12.5px; font-weight: 800; color: var(--brand); letter-spacing: .2px; }
.rd-cv-cell__body { font-size: 13px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.rd-cv-cell.is-empty { background: var(--bg-2); }
.rd-cv-cell__ph { color: var(--ink-soft); font-style: italic; opacity: .7; }

/* =========================================================
   ĐỢT 4b – TAB CASE MAP (8 case kinh điển)
   ========================================================= */
.rd-cm-list { display: flex; flex-direction: column; gap: 8px; }
.rd-cm-card { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.rd-cm-card.open { border-color: var(--brand); }
.rd-cm-card__head { display: flex; align-items: center; gap: 11px; padding: 11px 12px; cursor: pointer; user-select: none; }
.rd-cm-card__head:hover { background: var(--brand-soft); }
.rd-cm-card__ic { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.rd-cm-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rd-cm-card__name { font-family: var(--font-sans); font-weight: 700; font-size: 14.5px; color: var(--ink); }
.rd-cm-card__model { font-size: 11.5px; color: var(--ink-soft); }
.rd-cm-card__arrow { font-size: 20px; color: var(--brand); transition: transform .2s; flex: 0 0 auto; }
.rd-cm-card.open .rd-cm-card__arrow { transform: rotate(90deg); }
.rd-cm-body { display: none; padding: 2px 12px 12px; }
.rd-cm-card.open .rd-cm-body { display: block; }
.rd-cm-row { padding: 8px 0; border-top: 1px solid var(--border); }
.rd-cm-row__lb { font-family: var(--font-sans); font-weight: 800; font-size: 11.5px; color: var(--brand); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 4px; }
.rd-cm-row__v { font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.rd-cm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-cm-chip { border: 1px solid var(--brand); background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-family: var(--font-sans); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: background .12s, transform .1s; }
.rd-cm-chip:hover { background: var(--brand); color: #fff; }
.rd-cm-chip:active { transform: scale(.95); }

/* =========================================================
   ĐỢT 4b – Responsive + In sa bàn
   ========================================================= */
@media (max-width: 760px) {
  .rd-cv-modal__scroll { padding: 12px; }   /* lưới giữ min-width 700px -> cuộn ngang trên mobile để giữ đúng bố cục sa bàn */
}
@media print {
  body.rd-printcanvas > *:not(.rd-cv-modal) { display: none !important; }
  body.rd-printcanvas .rd-cv-ov { display: none !important; }
  body.rd-printcanvas .rd-cv-modal { position: static; display: block; background: #fff; }
  body.rd-printcanvas .rd-cv-modal__acts { display: none !important; }
  body.rd-printcanvas .rd-cv-modal__scroll { overflow: visible; padding: 0; }
  body.rd-printcanvas .rd-cv-board { min-width: 0; max-width: none; }
  body.rd-printcanvas .rd-cv-cell { break-inside: avoid; }
}
