:root {
    --primary: #123b66;
    --primary-dark: #092947;
    --primary-soft: #eaf1f8;
    --gold: #c69b43;
    --gold-soft: #fff8e8;
    --success: #16835a;
    --success-soft: #eaf8f2;
    --danger: #c63d47;
    --warning: #d68514;
    --text: #18212f;
    --text-muted: #687386;
    --border: #dfe5ec;
    --background: #f4f6f9;
    --white: #ffffff;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 10px 35px rgba(28, 43, 61, 0.06);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
.app-header {
    height: 76px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 14px; }
/* .brand-logo {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px;
} */
 .brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 11px;
    padding-left: 8px;
}
.brand-title { font-size: 16px; font-weight: 700; }
.brand-subtitle { color: var(--text-muted); font-size: 12px; }
.header-right { display: flex; align-items: center; gap: 20px; }
.application-number { text-align: right; }
.application-number small { display: block; color: var(--text-muted); }
.application-number strong { color: var(--primary); }
.user-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.application-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: calc(100vh - 76px);
}
.application-sidebar {
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 26px 20px;
}
.sidebar-heading { margin-bottom: 20px; }
.sidebar-heading h3 { margin: 0; font-size: 15px; }
.sidebar-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
.progress-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 18px; border-radius: var(--radius);
    color: white; margin-bottom: 25px;
}
.progress-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.progress-track { height: 7px; border-radius: 30px; overflow: hidden; background: rgba(255,255,255,.2); }
.progress-value { height: 100%; background: var(--gold); border-radius: 30px; }
.nav-section-title {
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: .08em; font-size: 10px; font-weight: 700;
    margin: 22px 12px 8px;
}
.application-menu { display: flex; flex-direction: column; gap: 4px; }
.application-menu a {
    display: grid; grid-template-columns: 30px 1fr auto;
    align-items: center; padding: 11px 12px; border-radius: 9px;
    font-size: 13px; color: #4b5767;
}
.application-menu a:hover { background: #f6f8fa; color: var(--primary); }
.application-menu a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.menu-number {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; background: white;
}
.active .menu-number { background: var(--primary); border-color: var(--primary); color: white; }
.completed .menu-number { background: var(--success); border-color: var(--success); color: white; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd2dc; }
.completed .status-dot { background: var(--success); }
.application-content {
    padding: 36px 42px 110px;
    max-width: 1280px;
    width: 100%;
}
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.page-heading {
    display: flex; justify-content: space-between; gap: 20px;
    align-items: flex-start; margin-bottom: 28px;
}
.page-heading h1 { margin: 0; font-size: 27px; letter-spacing: -.02em; }
.page-heading p { margin: 7px 0 0; max-width: 700px; color: var(--text-muted); }
.save-status {
    color: var(--success); background: var(--success-soft);
    border: 1px solid #caecde; padding: 8px 12px;
    border-radius: 30px; font-size: 12px; white-space: nowrap;
}
.info-panel {
    background: var(--gold-soft); border: 1px solid #f0dda8;
    border-left: 4px solid var(--gold);
    padding: 15px 18px; border-radius: var(--radius-sm);
    color: #61512d; font-size: 13px; margin-bottom: 22px;
}
.form-card {
    background: var(--white); border: 1px solid var(--border);
    box-shadow: var(--shadow); border-radius: var(--radius-lg);
    margin-bottom: 22px; overflow: hidden;
}
.card-header {
    padding: 21px 24px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.card-header h2 { margin: 0; font-size: 16px; }
.card-header p { color: var(--text-muted); margin: 4px 0 0; font-size: 12px; }
.section-number {
    background: var(--primary-soft); color: var(--primary);
    padding: 5px 9px; border-radius: 30px; font-size: 11px; font-weight: 700;
}
.card-body { padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.form-group label { display: block; font-size: 12px; font-weight: 650; margin-bottom: 7px; }
.required { color: var(--danger); }
.form-control, .form-select, textarea {
    width: 100%; min-height: 46px; border: 1px solid #cfd7e2;
    background: white; border-radius: 9px; padding: 10px 13px;
    font-size: 14px; outline: none; transition: .2s ease; color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
.form-control:focus, .form-select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18,59,102,.09);
}
.field-help { display: block; margin-top: 6px; font-size: 11px; color: var(--text-muted); }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.option-card {
    border: 1px solid var(--border); border-radius: 10px;
    padding: 14px; cursor: pointer; transition: .2s ease;
}
.option-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.option-card input { margin-right: 7px; }
.academic-summary {
    display: flex; justify-content: space-between; gap: 20px;
    padding: 16px 18px; border: 1px solid var(--border);
    background: #fbfcfd; border-radius: 11px;
}
.academic-summary strong { color: var(--primary); }
.upload-zone {
    border: 1.5px dashed #b8c4d3; border-radius: 12px;
    padding: 30px; text-align: center; background: #fafbfd;
    transition: .2s ease;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-icon {
    width: 48px; height: 48px; margin: 0 auto 10px;
    background: var(--primary-soft); color: var(--primary);
    border-radius: 50%; display: flex; justify-content: center;
    align-items: center; font-size: 22px;
}
.upload-zone strong { display: block; }
.upload-zone p { color: var(--text-muted); margin: 5px 0; font-size: 12px; }
.btn {
    border: 0; border-radius: 9px; min-height: 44px;
    padding: 0 18px; cursor: pointer; font-weight: 650; font-size: 13px;
}
.btn-primary { color: white; background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: white; border: 1px solid var(--border); color: var(--text); }
.btn-gold { color: #342710; background: var(--gold); }
.btn-link { background: transparent; color: var(--primary); }
.action-bar {
    position: fixed; bottom: 0; right: 0; left: 290px; z-index: 900;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 15px 42px;
    display: flex; justify-content: space-between; align-items: center;
}
.action-right { display: flex; gap: 10px; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; background: #f6f8fa; color: var(--text-muted);
    font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
}
.data-table td, .data-table th { padding: 13px; border-bottom: 1px solid var(--border); }
.data-table td { font-size: 13px; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}
.program-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.program-card h3 { margin: 0 0 8px; }
.badge {
    display: inline-block; padding: 6px 10px;
    border-radius: 999px; font-size: 11px; font-weight: 700;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: #fff5df; color: #9a6300; }
@media (max-width: 1000px) {
    .application-layout { grid-template-columns: 1fr; }
    .application-sidebar { display: none; }
    .action-bar { left: 0; }
    .application-content { padding: 25px 20px 100px; }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .app-header { padding: 0 16px; }
    .application-number { display: none; }
    .page-heading { flex-direction: column; }
    .form-grid { gap: 16px; }
    .col-3, .col-4, .col-6, .col-8 { grid-column: span 12; }
    .option-grid { grid-template-columns: 1fr; }
    .action-bar { padding: 12px 16px; }
}

.alert{padding:13px 16px;border-radius:9px;margin-bottom:18px;font-size:13px}.alert-success{background:var(--success-soft);color:var(--success);border:1px solid #caecde}.alert-danger{background:#fff0f1;color:var(--danger);border:1px solid #f2c7ca}.error-text{color:var(--danger);font-size:11px;margin-top:5px}.field-readonly{background:#f3f5f7}.checkbox-line{display:flex;gap:9px;align-items:flex-start;font-size:13px}.toolbar{display:flex;gap:10px;flex-wrap:wrap}.summary-good{color:var(--success)}.summary-bad{color:var(--danger)}.simple-page{max-width:850px;margin:50px auto;padding:20px}.admin-shell{max-width:1150px;margin:30px auto;padding:20px}.muted{color:var(--text-muted)}

.alert-warning{background:#fff8e8;color:#725718;border:1px solid #f0dda8}.alert-info{background:#eef5fb;color:#214f78;border:1px solid #cbdceb}
.menu-state{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:3px 6px;border-radius:999px;background:#edf0f4;color:#6b7482}.menu-state.open,.menu-state.always{background:var(--success-soft);color:var(--success)}.menu-state.preview{background:#fff5df;color:#9a6300}.menu-state.locked{background:#edf0f4;color:#596272}.preview-link .menu-number{border-style:dashed}.section-readonly{position:relative}.section-readonly .form-card{background:#fbfcfd}.section-readonly input:disabled,.section-readonly select:disabled,.section-readonly textarea:disabled{opacity:.82;background:#f1f3f5;color:#505966}.disabled-link{pointer-events:none;opacity:.55}

/* Phase 1 dashboard parity with CI3 */
.programme-list{display:flex;flex-direction:column;gap:18px}.programme-application-card{border:1px solid var(--border);border-radius:14px;padding:22px;background:#fff}.programme-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding-bottom:18px;border-bottom:1px solid var(--border)}.programme-title-row h3{margin:9px 0 3px;font-size:18px}.programme-title-row p{margin:0;color:var(--text-muted);font-size:12px}.application-id-box{text-align:right;background:var(--primary-soft);padding:11px 14px;border-radius:10px;min-width:170px}.application-id-box small,.selected-exam-display small,.phase-details-grid small{display:block;color:var(--text-muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em}.application-id-box strong{display:block;color:var(--primary);margin-top:3px}.phase-details-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0}.phase-details-grid>div{padding:12px;background:#f8fafc;border:1px solid var(--border);border-radius:9px}.phase-details-grid strong{display:block;font-size:12px;margin-top:4px}.programme-action-form{display:flex;justify-content:space-between;align-items:flex-end;gap:18px;padding-top:4px}.exam-select-group{flex:1;max-width:420px}.programme-actions{display:flex;gap:10px;flex-wrap:wrap}.programme-action-row{display:flex;align-items:center;justify-content:space-between;gap:20px}.selected-exam-display strong{display:block;color:var(--primary);font-size:18px}.exam-rule-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.exam-rule-grid>div{display:flex;flex-direction:column;gap:4px;border:1px solid var(--border);border-radius:10px;padding:15px}.exam-rule-grid strong{color:var(--primary)}.exam-rule-grid span{color:var(--text-muted);font-size:11px}.dashboard-progress-list{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:11px;overflow:hidden}.dashboard-progress-item{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--border)}.dashboard-progress-item:last-child{border-bottom:0}.dashboard-progress-item:hover{background:#f8fafc}.dashboard-progress-item small{display:block;color:var(--text-muted);font-size:10px;margin-top:2px}.progress-state-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:1px solid var(--border);font-size:11px}.progress-state-icon.open,.progress-state-icon.always{background:var(--success-soft);color:var(--success);border-color:#caecde}.progress-state-icon.preview{color:#9a6300;border-style:dashed}.progress-state-icon.locked{background:#edf0f4;color:#596272}@media(max-width:900px){.phase-details-grid,.exam-rule-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.programme-action-form{align-items:stretch;flex-direction:column}.exam-select-group{max-width:none}}@media(max-width:600px){.programme-title-row,.programme-action-row{flex-direction:column}.application-id-box{text-align:left;width:100%}.phase-details-grid,.exam-rule-grid{grid-template-columns:1fr}.programme-actions{width:100%}.programme-actions .btn{flex:1}.dashboard-progress-item{grid-template-columns:30px 1fr}.dashboard-progress-item .menu-state{grid-column:2}}
.phase-admin-box{border:1px solid var(--border);border-radius:12px;padding:18px;margin-bottom:14px;background:#fbfcfd}.phase-admin-box:last-child{margin-bottom:0}

/* CI3 parity helpers for conditional candidate fields */
.choice-row{display:flex;gap:22px;flex-wrap:wrap;margin-top:9px}.choice-option{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600}.subsection-title{font-size:15px;margin:0 0 15px;color:var(--primary)}.schedule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}.schedule-card{background:#fff;border:1px solid var(--border);border-radius:9px;padding:13px;line-height:1.65}@media(max-width:760px){.schedule-grid{grid-template-columns:1fr}}



.uploaded-preview-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.uploaded-image-link:hover .uploaded-preview-image {
    transform: scale(1.04);
}

.uploaded-preview-body .btn {
    font-size: 12px;
    padding: 7px 14px;
}