/* ── CAD Hub Styles ──────────────────────────────────────────────────────────── */

:root {
    --hub-navy:   #0f2044;
    --hub-navy2:  #1a3060;
    --hub-accent: #1e88e5;
    --hub-accent2:#1565c0;
    --hub-bg:     #f1f5f9;
    --hub-white:  #ffffff;
    --hub-border: #e2e8f0;
    --hub-text:   #1e293b;
    --hub-muted:  #64748b;
    --hub-green:  #22c55e;
    --hub-amber:  #f59e0b;
    --hub-red:    #ef4444;
    --hub-sidebar-w: 240px;
}

/* Reset scoped to hub */
.hub-app *, .hub-login-wrap * { box-sizing: border-box; }

/* ── Login ───────────────────────────────────────────────────────────────────── */

.hub-login-wrap {
    min-height: 100vh;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin: -40px -20px 0;
}

.hub-login-card {
    background: var(--hub-white);
    border-radius: 16px;
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    box-shadow: 0 4px 32px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid var(--hub-border);
}

.hub-login-logo {
    text-align: center;
    margin-bottom: 10px;
}
.hub-login-logo img { max-height: 80px; width: auto; }
.hub-site-name { font-size: 18px; font-weight: 700; color: var(--hub-navy); }

.hub-login-site {
    text-align: center;
    font-size: 13px;
    color: var(--hub-muted);
    margin: 0 0 6px;
    font-weight: 500;
}

.hub-login-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--hub-navy);
    margin: 0 0 6px;
}
.hub-login-sub {
    text-align: center;
    color: var(--hub-muted);
    font-size: 13px;
    margin: 0 0 28px;
    line-height: 1.5;
}
.hub-login-error {
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
    border: 1px solid #fecaca;
}

.hub-login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--hub-text);
    margin-bottom: 6px;
}

.hub-login-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--hub-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--hub-text);
    outline: none;
    transition: border-color .2s;
    background: white;
    font-family: inherit;
}
.hub-login-input:focus { border-color: var(--hub-accent); box-shadow: 0 0 0 3px rgba(30,136,229,0.12); }

.hub-login-form .hub-form-row { margin-bottom: 16px; }

.hub-login-disclaimer {
    margin: 18px 0 20px;
    background: #f8fafc;
    border: 1.5px solid var(--hub-border);
    border-radius: 10px;
    padding: 14px 16px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.hub-disclaimer-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px;
    cursor: pointer;
    font-size: 13px !important;
    color: var(--hub-text) !important;
    line-height: 1.5 !important;
    width: 100% !important;
    white-space: normal !important;
}
.hub-disclaimer-label span {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}
.hub-disclaimer-label input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
    accent-color: var(--hub-accent);
    cursor: pointer;
}

.hub-login-btn {
    font-size: 15px !important;
    padding: 13px 20px !important;
    border-radius: 9px !important;
}

.hub-login-footer {
    text-align: center;
    margin-top: 16px;
}
.hub-forgot { color: var(--hub-accent) !important; text-decoration: none !important; font-size: 13px; }
.hub-forgot:hover { text-decoration: underline !important; }

/* ── App Shell ───────────────────────────────────────────────────────────────── */

.hub-app {
    display: flex;
    min-height: 100vh;
    background: var(--hub-bg);
    margin: -40px -20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */

.hub-sidebar {
    width: var(--hub-sidebar-w);
    background: var(--hub-navy);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform .3s ease;
}

.hub-sidebar-logo {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.hub-sidebar-logo img { max-height: 50px; width: auto; filter: brightness(0) invert(1); }
.hub-sidebar-logo .hub-site-name { color: white; font-size: 15px; }

.hub-nav {
    padding: 12px 0;
    flex: 1;
}

.hub-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7) !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: background .2s, color .2s;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}
.hub-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.hub-nav-item:hover, .hub-nav-item--active {
    background: rgba(255,255,255,0.1);
    color: white !important;
    text-decoration: none !important;
}
.hub-nav-item--active { border-left: 3px solid var(--hub-accent); padding-left: 17px; }
.hub-nav-item--logout { color: rgba(255,255,255,0.5) !important; font-size: 13px; }
.hub-nav-item--logout:hover { color: white !important; background: rgba(255,0,0,0.15); }

.hub-nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hub-sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ── Main ────────────────────────────────────────────────────────────────────── */

.hub-main {
    margin-left: var(--hub-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────────── */

.hub-topbar {
    background: var(--hub-white);
    border-bottom: 1px solid var(--hub-border);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.hub-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--hub-navy);
    margin-right: auto;
}
.hub-hamburger svg { width: 22px; height: 22px; }

.hub-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hub-welcome { font-size: 14px; color: var(--hub-muted); }
.hub-welcome strong { color: var(--hub-text); }

.hub-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--hub-accent);
    color: white;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Content ─────────────────────────────────────────────────────────────────── */

.hub-content {
    padding: 28px;
    flex: 1;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all .2s;
    white-space: nowrap;
}
.hub-btn--primary { background: var(--hub-accent) !important; color: white !important; }
.hub-btn--primary:hover { background: var(--hub-accent2) !important; color: white !important; text-decoration: none !important; }
.hub-btn--outline { background: white !important; color: var(--hub-accent) !important; border: 1.5px solid var(--hub-accent) !important; }
.hub-btn--outline:hover { background: #eff6ff !important; text-decoration: none !important; }
.hub-btn--ghost { background: transparent !important; color: var(--hub-muted) !important; border: 1.5px solid var(--hub-border) !important; }
.hub-btn--ghost:hover { background: var(--hub-bg) !important; color: var(--hub-text) !important; text-decoration: none !important; }
.hub-btn--danger { background: #fff1f2 !important; color: #b91c1c !important; border: 1.5px solid #fecaca !important; }
.hub-btn--danger:hover { background: #fee2e2 !important; color: #991b1b !important; text-decoration: none !important; }
.hub-btn--sm { padding: 6px 12px; font-size: 13px; }
.hub-btn--lg { padding: 12px 20px; font-size: 15px; }
.hub-btn--full { width: 100%; justify-content: center; display: flex; }

/* ── Dashboard ───────────────────────────────────────────────────────────────── */

.hub-dashboard-hero {
    background: linear-gradient(135deg, var(--hub-navy) 0%, #1a4080 100%);
    color: white !important;
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.hub-dashboard-hero h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: white !important; }
.hub-dashboard-hero p { margin: 0; opacity: 0.85; font-size: 14px; line-height: 1.6; max-width: 480px; color: white !important; }
.hub-hero-icon { width: 80px; height: 80px; opacity: 0.6; flex-shrink: 0; }

.hub-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.hub-card {
    background: var(--hub-white);
    border-radius: 14px;
    padding: 24px 20px;
    text-decoration: none !important;
    color: var(--hub-text) !important;
    border: 1px solid var(--hub-border);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hub-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); color: var(--hub-text) !important; text-decoration: none !important; }
.hub-card--add { border-style: dashed; }

.hub-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.hub-card-icon svg { width: 24px; height: 24px; }
.hub-card h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--hub-text) !important; }
.hub-card p { margin: 0; font-size: 12px; color: var(--hub-muted) !important; line-height: 1.5; flex: 1; }
.hub-card-count { font-size: 12px; font-weight: 600; color: var(--hub-accent) !important; display: flex; align-items: center; gap: 4px; margin-top: 4px; }

/* ── Document List ───────────────────────────────────────────────────────────── */

.hub-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.hub-list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.hub-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.hub-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.hub-search-wrap svg {
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: var(--hub-muted);
}
.hub-search-wrap input {
    padding: 8px 12px 8px 34px;
    border: 1.5px solid var(--hub-border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    width: 220px;
    background: white;
}
.hub-search-wrap input:focus { border-color: var(--hub-accent); }

.hub-section-title { font-size: 18px; font-weight: 700; margin: 0 0 16px; color: var(--hub-navy); }

.hub-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--hub-muted);
}
.hub-breadcrumb a { color: var(--hub-accent); text-decoration: none; }
.hub-breadcrumb a:hover { text-decoration: underline; }
.hub-breadcrumb--mb { margin-bottom: 20px; }

.hub-table-wrap { background: white; border-radius: 12px; border: 1px solid var(--hub-border); overflow: hidden; }
.hub-table { width: 100%; border-collapse: collapse; }
.hub-table th { background: #f8fafc; padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--hub-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--hub-border); }
.hub-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid #f1f5f9; color: var(--hub-text); vertical-align: middle; }
.hub-table tr:last-child td { border-bottom: none; }
.hub-table tr:hover td { background: #f8fafc; }
.hub-table--sm th, .hub-table--sm td { padding: 10px 12px; font-size: 13px; }

.hub-doc-link { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--hub-text) !important; font-weight: 500; }
.hub-doc-link:hover { color: var(--hub-accent) !important; }

.hub-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .05em;
    flex-shrink: 0;
}
.hub-file-icon--pdf { background: #fee2e2; color: #dc2626; }
.hub-file-icon--doc { background: #dbeafe; color: #2563eb; }

/* ── Status Badges ───────────────────────────────────────────────────────────── */

.hub-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.hub-badge--green { background: #dcfce7; color: #15803d; }
.hub-badge--amber { background: #fef3c7; color: #92400e; }
.hub-badge--red   { background: #fee2e2; color: #dc2626; }
.hub-badge--grey  { background: #f1f5f9; color: #64748b; }

/* ── Select ──────────────────────────────────────────────────────────────────── */

.hub-select {
    padding: 8px 30px 8px 10px;
    border: 1.5px solid var(--hub-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--hub-text);
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
}
.hub-select:focus { border-color: var(--hub-accent); }
.hub-select--full { width: 100%; }

/* ── Empty State ─────────────────────────────────────────────────────────────── */

.hub-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--hub-muted);
    background: white;
    border-radius: 12px;
    border: 1px solid var(--hub-border);
}
.hub-empty p { margin: 12px 0 0; font-size: 15px; }

/* ── Document Detail ─────────────────────────────────────────────────────────── */

.hub-detail-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: start;
}

.hub-detail-main {
    background: white;
    border-radius: 14px;
    border: 1px solid var(--hub-border);
    padding: 28px;
}
.hub-detail-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.hub-detail-head h2 { margin: 0 0 8px; font-size: 20px; color: var(--hub-navy); }

.hub-file-icon-lg {
    width: 64px;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}
.hub-file-icon-lg--pdf { background: #fee2e2; color: #dc2626; }
.hub-file-icon-lg--doc { background: #dbeafe; color: #2563eb; }

.hub-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 24px;
}
.hub-meta-item span { display: block; font-size: 11px; color: var(--hub-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.hub-meta-item strong { font-size: 14px; color: var(--hub-text); }

.hub-detail-desc { margin-bottom: 24px; }
.hub-detail-desc h3, .hub-detail-history h3 { font-size: 15px; font-weight: 700; margin: 0 0 12px; color: var(--hub-navy); }

.hub-detail-history .hub-table-wrap { border: 1px solid var(--hub-border); }

.hub-detail-side {
    background: white;
    border-radius: 14px;
    border: 1px solid var(--hub-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 80px;
}

/* ── Add Document Form ───────────────────────────────────────────────────────── */

.hub-form-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.hub-form-head h2 { margin: 0; font-size: 22px; color: var(--hub-navy); }
.hub-form-head-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--hub-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hub-form-card {
    background: white;
    border-radius: 14px;
    border: 1px solid var(--hub-border);
    padding: 28px;
    max-width: 680px;
}

.hub-form-row { margin-bottom: 20px; }
.hub-label { display: block; font-size: 13px; font-weight: 600; color: var(--hub-text); margin-bottom: 6px; }
.hub-req { color: #ef4444; }
.hub-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--hub-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--hub-text);
    outline: none;
    transition: border-color .2s;
    background: white;
}
.hub-input:focus { border-color: var(--hub-accent); }
.hub-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--hub-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--hub-text);
    outline: none;
    resize: vertical;
    transition: border-color .2s;
    font-family: inherit;
    background: white;
}
.hub-textarea:focus { border-color: var(--hub-accent); }

.hub-form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.hub-file-drop {
    border: 2px dashed var(--hub-border);
    border-radius: 10px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    color: var(--hub-muted);
}
.hub-file-drop:hover { border-color: var(--hub-accent); background: #eff6ff; }
.hub-file-drop svg { color: var(--hub-muted); margin-bottom: 10px; }
.hub-file-drop p { margin: 0; font-size: 14px; }
.hub-file-browse { color: var(--hub-accent); cursor: pointer; font-weight: 600; text-decoration: underline; }
.hub-file-hint { font-size: 12px; color: #94a3b8; margin-top: 8px !important; }

.hub-upload-progress { margin-top: 12px; }
.hub-progress-bar { background: #e2e8f0; border-radius: 100px; height: 6px; overflow: hidden; margin-bottom: 6px; }
.hub-progress-fill { background: var(--hub-accent); height: 100%; width: 0; transition: width .3s; border-radius: 100px; }
.hub-upload-progress span { font-size: 12px; color: var(--hub-muted); }

.hub-file-info {
    margin-top: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #15803d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hub-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--hub-border);
}

.hub-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.hub-alert--success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.hub-alert--error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hub-sidebar {
        transform: translateX(-100%);
    }
    .hub-sidebar.hub-sidebar--open {
        transform: translateX(0);
    }
    .hub-main { margin-left: 0; }
    .hub-hamburger { display: flex; }

    .hub-dashboard-hero { flex-direction: column; }
    .hub-hero-icon { display: none; }

    .hub-card-grid { grid-template-columns: 1fr 1fr; }

    .hub-detail-grid { grid-template-columns: 1fr; }
    .hub-detail-side { position: static; }

    .hub-form-row-group { grid-template-columns: 1fr; }

    .hub-content { padding: 16px; }
    .hub-topbar { padding: 12px 16px; }
    .hub-welcome { display: none; }

    .hub-list-header { flex-direction: column; }
    .hub-search-wrap input { width: 160px; }
}

@media (max-width: 480px) {
    .hub-card-grid { grid-template-columns: 1fr; }
    .hub-login-card { padding: 28px 20px; }
    .hub-table-wrap { overflow-x: auto; }
}

/* ── Sidebar overlay on mobile ───────────────────────────────────────────────── */

.hub-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}
.hub-sidebar-overlay.active { display: block; }

/* ── Strip WP page title/padding when hub is active ─────────────────────────── */

.hub-app ~ *, .hub-login-wrap ~ * { display: none !important; }

/* ── Visibility badges ───────────────────────────────────────────────────────── */

.hub-badge--blue  { background: #dbeafe; color: #1d4ed8; }
.hub-badge--slate { background: #f1f5f9; color: #475569; }

/* ── Card with featured image ────────────────────────────────────────────────── */

.hub-card--has-image {
    padding: 0;
    overflow: hidden;
}
.hub-card--has-image h3,
.hub-card--has-image p,
.hub-card--has-image .hub-card-count {
    padding: 0 16px;
}
.hub-card--has-image h3 { padding-top: 14px; }
.hub-card--has-image .hub-card-count { padding-bottom: 16px; }

.hub-card-cover {
    position: relative;
    width: 100%;
    height: 130px;
    background-size: cover;
    background-position: center;
    background-color: #e2e8f0;
    flex-shrink: 0;
}
.hub-card-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.3) 100%);
}

/* ── Table thumbnail ─────────────────────────────────────────────────────────── */

.hub-thumb-sm {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--hub-border);
    display: block;
}
.hub-file-icon--sm {
    width: 36px;
    height: 36px;
    font-size: 8px;
}

/* ── Featured image upload ───────────────────────────────────────────────────── */

.hub-thumb-upload-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.hub-thumb-preview {
    position: relative;
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--hub-border);
    flex-shrink: 0;
}
.hub-thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.hub-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.55);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hub-thumb-remove:hover { background: rgba(220,38,38,0.85); }

.hub-thumb-picker { display: flex; align-items: center; gap: 8px; }

/* ── Archived notice in sidebar ──────────────────────────────────────────────── */

.hub-archived-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 600;
}

/* ── Version history current row ─────────────────────────────────────────────── */

.hub-history-current td { background: #f0f9ff !important; }

/* ── Current file indicator ──────────────────────────────────────────────────── */

.hub-current-file {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--hub-muted);
    background: #f8fafc;
    border: 1px solid var(--hub-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
}
.hub-current-file strong { color: var(--hub-text); }

/* ── Visibility radio options ────────────────────────────────────────────────── */

.hub-vis-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hub-vis-option {
    cursor: pointer;
}
.hub-vis-option input[type="radio"] { display: none; }
.hub-vis-option-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
    border: 2px solid var(--hub-border);
    border-radius: 10px;
    text-align: center;
    min-width: 110px;
    background: white;
    transition: border-color .2s, background .2s;
    color: var(--hub-text);
}
.hub-vis-option-inner svg { color: var(--hub-muted); }
.hub-vis-option-inner strong { font-size: 13px; display: block; }
.hub-vis-option-inner small { font-size: 11px; color: var(--hub-muted); line-height: 1.3; }
.hub-vis-option input[type="radio"]:checked + .hub-vis-option-inner {
    border-color: var(--hub-accent);
    background: #eff6ff;
}
.hub-vis-option input[type="radio"]:checked + .hub-vis-option-inner svg { color: var(--hub-accent); }
.hub-vis-option:hover .hub-vis-option-inner { border-color: var(--hub-accent); }

/* ── Notify checkbox ─────────────────────────────────────────────────────────── */

.hub-notify-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
}
.hub-notify-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--hub-text);
    line-height: 1.5;
}
.hub-notify-label input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--hub-accent);
    cursor: pointer;
}

/* ── Review alerts (dashboard) ───────────────────────────────────────────────── */

.hub-review-alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.hub-review-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}
.hub-review-alert--overdue {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.hub-review-alert--soon {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.hub-review-alert a {
    font-weight: 600;
    text-decoration: underline;
}
.hub-review-alert--overdue a { color: #b91c1c !important; }
.hub-review-alert--soon a    { color: #92400e !important; }

/* ── Help page ───────────────────────────────────────────────────────────────── */

.hub-help-page { max-width: 860px; margin: 0 auto; }

.hub-help-header {
    background: linear-gradient(135deg, var(--hub-navy) 0%, var(--hub-navy2) 100%);
    color: #fff;
    border-radius: 14px;
    padding: 32px 36px;
    margin-bottom: 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.hub-help-header h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.hub-help-header p  { margin: 0; opacity: .85; font-size: 14px; }

.hub-help-print-btn {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background .2s;
}
.hub-help-print-btn:hover { background: rgba(255,255,255,0.25); }

.hub-help-toc {
    background: var(--hub-white);
    border: 1px solid var(--hub-border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 28px;
}
.hub-help-toc h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--hub-muted); }
.hub-help-toc ol { margin: 0; padding-left: 20px; }
.hub-help-toc li { margin: 4px 0; font-size: 14px; }
.hub-help-toc a  { color: var(--hub-accent) !important; text-decoration: none; }
.hub-help-toc a:hover { text-decoration: underline; }

.hub-help-body { display: flex; flex-direction: column; gap: 24px; }

.hub-help-section {
    background: var(--hub-white);
    border: 1px solid var(--hub-border);
    border-radius: 12px;
    padding: 24px 28px;
    scroll-margin-top: 20px;
}
.hub-help-section h2 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: var(--hub-navy);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hub-border);
}
.hub-help-section p  { margin: 0 0 10px; font-size: 14px; line-height: 1.65; color: var(--hub-text); }
.hub-help-section ul,
.hub-help-section ol { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.65; color: var(--hub-text); }
.hub-help-section li { margin: 4px 0; }

.hub-help-tip {
    background: #eff6ff;
    border-left: 3px solid var(--hub-accent);
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    font-size: 13px;
    color: #1e40af;
    margin-top: 10px;
}

.hub-help-vis-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.hub-help-vis-table th {
    background: var(--hub-bg);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--hub-border);
}
.hub-help-vis-table td {
    padding: 8px 12px;
    border: 1px solid var(--hub-border);
    vertical-align: top;
}
.hub-help-vis-row--published td:first-child { color: #1d4ed8; font-weight: 600; }
.hub-help-vis-row--draft     td:first-child { color: #475569; font-weight: 600; }
.hub-help-vis-row--archived  td:first-child { color: #64748b; font-weight: 600; }

/* ── Dashboard Help section ──────────────────────────────────────────────────── */

.hub-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.hub-help-card {
    background: var(--hub-bg);
    border: 1px solid var(--hub-border);
    border-radius: 10px;
    padding: 16px;
    text-decoration: none !important;
    color: var(--hub-text) !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color .2s, box-shadow .2s;
}
.hub-help-card:hover {
    border-color: var(--hub-accent);
    box-shadow: 0 2px 8px rgba(30,136,229,.12);
}
.hub-help-card strong { font-size: 14px; font-weight: 600; color: var(--hub-navy); }
.hub-help-card small  { font-size: 12px; color: var(--hub-muted); line-height: 1.4; }
.hub-help-card--all {
    background: var(--hub-accent);
    border-color: var(--hub-accent);
    color: #fff !important;
}
.hub-help-card--all strong,
.hub-help-card--all small { color: #fff; }
.hub-help-card--all:hover { background: var(--hub-accent2); border-color: var(--hub-accent2); }

/* ── Print styles (Help page) ────────────────────────────────────────────────── */

@media print {
    .hub-sidebar, .hub-topbar, .hub-help-print-btn, .hub-help-toc { display: none !important; }
    .hub-main { margin-left: 0 !important; padding: 0 !important; }
    .hub-help-header { background: none !important; color: #000 !important; border: 1px solid #ccc; }
    .hub-help-section { border: 1px solid #ccc; break-inside: avoid; }
    .hub-help-section h2 { color: #000; }
    body { background: #fff !important; }
    * { box-shadow: none !important; }
}
