/* ===== FranklinWH Connect Portal — Training Demo shared styles ===== */
:root {
    --brand: #FF6A00;
    --brand-soft: #FFF2E8;
    --brand-hover: #E85F00;
    --ink: #1f2733;
    --ink-2: #4b5563;
    --muted: #8a94a6;
    --line: #ebedf1;
    --line-2: #f2f4f7;
    --bg: #f5f6f8;
    --link: #2f6bff;
    --green: #22a06b;
    --green-soft: #e7f6ee;
    --amber: #e8890c;
    --amber-soft: #fdf1e0;
    --red: #e5484d;
    --red-soft: #fdecec;
    --gray-dot: #b3bac5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 236px; flex-shrink: 0; background: #fff;
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 0 0 16px;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ===== Sidebar ===== */
.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px; font-weight: 700; font-size: 16px; color: var(--ink);
}
.brand-logo {
    width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800;
}
.nav-section { padding: 8px 12px 4px; }
.nav-label {
    font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); padding: 10px 12px 6px; font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px; margin: 2px 0;
    color: var(--ink-2); text-decoration: none; font-size: 14px;
    cursor: pointer; transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; }
.nav-item:hover { background: var(--line-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item .role-tag {
    margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 5px;
    background: var(--line-2); color: var(--muted); font-weight: 500;
}

/* ===== Top bar ===== */
.topbar {
    height: 56px; background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; flex-shrink: 0;
}
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs .sep { margin: 0 8px; color: #cfd4dc; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.role-switch {
    padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 13px; color: var(--ink-2); background: #fff; cursor: pointer;
}
.avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft);
    color: var(--brand); font-weight: 700; display: flex;
    align-items: center; justify-content: center; font-size: 13px;
}

/* ===== Content ===== */
.content { padding: 24px 28px 48px; }
.page-head { margin-bottom: 18px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ===== KPI cards ===== */
.kpi-row { display: grid; gap: 14px; margin-bottom: 20px; }
.kpi {
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
}
.kpi-value { font-size: 24px; font-weight: 700; color: var(--ink); }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.accent .kpi-value { color: var(--brand); }
.kpi.warn .kpi-value { color: var(--red); }

/* ===== Tabs (underline) ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
    padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--muted);
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ===== Toolbar / filters ===== */
.toolbar {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.seg { display: flex; align-items: center; gap: 4px; background: #fff;
    border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg-item {
    display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px;
    font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.seg-item .dot { width: 7px; height: 7px; border-radius: 50%; }
.seg-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.seg-item .count { color: var(--muted); font-size: 12px; }
.dot-green { background: var(--green); }
.dot-gray { background: var(--gray-dot); }
.dot-red { background: var(--red); }

select.input, input.input {
    padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 13px; color: var(--ink-2); background: #fff; outline: none;
}
input.input { min-width: 220px; }
select.input:focus, input.input:focus { border-color: var(--brand); }
.search {
    position: relative; display: inline-flex; align-items: center;
}
.search svg { position: absolute; left: 10px; width: 15px; height: 15px; stroke: var(--muted); }
.search input { padding-left: 32px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px; border-radius: 8px;
    font-size: 13px; padding: 8px 14px; cursor: pointer; border: 1px solid transparent;
    font-weight: 500; transition: background .15s, border-color .15s;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Tables ===== */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
    color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
th.sortable { cursor: pointer; }
th.sortable::after { content: ' ⇅'; color: #cfd4dc; font-size: 11px; }
td { padding: 14px 16px; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover > td { background: #fcfdff; }
.cell-main { color: var(--ink); font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.link { color: var(--link); text-decoration: none; }
.link:hover { text-decoration: underline; }
/* always-underlined link: signals clickability inside tables */
.link-u { color: var(--link); text-decoration: underline; cursor: pointer; }
.link-u:hover { color: var(--brand); }

/* ===== Tags ===== */
.tag {
    display: inline-flex; align-items: center; font-size: 12px; padding: 2px 8px;
    border-radius: 6px; background: var(--line-2); color: var(--ink-2); font-weight: 500;
}
.tag + .tag { margin-left: 6px; }
.tag-more { background: var(--line-2); color: var(--muted); }
.tag-mand { background: var(--brand-soft); color: var(--brand); }
.tag-elec { background: #eef1f6; color: #6b7280; }
.tag-role { background: var(--line-2); color: var(--muted); font-size: 11px; }

/* ===== Status pill w/ dot ===== */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; }
.s-ok { color: var(--green); }
.s-ok .dot { background: var(--green); }
.s-warn { color: var(--amber); }
.s-warn .dot { background: var(--amber); }
.s-bad { color: var(--red); }
.s-bad .dot { background: var(--red); }
.s-idle { color: var(--muted); }
.s-idle .dot { background: var(--gray-dot); }

/* ===== Progress bar ===== */
.pbar { display: inline-flex; align-items: center; gap: 8px; }
.pbar .track { width: 96px; height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
.pbar .fill { height: 100%; border-radius: 4px; }
.pbar .pct { font-size: 12px; color: var(--ink-2); min-width: 34px; }
.fill-high { background: var(--green); }
.fill-mid { background: var(--amber); }
.fill-low { background: var(--red); }

/* ===== Row action links ===== */
.actions { display: flex; gap: 14px; }
.act { font-size: 13px; cursor: pointer; }
.act-view { color: var(--link); }
.act-warn { color: var(--amber); }
.act-danger { color: var(--red); }
.act:hover { text-decoration: underline; }

/* ===== Pagination ===== */
.pager {
    display: flex; align-items: center; justify-content: flex-end; gap: 12px;
    padding: 12px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-2);
}
.pager .pages { display: flex; gap: 4px; }
.pager .pg {
    min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid var(--line);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink-2); background: #fff;
}
.pager .pg.active { border-color: var(--brand); color: var(--brand); }
.pager select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }

/* ===== Expand row ===== */
.expand-row { display: none; }
.expand-row.open { display: table-row; }
.expand-row > td { padding: 0; background: #fafbff; }
.expand-inner { padding: 18px 22px; }
.expand-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.mini-kpi { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.mini-kpi .v { font-size: 17px; font-weight: 700; color: var(--ink); }
.mini-kpi .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sub-title { font-size: 13px; font-weight: 600; color: var(--ink); margin: 6px 0 10px; }
.plan-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.plan-name { width: 150px; font-size: 13px; color: var(--ink-2); }
.plan-staff { font-size: 12px; color: var(--muted); width: 110px; text-align: right; }
.inner-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.inner-card th { background: #f6f7f9; }

/* ===== My Training: Learning Plan groups ===== */
.plan-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.plan-tab {
    padding: 8px 16px; border-radius: 20px; font-size: 13px; cursor: pointer;
    background: #fff; border: 1px solid var(--line); color: var(--ink-2);
}
.plan-tab:hover { border-color: var(--brand); color: var(--brand); }
.plan-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.group { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; }
.group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.group-title { font-size: 15px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.group-title .ic { width: 22px; height: 22px; border-radius: 6px; background: var(--brand-soft);
    color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.group-progress { font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* path bar */
.path { display: flex; align-items: center; margin-bottom: 18px; padding: 0 2px; }
.path-step { display: flex; align-items: center; }
.path-dot {
    width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.d-done { background: var(--green); }
.d-current { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.d-pending { background: #e2e6ec; color: var(--muted); }
.path-line { width: 44px; height: 3px; background: #e2e6ec; }
.path-line.done { background: var(--green); }

/* course cards */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.course {
    border: 1px solid var(--line); border-radius: 10px; padding: 15px; cursor: pointer;
    position: relative; transition: box-shadow .15s, border-color .15s; background: #fff;
}
.course:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(255,106,0,.10); }
.course.done { border-left: 3px solid var(--green); }
.course.next { border-left: 3px solid var(--brand); }
.course.overdue { border-left: 3px solid var(--red); }
.course-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cnum { font-size: 12px; color: var(--muted); font-weight: 600; }
.cbadge { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.cb-done { background: var(--green-soft); color: var(--green); }
.cb-next { background: var(--brand-soft); color: var(--brand); }
.cdur { font-size: 11px; color: var(--muted); }
.ctitle { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; margin-bottom: 10px; min-height: 38px; }
.ctags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cprog { height: 5px; background: var(--line); border-radius: 3px; margin-bottom: 8px; overflow: hidden; }
.cprog .f { height: 100%; background: var(--brand); border-radius: 3px; }
.cdue { font-size: 12px; color: var(--muted); }
.cdue.overdue { color: var(--red); font-weight: 600; }

/* elective collapse */
.elective-bar {
    display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 14px;
    background: #fafbfc; border: 1px dashed var(--line); border-radius: 8px;
    cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.elective-bar:hover { border-color: var(--brand); color: var(--brand); }
.elective-bar .chev { transition: transform .2s; }
.elective-bar.open .chev { transform: rotate(90deg); }
.elective-body { display: none; margin-top: 14px; }
.elective-body.open { display: block; }

/* ===== Toast & modal ===== */
.toast {
    position: fixed; top: 20px; right: 20px; background: #1f2733; color: #fff;
    padding: 12px 18px; border-radius: 10px; font-size: 14px; display: none; z-index: 3000;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.toast.show { display: block; animation: slideIn .25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.overlay { position: fixed; inset: 0; background: rgba(15,23,35,.4); display: none;
    align-items: center; justify-content: center; z-index: 2500; }
.overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: 360px; }
.modal h3 { font-size: 16px; margin-bottom: 6px; }
.modal p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.modal .fmt { display: flex; gap: 10px; margin-bottom: 18px; }
.modal .fmt label { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px;
    text-align: center; font-size: 13px; cursor: pointer; }
.modal .fmt input { margin-right: 6px; }
.modal .fmt label.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ===== Landing ===== */
.landing { max-width: 760px; margin: 40px auto; }
.landing h1 { font-size: 24px; margin-bottom: 6px; }
.landing .sub { color: var(--muted); margin-bottom: 28px; }
.role-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px;
    text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s, transform .15s; }
.role-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(255,106,0,.10); transform: translateY(-2px); }
.role-card .rc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.role-card .rc-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft);
    color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.role-card h3 { font-size: 16px; }
.role-card .rc-role { font-size: 11px; color: var(--muted); }
.role-card p { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* ===== Large modal (course/staff detail) ===== */
.modal-lg { width: 760px; max-width: calc(100vw - 48px); max-height: calc(100vh - 80px);
    display: flex; flex-direction: column; padding: 0; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between;
    padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; color: var(--ink); }
.modal-head .m-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.mclose { font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.mclose:hover { color: var(--ink); }
.modal-body { padding: 18px 22px 20px; overflow-y: auto; }

/* modal filter row */
.modal-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.modal-filters .search input { min-width: 200px; }

/* screenshot-style progress bar list */
.bar-list { margin-bottom: 6px; }
.bar-item { padding: 9px 0; }
.bar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.bar-name { font-size: 14px; color: var(--ink); font-weight: 500; }
.bar-meta { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.bar-meta .cnt { color: var(--muted); }
.bar-meta .pc { color: var(--ink-2); font-weight: 600; min-width: 48px; text-align: right; }
.bar-track { height: 10px; background: #eef0f3; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 6px; }

.modal-section-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 4px 0 10px; }
.modal-divider { height: 1px; background: var(--line); margin: 18px 0; }

/* table inside modal */
.modal-body .card { border-radius: 10px; }
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }

/* ===== My Certifications ===== */
.sync-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sync-info { font-size: 12px; color: var(--muted); }
.sync-info b { color: var(--ink-2); font-weight: 600; }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cert { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fff;
    border-left: 3px solid var(--green); }
.cert.expiring { border-left-color: var(--amber); }
.cert.expired { border-left-color: var(--red); }
.cert-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cert-name { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.cert-badge { font-size: 11px; padding: 3px 9px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.cb-valid { background: var(--green-soft); color: var(--green); }
.cb-expiring { background: var(--amber-soft); color: var(--amber); }
.cb-expired { background: var(--red-soft); color: var(--red); }
.cert-meta { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.cert-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.cert-row .k { color: var(--muted); }
.cert-row .v { color: var(--ink-2); }
.cert-row .v.warn { color: var(--amber); font-weight: 600; }
.cert-row .v.bad { color: var(--red); font-weight: 600; }
.cert-foot { border-top: 1px solid var(--line-2); padding-top: 12px; }
.cert-foot .btn svg { transform: none; }
.refresh-ic { transition: transform .5s; }
.refresh-ic.spin { transform: rotate(360deg); }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .es-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft);
    color: var(--brand); display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin: 0 auto 16px; }
.empty-state h3 { font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--muted); max-width: 380px; margin: 0 auto 18px; line-height: 1.6; }

/* ===== Extra-large modal (company detail with tabs) ===== */
.modal-xl { width: 900px; max-width: calc(100vw - 48px); max-height: calc(100vh - 64px);
    display: flex; flex-direction: column; padding: 0; }
.modal-xl .modal-body { padding: 18px 22px 22px; overflow-y: auto; }
.modal-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }

/* ===== Course List: card view ===== */
.view-seg .seg-item { padding: 6px 9px; }
.view-seg .seg-item svg { width: 16px; height: 16px; stroke: currentColor; display: block; }

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cat-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
    cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.cat-card:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(255,106,0,.10); }
.cat-cover { height: 104px; display: flex; align-items: center; justify-content: center;
    font-size: 34px; color: #fff; position: relative; }
.cat-cover .seq-chip { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 600;
    background: rgba(0,0,0,.28); color: #fff; padding: 2px 8px; border-radius: 20px; }
.cover-pk { background: linear-gradient(135deg, #4f86ff, #2f6bff); }
.cover-safety { background: linear-gradient(135deg, #f0a83c, #e8890c); }
.cover-install { background: linear-gradient(135deg, #ff8a3d, #ff6a00); }
.cover-default { background: linear-gradient(135deg, #9aa4b2, #6b7280); }
.cat-body { padding: 14px; }
.cat-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; margin-bottom: 6px; }
.cat-metaline { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.cat-card .ctags { display: flex; gap: 6px; flex-wrap: wrap; }
.catalog-count { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ===== My Training v2: Learning Plan cards ===== */
.lp-card { background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-bottom:18px; }
.lp-cover { height:88px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:30px; }
.lp-cover.c1 { background:linear-gradient(135deg,#ff8a3d,#ff6a00); }
.lp-cover.c2 { background:linear-gradient(135deg,#4f86ff,#2f6bff); }
.lp-cover.c3 { background:linear-gradient(135deg,#3ec98a,#22a06b); }
.lp-cover.c4 { background:linear-gradient(135deg,#9aa4b2,#6b7280); }
.lp-body { padding:16px 18px; }
.lp-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; }
.lp-title-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.lp-name { font-size:16px; font-weight:700; color:var(--ink); }
.info-btn { width:18px; height:18px; border-radius:50%; border:1px solid var(--line); color:var(--muted);
    display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-style:italic;
    cursor:pointer; position:relative; font-weight:700; }
.info-btn:hover { border-color:var(--brand); color:var(--brand); }
.popover { position:absolute; top:24px; left:0; z-index:60; width:260px; background:#fff; border:1px solid var(--line);
    border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.14); padding:12px 14px; font-size:12px; color:var(--ink-2);
    line-height:1.55; display:none; text-align:left; font-weight:400; font-style:normal; }
.popover.show { display:block; }
.id-chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; background:var(--line-2); color:var(--ink-2);
    padding:2px 8px; border-radius:6px; cursor:pointer; }
.id-chip:hover { color:var(--brand); }
.id-chip svg { width:12px; height:12px; stroke:currentColor; }
.time-tag { display:inline-flex; align-items:center; gap:5px; font-size:12px; background:var(--amber-soft);
    color:var(--amber); padding:2px 8px; border-radius:6px; font-weight:600; }
.no-time { color:var(--gray-dot); display:inline-flex; align-items:center; cursor:default; }
.no-time svg { width:15px; height:15px; stroke:currentColor; }
.lp-actions { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.completed-date { font-size:12px; color:var(--muted); }

.lp-progress { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.lp-progress .track { flex:1; height:8px; background:var(--line); border-radius:5px; overflow:hidden; }
.lp-progress .fill { height:100%; border-radius:5px; }
.lp-progress .txt { font-size:12px; color:var(--ink-2); white-space:nowrap; }

.resume-bar { display:flex; align-items:center; gap:10px; padding:10px 12px; background:var(--brand-soft);
    border:1px solid #ffd9bd; border-radius:8px; margin-bottom:8px; }
.resume-bar .rb-ic { color:var(--brand); font-size:14px; }
.resume-bar .rb-text { font-size:13px; color:var(--ink-2); flex:1; }
.resume-bar .rb-text b { color:var(--ink); }

.lp-section-title { font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase;
    letter-spacing:.03em; margin:14px 0 6px; }
.lp-item { display:flex; align-items:center; gap:11px; padding:10px 12px; border:1px solid var(--line-2);
    border-radius:8px; margin-bottom:6px; cursor:pointer; transition:border-color .15s, background .15s; }
.lp-item:hover { border-color:var(--brand); background:#fffaf5; }
.lp-item .type-ic { width:28px; height:28px; border-radius:6px; display:flex; align-items:center;
    justify-content:center; flex-shrink:0; }
.lp-item .type-ic svg { width:15px; height:15px; }
.type-video { background:#eef3ff; color:#2f6bff; }
.type-test { background:#f0ecff; color:#7c5cff; }
.lp-item .it-name { flex:1; font-size:14px; color:var(--ink); }
.lp-item .it-sub { font-size:11px; color:var(--muted); margin-top:1px; }
.it-badge { font-size:11px; padding:2px 8px; border-radius:6px; font-weight:600; white-space:nowrap; }
.b-done { background:var(--green-soft); color:var(--green); }
.b-prog { background:var(--brand-soft); color:var(--brand); }
.b-next { background:var(--brand); color:#fff; }
.b-lock { background:var(--line-2); color:var(--muted); }
.b-idle { background:var(--line-2); color:var(--muted); }
.prereq-tag { font-size:11px; background:#eef1f6; color:#6b7280; padding:2px 7px; border-radius:6px; white-space:nowrap; }
.refresh-ic { transition:transform .5s; }
.refresh-ic.spin { transform:rotate(360deg); }

/* ===== My Training v3: compact collapsible cards, 2-up grid ===== */
.lp-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(400px, 1fr)); gap:16px; align-items:start; }
.lp-head2 { display:flex; align-items:center; gap:12px; padding:12px 14px; cursor:pointer; }
.lp-head2:hover { background:#fcfdff; }
.lp-cover-sm { width:46px; height:46px; border-radius:10px; flex-shrink:0; display:flex; align-items:center;
    justify-content:center; font-size:22px; color:#fff; }
.lp-cover-sm.c1 { background:linear-gradient(135deg,#ff8a3d,#ff6a00); }
.lp-cover-sm.c2 { background:linear-gradient(135deg,#4f86ff,#2f6bff); }
.lp-cover-sm.c3 { background:linear-gradient(135deg,#3ec98a,#22a06b); }
.lp-hmain { flex:1; min-width:0; }
.lp-hname { display:flex; align-items:center; gap:8px; font-size:15px; font-weight:700; color:var(--ink); }
.lp-hname .lp-nm { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.status-pill { font-size:11px; padding:1px 8px; border-radius:20px; font-weight:600; flex-shrink:0; }
.sp-prog { background:var(--brand-soft); color:var(--brand); }
.sp-done { background:var(--green-soft); color:var(--green); }
.lp-hbar { display:flex; align-items:center; gap:8px; margin-top:7px; }
.lp-hbar .track { flex:1; height:6px; background:var(--line); border-radius:4px; overflow:hidden; }
.lp-hbar .fill { height:100%; border-radius:4px; }
.lp-hbar .txt { font-size:11px; color:var(--muted); white-space:nowrap; }
.lp-chev { color:var(--muted); transition:transform .2s; flex-shrink:0; font-size:12px; }
.lp-card.open .lp-chev { transform:rotate(90deg); }
.lp-collapse { display:none; padding:0 14px 14px; }
.lp-card.open .lp-collapse { display:block; }
.lp-meta2 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:4px 0 12px; border-top:1px solid var(--line-2); margin-top:2px; padding-top:12px; }
.lp-courses { max-height:280px; overflow-y:auto; padding-right:4px; }
.lp-courses .lp-section-title:first-child { margin-top:2px; }
.lp-foot2 { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line-2); }

/* ===== My Training v4: LP card grid (landing) ===== */
.lp-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
.lpcard { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff;
    cursor:pointer; transition:box-shadow .15s, border-color .15s; position:relative; }
.lpcard:hover { border-color:var(--brand); box-shadow:0 4px 14px rgba(255,106,0,.10); }
.lpcard-cover { height:100px; display:flex; align-items:center; justify-content:center; font-size:32px; color:#fff; position:relative; }
.lpcard-body { padding:14px 16px; }
.lpcard-title { font-size:15px; font-weight:700; color:var(--ink); margin-bottom:8px; line-height:1.35; }
.lpcard-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.lpcard-footer .time-tag, .lpcard-footer .no-time { font-size:11px; }
.lpcard .status-pill { position:absolute; top:10px; right:10px; }
.lpcard-action { position:absolute; bottom:14px; right:14px; z-index:2; }

/* ===== LP Detail page ===== */
.detail-back { display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-size:13px;
    cursor:pointer; margin-bottom:14px; text-decoration:none; }
.detail-back:hover { color:var(--brand); }
.detail-banner { display:flex; gap:18px; align-items:flex-start; margin-bottom:20px; }
.detail-cover { width:80px; height:80px; border-radius:12px; flex-shrink:0; display:flex;
    align-items:center; justify-content:center; font-size:36px; color:#fff; }
.detail-info { flex:1; }
.detail-title { font-size:20px; font-weight:700; color:var(--ink); margin-bottom:4px; }
.detail-desc { font-size:13px; color:var(--ink-2); line-height:1.55; margin-bottom:10px; }
.detail-stats { display:flex; gap:16px; flex-wrap:wrap; }
.detail-stat { font-size:13px; color:var(--muted); }
.detail-stat b { color:var(--ink-2); font-weight:600; }

/* ===== Company Detail page ===== */
.charts-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:22px; }
@media (max-width:900px) { .charts-row { grid-template-columns:1fr; } }
.chart-card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px; }
.chart-title { font-size:13px; font-weight:700; color:var(--ink); margin-bottom:14px; }
.bar-row { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.bar-label { width:140px; font-size:12px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex-shrink:0; }
.bar-track2 { flex:1; height:20px; background:var(--line-2); border-radius:6px; overflow:hidden; position:relative; }
.bar-fill2 { height:100%; border-radius:6px; background:var(--brand); }
.bar-values { display:flex; gap:12px; font-size:11px; color:var(--muted); flex-shrink:0; min-width:180px; justify-content:flex-end; }
.bar-values b { color:var(--ink-2); }
.chart-scroll { overflow-x:auto; max-height:280px; overflow-y:auto; padding-right:4px; }
/* donut */
.donut-wrap { display:flex; align-items:center; gap:24px; justify-content:center; flex-wrap:wrap; }
.donut-svg { width:140px; height:140px; flex-shrink:0; }
.donut-legend { font-size:13px; }
.donut-legend li { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.donut-legend .swatch { width:12px; height:12px; border-radius:3px; flex-shrink:0; }
.donut-legend .dl-val { font-weight:600; color:var(--ink); }
.donut-legend .dl-pct { color:var(--muted); font-size:12px; }
.section-title2 { font-size:15px; font-weight:700; color:var(--ink); margin-bottom:14px; }
