/* ==========================================================
   SDME SUBJECT MODULE
   Updated for modal subject entry, per-subject assignment mode,
   searchable catalogue, grouped stream combinations and
   contained scrolling panels.
========================================================== */

.subject-module{display:flex;flex-direction:column;gap:20px;color:var(--text-color,#172033);min-width:0;--subject-row-h:59px;--subject-head-h:38px;--subject-visible-rows:5}
.subject-module-header,.subject-panel-heading,.subject-alert{display:flex;align-items:center;justify-content:space-between;gap:16px}
.subject-module-header{padding:4px 2px 8px}
.subject-module-eyebrow,.subject-section-kicker{display:block;font-size:11px;font-weight:800;letter-spacing:.12em;color:var(--primary-color,#4f46e5);margin-bottom:5px}
.subject-module-header h2,.subject-panel-heading h3{margin:0}
.subject-module-header p,.subject-panel-heading p{margin:6px 0 0;color:#667085;font-size:13px;line-height:1.5;max-width:780px}

.subject-panel{background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:20px;box-shadow:0 4px 18px rgba(16,24,40,.04);min-width:0}
.subject-panel-heading{align-items:flex-start;margin-bottom:16px}
.subject-panel-heading-with-actions{align-items:center}
.subject-section-kicker{margin-bottom:4px}

.subject-btn{border:0;border-radius:10px;min-height:40px;padding:9px 14px;font:inherit;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;white-space:nowrap}
.subject-btn:disabled{opacity:.5;cursor:not-allowed}
.subject-btn-primary{background:#4f46e5;color:#fff}.subject-btn-primary:hover:not(:disabled){background:#4338ca}
.subject-btn-secondary{background:#f2f4f7;color:#344054}.subject-btn-secondary:hover:not(:disabled){background:#e4e7ec}
.subject-btn-small{min-height:34px;padding:7px 11px}
.subject-btn-danger{background:#fef3f2;color:#b42318}
.subject-saving{pointer-events:none}

.subject-alert{justify-content:flex-start;padding:13px 15px;border-radius:12px}
.subject-alert>i{font-size:16px}.subject-alert>div{display:flex;flex:1;flex-direction:column;gap:3px}.subject-alert strong{font-size:12px}.subject-alert span{font-size:11px;color:inherit;opacity:.9}
.subject-alert-warning{background:#fffaeb;color:#b54708;border:1px solid #fedf89}.subject-alert-info{background:#eff8ff;color:#175cd3;border:1px solid #b2ddff}

/* ==========================================================
   MAIN SUBJECT TABLE / SCROLL CONTAINER
========================================================== */

.subject-main-scroll{border:1px solid #eaecf0;border-radius:12px;overflow:auto;max-height:calc(var(--subject-head-h) + (var(--subject-row-h) * var(--subject-visible-rows)));min-height:90px}
.subject-table{min-width:920px}
.subject-table-head,.subject-row{display:grid;grid-template-columns:minmax(190px,1.35fr) 90px 120px minmax(260px,1.8fr) 90px;align-items:center;gap:14px}
.subject-table-head{position:sticky;top:0;z-index:3;background:#f8f9fb;border-bottom:1px solid #eaecf0;padding:11px 14px;font-size:10px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:#667085}
.subject-row{padding:13px 14px;border-bottom:1px solid #f0f1f3;background:#fff;min-height:58px}
.subject-row:last-child{border-bottom:0}
.subject-row:hover{background:#fcfcfd}
.subject-name-wrap{min-width:0}.subject-name{font-size:13px;font-weight:700;color:#1d2939;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.subject-scope-badge{display:inline-flex;margin-top:4px;padding:2px 7px;border-radius:999px;background:#f2f4f7;color:#667085;font-size:9px;font-weight:700}
.subject-code{display:inline-flex;padding:4px 7px;border-radius:7px;background:#f2f4f7;color:#475467;font-size:10px;font-weight:800;letter-spacing:.04em}
.subject-type-select,.selection-type{min-height:34px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;padding:6px 9px;font:inherit;font-size:11px;color:#344054;outline:none}
.subject-type-select:focus,.selection-type:focus{border-color:#7f56d9;box-shadow:0 0 0 3px rgba(127,86,217,.1)}
.subject-assignment-summary{display:flex;flex-wrap:wrap;gap:5px;min-width:0;max-height:48px;overflow:auto}
.subject-assignment-pill{display:inline-flex;align-items:center;padding:4px 7px;border-radius:7px;background:#f9f5ff;color:#6941c6;border:1px solid #e9d7fe;font-size:10px;white-space:nowrap}
.subject-assignment-none{font-size:11px;color:#98a2b3}
.subject-row-actions{display:flex;justify-content:flex-end;gap:4px}
.subject-icon-btn{border:0;background:transparent;width:34px;height:34px;border-radius:8px;display:inline-grid;place-items:center;cursor:pointer;color:#475467}
.subject-icon-btn:hover{background:#f2f4f7}.subject-icon-btn.subject-danger{color:#d92d20}.subject-icon-btn.subject-danger:hover{background:#fef3f2}

/* ==========================================================
   EMPTY / LOADING
========================================================== */

.subject-empty-state,.subject-empty-inline{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:7px;padding:36px 20px;color:#667085}
.subject-empty-state{min-height:260px;background:#fff;border:1px dashed #d0d5dd;border-radius:16px}
.subject-empty-state h3,.subject-empty-inline h4{margin:0;color:#344054;font-size:14px}.subject-empty-inline p,.subject-empty-state p{margin:0;font-size:12px;line-height:1.5;max-width:520px}
.subject-empty-inline span{font-size:12px}.subject-empty-icon{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:#f2f4f7;color:#667085;margin-bottom:4px}
.subject-modal-empty{padding:30px 15px;border:1px dashed #d0d5dd;border-radius:12px;margin-top:12px}
.subject-module-loading{min-height:260px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px}.subject-loading-spinner{font-size:24px;color:#4f46e5}.subject-module-loading span{font-size:12px;color:#667085}

/* ==========================================================
   SUBJECT MODAL
========================================================== */

.subject-modal-backdrop{position:fixed;inset:0;z-index:9999;background:rgba(15,23,42,.48);display:flex;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(2px)}
.subject-modal{width:min(1050px,100%);max-height:min(90vh,900px);background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(16,24,40,.25);display:flex;flex-direction:column;overflow:hidden}
.subject-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 22px;border-bottom:1px solid #eaecf0;flex:0 0 auto}
.subject-modal-header h3{margin:0;font-size:19px;color:#101828}.subject-modal-header p{margin:6px 0 0;color:#667085;font-size:12px;line-height:1.5;max-width:760px}
.subject-modal-close{border:0;background:#f2f4f7;color:#475467;width:34px;height:34px;border-radius:8px;display:grid;place-items:center;cursor:pointer;flex:0 0 auto}
.subject-modal-close:hover{background:#eaecf0}
.subject-modal-body{padding:18px 22px;overflow:auto;min-height:0}
.subject-modal-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 22px;border-top:1px solid #eaecf0;background:#fff;flex:0 0 auto}
.subject-modal-status{font-size:11px;color:#667085}.subject-modal-actions{display:flex;gap:8px}

.subject-modal-selector{display:flex;flex-direction:column;gap:12px;margin-bottom:18px}
.subject-catalogue{display:flex;flex-direction:column;gap:8px;min-width:0}
.subject-catalogue-trigger{width:100%;border:1px solid #d0d5dd;border-radius:11px;background:#fff;min-height:52px;padding:10px 13px;display:flex;align-items:center;gap:12px;text-align:left;cursor:pointer;color:#344054}
.subject-catalogue-trigger:hover{background:#f9fafb}.subject-catalogue-trigger i{color:#667085}
.subject-catalogue-panel{border:1px solid #eaecf0;border-radius:11px;background:#f8f9fb;overflow:hidden}.subject-catalogue-panel[hidden]{display:none}
.subject-search-wrap{position:relative;padding:10px;background:#fff;border-bottom:1px solid #eaecf0}.subject-search-wrap>i{position:absolute;left:21px;top:22px;color:#98a2b3;font-size:12px}.subject-search-wrap .subject-input{padding-left:34px}
.subject-catalogue-list{max-height:235px;overflow-y:auto;padding:6px}
.subject-catalogue-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 9px;border-radius:8px;font-size:12px;color:#344054}.subject-catalogue-item:hover{background:#fff}
.subject-catalogue-add{width:28px;height:28px;border:0;border-radius:7px;background:#eef2ff;color:#4f46e5;cursor:pointer;display:grid;place-items:center}.subject-catalogue-add:hover{background:#e0e7ff}
.subject-catalogue-empty{padding:20px;text-align:center;color:#667085;font-size:11px}

.subject-catalogue-column{display:flex;flex-direction:column;min-width:0}
.subject-custom-box{display:flex;flex-direction:column;gap:10px;min-width:0}
.subject-custom-box strong{font-size:12px;color:#344054}.subject-custom-box small{font-size:10px;color:#667085}.subject-custom-row{display:flex;flex-direction:column;gap:10px;min-width:0}.subject-custom-row .subject-input{min-height:36px}.subject-custom-row .subject-btn{min-height:36px}

.subject-modal-selection{border-top:1px solid #eaecf0;padding-top:16px}.subject-modal-selection-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}.subject-modal-selection-header>div{display:flex;flex-direction:column;gap:3px}.subject-modal-selection-header strong{font-size:13px;color:#344054}.subject-modal-selection-header small{font-size:10px;color:#98a2b3}
.subject-count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:26px;padding:0 9px;border-radius:999px;background:#f2f4f7;color:#344054;font-size:11px;font-weight:800}
.subject-selection-row{position:relative;display:grid;grid-template-columns:minmax(170px,1.35fr) 105px minmax(190px,1.45fr) minmax(190px,1.6fr) 34px;align-items:end;gap:10px;padding:12px 10px;border:1px solid #e4e7ec;border-radius:11px;background:#fff;margin-top:8px}
.subject-selection-row:hover{border-color:#d0d5dd}
.selection-subject{align-self:center;min-width:0}.selection-subject-name{font-size:12px;font-weight:750;color:#1d2939;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.selection-subject-code{display:inline-flex;margin-top:4px;font-size:9px;color:#667085;font-weight:800;letter-spacing:.04em}
.subject-mini-label{display:block;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:#667085;margin-bottom:5px}
.selection-type-cell,.selection-mode-cell,.selection-assignment{min-width:0;position:relative}.selection-type{width:100%}
.subject-mini-mode{display:flex;gap:5px}.subject-mini-radio{position:relative;flex:1;display:flex;align-items:center;justify-content:center;min-height:34px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;cursor:pointer}.subject-mini-radio input{position:absolute;opacity:0;pointer-events:none}.subject-mini-radio span{font-size:10px;font-weight:700;color:#667085}.subject-mini-radio.active{border-color:#7f56d9;background:#f9f5ff}.subject-mini-radio.active span{color:#6941c6}
.subject-assign-btn{width:100%;min-height:34px;border:1px solid #d0d5dd;border-radius:8px;background:#fff;color:#344054;padding:7px 9px;display:flex;align-items:center;justify-content:space-between;gap:8px;font:inherit;font-size:10px;cursor:pointer;text-align:left}.subject-assign-btn:hover:not(:disabled){border-color:#b7a4e8;background:#faf8ff}.subject-assign-btn.is-empty{color:#98a2b3}.subject-assign-btn:disabled{opacity:.6;cursor:not-allowed}.subject-assign-btn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.selection-remove{width:30px;height:30px;border:0;background:transparent;color:#d92d20;border-radius:7px;cursor:pointer;margin-bottom:2px}.selection-remove:hover{background:#fef3f2}

.subject-assignment-popover{position:absolute;z-index:50;right:0;top:calc(100% + 7px);width:min(330px,calc(100vw - 55px));background:#fff;border:1px solid #d0d5dd;border-radius:11px;box-shadow:0 16px 38px rgba(16,24,40,.16);overflow:hidden}
.subject-assignment-popover[hidden]{display:none}.subject-popover-header{padding:10px 11px;border-bottom:1px solid #eaecf0;display:flex;justify-content:space-between;gap:10px}.subject-popover-header strong{font-size:11px;color:#344054}.subject-popover-header span{font-size:10px;color:#98a2b3}.subject-target-list{max-height:230px;overflow:auto;padding:7px}.subject-target-check{display:flex;align-items:flex-start;gap:8px;padding:8px;border-radius:8px;cursor:pointer}.subject-target-check:hover{background:#f9fafb}.subject-target-check input{margin-top:2px}.subject-target-check span{display:flex;flex-direction:column;gap:2px;min-width:0}.subject-target-check strong{font-size:11px;color:#344054}.subject-target-check small{font-size:9px;color:#98a2b3}.subject-popover-empty{padding:15px;text-align:center;color:#667085;font-size:10px}.subject-popover-footer{padding:8px;border-top:1px solid #eaecf0;display:flex;justify-content:flex-end}

/* ==========================================================
   COMBINATION SECTION
========================================================== */

.subject-combination-scroll{max-height:650px;overflow:auto;padding-right:2px}
.subject-parent-group{border:1px solid #e4e7ec;border-radius:12px;overflow:hidden;background:#fff;margin-bottom:10px}.subject-parent-group:last-child{margin-bottom:0}
.subject-parent-group-header{width:100%;border:0;background:#f8f9fb;padding:12px 13px;display:flex;align-items:center;gap:9px;text-align:left;cursor:pointer}.subject-parent-group-header:hover{background:#f2f4f7}.subject-parent-chevron{width:18px;color:#667085}.subject-parent-title{display:flex;flex-direction:column;gap:2px}.subject-parent-title strong{font-size:12px;color:#344054}.subject-parent-title small{font-size:9px;color:#98a2b3}.subject-parent-group-body{border-top:1px solid #eaecf0}.subject-parent-group-body[hidden]{display:none}
.subject-combination-row-card{padding:12px 14px;border-bottom:1px solid #f0f1f3}.subject-combination-row-card:last-child{border-bottom:0}.subject-combination-row-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.subject-combination-row-title h4{margin:2px 0 0;font-size:13px;color:#1d2939}.subject-combination-parent-label{font-size:9px;color:#98a2b3;text-transform:uppercase;letter-spacing:.05em;font-weight:800}
.subject-combination-subject-line{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:9px}.subject-combination-stream-label{font-size:10px;color:#667085;font-weight:700;margin-right:2px}.subject-combination-chip{display:inline-flex;align-items:center;padding:5px 8px;border-radius:7px;background:#f9f5ff;border:1px solid #e9d7fe;color:#6941c6;font-size:10px;font-weight:700}
.subject-add-combination-btn{border:1px dashed #b7a4e8;background:#faf8ff;color:#6941c6;border-radius:8px;padding:7px 10px;font:inherit;font-size:10px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;gap:6px}.subject-add-combination-btn:hover{background:#f4efff}
.subject-combination-meta{margin-top:7px;font-size:9px;color:#98a2b3}.subject-combination-meta i{color:#12b76a;margin-right:3px}

.subject-combination-modal{width:min(720px,100%)}.subject-combination-modal-body{padding:18px 22px;overflow:auto;min-height:0}.subject-combination-checklist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.subject-combination-check{display:flex;align-items:flex-start;gap:9px;border:1px solid #e4e7ec;border-radius:10px;padding:11px;cursor:pointer;background:#fff}.subject-combination-check:hover{background:#f9fafb}.subject-combination-check:has(input:checked){border-color:#b7a4e8;background:#faf8ff}.subject-combination-check input{margin-top:3px}.subject-combination-check span{display:flex;flex-direction:column;gap:3px}.subject-combination-check strong{font-size:11px;color:#344054}.subject-combination-check small{font-size:9px;color:#667085}

.subject-input{width:100%;min-height:42px;border:1px solid #d0d5dd;border-radius:9px;padding:9px 11px;font:inherit;font-size:12px;outline:none;background:#fff;box-sizing:border-box;transition:.15s}.subject-input:focus{border-color:#7f56d9;box-shadow:0 0 0 3px rgba(127,86,217,.12)}

@media (max-width:900px){
    .subject-selection-row{grid-template-columns:minmax(170px,1fr) minmax(110px,.7fr);align-items:start}
    .selection-type-cell,.selection-mode-cell,.selection-assignment{grid-column:span 1}.selection-assignment{grid-column:1/-1}.selection-remove{position:absolute;right:8px;top:8px}
    .subject-combination-checklist{grid-template-columns:1fr}
}

@media (max-width:700px){
    .subject-panel{padding:15px}.subject-panel-heading-with-actions,.subject-alert,.subject-custom-box,.subject-modal-footer{align-items:flex-start;flex-direction:column}
    .subject-panel-heading-with-actions .subject-btn{width:100%}.subject-custom-row{width:100%;min-width:0;flex-direction:column}.subject-custom-row .subject-btn{width:100%}
    .subject-modal-backdrop{padding:8px}.subject-modal{max-height:94vh}.subject-modal-header,.subject-modal-body,.subject-modal-footer{padding-left:15px;padding-right:15px}
}


/* ==========================================================
   SUBJECT MODULE UI UPDATE
   ========================================================== */

/* Keep School Subjects contained with vertical scrolling only.
   5 rows show before the scrollbar kicks in - header height +
   (row height * visible row count), both set as variables above
   so the two stay in sync with the actual row/header CSS. */
.subject-main-scroll{
    max-height:calc(var(--subject-head-h) + (var(--subject-row-h) * var(--subject-visible-rows)));
    overflow-y:auto;
    overflow-x:hidden;
}
.subject-table{min-width:0}
.subject-table-head,
.subject-row{
    grid-template-columns:minmax(180px,1.4fr) 78px 110px minmax(220px,1.7fr) 78px;
}

/* Compact selector and custom-subject controls on one balanced row. */
.subject-modal-selector{margin-bottom:14px}
.subject-selector-row{
    display:grid;
    grid-template-columns:minmax(260px,1fr) minmax(280px,.95fr);
    gap:10px;
    align-items:start;
}
.subject-selector-row .subject-catalogue{min-width:0}
.subject-selector-row .subject-custom-row{
    width:100%;
    min-width:0;
}

/* One assignment setting for the entire modal session. */
.subject-session-assignment{
    border:1px solid #e4e7ec;
    background:#f9fafb;
    border-radius:12px;
    padding:12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:16px;
}
.subject-session-assignment-copy{
    display:flex;
    flex-direction:column;
    gap:3px;
    min-width:0;
}
.subject-session-assignment-copy strong{font-size:12px;color:#344054}
.subject-session-assignment-copy small{font-size:10px;color:#667085;line-height:1.45}
.subject-session-controls{
    display:grid;
    grid-template-columns:210px minmax(210px,330px);
    gap:8px;
    align-items:center;
    min-width:min(100%,560px);
}
.subject-session-controls .selection-assignment{position:relative}
.subject-session-controls .subject-mini-mode{height:36px}
.subject-session-controls .subject-assign-btn{min-height:36px}

.subject-selection-row{
    grid-template-columns:minmax(220px,1fr) 120px 34px;
    align-items:end;
}
.subject-selection-row .selection-remove{justify-self:end}

/* Subject Combination card uses a contained vertical scroll and straight rows. */
.subject-combination-scroll{
    max-height:520px;
    overflow-y:auto;
    overflow-x:hidden;
    padding-right:2px;
}
.subject-combination-row-card{padding:0}
.subject-combination-row-grid{
    display:grid;
    grid-template-columns:minmax(150px,.8fr) minmax(220px,1.35fr) minmax(240px,1.55fr) auto;
    gap:14px;
    align-items:center;
    padding:12px 14px;
}
.subject-combination-stream-cell strong{
    font-size:12px;
    color:#1d2939;
}
.subject-combination-core-cell,
.subject-combination-elective-cell{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:6px;
}
.subject-combination-cell-label{
    font-size:9px;
    color:#98a2b3;
    text-transform:uppercase;
    letter-spacing:.05em;
    font-weight:800;
}
.subject-combination-chip-list{
    display:flex;
    align-items:center;
    gap:5px;
    flex-wrap:wrap;
    min-width:0;
}
.subject-combination-chip{margin:0}
.subject-core-chip{
    background:#eef4ff;
    border-color:#c7d7fe;
    color:#3538cd;
}
.subject-combination-action-cell{
    justify-self:end;
    display:flex;
    align-items:center;
}
.subject-combination-action-cell:empty{display:none}
.subject-add-combination-btn{
    align-self:flex-start;
    white-space:nowrap;
}
.subject-combination-check.is-core{
    opacity:.82;
    background:#f8fafc;
    cursor:default;
}

/* Parent department/class name remains only at the group level. */
.subject-parent-title{min-width:0}
.subject-parent-group-body{overflow:hidden}

@media (max-width:900px){
    .subject-table-head,.subject-row{
        grid-template-columns:minmax(150px,1fr) 70px 95px minmax(170px,1.2fr) 70px;
        gap:9px;
        padding-left:10px;
        padding-right:10px;
    }
    .subject-selector-row,
    .subject-session-assignment{
        grid-template-columns:1fr;
        display:grid;
    }
    .subject-session-controls{grid-template-columns:1fr;min-width:0}
    .subject-combination-row-grid{
        grid-template-columns:minmax(140px,.75fr) minmax(180px,1fr) minmax(190px,1.15fr) auto;
        gap:10px;
    }
}

@media (max-width:700px){
    .subject-table-head{display:none}
    .subject-row{
        grid-template-columns:1fr auto;
        gap:10px;
    }
    .subject-row>div:nth-child(2),
    .subject-row>div:nth-child(3),
    .subject-row>div:nth-child(4){
        grid-column:1/-1;
    }
    .subject-row-actions{grid-column:2;grid-row:1;align-self:start}
    .subject-selection-row{grid-template-columns:1fr auto}
    .selection-type-cell,.selection-assign-cell{grid-column:1/-1}
    .subject-combination-row-grid{
        grid-template-columns:1fr;
        gap:10px;
    }
    .subject-combination-action-cell{justify-self:start}
    .subject-session-assignment{align-items:stretch}
}

/* ==========================================================
   SUBJECT MODAL — VISUAL REFRESH + PER-SUBJECT ASSIGNMENT
   Bolder header type, a stacked custom-subject box, properly
   sized Classes/Departments toggle buttons, and a per-row
   "Assign to" control that sits next to each selected subject's
   Core/Elective type selector so individual subjects can be
   pointed at their own classes/departments within one session.
========================================================== */

.subject-modal{border-radius:20px}
.subject-modal-header{padding:22px 26px 18px}
.subject-modal-header h3{font-size:24px;font-weight:800;letter-spacing:-.01em}
.subject-modal-header p{font-size:13px}
.subject-modal-body{padding:20px 26px}
.subject-modal-footer{padding:16px 26px}

.subject-catalogue-trigger{min-height:56px}

.subject-custom-box{flex-direction:column;align-items:stretch;background:#fff;border:1px solid #d0d5dd;padding:12px}
.subject-custom-row{flex-direction:column;gap:10px;min-width:0}
.subject-custom-row .subject-input,.subject-custom-row .subject-btn{min-height:44px}
.subject-btn-block{width:100%}

.subject-session-assignment{background:#f9fafb;border-color:#e4e7ec;padding:16px}
.subject-session-assignment-copy strong{font-size:13px;font-weight:700;color:#101828}
.subject-session-controls{
    display:flex;
    flex-wrap:wrap;
    grid-template-columns:unset;
    min-width:0;
}
.subject-mini-mode{
    display:inline-flex;
    flex:0 0 auto;
    gap:8px;
    height:auto;
}
.subject-mini-radio{
    flex:0 0 auto;
    min-height:42px;
    padding:0 20px;
    border-radius:10px;
    background:#fff;
}
.subject-mini-radio span{font-size:13px;font-weight:600;color:#475467}
.subject-mini-radio.active{border-color:#7f56d9;background:#f9f5ff;box-shadow:0 0 0 1px #7f56d9 inset}
.subject-mini-radio.active span{color:#5925dc}
.subject-session-controls .selection-assignment{flex:1;min-width:200px}
.subject-session-controls .subject-assign-btn{min-height:42px;font-size:12px;border-radius:10px}

.subject-modal-selection-header strong{font-size:14px;font-weight:700;color:#101828}
.subject-count-badge{min-width:32px;height:32px}

/* Per-subject "Assign to" control, next to the Core/Elective type select */
.subject-selection-row{
    grid-template-columns:minmax(180px,1fr) 108px minmax(190px,1fr) 34px;
}
.selection-assign-cell{min-width:0;position:relative}
.subject-assign-btn-row{min-height:34px;font-size:10px}
.subject-link-btn{border:0;background:transparent;color:#6941c6;font-size:10px;font-weight:700;cursor:pointer;padding:6px 4px}
.subject-link-btn:hover{text-decoration:underline}
.subject-popover-footer-split{justify-content:space-between;align-items:center}

@media (max-width:900px){
    .subject-selection-row{grid-template-columns:minmax(170px,1fr) minmax(110px,.7fr) minmax(190px,1fr)}
    .selection-assign-cell{grid-column:1/-1}
}

@media (max-width:700px){
    .subject-selection-row{grid-template-columns:1fr auto}
    .selection-type-cell,.selection-assign-cell{grid-column:1/-1}
    .subject-session-controls{flex-direction:column;align-items:stretch}
    .subject-mini-mode{width:100%}
    .subject-mini-radio{flex:1}
}

/* ==========================================================
   ADD SUBJECT MODAL — PREMIUM VISUAL PASS
   Icon avatar in the header, numbered step badges above each
   section, a search-styled catalogue trigger, an icon-prefixed
   custom-subject input, icons on the Classes/Departments pills,
   an inline "N selected" pill count, and a pill-styled footer
   status message. Purely presentational - no markup added here
   changes any data-* hooks the interaction logic relies on.
========================================================== */

.subject-modal-header-main{display:flex;align-items:flex-start;gap:14px;min-width:0}
.subject-modal-icon{
    flex:0 0 auto;
    width:46px;
    height:46px;
    border-radius:13px;
    display:grid;
    place-items:center;
    font-size:19px;
    color:#fff;
    background:linear-gradient(135deg,#8b5cf6,#4f46e5);
    box-shadow:0 8px 18px rgba(79,70,229,.28);
}

.subject-step-heading{display:flex;align-items:flex-start;gap:10px;margin-bottom:10px}
.subject-step-heading strong{display:block;font-size:13px;font-weight:700;color:#101828}
.subject-step-heading small{display:block;margin-top:2px;font-size:11px;color:#667085;line-height:1.4}
.subject-step-badge{
    flex:0 0 auto;
    width:24px;
    height:24px;
    border-radius:50%;
    display:grid;
    place-items:center;
    font-size:11px;
    font-weight:800;
    color:#fff;
    background:linear-gradient(135deg,#8b5cf6,#4f46e5);
    margin-top:1px;
}

/* Catalogue trigger restyled to look like a live search field */
.subject-catalogue-trigger>i:first-child{color:#98a2b3;font-size:13px;flex:0 0 auto}
.subject-catalogue-trigger-text{flex:1;text-align:left;font-size:12px;color:#98a2b3}
.subject-catalogue-chevron{flex:0 0 auto;color:#667085}
.subject-catalogue-trigger[aria-expanded="true"]{border-color:#7f56d9;box-shadow:0 0 0 3px rgba(127,86,217,.12)}

/* Icon-prefixed inputs (custom subject field, etc.) */
.subject-input-icon-wrap{position:relative}
.subject-input-icon-wrap>i{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#98a2b3;font-size:12px;pointer-events:none}
.subject-input-icon-wrap .subject-input{padding-left:36px}

/* Classes / Departments pill icons */
.subject-mini-radio{gap:8px}
.subject-mini-radio i{font-size:12px;color:#667085}
.subject-mini-radio.active i{color:#5925dc}

/* Selected count pill next to "Selected Subjects" */
.subject-count-wrap{display:inline-flex;align-items:center;gap:8px}
.subject-count-label{font-size:11px;font-weight:600;color:#667085}

/* Larger, more deliberate empty state inside the modal */
.subject-modal-empty{padding:44px 20px;border-radius:16px}
.subject-modal-empty .subject-empty-icon{width:60px;height:60px;font-size:20px;background:#f5f3ff;color:#7f56d9;margin-bottom:6px}
.subject-modal-empty h4{font-size:15px;font-weight:700}
.subject-modal-empty p{font-size:12px}

/* Footer status pill (info icon + message) */
.subject-modal-status{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 13px;
    border-radius:999px;
    background:#f5f3ff;
    color:#5925dc;
    font-size:11px;
    font-weight:600;
}
.subject-modal-status i{font-size:12px;color:#7f56d9}

@media (max-width:700px){
    .subject-modal-footer{flex-direction:column;align-items:stretch;gap:12px}
    .subject-modal-status{width:100%;box-sizing:border-box}
}
