/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    background: #f1f5f9;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* =========== LOGIN SCREEN =========== */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
}
.auth-wrapper { width: 100%; max-width: 420px; }
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo img { height: 48px; margin: 0 auto; }
.auth-title { margin: 0 0 .25rem; text-align: center; font-size: 1.5rem; color: var(--secondary); }
.auth-sub   { margin: 0 0 2rem; text-align: center; color: #64748b; font-size: .9rem; }
.auth-form  { display: flex; flex-direction: column; gap: 1rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; }

/* =========== ADMIN LAYOUT =========== */
.admin-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.admin-sidebar {
    background: var(--secondary);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand {
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 1rem;
    color: #fff;
}
.sidebar-brand img { max-height: 40px; }
.sidebar-nav  { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 0 .5rem; }
.sidebar-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .625rem .875rem;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: .925rem;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.sidebar-link:hover   { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar-link.is-active { background: var(--primary); color: #fff; }
.sidebar-icon { display: inline-flex; width: 1.25rem; justify-content: center; opacity: .85; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding: 1rem .5rem 0; margin-top: 1rem; }
.logout-btn    { color: #fca5a5; }

/* =========== MAIN AREA =========== */
.admin-main { padding: 1.5rem 2rem; min-width: 0; }
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem;
}
.admin-page-title { margin: 0; font-size: 1.5rem; color: var(--secondary); }
.admin-user { color: #64748b; font-size: .9rem; }

/* =========== FLASH =========== */
.flash {
    padding: .875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .925rem;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash ul { margin: .5rem 0 0 1.25rem; padding: 0; }

/* =========== CARDS =========== */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card h3 { margin: 0 0 .25rem; color: var(--secondary); }
.card-sub { margin: 0 0 1.5rem; color: #64748b; font-size: .9rem; }

/* =========== STATS =========== */
.stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 1.25rem;
}
.stat-label { color: #64748b; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--secondary); margin: .25rem 0; }
.stat-link  { font-size: .85rem; color: var(--primary); font-weight: 500; }

/* =========== FORMS =========== */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row {
    display: grid; grid-template-columns: 200px 1fr; gap: 1rem; align-items: start;
}
.form-label { font-weight: 600; color: var(--secondary); padding-top: .5rem; font-size: .925rem; }
.form-input { display: flex; flex-direction: column; gap: .5rem; }
.form-help  { color: #64748b; font-size: .8rem; }

.field { display: flex; flex-direction: column; gap: .375rem; }
.field span { font-weight: 500; font-size: .875rem; color: #334155; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], textarea, select {
    padding: .625rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: .925rem;
    font-family: inherit;
    background: #fff;
    width: 100%;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

input[type="file"] {
    padding: .5rem; border: 1px dashed #cbd5e1; border-radius: 8px; background: #f8fafc;
}

.color-input { display: flex; gap: .5rem; align-items: center; }
.color-input input[type="color"] {
    width: 50px; height: 40px; padding: 0; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer;
}
.color-input input[type="text"] { max-width: 150px; font-family: ui-monospace, monospace; }

.image-preview {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
}
.image-preview img { max-height: 60px; max-width: 120px; }
.image-preview code { font-size: .75rem; color: #64748b; }

.form-actions {
    display: flex; gap: .5rem; justify-content: flex-end;
    padding-top: 1rem; border-top: 1px solid #e2e8f0;
}

.form-inline {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: .75rem;
}
.form-inline input { flex: 1; min-width: 120px; }
.inline-check { display: flex; align-items: center; gap: .375rem; font-size: .9rem; }

/* =========== BUTTONS =========== */
.btn {
    padding: .625rem 1.25rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: .925rem;
    font-family: inherit;
    transition: all .15s ease;
    text-decoration: none;
    display: inline-block;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(.92); }
.btn-danger   { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm       { padding: .375rem .75rem; font-size: .8rem; }
.btn-block    { width: 100%; }

/* =========== TABLES =========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: .625rem .5rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}
.data-table th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    background: #f8fafc;
}
.data-table td input[type="text"], .data-table td input[type="number"] { padding: .375rem .5rem; }
.data-table .actions { display: flex; gap: .25rem; }

.empty { color: #64748b; font-style: italic; }

/* =========== RESPONSIVE =========== */
@media (max-width: 800px) {
    .admin-body { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .form-row { grid-template-columns: 1fr; }
    .form-label { padding-top: 0; }
}

/* ===== AIRFIELD MODULE ADDITIONS ===== */

.sidebar-section-label {
    padding: .75rem .875rem .25rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.4);
    font-weight: 600;
}

.pill {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 12px;
    font-size: .75rem;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
    text-transform: capitalize;
}
.pill-create { background: #dcfce7; color: #166534; }
.pill-update { background: #dbeafe; color: #1e40af; }
.pill-delete { background: #fee2e2; color: #991b1b; }
.pill-status { background: #f1f5f9; color: #475569; }
.pill-phase-pre  { background: #fef3c7; color: #92400e; }
.pill-phase-post { background: #dcfce7; color: #166534; }
.pill-phase-both { background: #e0e7ff; color: #3730a3; }

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .5rem;
    margin: .5rem 0;
}
.check-pill {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .625rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    transition: all .15s;
}
.check-pill:hover { border-color: var(--primary); background: #fff; }
.check-pill input[type="checkbox"] { margin: 0; cursor: pointer; }
.check-pill input[type="checkbox"]:checked + span { font-weight: 600; color: var(--primary); }

.sub-systems-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .5rem; }
.sub-row { display: flex; gap: .5rem; align-items: center; }
.sub-row input { flex: 1; }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ===== Dashboard improvements ===== */
.welcome-band {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all .15s;
}
.stat-card-link:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.stat-icon {
    font-size: 1.6rem;
    margin-bottom: .5rem;
    color: var(--primary);
}
.stat-sub {
    font-size: .8rem;
    color: #64748b;
    margin-top: .25rem;
    line-height: 1.3;
}

/* Permission group label inside role form */
.perm-group { margin: 1rem 0 1.5rem; }
.perm-group-label {
    margin: 0 0 .25rem;
    color: var(--secondary);
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ===========================================================
   v3 — Risk Register, Issue Register, RACI, Custom Fields
   =========================================================== */

.filter-bar {
    display: flex; gap: .5rem; align-items: center;
    margin-bottom: 1rem; padding: .75rem 1rem;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
}
.filter-bar select {
    padding: .35rem .5rem; border: 1px solid #cbd5e1;
    border-radius: 4px; background: #fff; font-size: .9rem;
}

/* Multi-column form layouts */
.grid-2, .grid-3 {
    display: grid; gap: 1rem;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.grid-2 .form-row, .grid-3 .form-row {
    display: block; margin-bottom: .25rem;
}
.grid-2 .form-row .form-label, .grid-3 .form-row .form-label,
.grid-3 > div > label {
    display: block; margin-bottom: .25rem;
    font-size: .85rem; color: #475569; font-weight: 500;
}
.grid-2 .form-row .form-input, .grid-3 .form-row .form-input,
.grid-3 > div > input, .grid-3 > div > select {
    width: 100%;
}

/* Section headers inside forms */
.form-section-h {
    margin: 2rem 0 .75rem; padding-bottom: .5rem;
    border-bottom: 2px solid #e2e8f0;
    color: #1e293b; font-size: 1.05rem;
}
.form-subhead {
    margin: 1rem 0 .5rem; font-size: .85rem;
    text-transform: uppercase; letter-spacing: .05em;
    color: #64748b; font-weight: 600;
}

/* Phase blocks (Initial / Current / Post-Mitigation) */
.phase-block {
    padding: 1rem 1.25rem; margin-bottom: 1rem;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb; border-radius: 6px;
}
.readonly-rating {
    padding: .5rem .75rem; background: #fff;
    border: 1px solid #cbd5e1; border-radius: 4px;
    min-height: 36px; display: flex; align-items: center;
}

/* Type pills */
.pill-type-threat {
    background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;
}
.pill-type-opportunity {
    background: #dcfce7; color: #166534; border: 1px solid #bbf7d0;
}

/* Severity pills */
.pill-sev-critical { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; font-weight: 600; }
.pill-sev-high     { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.pill-sev-medium   { background: #fef3c7; color: #854d0e; border: 1px solid #fde68a; }
.pill-sev-low      { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* Risk rating chips (in tables and dashboard) */
.rating {
    display: inline-block; min-width: 40px; padding: .2rem .5rem;
    text-align: center; border-radius: 4px;
    font-weight: 600; font-size: .9rem;
}
.rating-low    { background: #dcfce7; color: #166534; }
.rating-medium { background: #fef3c7; color: #854d0e; }
.rating-high   { background: #fee2e2; color: #991b1b; }
.rating-none   { background: #f1f5f9; color: #64748b; }

/* Heat-map */
.heatmap-row {
    display: flex; gap: 2rem; flex-wrap: wrap;
    justify-content: space-around;
}
.heatmap-block { flex: 1; min-width: 360px; }
.heatmap-title {
    text-align: center; font-weight: 600;
    margin-bottom: .5rem; color: #1e293b;
}
.heatmap {
    width: 100%; border-collapse: collapse;
    border: 1px solid #cbd5e1;
}
.heatmap th, .heatmap td {
    border: 1px solid #cbd5e1; text-align: center;
    padding: .5rem; font-size: .85rem;
}
.heatmap th { background: #f1f5f9; color: #475569; font-weight: 600; }
.heatmap-axis { font-size: .8rem; color: #64748b; font-weight: normal; }
.heatmap td   { position: relative; height: 56px; min-width: 56px; }
.heat-low     { background: #bbf7d0; }
.heat-medium  { background: #fef08a; }
.heat-high    { background: #fca5a5; }
.heat-score   { display: block; font-size: .75rem; color: rgba(0,0,0,0.55); }
.heat-count   { display: block; font-size: 1.2rem; font-weight: 700; color: #0f172a; }

/* RACI matrix */
.raci-table-wrap {
    overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 6px;
}
.raci-table {
    width: 100%; border-collapse: collapse; min-width: 600px;
}
.raci-table th, .raci-table td {
    border: 1px solid #e2e8f0; padding: .5rem .75rem;
    text-align: center; vertical-align: middle;
}
.raci-table th {
    background: #f8fafc; color: #1e293b; font-weight: 600;
    border-bottom: 3px solid #2563eb;
}
.raci-act-col {
    text-align: left !important; min-width: 200px;
    background: #fff !important; font-weight: 500;
}
.raci-team-col { min-width: 90px; }
.raci-cell { background: #fff; }
.raci-cell:hover { background: #f8fafc; }

/* RACI letter chips */
.raci-letter {
    display: inline-block; width: 24px; height: 24px;
    line-height: 24px; text-align: center;
    border-radius: 50%; color: #fff; font-weight: 700;
    font-size: .8rem; margin: 0 1px;
}
.raci-r { background: #dc2626; }   /* Responsible — red */
.raci-a { background: #2563eb; }   /* Accountable — blue */
.raci-c { background: #d97706; }   /* Consulted — amber */
.raci-i { background: #64748b; }   /* Informed — gray */

/* Dynamic RACI assignment rows on activity form */
.raci-rows { margin-bottom: .75rem; }
.raci-row {
    display: flex; gap: .5rem; align-items: center;
    margin-bottom: .5rem;
}
.raci-row select, .raci-row input {
    padding: .35rem .5rem; border: 1px solid #cbd5e1;
    border-radius: 4px; background: #fff;
}
.raci-row select[name="raci_letter[]"] { width: 70px; }
.raci-row input[name="raci_note[]"] { flex: 1; }

/* Team color dot */
.team-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-left: .5rem;
    border: 1px solid rgba(0,0,0,.2);
}

/* RACI legend */
.legend-row {
    display: flex; align-items: center; gap: .5rem;
    color: #475569; padding: .5rem .75rem;
    background: #f8fafc; border-radius: 6px;
}

/* Comment list */
.comment-list {
    list-style: none; padding: 0; margin: 0;
}
.comment-list li {
    padding: .75rem 1rem; margin-bottom: .5rem;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 6px;
}
.comment-meta {
    font-size: .8rem; color: #64748b; margin-bottom: .25rem;
}
.comment-body { color: #334155; line-height: 1.5; }

/* Tweaks for stat-card sub line allowing inline HTML */
.stat-card .stat-sub strong { font-weight: 600; }

/* ===========================================================
   PHASE 3 — ICT Programme Tracker styles
   =========================================================== */

/* Welcome / page header band */
.welcome-band {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
}
.welcome-band h2 { color: #fff; }
.welcome-band p { color: #cbd5e1; }

/* Executive grid (cards row) */
.exec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.exec-card {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.exec-card-alert { border-left: 4px solid #dc2626; background: #fef2f2; }
.exec-label { font-size: .75rem; color: #64748b; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .25rem; }
.exec-num   { font-size: 1.85rem; font-weight: 700; color: #0f172a; line-height: 1; }
.exec-sub   { font-size: .75rem; color: #94a3b8; margin-top: .25rem; }
.exec-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 900px) { .exec-row { grid-template-columns: 1fr; } }

/* Module tile grid (12 modules home page) */
.module-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .75rem;
}
.module-tile {
    display: block;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #0f172a;
    transition: all .15s ease;
}
.module-tile:hover {
    background: #fff;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.module-tile-icon  { font-size: 1.6rem; margin-bottom: .35rem; }
.module-tile-label { font-weight: 600; font-size: .92rem; }
.module-tile-num   { font-size: .8rem; color: #64748b; margin-top: .25rem; }

/* RAG horizontal bar / dot */
.rag-bar {
    display: flex; height: 32px; border-radius: 6px; overflow: hidden;
    border: 1px solid #e2e8f0;
}
.rag-bar-seg {
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .85rem; font-weight: 600;
    min-width: 30px;
}
.rag-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: .35rem; vertical-align: middle;
}

/* Category pill */
.cat-pill {
    background: #f1f5f9; padding: .4rem .7rem;
    border-radius: 999px; font-size: .85rem;
    border: 1px solid #e2e8f0;
}
.cat-pill strong { color: #2563eb; margin-right: .35rem; }

/* Stage Gate matrix */
.gate-matrix {
    width: 100%; border-collapse: collapse; font-size: .85rem;
}
.gate-matrix th, .gate-matrix td {
    border: 1px solid #e2e8f0; padding: .35rem .5rem;
    text-align: center;
}
.gate-matrix thead th { background: #f8fafc; position: sticky; top: 0; z-index: 2; }
.gate-matrix .sticky-col {
    position: sticky; left: 0; background: #fff;
    text-align: left; min-width: 220px; z-index: 1;
    border-right: 2px solid #cbd5e1;
}
.gate-matrix thead .sticky-col { background: #f8fafc; z-index: 3; }
.gate-matrix .gate-col { width: 38px; min-width: 38px; }
.gate-matrix tbody tr:hover .sticky-col { background: #f1f5f9; }

/* Gate cells colour codes */
.gate-cell { width: 38px; height: 32px; padding: 0 !important; }
.gate-none      { background: #f8fafc; }
.gate-pending   { background: #f1f5f9; }
.gate-planned   { background: #cbd5e1; }
.gate-actual    { background: #93c5fd; }
.gate-pass      { background: #86efac; }
.gate-pass-cond { background: #fde68a; }
.gate-fail      { background: #fca5a5; }
.gate-waived    { background: #e2e8f0; opacity: .55; }

.legend-row { display: flex; align-items: center; gap: .5rem; font-size: .85rem; flex-wrap: wrap; }

/* Wrap raci-table responsively */
.raci-table-wrap { overflow-x: auto; }

/* Late row highlighting (action log overdue) */
.row-late { background: #fef2f2 !important; }
.row-late td { color: #991b1b; }

/* Breadcrumb (already may exist; safe-redefine) */
.breadcrumb {
    display: flex; gap: .5rem; align-items: center;
    margin-bottom: 1rem; font-size: .9rem; color: #64748b;
}
.breadcrumb a { color: #2563eb; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: #94a3b8; }

/* Form section heading */
.form-section-h {
    margin: 1.5rem 0 .75rem; padding-bottom: .35rem;
    border-bottom: 1px solid #e2e8f0; font-size: 1rem; color: #475569;
}
.form-subhead { font-size: .9rem; color: #64748b; margin: 0 0 .75rem; }

/* Grid layouts for forms */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Filter bar */
.filter-bar {
    display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
    background: #f8fafc; padding: .65rem .9rem; border-radius: 6px;
    margin-bottom: 1rem; border: 1px solid #e2e8f0;
}
.filter-bar select, .filter-bar input { padding: .35rem .55rem; }

/* Check pills (checkbox-style toggles) */
.check-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .4rem .75rem; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 999px;
    font-size: .85rem; cursor: pointer;
}
.check-pill input { margin: 0; }
.checkbox-grid {
    display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem;
}

/* Generic pill */
.pill {
    display: inline-block; padding: .15rem .55rem;
    background: #f1f5f9; border-radius: 999px;
    font-size: .8rem; color: #475569;
}

/* Rating colours (used for variance + score) */
.rating { padding: .2rem .55rem; border-radius: 4px; font-weight: 600; font-size: .85rem; }
.rating-low    { background: #d1fae5; color: #065f46; }
.rating-medium { background: #fef3c7; color: #92400e; }
.rating-high   { background: #fee2e2; color: #991b1b; }

/* Empty state */
.empty {
    text-align: center; color: #94a3b8;
    padding: 2rem; font-style: italic;
}

/* Form actions strip */
.form-actions {
    display: flex; gap: .5rem; justify-content: flex-end;
    padding-top: 1rem; margin-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.form-actions .btn-danger { margin-right: auto; }

/* Card sub-text */
.card-sub { color: #64748b; font-size: .9rem; }

/* Programme-specific small button variants */
.btn-sm  { padding: .25rem .65rem; font-size: .85rem; }
.btn-outline {
    background: #fff; border: 1px solid #cbd5e1; color: #334155;
}
.btn-outline:hover { background: #f1f5f9; }

/* === ICT Tracker (phase 3) additions === */
.alert {
    padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-danger {
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
}
.alert-success {
    background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
}
.btn-danger {
    background: #dc2626; color: #fff; border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; }

.pill {
    display: inline-block; padding: .15rem .55rem; border-radius: 999px;
    font-size: .75rem; background: #e2e8f0; color: #334155; font-weight: 500;
}

.empty {
    color: #94a3b8; padding: 2rem; text-align: center;
    background: #f8fafc; border-radius: 6px;
}

.form-section-h {
    margin-top: 1.5rem; margin-bottom: .75rem;
    padding-bottom: .35rem; border-bottom: 2px solid #e2e8f0;
    color: #0f172a; font-size: 1rem;
}

.grid-2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
    margin-bottom: .75rem;
}
.grid-3 {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem;
    margin-bottom: .75rem;
}
@media (max-width: 800px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.rating {
    display: inline-block; padding: .15rem .5rem; border-radius: 4px;
    font-weight: 700; font-size: .85rem;
}
.rating-low    { background: #d1fae5; color: #065f46; }
.rating-medium { background: #fef3c7; color: #92400e; }
.rating-high   { background: #fee2e2; color: #991b1b; }

/* Form actions */
.form-actions {
    display: flex; gap: .5rem; justify-content: flex-end;
    margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e2e8f0;
}

/* Check pill (used on RACI / IST flags) */
.check-pill {
    border: 1px solid #cbd5e1; padding: .35rem .65rem; border-radius: 6px;
    background: #f8fafc; cursor: pointer;
}

