@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');

* {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

body {
    color: #212529;
    background: #eee;
    font-size: 1rem;
}

.sb-nav-fixed body,
body.sb-nav-fixed {
    padding-top: 4rem;
}

/* ═══════════════════════════════════════════════════════════════
   CCMS DESIGN SYSTEM — Component Classes
   All UI elements use these classes. No inline styles in templates.
   ═══════════════════════════════════════════════════════════════ */

/* ── Global form overrides ──────────────────────────────────── */

.form-control {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-color: #e2e8f0;
}

.form-label {
    font-size: 1rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.4rem;
}

.form-select:focus,
.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #00a04a;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(0, 160, 74, 0.25);
}

/* ── Cards ──────────────────────────────────────────────────── */

.ccms-card {
    background: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ccms-card .card-body {
    padding: 1.5rem;
}

/* ── Page headers ───────────────────────────────────────────── */

.ccms-page-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.ccms-page-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #00a04a 0%, #007d39 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1rem;
}

.ccms-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1e293b;
    margin: 0;
}

.ccms-page-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0.15rem 0 0 0;
}

/* ── Section titles inside cards ────────────────────────────── */

.ccms-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.75rem;
}

.ccms-card-header-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.icon-blue { background: #eff6ff; color: #3b82f6; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-green { background: #f0fdf4; color: #16a34a; }
.icon-brand { background: #e8f6ed; color: #00a04a; }
.icon-grey { background: #f1f5f9; color: #64748b; }
.icon-red { background: #fef2f2; color: #dc2626; }

/* ── Stat cards (dashboard) ─────────────────────────────────── */

.ccms-stat-card {
    background: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
}

.ccms-stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.ccms-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.ccms-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* ── Action items (dashboard quick links) ───────────────────── */

.ccms-action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.ccms-action-item:hover {
    background: #f8fafc;
}

.ccms-dashboard-activity-scroll { overflow-y: auto; max-height: 18rem; }
.ccms-dashboard-activity-scroll::-webkit-scrollbar { width: 4px; }
.ccms-dashboard-activity-scroll::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.ccms-dashboard-activity-scroll::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

.ccms-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.ccms-action-title {
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
}

.ccms-action-desc {
    font-size: 1rem;
    color: #94a3b8;
    margin: 0;
}

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

.ccms-btn-primary {
    background: #00a04a;
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 160, 74, 0.2);
    transition: all 0.2s ease;
}

.ccms-btn-primary:hover {
    background: #007d39;
    box-shadow: 0 4px 12px rgba(0, 160, 74, 0.35);
    color: #fff;
}

.ccms-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.08);
    transition: all 0.15s ease;
}

.ccms-btn-secondary:hover {
    background: #e2e8f0;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.15);
    color: #334155;
}

.ccms-btn-outline {
    color: #00a04a;
    background: transparent;
    border: 1px solid #00a04a;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.ccms-btn-outline:hover {
    background: #00a04a;
    color: #fff;
}

.ccms-btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
    transition: all 0.15s ease;
}

.ccms-btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
    color: #fff;
}

.ccms-btn-outline-danger {
    color: #dc2626;
    background: transparent;
    border: 1px solid #dc2626;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.ccms-btn-outline-danger:hover {
    background: #dc2626;
    color: #fff;
}

.ccms-btn-outline-warning {
    color: #ca8a04;
    background: transparent;
    border: 1px solid #eab308;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.ccms-btn-outline-warning:hover {
    background: #eab308;
    color: #fff;
}

.ccms-btn-warning {
    background: #eab308;
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.25);
    transition: all 0.15s ease;
}

.ccms-btn-warning:hover {
    background: #ca8a04;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
    color: #fff;
}

.ccms-btn-success { background: #16a34a; color: #fff; border: none; font-weight: 600; border-radius: 8px; padding: 0.5rem 1rem; font-size: 1rem; box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25); transition: all 0.15s ease; }
.ccms-btn-success:hover { background: #15803d; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4); color: #fff; }

/* Focus rings — each variant keeps its own colour instead of the global .btn:focus */
.ccms-btn-primary:focus,
.ccms-btn-outline:focus { box-shadow: 0 0 0 0.25rem rgba(0, 160, 74, 0.4); }
.ccms-btn-secondary:focus { box-shadow: 0 0 0 0.25rem rgba(100, 116, 139, 0.35); }
.ccms-btn-danger:focus,
.ccms-btn-outline-danger:focus { box-shadow: 0 0 0 0.25rem rgba(220, 38, 38, 0.4); }
.ccms-btn-warning:focus,
.ccms-btn-outline-warning:focus { box-shadow: 0 0 0 0.25rem rgba(234, 179, 8, 0.4); }
.ccms-btn-success:focus { box-shadow: 0 0 0 0.25rem rgba(22, 163, 74, 0.4); }

/* ── Members ────────────────────────────────────────────────── */

.ccms-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
}

.ccms-member-row + .ccms-member-row {
    border-top: 1px solid #f1f5f9;
}

.ccms-member-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 0.75rem;
}

.ccms-badge-role {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ── Metadata ───────────────────────────────────────────────── */

.ccms-meta {
    font-size: 0.85rem;
    color: #94a3b8;
}

.ccms-description {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.5;
}

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

.ccms-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.ccms-login-container {
    width: 100%;
    max-width: 450px;
}

.ccms-login-brand {
    margin-bottom: 0.5rem;
    line-height: 1;
}

.ccms-login-logo {
    height: 7rem;
    width: auto;
    display: block;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.ccms-login-tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.ccms-login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 2rem;
}

.ccms-login-footer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

/* ── Error pages ────────────────────────────────────────────── */

.ccms-error-page {
    min-height: 100vh;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ccms-error-content {
    text-align: center;
    max-width: 480px;
    padding: 2rem;
}

.ccms-error-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.ccms-error-desc {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.ccms-error-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    color: #334155;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.ccms-error-link:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

.ccms-error-link i {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ── Project cards ──────────────────────────────────────────── */

.ccms-project-card {
    background: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.ccms-project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.ccms-project-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00a04a 0%, #007d39 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1rem;
}

/* ── Empty state ────────────────────────────────────────────── */

.ccms-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.ccms-empty-state-compact {
    padding: 1.5rem 0;
}

.ccms-page-header-flush { margin-top: 0; }
.ccms-modal-card { border-radius: 12px; }
.ccms-italic { font-style: italic; }
.ccms-no-resize { resize: none; }

.ccms-empty-placeholder-icon {
    font-size: 1.5rem;
    color: #e2e8f0;
    display: block;
    margin-bottom: 0.5rem;
}

.ccms-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e8f6ed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 2rem;
    color: #00a04a;
    opacity: 0.7;
}

.ccms-empty-title {
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.25rem;
}

.ccms-empty-desc {
    font-size: 1rem;
    color: #94a3b8;
}

/* ── Search ─────────────────────────────────────────────────── */

.ccms-navbar-spacer {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    padding: 0 1rem;
}

.ccms-search-wrapper {
    position: relative;
    width: 16rem;
}

.ccms-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.ccms-search-icon {
    position: absolute;
    left: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 1;
}

.ccms-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.ccms-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.ccms-search-input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.ccms-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 360px;
    overflow-y: auto;
    padding: 0.35rem;
}

.ccms-search-results.show {
    display: block;
}

.ccms-search-result-item {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: #334155;
    font-size: 1rem;
    transition: background 0.1s ease;
}

.ccms-search-result-item:hover, .ccms-search-result-item:focus {
    background: #f8fafc;
    color: #1e293b;
    outline: none;
}

.ccms-search-result-title { display: flex; align-items: center; gap: 0.35rem; }
.ccms-search-result-title > span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ccms-search-result-snippet { margin-top: 0.15rem; font-size: 0.8rem; color: #64748b; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ccms-search-result-snippet mark { background-color: #fef08a; color: inherit; padding: 0; border-radius: 0.125rem; }

.ccms-search-no-results {
    padding: 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 1rem;
}

/* ── Navbar ──────────────────────────────────────────────────── */

.sb-topnav .navbar-brand {
    display: flex;
    align-items: center;
    padding: 0;
    width: auto;
}

.ccms-navbar-logo {
    height: 3rem;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.ccms-navbar-brand-text {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-left: 0.05rem;
    margin-top: 1rem;
}

.ccms-nav-link {
    font-size: 1rem !important;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65) !important;
    padding: 0.45rem 0.85rem !important;
    border-radius: 6px;
    transition: all 0.15s ease !important;
}

.ccms-nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
}

.ccms-nav-link.active {
    color: #fff !important;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
}

.ccms-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    transition: all 0.15s ease;
    color: #fff;
    font-size: 0.7rem;
}

/* ── User dropdown ──────────────────────────────────────────── */

.ccms-dropdown {
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 0.5rem;
    min-width: 220px;
    margin-top: 0.5rem;
}

.ccms-dropdown-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 0.35rem 0.5rem 0.35rem 1rem;
}

.ccms-dropdown-item {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem !important;
    border-radius: 7px !important;
    font-size: 1rem;
    color: #334155 !important;
    font-weight: 450;
    transition: background 0.12s ease;
}

.ccms-dropdown-item:hover,
.ccms-dropdown-item:focus {
    background: #f8fafc !important;
    color: #1e293b !important;
}

.ccms-dropdown-logout:hover,
.ccms-dropdown-logout:focus {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.ccms-dropdown-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.65rem;
}

.ccms-dropdown-divider {
    margin: 0.25rem 0.75rem;
    border-color: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════════════
   NEON FLICKER — Error page numbers
   ═══════════════════════════════════════════════════════════════ */

.error-number {
    font-family: "Varela Round", sans-serif;
    font-size: 12rem;
    font-style: italic;
    font-weight: 400;
    color: #00a04a;
    line-height: 1;
    margin-bottom: 0;
    text-shadow:
        0 0 0.4rem #00a04a,
        0 0 1.2rem #00a04a,
        0 0 2.8rem rgba(0, 160, 74, 0.5),
        0 0 5rem rgba(0, 160, 74, 0.2);
}

.error-number-2 {
    font-family: "Varela Round", sans-serif;
    font-size: 12rem;
    font-style: italic;
    font-weight: 400;
    color: #00a04a;
    line-height: 1;
    margin-bottom: 0;
    text-shadow:
        0 0 0.4rem #00a04a,
        0 0 1.2rem #00a04a,
        0 0 2.8rem rgba(0, 160, 74, 0.5),
        0 0 5rem rgba(0, 160, 74, 0.2);
    transition: all ease-in-out;
}

.animate-flicker-1 { animation: neon-sputter 4s ease-in-out infinite; }
.animate-flicker-2 { animation: neon-broken 6s ease-in-out infinite; }

@keyframes neon-sputter {
    0%, 100% { color: #00a04a; text-shadow: 0 0 0.4rem #00a04a, 0 0 1.2rem #00a04a, 0 0 2.8rem rgba(0,160,74,0.5), 0 0 5rem rgba(0,160,74,0.2); opacity: 1; }
    8%, 8.5% { color: #005c2d; text-shadow: 0 0 0.2rem rgba(0,160,74,0.3); opacity: 0.6; }
    9% { color: #00a04a; text-shadow: 0 0 0.4rem #00a04a, 0 0 1.2rem #00a04a, 0 0 2.8rem rgba(0,160,74,0.5); opacity: 1; }
    42%, 42.3% { color: #005c2d; text-shadow: 0 0 0.1rem rgba(0,160,74,0.2); opacity: 0.4; }
    42.6% { opacity: 0.1; }
    43% { color: #00a04a; text-shadow: 0 0 0.6rem #00a04a, 0 0 1.5rem #00a04a, 0 0 3.5rem rgba(0,160,74,0.6), 0 0 6rem rgba(0,160,74,0.3); opacity: 1; }
    76%, 76.2% { color: #005c2d; text-shadow: 0 0 0.2rem rgba(0,160,74,0.3); opacity: 0.5; }
    76.5% { color: #00a04a; text-shadow: 0 0 0.4rem #00a04a, 0 0 1.2rem #00a04a, 0 0 2.8rem rgba(0,160,74,0.5); opacity: 1; }
}

@keyframes neon-broken {
    0%, 5% { color: #00a04a; text-shadow: 0 0 0.4rem #00a04a, 0 0 1.2rem #00a04a, 0 0 2.8rem rgba(0,160,74,0.5), 0 0 5rem rgba(0,160,74,0.2); opacity: 1; }
    6% { color: #005c2d; text-shadow: 0 0 0.1rem rgba(0,160,74,0.15); opacity: 0.3; }
    7% { opacity: 0.05; }
    8% { color: #00a04a; text-shadow: 0 0 0.3rem rgba(0,160,74,0.4); opacity: 0.7; }
    9% { opacity: 0.1; }
    10.5% { color: #00a04a; text-shadow: 0 0 0.5rem #00a04a, 0 0 1.5rem #00a04a, 0 0 3.5rem rgba(0,160,74,0.6), 0 0 7rem rgba(0,160,74,0.25); opacity: 1; }
    35%, 50% { color: #00a04a; text-shadow: 0 0 0.4rem #00a04a, 0 0 1.2rem #00a04a, 0 0 2.8rem rgba(0,160,74,0.5); opacity: 1; }
    51% { opacity: 0.6; text-shadow: 0 0 0.2rem rgba(0,160,74,0.3); }
    51.5% { opacity: 0.08; }
    52% { opacity: 0.5; text-shadow: 0 0 0.3rem rgba(0,160,74,0.4); }
    52.3% { opacity: 0.05; }
    53% { opacity: 0.4; }
    54% { color: #00a04a; text-shadow: 0 0 0.6rem #00a04a, 0 0 1.8rem #00a04a, 0 0 4rem rgba(0,160,74,0.7), 0 0 8rem rgba(0,160,74,0.3); opacity: 1; }
    80%, 82% { color: #00a04a; text-shadow: 0 0 0.4rem #00a04a, 0 0 1.2rem #00a04a, 0 0 2.8rem rgba(0,160,74,0.5); opacity: 1; }
    82.5%, 82.8% { color: #005c2d; text-shadow: 0 0 0.1rem rgba(0,160,74,0.2); opacity: 0.3; }
    83.2% { color: #00a04a; text-shadow: 0 0 0.4rem #00a04a, 0 0 1.2rem #00a04a, 0 0 2.8rem rgba(0,160,74,0.5); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   STATUS + TYPE BADGES
   ═══════════════════════════════════════════════════════════════ */

.badge-status-draft { background-color: #94a3b8; color: #fff; }
.badge-status-review { background-color: #f59e0b; color: #fff; }
.badge-status-approved { background-color: #22c55e; color: #fff; }
.badge-status-published { background-color: #3b82f6; color: #fff; }

.badge-type-topic { background-color: #6366f1; color: #fff; }
.badge-type-concept { background-color: #8b5cf6; color: #fff; }
.badge-type-task { background-color: #ec4899; color: #fff; }
.badge-type-reference { background-color: #14b8a6; color: #fff; }
.badge-type-glossentry { background-color: #0f9d58; color: #fff; }

/* ─── Map integrity / workflow badges ──────────────────────── */

.ccms-integrity-badge {
    /* Button reset — overrides Bootstrap btn defaults so the pill styling
       below is what wins. The element is a <button> for keyboard a11y. */
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    margin: 0;
    line-height: 1;
    /* Pill styling */
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.ccms-integrity-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    filter: brightness(1.05);
}
.ccms-integrity-badge:focus-visible {
    outline: 2px solid #00a04a;
    outline-offset: 2px;
}
.ccms-integrity-badge[data-state="loading"] { background-color: #94a3b8; }
.ccms-integrity-badge[data-state="ok"]      { background-color: #22c55e; }
.ccms-integrity-badge[data-state="warn"]    { background-color: #f59e0b; }
.ccms-integrity-badge[data-state="error"]   { background-color: #dc2626; }
.ccms-integrity-badge .fa-circle-notch {
    font-size: 0.65rem;
}
.ccms-integrity-badge-label {
    white-space: nowrap;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Editor commit note button + popover ──────────────────── */

.ccms-note-toggle {
    position: relative;
}
/* Pending-dot indicator: hidden by default; the JS toggles
   `.has-pending` on the button when a note is queued for the next save. */
.ccms-note-dot {
    display: none;
    position: absolute;
    top: -0.15rem;
    right: -0.15rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #00a04a;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.ccms-note-toggle.has-pending .ccms-note-dot {
    display: block;
}
.ccms-note-popover {
    width: 22rem;
    border: 0;
    border-radius: 0.625rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.ccms-note-popover textarea {
    resize: vertical;
    min-height: 4.5rem;
}

/* ─── Commit-message ticket badge ───────────────────────────── */

.ccms-ticket-badge {
    display: inline-block;
    padding: 0.1em 0.5em;
    margin-right: 0.35em;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8em;
    font-weight: 600;
    background: #e8f6ed;
    color: #007d39;
    border-radius: 0.25rem;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
a.ccms-ticket-badge:hover {
    background: #00a04a;
    color: #fff;
    text-decoration: none;
}
a.ccms-ticket-badge:focus-visible {
    outline: 2px solid #00a04a;
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENT UI (for Phase 2+)
   ═══════════════════════════════════════════════════════════════ */

.component-card { transition: box-shadow 0.15s ease; }
.component-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.component-card .ccms-card-title { font-size: 1rem; font-weight: 600; color: #1e293b; }

.ccms-filter-select {
    border-radius: 6px;
    border-color: #e2e8f0;
    font-size: 1rem;
    min-width: 140px;
}

.ccms-breadcrumb-link {
    color: #00a04a;
    text-decoration: none;
}

.ccms-breadcrumb-link:hover {
    color: #007d39;
    text-decoration: underline;
}

.ccms-breadcrumb-active {
    color: #94a3b8;
}

.ccms-pagination .page-link {
    border: none;
    color: #475569;
    border-radius: 6px;
    margin: 0 0.15rem;
    padding: 0.4rem 0.75rem;
}

.ccms-pagination .page-item.active .page-link {
    background: #00a04a;
    color: #fff;
}

.ccms-pagination .page-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.ccms-pagination .page-item.disabled .page-link {
    color: #cbd5e1;
    background: transparent;
}

.active-editors {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #0891b2;
    background: #ecfeff;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
}

.active-editors .dot {
    width: 6px;
    height: 6px;
    background: #0891b2;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Folder tree ────────────────────────────────────────────── */

.ccms-folder-tree ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.ccms-folder-tree ul ul {
    padding-left: 1.5rem;
    border-left: 1px solid #f1f5f9;
    margin-left: 0.6rem;
}

.ccms-folder-node {
    padding: 0.1rem 0;
}

.ccms-folder-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s ease;
    text-decoration: none;
    color: #334155;
    font-size: 1rem;
}

.ccms-folder-header:hover {
    background: #f8fafc;
}

.ccms-folder-header.active {
    background: #edf8f1;
    color: #007d39;
    font-weight: 600;
}

.ccms-folder-toggle {
    width: 1.1rem;
    text-align: center;
    color: #cbd5e1;
    font-size: 0.6rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.ccms-folder-toggle.open {
    transform: rotate(90deg);
}

.ccms-folder-toggle.empty {
    visibility: hidden;
}

.ccms-folder-icon {
    color: #d97706;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ccms-folder-header.active .ccms-folder-icon {
    color: #007d39;
}

.ccms-folder-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ccms-folder-more {
    display: none;
    color: #94a3b8;
    font-size: 0.8rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.12s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.ccms-folder-header.active .ccms-folder-more {
    display: inline-block;
    color: #007d39;
}

.ccms-folder-more:hover {
    color: #475569;
    background: #f1f5f9;
}

.ccms-folder-count {
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.ccms-folder-children {
    display: block;
}

.ccms-folder-children.collapsed {
    display: none;
}

/* Inline rename input */
/* Folder picker (in modals) */
.ccms-picker-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 0.5rem;
}

.ccms-picker-tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.ccms-picker-tree ul {
    list-style: none;
    padding-left: 1.25rem;
    margin: 0;
    display: none;
}

.ccms-picker-selection {
    padding: 0.4rem 0.6rem;
    background: #f8fafc;
    border-radius: 6px;
    color: #475569;
}

.ccms-folder-rename {
    border: 1px solid #00a04a;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 1rem;
    outline: none;
    flex: 1;
    box-shadow: 0 0 0 2px rgba(0, 160, 74, 0.15);
}

/* File items (components inside folders) */
.ccms-file-node {
    list-style: none;
    padding: 0.05rem 0;
}

.ccms-file-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem 0.3rem 1.6rem;
    border-radius: 5px;
    text-decoration: none;
    color: #475569;
    transition: background 0.1s ease;
}

.ccms-file-item:hover {
    background: #f1f5f9;
    color: #334155;
}

.ccms-file-icon {
    color: #94a3b8;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.ccms-file-name {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ccms-file-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    flex-shrink: 0;
}

/* Context menu */
.ccms-context-menu {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 0.35rem;
    min-width: 180px;
    display: none;
}

.ccms-context-menu.show {
    display: block;
}

.ccms-context-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    color: #334155;
    transition: background 0.1s ease;
}

.ccms-context-item:hover {
    background: #f8fafc;
}

.ccms-context-item.danger {
    color: #dc2626;
}

.ccms-context-item.danger:hover {
    background: #fef2f2;
}

.ccms-context-item i {
    width: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.ccms-context-item.danger i {
    color: #dc2626;
}

.ccms-context-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0.25rem 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   LEGACY (from dita project — keep for compatibility)
   ═══════════════════════════════════════════════════════════════ */

.badge-pill { border-radius: 10rem; }
.table th { font-weight: unset; }
.table > :not(caption) > * > *, .datatable-table > :not(caption) > * > * { padding: 0.66rem 0.5rem; }
.modal-body { max-height: calc(100vh - 210px); overflow-y: auto; }
.text-thin { font-weight: lighter; }
.text-normal { font-weight: normal; }
.display-7 { font-size: 2.5rem; }
.display-8 { font-size: 2rem; }
.display-9 { font-size: 1.5rem; }

.datatable-wrapper { color: #212529 !important; }
.datatable-input.form-control, .datatable-selector.form-select { color: #212529; background-color: #fff; border-color: #ced4da; display: inline-block; }
.datatable-selector.form-select { width: auto; }
.datatable-input:focus, .datatable-input:focus-visible, .datatable-selector:focus-visible { color: #212529; background-color: #fff; border-color: #00a04a; }
.datatable-dropdown { float: right !important; margin-left: 1rem; }
.datatable-info { display: none; }
.datatable-pagination a:hover, .datatable-pagination button:hover { background-color: #f8f9fa; }
.datatable-pagination .datatable-active a, .datatable-pagination .datatable-active a:focus, .datatable-pagination .datatable-active a:hover, .datatable-pagination .datatable-active button, .datatable-pagination .datatable-active button:focus, .datatable-pagination .datatable-active button:hover { background-color: #f8f9fa; cursor: default; }
.datatable-wrapper.no-footer .datatable-container { border-bottom: unset; }
.datatable-table > tbody > tr > td { height: 3.5rem; }
.datatable-pagination-list button { border-radius: 5px; }

/* ── Editor wrapper — mirrors Bootstrap .container breakpoints ── */
.ccms-editor-wrapper { width: 100%; margin-left: auto; margin-right: auto; }
@media (min-width: 576px)  { .ccms-editor-wrapper { max-width: 33.75rem; } }
@media (min-width: 768px)  { .ccms-editor-wrapper { max-width: 45rem; } }
@media (min-width: 992px)  { .ccms-editor-wrapper { max-width: 60rem; } }
@media (min-width: 1200px) { .ccms-editor-wrapper { max-width: 71.25rem; } }
@media (min-width: 1400px) { .ccms-editor-wrapper { max-width: 82.5rem; } }

/* ── Diff viewer ───────────────────────────────────────────── */

.ccms-diff-viewer { max-height: 28rem; overflow: auto; border: 1px solid #e2e8f0; border-radius: 0.5rem; background: #fafbfc; }
.ccms-diff-table { width: 100%; border-collapse: collapse; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 0.8rem; line-height: 1.5; }
.ccms-diff-table td { padding: 0.1rem 0.5rem; white-space: pre-wrap; word-break: break-all; vertical-align: top; }
.ccms-diff-gutter { width: 3rem; min-width: 3rem; text-align: right; color: #94a3b8; user-select: none; border-right: 1px solid #e2e8f0; background: #f8fafc; }
.ccms-diff-add { background: #f0fdf4; }
.ccms-diff-add td:last-child { border-left: 0.1875rem solid #16a34a; }
.ccms-diff-remove { background: #fef2f2; }
.ccms-diff-remove td:last-child { border-left: 0.1875rem solid #dc2626; }
.ccms-diff-context { background: #fff; }
.ccms-diff-hunk { background: #eff6ff; color: #3b82f6; font-weight: 500; padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.ccms-diff-empty { text-align: center; padding: 2rem; color: #94a3b8; font-size: 0.9rem; }

/* ── History list ──────────────────────────────────────────── */

.ccms-history-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.625rem 0.5rem; border-radius: 0.375rem; transition: background 0.12s; }
.ccms-history-row:hover { background: #f8fafc; }
.ccms-history-row + .ccms-history-row { border-top: 1px solid #f1f5f9; }
.ccms-history-current { background: #edf8f1; border-left: 0.1875rem solid #00a04a; padding-left: 0.625rem; }
.ccms-history-current:hover { background: #dcf1e3; }
.ccms-history-check {
    margin-top: 0.25rem;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 0.125rem solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.ccms-history-check:hover { border-color: #00a04a; box-shadow: 0 0 0 0.1875rem rgba(0, 160, 74, 0.1); }
.ccms-history-check[type="checkbox"] { border-radius: 0.1875rem; }
.ccms-history-check[type="radio"] { border-radius: 50%; }
.ccms-history-check:checked {
    background-color: #00a04a;
    border-color: #00a04a;
    box-shadow: 0 0 0 0.125rem rgba(0, 160, 74, 0.2);
}
.ccms-history-check[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5L6.5 11.5L12.5 4.5'/%3E%3C/svg%3E");
    background-size: 0.75rem;
    background-position: center;
    background-repeat: no-repeat;
}
.ccms-history-check[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3.5' fill='%23fff'/%3E%3C/svg%3E");
    background-size: 0.75rem;
    background-position: center;
    background-repeat: no-repeat;
}
.ccms-badge-current {
    background: linear-gradient(135deg, #00a04a, #006130);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.125rem 0.4375rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 160, 74, 0.3);
}
.ccms-history-info { flex: 1; min-width: 0; }
.ccms-history-info .fw-500 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Editor history offcanvas ──────────────────────────────── */

.ccms-offcanvas-history { width: 26rem !important; display: flex; flex-direction: column; }
.ccms-offcanvas-history .offcanvas-body { padding: 1rem 1.25rem; flex: 1; overflow-y: auto; }
.ccms-offcanvas-history .offcanvas-header { border-bottom: 1px solid #f1f5f9; padding: 1rem 1.25rem; }
.ccms-offcanvas-history .offcanvas-footer { flex-shrink: 0; background: #f8fafc; border-top: 1px solid #e2e8f0; }
.ccms-offcanvas-history .offcanvas-footer .btn:disabled { opacity: 0.45; }
.ccms-restore-detail { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.75rem 1rem; }

/* ── Map tree ──────────────────────────────────────────────── */

.ccms-map-card { transition: border-color 0.15s, box-shadow 0.15s; }
.ccms-map-card:hover { border-color: #00a04a; box-shadow: 0 2px 8px rgba(0, 160, 74, 0.1); }

.ccms-map-tree { list-style: none; padding: 0; margin: 0; counter-reset: item; }
.ccms-map-tree > .ccms-map-entry { border-left: 3px solid #e2e8f0; }
.ccms-map-subtree { list-style: none; padding: 0; margin: 0.25rem 0 0 1.75rem; border-left: 2px solid #e2e8f0; }

.ccms-map-entry { display: block; position: relative; margin-bottom: 0.25rem; border-radius: 0.375rem; transition: background 0.1s; }
.ccms-map-entry-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.75rem; border-radius: 0.375rem; border: 1px solid transparent; }
.ccms-map-entry-row:hover { background: #f8fafc; border-color: #f1f5f9; }

.ccms-map-entry-handle { cursor: grab; color: #cbd5e1; padding: 0 0.25rem; font-size: 0.85rem; flex-shrink: 0; }
.ccms-map-entry-handle:active { cursor: grabbing; }
.ccms-map-entry-handle:hover { color: #00a04a; }

.ccms-map-entry-icon { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }
.icon-type-topic { background: #94a3b8; }
.icon-type-concept { background: #3b82f6; }
.icon-type-task { background: #00a04a; }
.icon-type-reference { background: #22c55e; }
.icon-type-glossentry { background: #a855f7; }

.ccms-map-entry-title { font-weight: 500; flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1e293b; }

.ccms-map-entry-actions { display: flex; gap: 0.25rem; opacity: 0; transition: opacity 0.15s; flex-shrink: 0; }
.ccms-map-entry-row:hover .ccms-map-entry-actions { opacity: 1; }
.ccms-map-entry-action { display: flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 0.25rem; border: none; background: none; color: #94a3b8; cursor: pointer; text-decoration: none; font-size: 0.75rem; transition: all 0.1s; }
.ccms-map-entry-action:hover { background: #f1f5f9; color: #475569; }
.ccms-map-entry-add-child:hover { background: #f0fdf4; color: #16a34a; }
.ccms-map-entry-remove:hover { background: #fef2f2; color: #dc2626; }

.ccms-dragging { opacity: 0.35; }
.ccms-drop-before { border-top: 4px solid #00a04a !important; background: linear-gradient(to bottom, rgba(0, 160, 74, 0.12) 0%, rgba(0, 160, 74, 0.03) 100%); position: relative; }
.ccms-drop-after { border-bottom: 4px solid #00a04a !important; background: linear-gradient(to top, rgba(0, 160, 74, 0.12) 0%, rgba(0, 160, 74, 0.03) 100%); position: relative; }
.ccms-drop-child { border: 3px dashed #00a04a !important; background: rgba(0, 160, 74, 0.04); position: relative; }
.ccms-drop-before::after, .ccms-drop-after::after, .ccms-drop-child::after { position: absolute; right: 0.75rem; font-size: 0.65rem; font-weight: 600; color: #00a04a; letter-spacing: 0.03em; text-transform: uppercase; pointer-events: none; z-index: 1; }
.ccms-drop-before::after { content: "DROP BEFORE"; top: 0.125rem; }
.ccms-drop-after::after { content: "DROP AFTER"; bottom: 0.125rem; }
.ccms-drop-child::after { content: "MAKE CHILD"; top: 50%; transform: translateY(-50%); }

.ccms-editable-title { cursor: pointer; border-radius: 0.25rem; padding: 0 0.25rem; transition: background 0.15s; }
.ccms-editable-title:hover { background: #f1f5f9; }
.ccms-title-editing { background: #fff; box-shadow: 0 0 0 2px #00a04a; outline: none; }

/* ── Bookmap slot sections (top-level grouping on a bookmap) ── */
.ccms-map-slot-section { list-style: none; margin-bottom: 1.25rem; }
.ccms-map-slot-header { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.25rem 0.375rem; margin-bottom: 0.25rem; border-bottom: 1px solid #e2e8f0; }
.ccms-map-slot-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #006a31; }
.ccms-map-slot-list { margin-left: 0; border-left: 2px solid #d1fae5; padding-left: 0.5rem; }
.ccms-map-slot-empty { list-style: none; padding: 0.5rem 0.75rem; color: #94a3b8; font-style: italic; font-size: 0.875rem; }
.ccms-map-slot-select { width: auto; max-width: 9rem; flex-shrink: 0; font-size: 0.8rem; margin-left: 0.25rem; }

/* ── Add component search results ────────────────────────── */

.ccms-comp-result { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.625rem; border-radius: 0.375rem; cursor: pointer; transition: background 0.1s; }
.ccms-comp-result:hover { background: #f8fafc; }
.ccms-comp-result + .ccms-comp-result { border-top: 1px solid #f1f5f9; }
.ccms-comp-result-add { color: #94a3b8; font-size: 0.75rem; }
.ccms-comp-result:hover .ccms-comp-result-add { color: #00a04a; }
.ccms-comp-result-loading { opacity: 0.5; pointer-events: none; }

/* ── Loader animation ──────────────────────────────────────── */

/* ── Audit table ────────────────────────────────────────────── */

.ccms-audit-filters .form-control-sm, .ccms-audit-filters .form-select-sm { padding: 0.5rem 1rem; font-size: 1rem; border-radius: 8px; }

.ccms-audit-table { font-size: 0.95rem; }
.ccms-audit-table thead th { background: #f8fafc; font-weight: 600; font-size: 0.85rem; color: #475569; text-transform: uppercase; letter-spacing: 0.02em; border-bottom: 2px solid #e2e8f0; padding: 0.75rem; }
.ccms-audit-table tbody td { padding: 0.65rem 0.75rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }

.ccms-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.ccms-table thead th { background: #f8fafc; font-weight: 600; color: #475569; padding: 0.65rem 0.75rem; border-bottom: 2px solid #e2e8f0; text-align: left; }
.ccms-table tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.ccms-table tbody tr:last-child td { border-bottom: 0; }

.ccms-audit-badge-create { background: #22c55e; color: #fff; }
.ccms-audit-badge-update { background: #3b82f6; color: #fff; }
.ccms-audit-badge-delete { background: #ef4444; color: #fff; }
.ccms-audit-badge-status_change { background: #f59e0b; color: #fff; }
.ccms-audit-badge-restore { background: #8b5cf6; color: #fff; }
.ccms-audit-badge-publish { background: #06b6d4; color: #fff; }
.ccms-audit-badge-export { background: #06b6d4; color: #fff; }
.ccms-audit-badge-save { background: #3b82f6; color: #fff; }
.ccms-audit-badge-refresh_body { background: #3b82f6; color: #fff; }
.ccms-audit-badge-reset { background: #f59e0b; color: #fff; }
.ccms-audit-badge-reject_add_entry { background: #ef4444; color: #fff; }
.ccms-audit-badge-reject_reorder_entries { background: #ef4444; color: #fff; }
.ccms-audit-badge-reject_update_entry { background: #ef4444; color: #fff; }

/* ── Notification bell ─────────────────────────────────────── */

.ccms-notif-bell { position: relative; cursor: pointer; color: rgba(255,255,255,0.8); font-size: 1.1rem; padding: 0.4rem 0.5rem; transition: color 0.15s; }
.ccms-notif-bell:hover { color: #fff; }
.ccms-notif-badge { position: absolute; top: 0; right: 0; background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700; min-width: 1rem; height: 1rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 0.25rem; }
.ccms-notif-dropdown { position: absolute; right: 0; top: 100%; width: 22rem; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); z-index: 1050; display: none; overflow: hidden; }
.ccms-notif-dropdown.show { display: block; }
.ccms-notif-header { padding: 0.65rem 0.75rem; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.ccms-notif-header h6 { font-size: 0.9rem; font-weight: 700; margin: 0; color: #1e293b; }
.ccms-notif-list { max-height: 20rem; overflow-y: auto; }
.ccms-notif-item { display: block; padding: 0.6rem 0.75rem; border-bottom: 1px solid #f8fafc; text-decoration: none; color: #334155; transition: background 0.1s; }
.ccms-notif-item:hover { background: #f8fafc; color: #1e293b; }
.ccms-notif-item-unread { background: #fffbeb; font-weight: 500; }
.ccms-notif-item-unread:hover { background: #fef3c7; }
.ccms-notif-message { font-size: 0.875rem; line-height: 1.3; }
.ccms-notif-time { font-size: 0.75rem; color: #94a3b8; margin-top: 0.15rem; }
.ccms-notif-empty { padding: 1.5rem; text-align: center; color: #94a3b8; font-size: 0.875rem; }

/* ── Loader animation ──────────────────────────────────────── */

/* ── User level/status badges ──────────────────────────────── */

.ccms-level-0 { background: #dc2626; color: #fff; font-size: 0.7rem; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.ccms-level-1 { background: #00a04a; color: #fff; font-size: 0.7rem; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.ccms-level-2 { background: #64748b; color: #fff; font-size: 0.7rem; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.ccms-status-active { background: #16a34a; color: #fff; font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.ccms-status-inactive { background: #94a3b8; color: #fff; font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }

.ccms-loader { width: 2.5rem; height: 2.5rem; border: 0.25rem solid #e2e8f0; border-top-color: #00a04a; border-radius: 50%; animation: ccms-spin 0.8s linear infinite; margin: 0 auto; }
@keyframes ccms-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   NOTICE FAMILY — persistent in-page banners
   Use .ccms-notice + one of .ccms-notice-{warning,info,success,error}
   in place of raw Bootstrap .alert-* for the design-system surface.
   Transient AJAX error containers may keep .alert-danger.
   For dismissable toasts, use window.ccmsFlash.
   ═══════════════════════════════════════════════════════════════ */

.ccms-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
}
.ccms-notice-icon { flex-shrink: 0; font-size: 1.1rem; }
.ccms-notice-message { flex: 1 1 auto; }

.ccms-notice-warning { background: #fff8e1; border-color: #ffe082; color: #6b4d00; }
.ccms-notice-info    { background: #e3f2fd; border-color: #90caf9; color: #0d3a5e; }
.ccms-notice-success { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.ccms-notice-error   { background: #ffebee; border-color: #ef9a9a; color: #b71c1c; }

/* Map Output dropdown (S2-M-08): the disambiguating engine labels run wider
   than Bootstrap's default dropdown min-width — pin a comfortable width so
   long items like "Format & Export PDF — Customised (OnlyOffice)" stay on
   a single line rather than wrapping into two ragged rows. */
.ccms-output-menu { min-width: 22rem; }

/* ═══════════════════════════════════════════════════════════════
   AFFORDANCE SYSTEM — element-level cursor/hover hints
   Apply .ccms-affordance-static to metadata blocks that LOOK
   clickable but aren't. Apply .ccms-affordance-link to text
   inside card-as-link wrappers so the title reads as actionable.
   ═══════════════════════════════════════════════════════════════ */

.ccms-affordance-static,
.ccms-affordance-static:hover {
    cursor: default;
    text-decoration: none;
}

.ccms-affordance-link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.ccms-affordance-link:hover,
a:hover .ccms-affordance-link {
    text-decoration: underline;
    text-decoration-color: #00a04a;
    text-underline-offset: 0.2rem;
}

/* ═══════════════════════════════════════════════════════════════
   Utility classes — replace inline style="…" usage in templates.
   ═══════════════════════════════════════════════════════════════ */

.ccms-flash-toast { top: 1rem; right: 1rem; z-index: 9999; min-width: 16rem; }
.ccms-notif-mark-all { color: #00a04a; text-decoration: none; }
.ccms-notif-mark-all:hover { color: #007d39; text-decoration: underline; }
.ccms-badge-review { background: #fef3cd; color: #856404; font-size: 0.75rem; }
.ccms-offcanvas-body-scroll { overflow-y: auto; flex: 1; }
.ccms-meta-italic { font-style: italic; }
.ccms-textarea-noresize { resize: none; }
.ccms-status-select-auto { width: auto; }
.ccms-search-results-bounded { max-height: 18rem; overflow-y: auto; }
.ccms-notif-row { color: inherit; }
.ccms-notif-bell-item { position: relative; }
.ccms-notif-dot-unread { font-size: 0.5rem; color: #00a04a; }
.ccms-notif-dot-read { color: #94a3b8; }

/* ═══════════════════════════════════════════════════════════════
   Add Component to Map — version-aware picker
   ═══════════════════════════════════════════════════════════════ */

.ccms-add-component-modal { overflow: hidden; }

.ccms-add-component-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.ccms-add-component-title-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}
.ccms-add-component-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, #00a04a 0%, #007d39 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 160, 74, 0.25);
}
.ccms-add-component-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Version toggle (segmented draft/published) ────────────── */
.ccms-version-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    padding: 0.4rem;
}
.ccms-version-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.ccms-version-toggle-option {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.7rem;
    row-gap: 0.1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
    user-select: none;
    margin: 0;
    border: 1px solid transparent;
}
.ccms-version-toggle-icon {
    grid-row: 1 / span 2;
    align-self: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.ccms-version-toggle-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.25;
    letter-spacing: -0.005em;
}
.ccms-version-toggle-hint {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.3;
}
.ccms-version-toggle-option:hover {
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.ccms-version-toggle-input:focus-visible + .ccms-version-toggle-option {
    outline: 2px solid #00a04a;
    outline-offset: 2px;
}

#add-version-draft:checked + .ccms-version-toggle-draft {
    background: #fff;
    border-color: rgba(0, 160, 74, 0.35);
    box-shadow: 0 4px 12px rgba(0, 160, 74, 0.18);
}
#add-version-draft:checked + .ccms-version-toggle-draft .ccms-version-toggle-icon {
    background: linear-gradient(135deg, #00a04a 0%, #007d39 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 160, 74, 0.35);
}
#add-version-draft:checked + .ccms-version-toggle-draft .ccms-version-toggle-label { color: #006130; }

#add-version-published:checked + .ccms-version-toggle-published {
    background: #fff;
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.16);
}
#add-version-published:checked + .ccms-version-toggle-published .ccms-version-toggle-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.32);
}
#add-version-published:checked + .ccms-version-toggle-published .ccms-version-toggle-label { color: #1d4ed8; }

/* ── Search input + type filter as one input-group ─────────── */
.ccms-add-component-search {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ccms-add-component-search:focus-within {
    border-color: #00a04a;
    box-shadow: 0 0 0 3px rgba(0, 160, 74, 0.18);
}
.ccms-add-component-search .ccms-search-input-prefix {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding-left: 1rem;
    padding-right: 0.4rem;
    font-size: 0.9rem;
}
.ccms-add-component-search .ccms-search-input {
    border: none;
    box-shadow: none;
    padding-left: 0;
    background: transparent;
    font-size: 0.95rem;
}
.ccms-add-component-search .ccms-search-input:focus {
    box-shadow: none;
    background: transparent;
}
.ccms-add-component-search .ccms-search-input-suffix {
    border: none;
    border-left: 1px solid #f1f5f9;
    background: #f8fafc;
    color: #475569;
    width: auto;
    flex: 0 0 auto;
    padding-right: 2rem;
    font-size: 0.85rem;
    border-radius: 0;
}
.ccms-add-component-search .ccms-search-input-suffix:focus {
    box-shadow: none;
    background: #f1f5f9;
}

/* ── Result list ────────────────────────────────────────────── */
.ccms-add-component-results {
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    background: #fff;
    overflow: hidden auto;
    max-height: 22rem;
}
.ccms-add-component-results:empty { display: none; }
.ccms-add-component-results .ccms-comp-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 0.95rem 0.7rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 0;
    position: relative;
    transition: background 0.12s ease, padding-left 0.12s ease;
    cursor: pointer;
}
.ccms-add-component-results .ccms-comp-result:last-child { border-bottom: none; }
.ccms-add-component-results .ccms-comp-result + .ccms-comp-result { border-top: none; }
.ccms-add-component-results .ccms-comp-result::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.15s ease;
}
.ccms-add-component-results .ccms-comp-result:hover {
    background: #edf8f1;
    padding-left: 1.25rem;
}
.ccms-add-component-results .ccms-comp-result:hover::before { background: #00a04a; }
.ccms-add-component-results .ccms-comp-result:hover .ccms-comp-result-add { color: #00a04a; }
.ccms-add-component-results .ccms-comp-result-add { color: #cbd5e1; transition: color 0.15s ease; }

.ccms-add-component-error {
    margin: 0;
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 0.65rem 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════
   Map-tree Switch-to-Published button
   ═══════════════════════════════════════════════════════════════ */

.ccms-entry-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.ccms-entry-switch-btn:hover {
    background: #3b82f6;
    color: #fff;
    border-color: #2563eb;
}
.ccms-entry-switch-btn[disabled] { opacity: 0.5; cursor: progress; }
.ccms-entry-switch-btn .fas { font-size: 0.6rem; }

/* ═══════════════════════════════════════════════════════════════
   Format & Export PDF — OO editor host (full-width edit-mode page)
   ═══════════════════════════════════════════════════════════════ */
#oo-publish-editor {
    width: 100%;
    height: calc(100vh - 12rem);
    min-height: 32rem;
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
/* OO ships frameEditor with width/height HTML attrs but no CSS height — force
   one so the editor fills the host. Shared with the component editor page; lives
   here (not in page-scoped <style>) so every OO-hosting page gets the same treatment. */
iframe[name="frameEditor"] {
    width: 100% !important;
    height: calc(100vh - 12rem) !important;
    min-height: 32rem !important;
    border: 0 !important;
    border-radius: 0.625rem !important;
}

/* Rendered DITA on a centred A4-width page surface, scrolled within the viewport. */
.ccms-rendered-pane {
    max-width: 49.625rem;
    margin: 1.25rem auto 0;
    background: #fff;
    border-radius: 0.625rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 2.5rem 3rem;
    max-height: calc(100vh - 16rem);
    min-height: 30rem;
    overflow-y: auto;
}

/* ============================================
   ABBON CONVERTER OVERRIDES
   Keep the datatable search box on the top right now that the
   per-page selector is removed (search becomes the first child
   and would otherwise sit on the left).
   ============================================ */

.datatable-top .datatable-search,
.datatable-top > div:last-child {
    float: right;
    margin-left: auto;
}
