/*
 * csp-base.css — Utility classes extracted from inline styles (CSP Option B migration)
 * DO NOT add component-specific styles here. This file is for reusable utilities only.
 * Add new classes as more templates are migrated.
 */

/* ── Layout ── */
.csp-flex          { display: flex; }
.csp-flex-col      { display: flex; flex-direction: column; }
.csp-flex-wrap     { flex-wrap: wrap; }
.csp-inline-flex   { display: inline-flex; }
.csp-grid          { display: grid; }
.csp-block         { display: block; }
.csp-inline-block  { display: inline-block; }
.csp-d-none        { display: none; }

/* ── Alignment ── */
.csp-align-center  { align-items: center; }
.csp-align-start   { align-items: flex-start; }
.csp-align-self-start { align-self: flex-start; }
.csp-justify-center { justify-content: center; }

/* ── Gap ── */
.csp-gap-xs   { gap: 0.25rem; }
.csp-gap-sm   { gap: 0.35rem; }
.csp-gap-md   { gap: 0.5rem; }
.csp-gap-lg   { gap: 1rem; }
.csp-gap-xl   { gap: 2rem; }

/* ── Flex utility ── */
.csp-flex-1       { flex: 1; }
.csp-flex-shrink-0 { flex-shrink: 0; }
.csp-flex-grow-1  { flex-grow: 1; }
.csp-min-w-0      { min-width: 0; }
.csp-span-2       { grid-column: span 2; }
.csp-col-full     { grid-column: 1 / -1; }

/* ── Margin ── */
.csp-mt-sm   { margin-top: 0.5rem; }
.csp-mt-md   { margin-top: 1rem; }
.csp-mt-lg   { margin-top: 1.5rem; }
.csp-mt-xl   { margin-top: 2rem; }
.csp-mt-6    { margin-top: 6rem; }
.csp-mt-4    { margin-top: 4rem; }
.csp-mb-sm   { margin-bottom: 0.5rem; }
.csp-mb-md   { margin-bottom: 1rem; }
.csp-mb-lg   { margin-bottom: 1.5rem; }
.csp-mb-xl   { margin-bottom: 2rem; }
.csp-mb-1    { margin-bottom: 0.25rem; }
.csp-mx-auto { margin-left: auto; margin-right: auto; }

/* ── Padding ── */
.csp-p-sm   { padding: 0.5rem; }
.csp-p-md   { padding: 0.9rem 1rem; }
.csp-py-sm  { padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* ── Text ── */
.csp-text-center    { text-align: center; }
.csp-text-end       { text-align: end; }
.csp-text-secondary { color: var(--text-secondary); }
.csp-text-accent    { color: var(--accent-color); }
.csp-text-error     { color: #ef4444; }
.csp-text-purple    { color: #c4b5fd; }
.csp-text-sm        { font-size: 0.85rem; }
.csp-text-xs        { font-size: 0.85em; }
.csp-text-hero      { font-size: 4rem; }
.csp-text-h1        { font-size: 2rem; font-weight: 800; }
.csp-text-h3        { font-size: 1.25rem; font-weight: 700; }
.csp-fw-700         { font-weight: 700; }
.csp-lh-16         { line-height: 1.6; }
.csp-lh-15         { line-height: 1.5; }
.csp-no-decoration  { text-decoration: none; }
.csp-color-inherit  { color: inherit; }

/* ── Opacity / visual ── */
.csp-opacity-60     { opacity: 0.6; }
.csp-cursor-pointer { cursor: pointer; }
.csp-overflow-hidden { overflow: hidden; }
.csp-object-cover   { object-fit: cover; width: 100%; height: 100%; }

/* ── Max-width containers ── */
.csp-mw-560  { max-width: 560px; }
.csp-mw-600  { max-width: 600px; }
.csp-mw-860  { max-width: 860px; margin: 0 auto; }
.csp-mw-900  { max-width: 900px; margin-left: auto; margin-right: auto; }

/* ── Sizes ── */
.csp-icon-56 {
    width: 56px; height: 56px;
    border-radius: 12px; overflow: hidden;
    border: 2px solid var(--border-color);
    margin-bottom: 1rem;
    flex-shrink: 0;
}
.csp-icon-56-accent {
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
}
.csp-icon-56-yellow { background: rgba(250, 204, 21, 0.12); color: var(--accent-color); }
.csp-icon-56-purple { background: rgba(168, 85, 247, 0.12); color: #c4b5fd; }
.csp-svg-full { width: 100%; max-width: 1050px; }
.csp-svg-chart { width: 100%; max-width: 380px; margin-bottom: 2rem; }

/* ── Error box ── */
.csp-error-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.24);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    color: #fca5a5;
}
.csp-error-text {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ── Form utilities ── */
.csp-form-group  { margin-bottom: 1.2rem; }
.csp-form-label  { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); font-size: 0.9rem; }
.csp-help-text   { color: var(--text-secondary); display: block; margin-top: 0.25rem; }
.csp-btn-row     { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.csp-btn-flex    { flex: 1; min-width: 120px; }
.csp-btn-center  { text-align: center; text-decoration: none; box-sizing: border-box; line-height: 2.5; }

/* ── Card grid utilities ── */
.csp-card-grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 1rem; }
.csp-card-link  { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; border: 1px solid var(--border-color); cursor: pointer; }
.csp-card-footer-yellow { margin-top: 1.5rem; font-weight: 700; font-size: 0.85rem; color: var(--accent-color); display: flex; align-items: center; gap: 0.35rem; }
.csp-card-footer-purple { margin-top: 1.5rem; font-weight: 700; font-size: 0.85rem; color: #c4b5fd; display: flex; align-items: center; gap: 0.35rem; }

/* ── Attendance page utilities ── */
.csp-attendance-form { margin-top: 1rem; }

/* ── Generic form.html (form-control styles extracted from inline <style>) ── */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}
select.form-control option {
    background: #1e1e2e;
    color: white;
}
[dir="rtl"] select.form-control {
    background-position: left 1rem center;
    padding-right: 1rem;
    padding-left: 2.5rem;
}
[dir="rtl"] .form-group label,
[dir="rtl"] .form-group small {
    text-align: right;
    display: block;
}
[dir="rtl"] .form-control { text-align: right; }
[dir="rtl"] .form-control[dir="ltr"] { text-align: left; direction: ltr; }

/* ── my_requests.html hover effects (extracted from inline <style>) ── */
.csp-req-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color) !important;
    box-shadow: 0 12px 30px rgba(250, 204, 21, 0.1) !important;
}
.csp-req-card:hover .feature-icon { transform: scale(1.05); }

/* ── Justify ── */
.csp-justify-between { justify-content: space-between; }
.csp-justify-end     { justify-content: flex-end; }

/* ── Visibility / pointer ── */
.csp-vis-hidden         { visibility: hidden; }
.csp-pointer-events-none { pointer-events: none; }

/* ── Width ── */
.csp-w-full { width: 100%; }

/* ── Flex variants ── */
.csp-flex-11-auto  { flex: 1 1 auto; }
.csp-flex-11-160   { flex: 1 1 160px; }
.csp-flex-21-200   { flex: 2 1 200px; }

/* ── Overflow ── */
.csp-overflow-x-auto { overflow-x: auto; }

/* ── Resize ── */
.csp-resize-vertical { resize: vertical; }

/* ── Direction ── */
.csp-ltr { direction: ltr; }

/* ── Display contents ── */
.csp-contents { display: contents; }

/* ── Pagination (shared across many templates) ── */
.csp-pagination { display: flex; align-items: center; justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--border-color); margin-top: 0.75rem; flex-wrap: wrap; gap: 0.75rem; }
.csp-pagination-center { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); }
.csp-page-btns    { display: flex; gap: 0.35rem; align-items: center; }
.csp-page-btn     { padding: 0.35rem 0.75rem; font-size: 0.78rem; border-radius: 6px; text-decoration: none; display: inline-flex; align-items: center; gap: 0.25rem; }
.csp-page-btn-sm  { height: 34px; padding: 0 1rem; font-size: 0.82rem; display: inline-flex; align-items: center; text-decoration: none; }
.csp-page-current { padding: 0.35rem 0.65rem; font-size: 0.78rem; font-weight: 700; border-radius: 6px; background: rgba(250,204,21,0.12); color: var(--accent-color); border: 1px solid rgba(250,204,21,0.3); }
.csp-page-other   { padding: 0.35rem 0.65rem; font-size: 0.78rem; border-radius: 6px; text-decoration: none; color: var(--text-secondary); border: 1px solid var(--border-color); background: transparent; }
.csp-page-info    { font-size: 0.78rem; color: var(--text-secondary); }
.csp-page-info-center { height: 34px; padding: 0 1rem; display: inline-flex; align-items: center; font-size: 0.82rem; color: var(--text-secondary); }

/* ── KPI stat strip ── */
.csp-kpi-strip  { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px,100%), 1fr)); gap: 1rem; margin-bottom: 2rem; }
.csp-kpi-card   { padding: 1.25rem; text-align: center; }
.csp-kpi-num    { font-size: 2rem; font-weight: 800; }
.csp-kpi-label  { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* ── Tracker section labels ── */
.csp-section-label { margin-bottom: 0.5rem; font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; padding-inline-start: 0.25rem; }

/* ── Tracker card grids ── */
.csp-grid-auto-300 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px,100%), 1fr)); gap: 1rem; margin-bottom: 2rem; }

/* ── Tracker color themes (onboarding/offboarding) ── */
.tracker-color-red   { --tc: #ef4444; --tc-bg: rgba(239,68,68,0.13); }
.tracker-color-amber { --tc: #f59e0b; --tc-bg: rgba(245,158,11,0.13); }
.tracker-color-blue  { --tc: #3b82f6; --tc-bg: rgba(59,130,246,0.13); }
.tracker-color-green { --tc: #22c55e; --tc-bg: rgba(34,197,94,0.13); }

.tracker-badge        { border-radius: 20px; padding: 0.2rem 0.65rem; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; background: var(--tc-bg); color: var(--tc); }
.tracker-progress-bar { height: 100%; border-radius: 4px; transition: width 0.3s; background: var(--tc); }
.tracker-date-color   { color: var(--tc); }
.tracker-card-avatar-initials { width: 44px; height: 44px; border-radius: 50%; background: var(--tc-bg); display: flex; align-items: center; justify-content: center; color: var(--tc); font-weight: 700; font-size: 1rem; flex-shrink: 0; }

/* ── Label uppercase patterns (disciplinary forms) ── */
.csp-label-upper    { display: block; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.5rem; }
.csp-label-upper-xs { display: block; font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.4rem; }

/* ── Warning / alert boxes ── */
.csp-warn-box   { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); border-radius: 6px; padding: 0.45rem 0.7rem; font-size: 0.72rem; color: #fca5a5; margin-bottom: 0.5rem; }
.csp-alert-error { margin-bottom: 1.5rem; padding: 0.9rem 1.2rem; border-radius: 8px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); }
.csp-alert-text  { color: #fca5a5; font-size: 0.875rem; }
.csp-info-box    { padding: 0.9rem 1.1rem; border-radius: 8px; background: var(--overlay-subtle); border: 1px solid var(--border-color); }
.csp-alert-generic { padding: 0.75rem 1rem; border-radius: 8px; background: var(--card-bg); border: 1px solid var(--accent-color); color: var(--text-primary); margin-bottom: 0.5rem; }

/* ── Avatar helpers ── */
.csp-avatar-34       { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.csp-avatar-44-img   { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.csp-avatar-green    { background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.25); }
.csp-avatar-red-soft { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.2); }
.csp-avatar-accent   { background: rgba(250,204,21,0.08); color: var(--accent-color); border: 1.5px solid rgba(250,204,21,0.2); }
.csp-avatar-30-img   { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--border-color); flex-shrink: 0; }
.csp-avatar-30-init  { width: 30px; height: 30px; border-radius: 50%; background: rgba(250,204,21,0.08); color: var(--accent-color); font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1.5px solid rgba(250,204,21,0.2); flex-shrink: 0; }

/* ── Progress track ── */
.csp-progress-track        { background: var(--border-color); border-radius: 99px; height: 6px; overflow: hidden; }
.csp-progress-fill-accent  { height: 100%; background: var(--accent-color); border-radius: 99px; }

/* ── Disciplinary severity colors ── */
.csp-severity-high   { color: #ef4444; font-weight: 600; font-size: 0.82rem; }
.csp-severity-medium { color: #f59e0b; font-weight: 600; font-size: 0.82rem; }
.csp-severity-low    { color: #22c55e; font-weight: 600; font-size: 0.82rem; }

/* ── Disciplinary badge variants (table) ── */
.csp-badge-written  { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.csp-badge-final    { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.3); }
.csp-badge-terminat { background: rgba(239,68,68,0.2);  color: #ef4444;  border: 1px solid rgba(239,68,68,0.4); font-weight: 700; }
.csp-badge-other    { background: var(--overlay-medium); color: var(--text-secondary); }

/* ── Empty states ── */
.csp-empty-state       { padding: 3rem; text-align: center; color: var(--text-secondary); }
.csp-empty-icon-lg     { font-size: 2.5rem; margin-bottom: 0.75rem; }
.csp-empty-title       { font-weight: 600; margin-bottom: 0.4rem; }
.csp-empty-text        { font-size: 0.88rem; }

/* ── Button helpers ── */
.csp-btn-danger-bg   { background: #ef4444; border-color: #ef4444; }
.csp-btn-inline-flex { display: inline-flex; align-items: center; gap: 0.4rem; }
.csp-btn-h42         { height: 42px; font-size: 0.9rem; }
.csp-btn-h38         { height: 38px; }
.csp-btn-h36         { height: 36px; }
.csp-btn-h34         { height: 34px; }

/* ── Filter bar pattern ── */
.csp-filter-field    { flex: 2 1 200px; }
.csp-filter-field-sm { flex: 1 1 160px; }
.csp-filter-field-xs { flex: 1 1 130px; }
.csp-filter-actions  { display: flex; gap: 0.6rem; }

/* ── Max-width containers ── */
.csp-mw-700  { max-width: 700px; margin: 0 auto 4rem; }
.csp-mw-680  { max-width: 680px; }
.csp-mw-960  { max-width: 960px; margin-left: auto; margin-right: auto; }

/* ── Leave balance ── */
.csp-leave-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px,100%), 1fr)); gap: 1.75rem; margin-bottom: 2.5rem; }
.csp-leave-card   { border-radius: 12px; overflow: hidden; }
.csp-leave-hdr    { padding: 1.1rem 1.25rem 1rem; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 0.75rem; }
.csp-leave-icon   { font-size: 1.4rem; width: 42px; height: 42px; border: 1px solid var(--border-color); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.csp-leave-tbl    { width: 100%; border-collapse: collapse; table-layout: fixed; }
.csp-leave-th     { padding: 0.55rem 0.5rem; text-align: center; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(255,255,255,0.025); border: 1px solid var(--border-color); font-weight: 600; }
.csp-leave-td     { padding: 1rem 0.5rem; text-align: center; border: 1px solid var(--border-color); }
.csp-leave-val    { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.csp-leave-sub    { font-size: 0.65rem; color: var(--text-secondary); margin-top: 0.3rem; }
.csp-leave-prog   { padding: 0.9rem 1.25rem 0.8rem; border-top: 1px solid var(--border-color); }
.csp-leave-exceeded-tag { margin-inline-start: auto; font-size: 0.65rem; font-weight: 700; color: #ef4444; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); padding: 0.2rem 0.55rem; border-radius: 999px; white-space: nowrap; }

/* ── Notification filter sidebar ── */
.csp-notif-filter-link { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-radius: 8px; text-decoration: none; color: var(--text-secondary); font-size: 0.92rem; font-weight: 500; transition: all 0.2s ease; }
.csp-notif-type-link   { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border-radius: 8px; text-decoration: none; color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }

/* ── Read receipts ── */
.csp-receipts-wrap { max-width: 860px; margin: 0 auto 4rem; }
.csp-receipt-card  { padding: 0.75rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.csp-receipt-row   { display: flex; align-items: center; gap: 0.75rem; }
.csp-receipt-name  { margin: 0; font-size: 0.9rem; font-weight: 600; }
.csp-receipt-dept  { margin: 0; font-size: 0.75rem; color: var(--text-secondary); }
.csp-receipt-time  { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; }
.csp-receipts-h3   { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.csp-progress-annc { text-align: center; min-width: 100px; }
.csp-annc-count    { font-size: 2rem; font-weight: 700; color: var(--accent-color); line-height: 1; }
.csp-annc-label    { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.2rem; }
.csp-annc-bar-wrap { margin-top: 0.5rem; background: var(--border-color); border-radius: 99px; height: 6px; overflow: hidden; }
.csp-annc-bar-fill { height: 100%; background: var(--accent-color); border-radius: 99px; }

/* ── Board post (my_team) ── */
.csp-board-post-head { display: flex; align-items: center; gap: 0.65rem; }

/* ── Additional helpers ── */
.csp-items-center  { align-items: center; }
.csp-align-center  { align-items: center; }
.csp-m-0           { margin: 0; }
.csp-m-0-sm        { margin: 0.2rem 0 0; }
.csp-mt-xs         { margin-top: 0.25rem; }
.csp-pt-xs         { padding-top: 0.25rem; }
.csp-px-sm         { padding-inline: 0.75rem; }
.csp-px-lg         { padding-inline: 1.25rem; }
.csp-py-xl         { padding-block: 2rem; }
.csp-text-xl       { font-size: 1.5rem; }
.csp-text-lg       { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.csp-text-xs       { font-size: 0.65rem; }
.csp-font-bold     { font-weight: 700; }
.csp-ws-nowrap     { white-space: nowrap; }
.csp-border-none   { border-bottom: none !important; }
.csp-text-green    { color: #10b981; }
.csp-text-red      { color: #ef4444; }
.csp-grid-auto-320 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.csp-mw-1100       { max-width: 1100px; }
.csp-inline        { display: inline; }
.csp-avatar-sm     { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--border-color); flex-shrink: 0; display: block; }
.csp-avatar-sm.csp-avatar-accent { background: rgba(250,204,21,0.08); color: var(--accent-color); border-color: rgba(250,204,21,0.2); display: flex; align-items: center; justify-content: center; }
.csp-flex-col      { display: flex; flex-direction: column; }
.csp-gap-xs        { gap: 0.25rem; }
.csp-gap-sm        { gap: 0.5rem; }
.csp-gap-md        { gap: 0.75rem; }
.csp-gap-lg        { gap: 1rem; }

/* ── More utility helpers ── */
.csp-ml-auto       { margin-left: auto; }
.csp-mr-auto       { margin-right: auto; }
.csp-mb-xs         { margin-bottom: 0.25rem; }
.csp-mb-sm         { margin-bottom: 0.5rem; }
.csp-mt-lg         { margin-top: 1.5rem; }
.csp-fw-800        { font-weight: 800; }
.csp-text-base     { font-size: 1rem; }
.csp-justify-between { justify-content: space-between; }
.csp-justify-end   { justify-content: flex-end; }
.csp-justify-start { justify-content: flex-start; }
.csp-justify-center { justify-content: center; }
.csp-flex-wrap     { flex-wrap: wrap; }
.csp-flex-shrink-0 { flex-shrink: 0; }
.csp-items-start   { align-items: flex-start; }
.csp-items-end     { align-items: flex-end; }
.csp-progress-fill-green { height: 100%; background: #10b981; border-radius: 99px; transition: width 0.4s ease; }
.csp-text-accent   { color: var(--accent-color); }
.csp-apr-checkbox  { margin-top: 0.15rem; flex-shrink: 0; accent-color: var(--accent-color); }
.csp-mt-xs         { margin-top: 0.15rem; }
.csp-pt-sm         { padding-top: 0.5rem; }
.csp-font-bold     { font-weight: 700; }

/* ── Disciplinary/admin table helpers ── */
.csp-td-title-220     { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csp-border-bottom    { border-bottom: 1px solid var(--border-color); }
.csp-border-top       { border-top: 1px solid var(--border-color); }
.csp-p-0              { padding: 0; }
.csp-p-lg             { padding: 1.5rem; }
.csp-p-xl             { padding: 2rem; }
.csp-px-md            { padding-inline: 1rem; }
.csp-px-lg            { padding-inline: 1.25rem; }
.csp-py-md            { padding-block: 1.25rem; }
.csp-py-sm            { padding-block: 0.5rem; }
.csp-mb-4             { margin-bottom: 4rem; }
.csp-mb-sm            { margin-bottom: 0.5rem; }
.csp-fw-400           { font-weight: 400; }
.csp-fw-500           { font-weight: 500; }
.csp-fw-600           { font-weight: 600; }
.csp-ml-sm            { margin-left: 0.4rem; }
.csp-ml-auto          { margin-left: auto; }
.csp-opacity-80       { opacity: 0.8; }
.csp-block            { display: block; }
.csp-cursor-pointer   { cursor: pointer; }
.csp-no-decoration    { text-decoration: none; }
.csp-text-primary     { color: var(--text-primary); }
.csp-text-error       { color: #fca5a5; }
.csp-overflow-hidden  { overflow: hidden; }
.csp-w-full           { width: 100%; }
.csp-items-end        { align-items: flex-end; }
.csp-gap-xl           { gap: 1.5rem; }
.csp-mt-xl            { margin-top: 2rem; }
.csp-gap-lg           { gap: 1rem; }
.csp-flex-21-200      { flex: 2 1 200px; }
.csp-flex-11-160      { flex: 1 1 160px; }
.csp-flex-11-130      { flex: 1 1 130px; }
.csp-flex-21-120      { flex: 1 1 120px; }
.csp-flex-21-160      { flex: 1 1 160px; }
.csp-btn-h34          { height: 34px; }
.csp-btn-h36          { height: 36px; }
.csp-btn-h38          { height: 38px; }
.csp-btn-h42          { height: 42px; }
.csp-mw-700           { max-width: 700px; }
.csp-mw-960           { max-width: 960px; }
.csp-mb-lg            { margin-bottom: 1.5rem; }
.csp-alert-generic    { padding: 0.85rem 1.25rem; border-radius: 8px; background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25); color: #86efac; }
.csp-info-box         { padding: 0.9rem 1.1rem; border-radius: 8px; background: var(--overlay-subtle); border: 1px solid var(--border-color); }

/* ── Tracker card avatar helpers ── */
.csp-avatar-44-img     { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.csp-avatar-44-init    { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; background: rgba(239,68,68,0.13); color: #ef4444; }
.csp-avatar-44-init.csp-avatar-accent { background: var(--accent-color); color: #fff; }
.csp-tc-color          { color: var(--tc, var(--accent-color)); }

/* ── Section label (tracker section headings) ── */
.csp-section-label     { margin-bottom: 0.5rem; font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; padding-inline-start: 0.25rem; }

/* ── Tracker/KPI missing helpers ── */
.csp-text-amber    { color: #f59e0b; }
.csp-text-blue     { color: #3b82f6; }
.csp-kpi-num       { font-size: 2rem; font-weight: 800; }
.csp-kpi-label     { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; }
.csp-card-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px,100%), 1fr)); gap: 1rem; }
.csp-inline-block  { display: inline-block; }
.csp-py-sm         { padding-block: 0.6rem; }
.csp-px-xl         { padding-inline: 1.5rem; }
.csp-overflow-hidden { overflow: hidden; }

/* ── Additional utility classes ── */
.csp-hidden      { display: none; }
.csp-obj-contain { object-fit: contain; }

/* ── Read receipts ── */
.rr-avatar        { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rr-avatar-green  { background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.25); }
.rr-avatar-red    { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.2); }
.csp-text-upper   { text-transform: uppercase; letter-spacing: 0.05em; }
.csp-min-w-100    { min-width: 100px; }
.csp-lh-1         { line-height: 1; }
.csp-opacity-70   { opacity: 0.7; }
.csp-opacity-60   { opacity: 0.6; }
.csp-p-3xl        { padding: 3rem 2rem; }
.csp-text-3xl     { font-size: 3rem; }
.csp-min-w-full   { min-width: 100%; }
.csp-mw-620       { max-width: 620px; }
.csp-min-w-220       { min-width: min(220px, 100%); }
/* ── Org-form / picture upload ── */
.csp-drop-zone       { border: 2px dashed var(--border-color); border-radius: 10px; padding: 1.5rem; text-align: center; transition: border-color 0.2s; cursor: pointer; }
.csp-drop-zone:hover { border-color: var(--accent-color); }
.csp-drop-zone input[type="file"] { display: block; margin: 0.75rem auto 0; font-size: 0.78rem; color: var(--text-secondary); cursor: pointer; }
.csp-pic-preview     { display: none; margin-top: 1rem; text-align: center; }
.csp-pic-preview img { max-height: 120px; border-radius: 10px; border: 1px solid var(--border-color); }
.csp-form-section    { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.csp-form-group      { margin-bottom: 1.1rem; }
.csp-field-label     { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.csp-field-label-sm  { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.csp-required-star   { color: #ef4444; }
.csp-help-text       { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.3rem; opacity: 0.75; }
.csp-field-error     { color: #ef4444; font-size: 0.78rem; margin-top: 0.3rem; }
.csp-field-error-sm  { color: #ef4444; font-size: 0.78rem; margin-top: 0.35rem; }
.csp-btn-row         { display: flex; gap: 0.75rem; margin-top: 1.75rem; flex-wrap: wrap; }
.csp-btn-row-sm      { display: flex; gap: 1rem; margin-top: 0.5rem; flex-wrap: wrap; }
.csp-btn-flex        { flex: 1; min-width: 140px; }
.csp-btn-flex-link   { flex: 1; min-width: 140px; text-align: center; text-decoration: none; }
.csp-btn-flex-lg     { flex: 1 1 160px; height: 42px; font-size: 0.9rem; cursor: pointer; }
.csp-btn-flex-cancel { flex: 1 1 120px; height: 42px; font-size: 0.9rem; display: inline-flex; align-items: center; justify-content: center; }

/* Grid layouts */
.csp-grid-2          { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Form card max-width variants */
.csp-mw-640  { max-width: 640px; }

/* Form container */
.csp-form-col  { display: flex; flex-direction: column; gap: 1.25rem; }
.csp-form-mb-0 { margin-bottom: 0; }

/* Info/period display box */
.csp-info-box { padding: 0.9rem 1.1rem; border-radius: 8px; background: var(--overlay-subtle); border: 1px solid var(--border-color); }
.csp-info-box-label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.csp-info-box-value { font-weight: 600; color: var(--text-primary); }

/* Error list box for forms */
.csp-form-error-box  { margin-bottom: 1.5rem; padding: 0.9rem 1.2rem; border-radius: 8px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); }
.csp-form-error-line { color: #fca5a5; font-size: 0.875rem; }
.csp-pic-thumb       { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 2px solid var(--border-color); }
.csp-pic-row         { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.csp-pic-info        { flex: 1; min-width: 160px; }
.csp-pic-info-p      { margin: 0; font-size: 0.82rem; color: var(--text-secondary); }
.csp-pic-info-p2     { margin: 0.15rem 0 0.6rem; font-size: 0.78rem; color: var(--text-secondary); opacity: 0.7; }
.csp-pic-remove-lbl  { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #ef4444; cursor: pointer; }
.csp-pic-remove-cb   { accent-color: #ef4444; }
.csp-drop-icon       { font-size: 2rem; margin-bottom: 0.5rem; }
.csp-drop-hint       { margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.csp-drop-hint2      { margin: 0; font-size: 0.72rem; color: var(--text-secondary); opacity: 0.6; }
.csp-alert-error-flex { display: flex; gap: 0.75rem; align-items: flex-start; color: #fca5a5; font-size: 0.88rem; margin-bottom: 2rem; padding: 1rem 1.4rem; border-radius: 10px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.35); }

/* Generic flash message alert boxes — used by disciplinary-detail, announcement-list, etc. */
.alert-msg          { max-width: 900px; margin: 0 auto 1.5rem; padding: 0.85rem 1.25rem; border-radius: 8px; font-size: 0.9rem; font-weight: 500; }
.alert-msg-error    { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-msg-success  { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25); color: #86efac; }

/* ── Generic status/colour badge tokens ─────────────────────────────────── */
.csp-badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 5px; font-size: 0.72rem; font-weight: 600; }
.csp-badge-green   { background: rgba(16,185,129,0.12); color: #10b981; }
.csp-badge-blue    { background: rgba(59,130,246,0.12);  color: #3b82f6; }
.csp-badge-accent  { background: rgba(201,168,76,0.12);  color: var(--accent-color); }
.csp-badge-muted   { background: rgba(100,100,100,0.12); color: var(--text-secondary); }
.csp-badge-red     { background: rgba(239,68,68,0.12);   color: #ef4444; }
/* Actions cell helper */
.csp-actions-end { display: flex; gap: 0.4rem; justify-content: flex-end; align-items: center; }
.csp-btn-sm      { padding: 0.3rem 0.65rem; font-size: 0.75rem; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
/* Table cell name/sub helpers */
.csp-td-name     { font-weight: 700; font-size: 0.9rem; }
.csp-td-sub      { font-size: 0.73rem; color: var(--text-secondary); margin-top: 0.15rem; }
.csp-td-bold     { font-weight: 700; }

/* ── Filter bar (search/filter row + create button) ─────────────────────── */
.csp-filter-bar   { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; justify-content: space-between; }
.csp-filter-form  { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.csp-filter-input { width: 180px; }
.csp-filter-btn   { height: 34px; padding: 0 1rem; font-size: 0.84rem; cursor: pointer; display: inline-flex; align-items: center; }

/* ── Table in a card (padding:0 + overflow:hidden) ──────────────────────── */
.csp-table-card  { padding: 0; overflow: hidden; }
.csp-form-inline  { display: inline; }
/* Clickable feature-card wrapper (replaces onclick="window.location.href=...") */
.feature-card-link { display: block; text-decoration: none; color: inherit; }
.feature-card-link .feature-card { cursor: pointer; }
/* Feature card stat line */
.feature-card-stat { margin-top: 1rem; color: var(--text-primary); font-weight: 600; }

/* ── Simple pagination (prev · page-info · next) ─────────────────────────── */
.csp-pag-row   { display: flex; justify-content: center; gap: 0.4rem; margin-top: 1rem; }
.csp-pag-label { padding: 0.35rem 0.75rem; font-size: 0.8rem; color: var(--text-secondary); display: inline-flex; align-items: center; }

/* ── Empty state inside a card ──────────────────────────────────────────── */
.csp-empty-card { text-align: center; padding: 3.5rem 2rem; }
.csp-empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; }
.csp-empty-h5   { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.4rem; }
.csp-empty-p    { font-size: 0.84rem; color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ── Mini progress bar (table cell usage, animated by csp-events.js data-pct) ── */
.csp-mini-bar-wrap  { display: flex; align-items: center; gap: 0.4rem; }
.csp-mini-bar-track { flex: 1; height: 5px; background: var(--border-color); border-radius: 3px; overflow: hidden; }
.csp-mini-bar-fill  { height: 100%; width: 0; background: var(--accent-color); border-radius: 3px; }
.csp-mini-bar-pct   { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; }

/* ── Settings page ── */
.sett-features { justify-content: center; max-width: 960px; margin: 2rem auto 0; }
.sett-card-center { text-align: center; }
.sett-card-solo { max-width: 360px; margin: 0 auto; }
.sett-icon { margin: 0 auto 1.5rem; }
.sett-card-desc { margin-bottom: 1.5rem; }
.sett-full-btn  { margin: auto 0 0 0; display: block; width: 100%; box-sizing: border-box; }

/* ── base.html helpers ── */
.msg-badge       { display: none; }          /* shown via JS CSSOM when count > 0 */
.form-inline-flex{ margin: 0; display: flex; }
.form-no-margin  { margin: 0; flex-shrink: 0; }
