/* ═══════════════════════════════════════════════
   Primabi CMS Training — Global Styles
   ═══════════════════════════════════════════════ */

:root {
    --navy:       #1B3057;
    --navy-dark:  #152644;
    --navy-hover: rgba(255,255,255,0.07);
    --navy-active:rgba(255,255,255,0.14);
    --accent:     #29B6F6;
    --accent-dim: rgba(41,182,246,0.15);
    --sidebar-w:  280px;
    --topbar-h:   46px;
    --text-white: #ffffff;
    --text-dim:   rgba(255,255,255,0.72);
    --text-dimmer:rgba(255,255,255,0.45);
    --radius:     6px;
    --shadow:     0 4px 24px rgba(0,0,0,0.12);
}

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

html, body { height: 100%; overflow: hidden; }
/* On mobile the shell scrolls naturally */
@media (max-width: 768px) { html, body { overflow: auto; } }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: #222;
    background: #fff;
}

a { color: inherit; text-decoration: none; }

/* ── Logo ─────────────────────────────────────── */
.logo {
    font-size: 20px;
    font-weight: 700;
    color: #4FC3F7;
    letter-spacing: -0.5px;
    line-height: 1;
}
.logo-accent { color: #81D4FA; }

.logo-img {
    max-height: 40px;
    width: auto;
    display: block;
}


/* ═══════════════════════════════════════════════
   APP SHELL  (matches desktop layout exactly)
   ═══════════════════════════════════════════════ */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ── Top Bar ───────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--navy);
    display: flex;
    align-items: center;
    padding: 0 0 0 0;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0,0,0,0.25);
    gap: 0;
}

.topbar-logo {
    width: var(--sidebar-w);
    padding: 0 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(255,255,255,0.08);
    height: 100%;
    background-color: white;
}

.topbar-breadcrumb {
    flex: 1;
    text-align: center;
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    flex-shrink: 0;
}

.user-pill {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
}

.user-sep { color: var(--text-dimmer); font-size: 11px; }

.btn-topbar-exit {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-dim);
    width: 22px; height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.btn-topbar-exit:hover { background: rgba(220,50,50,0.5); color: #fff; }

/* ── Body Split ────────────────────────────────── */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(0,0,0,0.2);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }

/* ── Sidebar Menu ──────────────────────────────── */
.sidemenu { 
    padding: 6px 0; 
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-leaf,
.menu-parent,
.menu-child {
    color: var(--text-dim);
    font-size: 12.5px;
    padding: 7px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s, color 0.12s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: 1.3;
}

.menu-leaf:hover,
.menu-parent:hover { background: var(--navy-hover); color: var(--text-white); }

.menu-leaf.active,
.menu-child.active {
    background: var(--navy-active);
    color: var(--text-white);
    border-left: 3px solid var(--accent);
    padding-left: 11px;
}

.menu-parent { font-weight: 500; }
.menu-parent.expanded { color: var(--text-white); }

.menu-arrow { font-size: 9px; opacity: 0.5; flex-shrink: 0; margin-left: 4px; }

.menu-child {
    padding-left: 26px;
    font-size: 12px;
    color: rgba(255,255,255,0.62);
}
.menu-child:hover { background: var(--navy-hover); color: rgba(255,255,255,0.9); }
.menu-child.active { padding-left: 23px; }

/* ── Main Content ──────────────────────────────── */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
}


/* ═══════════════════════════════════════════════
   WELCOME SCREEN
   ═══════════════════════════════════════════════ */

.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f7f9fc;
}

.welcome-box {
    text-align: center;
    padding: 48px;
}

.welcome-logo {
    font-size: 40px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.welcome-box h2 {
    font-size: 22px;
    color: var(--navy);
    margin-bottom: 10px;
    font-weight: 600;
}

.welcome-box p { color: #667; font-size: 14px; margin-bottom: 32px; }

.welcome-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-dim);
    color: #1565C0;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
}

.hint-arrow { font-size: 18px; }


/* ═══════════════════════════════════════════════
   TRAINING PANEL
   ═══════════════════════════════════════════════ */

.training-panel {
    padding: 28px 36px 48px;
}

.tp-section {
    margin-bottom: 36px;
}

.tp-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--navy);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* Video */
.tp-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #000;
}

.tp-video iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Text */
.tp-text {
    font-size: 14px;
    line-height: 1.75;
    color: #333;
}

.tp-text h3 { font-size: 15px; margin: 16px 0 8px; color: var(--navy); }
.tp-text p  { margin-bottom: 10px; }
.tp-text ul, .tp-text ol { padding-left: 22px; margin-bottom: 10px; }
.tp-text li { margin-bottom: 4px; }
.tp-text strong { color: #111; }

/* Screenshots */
.tp-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.tp-shot {
    border: 1px solid #e0e4ea;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: zoom-in;
    transition: box-shadow 0.18s, transform 0.18s;
    background: #fafafa;
}

.tp-shot:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
    transform: translateY(-3px);
}

.tp-shot img { width: 100%; display: block; object-fit: cover; }

.tp-shot-caption {
    padding: 7px 10px;
    font-size: 11.5px;
    color: #666;
    background: #f4f6f9;
    border-top: 1px solid #e8eaed;
}

/* Key Points */
.tp-keypoints {
    background: #EFF8FF;
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 20px 24px;
}

.tp-keypoints-body { font-size: 14px; line-height: 1.7; color: #1a3a5c; }
.tp-keypoints-body ul { padding-left: 18px; }
.tp-keypoints-body li { margin-bottom: 6px; }

.tp-updated { font-size: 11px; color: #aaa; margin-top: 8px; }

/* Empty / Loading */
.tp-loading, .tp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 12px;
    color: #888;
}

.tp-empty-icon { font-size: 40px; opacity: 0.3; }
.tp-empty h3 { color: #555; font-size: 16px; }
.tp-empty p { font-size: 13px; }

.spinner {
    width: 36px; height: 36px;
    border: 3px solid #e8eaed;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ═══════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════ */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.lightbox-inner {
    max-width: 92vw;
    max-height: 92vh;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.lightbox-inner img { max-width: 92vw; max-height: 80vh; display: block; }
.lightbox-inner p { padding: 12px 16px; font-size: 13px; color: #444; text-align: center; }

.lb-close {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none; border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.lb-close:hover { background: rgba(200,0,0,0.7); }


/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */

.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--navy) 0%, var(--navy-dark) 100%);
}

.admin-bg { background: linear-gradient(145deg, #0d1f35 0%, #091628 100%); }

.login-card {
    background: #fff;
    border-radius: 10px;
    padding: 40px 36px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.login-header { text-align: center; margin-bottom: 28px; }
.login-logo { font-size: 34px; }
.login-subtitle { color: #888; font-size: 13px; margin-top: 6px; }

.lf-group { margin-bottom: 18px; }
.lf-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.lf-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dde1e8;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fafafa;
    color: #222;
}

.lf-input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(41,182,246,0.14);
}

.lf-btn {
    width: 100%;
    padding: 12px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    letter-spacing: 0.3px;
    margin-top: 4px;
}
.lf-btn:hover { background: #234a7a; }
.lf-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.login-error {
    background: #fff3f3;
    border: 1px solid #f8c8c8;
    color: #c0392b;
    padding: 10px 13px;
    border-radius: var(--radius);
    font-size: 12.5px;
    margin-bottom: 16px;
}

.login-footer { text-align: center; margin-top: 20px; }
.login-admin-link { font-size: 12px; color: #aaa; }
.login-admin-link:hover { color: var(--navy); }


/* ═══════════════════════════════════════════════
   ADMIN SHELL
   ═══════════════════════════════════════════════ */

.admin-shell { display: flex; flex-direction: column; min-height: 100vh; overflow: auto; }

.admin-topbar {
    background: var(--navy);
    padding: 0 24px;
    height: 50px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.admin-badge {
    background: rgba(41,182,246,0.25);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.admin-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.admin-nav-link {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    padding: 6px 14px;
    border-radius: var(--radius);
    transition: background 0.12s, color 0.12s;
}
.admin-nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }

.btn-admin-logout {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    padding: 5px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.12s;
}
.btn-admin-logout:hover { background: rgba(200,0,0,0.35); color: #fff; }

.admin-body {
    flex: 1;
    background: #f2f4f8;
    overflow-y: auto;
}


/* ═══════════════════════════════════════════════
   ADMIN PAGES — shared components
   ═══════════════════════════════════════════════ */

.ap-page { padding: 28px 32px; }

.ap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ap-header h2 { font-size: 18px; color: var(--navy); font-weight: 600; }

.ap-count { font-size: 12px; color: #888; }

.ap-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e3e7ef;
    margin-bottom: 20px;
    overflow: hidden;
}

.ap-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    margin: 0;
}

/* Table */
.ap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ap-table th {
    background: #f7f8fb;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #e8eaed;
}
.ap-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}
.ap-table tr:last-child td { border-bottom: none; }
.ap-table tr:hover td { background: #fafbfd; }

.row-parent { font-weight: 500; }
.row-child td:first-child { color: #555; }
.child-indent { color: #bbb; margin-right: 2px; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #fff3e0; color: #e65100; }

.ap-actions { display: flex; gap: 5px; white-space: nowrap; }

/* Buttons */
.ap-btn-primary {
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s;
}
.ap-btn-primary:hover { background: #234a7a; }

.ap-btn-sm {
    background: #fff;
    border: 1px solid #d8dce5;
    color: #444;
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s;
    white-space: nowrap;
}
.ap-btn-sm:hover { background: #f5f6fa; }

.ap-btn-danger { color: #c0392b; border-color: #f5b7b1; }
.ap-btn-danger:hover { background: #fdf3f2; }

/* Form within admin card */
.cm-form { padding: 20px; }
.lf-hint { font-size: 11px; color: #999; font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.lf-textarea { resize: vertical; min-height: 100px; }
.lf-code { font-family: 'Consolas', 'Courier New', monospace; font-size: 12.5px; }
.lf-check { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 13px; color: #444; }
.save-ok { color: #2e7d32; font-size: 12px; background: #e8f5e9; padding: 4px 12px; border-radius: 20px; margin-left: 12px; font-weight: 600; }

/* Upload */
.upload-drop {
    border: 2px dashed #c8d0de;
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin: 16px 20px;
    color: #888;
}
.upload-drop:hover { border-color: var(--accent); background: var(--accent-dim); color: #1565C0; }
.upload-icon { font-size: 28px; display: block; margin-bottom: 8px; opacity: 0.6; }
.upload-hint { font-size: 11px; margin-top: 4px; opacity: 0.7; }
.upload-progress { padding: 10px 20px; color: #1565C0; font-size: 13px; }

/* Image grid in admin */
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 0 20px 20px;
}

.img-tile { border: 1px solid #e3e7ef; border-radius: var(--radius); overflow: hidden; }
.img-tile img { width: 100%; height: 130px; object-fit: cover; display: block; }
.img-tile .lf-input { border: none; border-top: 1px solid #eee; border-radius: 0; font-size: 12px; padding: 7px 10px; background: #fafafa; }
.img-tile-actions { display: flex; gap: 4px; padding: 7px; background: #f5f6fa; }
.img-tile-actions .ap-btn-sm { flex: 1; font-size: 11px; padding: 4px 6px; }

.no-images { padding: 20px; color: #bbb; text-align: center; }

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px 30px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.22);
    margin: 16px;
}

.modal-sm   { max-width: 380px; }
.modal-step { max-width: 600px; width: 100%; }

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 22px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Blazor error UI */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0; left: 0; right: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    overflow: hidden;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    z-index: 9999;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }


/* ═══════════════════════════════════════════════
   DUAL-COLUMN TRAINING PANEL
   ═══════════════════════════════════════════════ */

.tp-dual {
    display: grid;
    grid-template-columns: 42% 58%;
    height: calc(100vh - var(--topbar-h));
    overflow: hidden;
}

.tp-left {
    overflow-y: auto;
    padding: 28px 24px 48px 32px;
    border-right: 1px solid #e8eaed;
}

.tp-left::-webkit-scrollbar { width: 4px; }
.tp-left::-webkit-scrollbar-thumb { background: #d0d4dc; border-radius: 2px; }

.tp-right {
    overflow-y: auto;
    background: #f8f9fb;
}

.tp-right::-webkit-scrollbar { width: 4px; }
.tp-right::-webkit-scrollbar-thumb { background: #d0d4dc; border-radius: 2px; }

.tp-right-sticky {
    padding: 24px 28px 40px;
}

/* Section labels (uppercase small caps like screenshot) */
.tp-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    margin: 24px 0 10px;
}
.tp-section-label:first-child { margin-top: 4px; }

/* Breadcrumb */
.tp-breadcrumb {
    font-size: 12px;
    color: #1565C0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tp-bc-sep { color: #aaa; }

/* Module Title */
.tp-module-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
    line-height: 1.3;
}

/* Video in right column */
.tp-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #000;
    margin-bottom: 16px;
}
.tp-video iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Prev / Next navigation */
.tp-prevnext {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
}
.tp-prevnext-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #888;
    text-transform: uppercase;
}
.tp-prevnext-btn {
    background: none;
    border: 1px solid #d8dce5;
    color: var(--navy);
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.12s;
    line-height: 1;
}
.tp-prevnext-btn:hover:not(:disabled) { background: #e8f0fe; }
.tp-prevnext-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Step thumbnail in right column */
.tp-step-thumb {
    border: 1px solid #e0e4ea;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: zoom-in;
    margin-bottom: 20px;
    background: #fff;
    transition: box-shadow 0.15s;
}
.tp-step-thumb:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.tp-step-thumb img { width: 100%; display: block; max-height: 200px; object-fit: cover; }
.tp-step-thumb-label {
    padding: 8px 12px;
    font-size: 12px;
    color: #555;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* Course Contents */
.tp-course-contents {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: var(--radius);
    overflow: hidden;
}
.tp-cc-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: #f7f8fb;
}
.tp-course-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    border-bottom: 1px solid #f2f4f7;
    transition: background 0.12s;
}
.tp-course-item:last-child { border-bottom: none; }
.tp-course-item:hover { background: #f0f4ff; }
.tp-course-item-active { background: #EFF8FF; color: var(--navy); font-weight: 600; }

.tp-ci-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 2px solid #d0d4dc;
    flex-shrink: 0;
    background: #fff;
}
.tp-ci-dot-active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Key Points two-card grid */
.tp-keypoints-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

.tp-kp-card {
    background: #f7f9fc;
    border: 1px solid #e3e7ef;
    border-radius: var(--radius);
    padding: 14px 16px;
}
.tp-kp-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.tp-kp-body { font-size: 13px; line-height: 1.65; color: #444; }
.tp-kp-body ul { padding-left: 16px; }
.tp-kp-body li { margin-bottom: 4px; }

/* Training Steps (left column) */
.tp-steps { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.tp-step-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e3e7ef;
    border-radius: var(--radius);
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tp-step-item:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(41,182,246,0.1); }
.tp-step-active {
    border-color: var(--accent);
    background: #EFF8FF;
    box-shadow: 0 2px 10px rgba(41,182,246,0.12);
}

.tp-step-number {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.tp-step-active .tp-step-number { background: var(--accent); }

.tp-step-body { flex: 1; min-width: 0; }
.tp-step-title { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.tp-step-desc  { font-size: 13px; line-height: 1.65; color: #555; margin-bottom: 10px; }
.tp-step-desc p { margin-bottom: 6px; }
.tp-step-desc ul { padding-left: 18px; }

.tp-shot {
    border: 1px solid #e0e4ea;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: zoom-in;
    display: inline-block;
    max-width: 100%;
    transition: box-shadow 0.15s;
}
.tp-shot:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.tp-shot img { width: 100%; display: block; max-height: 260px; object-fit: cover; }

.tp-text { font-size: 13.5px; line-height: 1.75; color: #333; margin-bottom: 8px; }
.tp-text h3 { font-size: 14px; margin: 14px 0 6px; color: var(--navy); }
.tp-text p  { margin-bottom: 8px; }
.tp-text ul, .tp-text ol { padding-left: 20px; margin-bottom: 8px; }
.tp-text li { margin-bottom: 3px; }

.tp-updated { font-size: 11px; color: #aaa; margin-top: 16px; }


/* ═══════════════════════════════════════════════
   ADMIN CONTENT MANAGER ADDITIONS
   ═══════════════════════════════════════════════ */

/* Admin Content Manager — two-column layout */
.cm-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.cm-left,
.cm-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Highlight the row currently being edited */
.step-row-editing td { background: #EFF8FF; }

/* Side-by-side Assumptions / Prerequisites textareas */
.cm-kp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ap-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 0;
}

.step-order { color: #999; font-weight: 600; font-size: 13px; }

.step-thumb-sm {
    width: 60px;
    height: 42px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #e3e7ef;
}

.step-img-preview {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.step-img-preview img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid #e3e7ef;
}

.no-image-text { font-size: 11px; color: #bbb; }

/* ═══════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   1024px  Tablet landscape
    900px  Tablet portrait / small laptop
    768px  Tablet small
    480px  Large phone
    360px  Small phone
   ═══════════════════════════════════════════════ */

/* ── Tablet landscape (≤ 1024px) ──────────────── */
@media (max-width: 1024px) {
    /* Narrow sidebar slightly */
    :root { --sidebar-w: 170px; }

    .topbar-breadcrumb { font-size: 11.5px; }

    /* Training panel: give left column more space */
    .tp-dual { grid-template-columns: 46% 54%; }

    /* Admin content manager columns equal */
    .cm-dual { grid-template-columns: 1fr 1fr; }

    .ap-page { padding: 20px 24px; }
}

/* ── Tablet portrait (≤ 900px) ─────────────────── */
@media (max-width: 900px) {
    :root { --sidebar-w: 160px; }

    /* Training panel: stack columns */
    .tp-dual { grid-template-columns: 1fr; height: auto; overflow: visible; }
    .tp-left  { border-right: none; border-bottom: 1px solid #e8eaed; }
    .tp-right { border-top: none; }
    .tp-right-sticky { position: static; }

    /* Admin content: stack columns */
    .cm-dual     { grid-template-columns: 1fr; }
    .cm-kp-grid  { grid-template-columns: 1fr; }
    .tp-keypoints-grid { grid-template-columns: 1fr; }

    /* Tables: allow horizontal scroll instead of overflow */
    .ap-card { overflow-x: auto; }
    .ap-table { min-width: 520px; }

    /* Admin topbar: tighten */
    .admin-topbar { padding: 0 14px; gap: 8px; }
    .admin-nav-link { padding: 6px 10px; font-size: 12px; }
}

/* ── Small tablet / large phone (≤ 768px) ──────── */
@media (max-width: 768px) {
    /* App shell: stack sidebar above content on mobile */
    .app-body { flex-direction: column; }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 220px;
        overflow-y: auto;
        border-right: none;
        border-bottom: 2px solid rgba(0,0,0,0.2);
        display: flex;
        flex-wrap: wrap;
    }

    .sidemenu {
        display: flex;
        flex-wrap: wrap;
        padding: 4px 8px;
        gap: 2px;
        width: 100%;
    }

    .menu-leaf,
    .menu-parent,
    .menu-child {
        padding: 5px 10px;
        font-size: 11.5px;
        white-space: nowrap;
    }

    .main-content { overflow-y: auto; flex: 1; }

    /* Topbar: hide breadcrumb, tighten */
    .topbar-breadcrumb { display: none; }
    .topbar { padding: 0; }
    .topbar-logo { width: auto; padding: 0 12px; border-right: none; }
    .topbar-right { padding: 0 10px; gap: 6px; }
    .user-pill { font-size: 11px; }

    /* Login card: full width with safe padding */
    .login-bg { align-items: flex-start; padding: 24px 16px; }
    .login-card { padding: 28px 20px; border-radius: 8px; }

    /* Training panel adjustments */
    .tp-left  { padding: 16px 16px 32px; }
    .tp-right-sticky { padding: 16px 16px 32px; }
    .tp-module-title { font-size: 17px; }
    .tp-keypoints-grid { grid-template-columns: 1fr; }

    /* Admin shell */
    .admin-topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
    .admin-nav { margin-left: 0; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .admin-nav-link { font-size: 12px; padding: 5px 8px; }
    .btn-admin-logout { margin-left: 0; }

    /* Admin page padding */
    .ap-page { padding: 14px 14px; }
    .ap-header h2 { font-size: 15px; }

    /* Step thumbnail in right column */
    .tp-step-thumb img { max-height: 150px; }
}

/* ── Large phone (≤ 480px) ─────────────────────── */
@media (max-width: 480px) {
    .login-card { padding: 24px 16px; }
    .login-logo  { font-size: 28px; }

    /* Training steps: tighten */
    .tp-step-item { padding: 10px; gap: 10px; }
    .tp-step-number { width: 24px; height: 24px; font-size: 12px; }
    .tp-step-title { font-size: 13px; }

    /* Prev/Next buttons */
    .tp-prevnext { padding: 8px 10px; }
    .tp-prevnext-label { font-size: 10px; }

    /* Course contents */
    .tp-course-item { padding: 7px 12px; font-size: 12px; }

    /* Admin actions: smaller buttons */
    .ap-actions { gap: 3px; flex-wrap: wrap; }
    .ap-btn-sm  { padding: 4px 8px; font-size: 11px; }

    /* Modal full-width on phone */
    .modal-box { padding: 20px 16px; margin: 8px; border-radius: 6px; }

    /* Key points cards stack */
    .tp-kp-card { padding: 10px 12px; }

    /* cm-kp-grid already 1fr from 900px breakpoint */
}

/* ── Small phone (≤ 360px) ─────────────────────── */
@media (max-width: 360px) {
    :root { --topbar-h: 40px; }
    .topbar-logo .logo { font-size: 17px; }
    .tp-left, .tp-right-sticky { padding: 12px 10px 24px; }
    .ap-page { padding: 10px; }
    .lf-input { font-size: 13px; }
    .lf-btn   { font-size: 13px; }
}

/* ════════════════════════════════════════════════
   ERROR BOUNDARY
   ════════════════════════════════════════════════ */
.error-boundary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
    color: #c0392b;
}
.error-boundary-icon { font-size: 40px; line-height: 1; }
.error-boundary-msg  { font-size: 15px; color: #555; margin: 0; }
.eb-btn {
    padding: 8px 20px;
    background: #1B3057;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.eb-btn:hover { background: #24427a; }

/* ════════════════════════════════════════════════
   ERROR LOG VIEWER  (/admin/errors)
   ════════════════════════════════════════════════ */
.el-filter {
    padding: 5px 10px;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #1B3057;
}

.el-confirm {
    background: #fff5f5;
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.el-confirm p { margin: 0; flex: 1 1 200px; font-size: 14px; color: #c0392b; }

.el-empty { color: #888; font-style: italic; padding: 24px 0; text-align: center; }

.el-table { font-size: 13px; }
.el-table th { white-space: nowrap; }

.el-time   { white-space: nowrap; color: #666; font-size: 12px; }
.el-source { color: #888; font-size: 12px; max-width: 120px; word-break: break-word; }
.el-msg    { max-width: 380px; }
.el-msg-short { font-weight: 500; word-break: break-word; }

.el-details summary {
    cursor: pointer;
    color: #1B3057;
    font-size: 12px;
    margin-top: 4px;
    user-select: none;
}
.el-stack {
    font-size: 11px;
    background: #f4f6f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px 10px;
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    color: #333;
}

.el-actions { white-space: nowrap; display: flex; gap: 4px; }

/* Severity badges */
.el-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.el-error   { background: #fde8e8; color: #c0392b; }
.el-warning { background: #fef6e4; color: #d4890a; }
.el-info    { background: #e8f4fd; color: #1a6fa8; }

/* Row tinting */
.el-row-resolved { opacity: 0.55; }
.el-row-error    { border-left: 3px solid #e74c3c; }
.el-row-warning  { border-left: 3px solid #f39c12; }
.el-row-info     { border-left: 3px solid #3498db; }

/* Responsive */
@media (max-width: 768px) {
    .el-source, .el-time { display: none; }
    .el-msg { max-width: unset; }
}

/* ════════════════════════════════════════════════
   RICH TEXT EDITOR
   ════════════════════════════════════════════════ */

.rte-wrapper {
    display: flex;
    flex-direction: column;
    height: 280px;
    border: 1px solid #dde1e8;
    border-radius: var(--radius);
    overflow: hidden;
}

.rte-container {
    border: none;
    border-radius: 0;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rte-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: #f7f8fb;
    border-bottom: 1px solid #e8eaed;
    flex-wrap: wrap;
}

.rte-btn {
    background: #fff;
    border: 1px solid #d8dce5;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    font-family: inherit;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
}

.rte-btn:hover {
    background: #e8f0fe;
    border-color: var(--accent);
    color: var(--navy);
}

.rte-icon {
    display: inline-block;
}

.rte-sep {
    width: 1px;
    height: 20px;
    background: #e8eaed;
    margin: 0 4px;
}

.rte-split-view {
    flex: 1;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid #e8eaed;
}

.rte-editor-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #e8eaed;
}

.rte-preview-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rte-pane-label {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    padding: 8px 12px;
    background: #fafbfd;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e8eaed;
}

.rte-textarea {
    flex: 1;
    border: none;
    padding: 12px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    color: #222;
    overflow-y: auto;
}

.rte-textarea:focus {
    outline: none;
    background: #fafbfd;
}

.rte-preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-size: 13.5px;
    line-height: 1.75;
    color: #333;
}

.rte-preview-content h3 {
    font-size: 15px;
    color: var(--navy);
    margin: 12px 0 6px;
    font-weight: 600;
}

.rte-preview-content p {
    margin-bottom: 10px;
}

.rte-preview-content ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.rte-preview-content li {
    margin-bottom: 4px;
}

.rte-preview-content b {
    font-weight: 600;
    color: #111;
}

/* ═══════════════════════════════════════════════
   QUILL EDITOR STYLING
   ═══════════════════════════════════════════════ */

.quill-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #dde1e8;
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.quill-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Override Quill theme styles */
.ql-container {
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    border: none !important;
    border-radius: 0;
}

.ql-editor {
    padding: 12px;
    height: 100%;
    overflow-y: auto;
    color: #222;
}

.ql-editor.ql-blank::before {
    color: #aaa;
    font-style: italic;
}

.ql-editor:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px var(--accent);
}

.ql-toolbar {
    border: none !important;
    border-bottom: 1px solid #e8eaed !important;
    background: #f7f8fb;
    padding: 8px 10px !important;
}

.ql-toolbar.ql-snow .ql-formats {
    margin-right: 12px;
}

.ql-toolbar.ql-snow .ql-stroke {
    stroke: #444;
}

.ql-toolbar.ql-snow .ql-fill,
.ql-toolbar.ql-snow .ql-stroke.ql-fill {
    fill: #444;
}

.ql-toolbar.ql-snow button:hover,
.ql-toolbar.ql-snow button:focus,
.ql-toolbar.ql-snow button.ql-active {
    color: var(--accent);
}

.ql-toolbar.ql-snow button:hover .ql-stroke,
.ql-toolbar.ql-snow button:focus .ql-stroke,
.ql-toolbar.ql-snow button.ql-active .ql-stroke {
    stroke: var(--accent);
}

.ql-toolbar.ql-snow button:hover .ql-fill,
.ql-toolbar.ql-snow button:focus .ql-fill,
.ql-toolbar.ql-snow button.ql-active .ql-fill {
    fill: var(--accent);
}

.ql-toolbar.ql-snow .ql-picker-label {
    color: #444;
}

.ql-snow.ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active {
    background-color: #e8f0fe;
}

/* Dropdown styling */
.ql-picker-options {
    background: #fff;
    border: 1px solid #d8dce5;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ql-picker-item:hover {
    background-color: #f0f4f8;
}

/* Content styling when displaying */
.quill-content h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 16px 0 8px;
}

.quill-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 14px 0 7px;
}

.quill-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
    margin: 12px 0 6px;
}

.quill-content p {
    margin-bottom: 10px;
}

.quill-content ul,
.quill-content ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.quill-content li {
    margin-bottom: 4px;
}

.quill-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 10px;
    margin: 10px 0;
    color: #666;
    font-style: italic;
}

.quill-content code {
    background: #f0f2f7;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}
