/* COUNSIVA operational final workspace v3.7.17
 * Dashboard is explicitly excluded. Existing app actions and RBAC untouched.
 */
:is(#view-students,#view-leads,#view-visitors,#view-followups,#view-counselling,#view-classes,#view-applications,#view-visa) .panel-body .cvf-filters {
  padding: 11px 12px !important;
  margin: 0 0 9px !important;
  border: 1px solid #dce8ee;
  background: #fff;
  border-radius: 11px;
  min-width: 0;
}
.cvf-mainfilters {
  display:grid;
  grid-template-columns:minmax(165px,1.75fr) repeat(4,minmax(95px,1fr)) auto;
  align-items:end; gap:8px;
}
.cvf-mainfilters>.field {min-width:0;max-width:none!important;}
.cvf-mainfilters>.field.wide {grid-column:auto!important;}
.cvf-mainfilters>.field>label,.cvf-advanced>.field>label{font-size:10px!important;font-weight:800!important;color:#557489!important;margin-bottom:5px!important;display:block!important;}
.cvf-mainfilters input,.cvf-mainfilters select,.cvf-advanced input,.cvf-advanced select{
  width:100%;min-width:0;min-height:34px!important;height:34px;
  padding:5px 8px!important;background:#fcfdff!important;
  border:1px solid #d4e3ec!important;border-radius:8px!important;
  font-size:11px!important;color:#284b64;
}
.cvf-more{min-height:34px!important;height:34px;padding:6px 10px!important;white-space:nowrap;align-self:end;}
.cvf-advanced {
  display:grid;
  grid-template-columns:repeat(4,minmax(120px,1fr));
  align-items:end;gap:9px;
  padding-top:11px;margin-top:11px;
  border-top:1px dashed #dce8ef;
}
.cvf-advanced[hidden]{display:none!important;}
.cvf-advanced>.field{min-width:0}
.cvf-advanced>.btn{height:34px;margin:0!important;}
.cvf-metrics{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:0 0 11px;font-size:11px;color:#748a9d}
.cvf-metric {
  background:#fff;border:1px solid #d9e7ee;border-radius:9px;
  display:flex;align-items:center;gap:10px;
  padding:8px 11px;min-height:40px;max-width:100%;
  box-shadow:0 2px 8px rgba(19,58,86,.05);
  cursor:pointer;transition:background .12s,border .12s;
}
.cvf-metric span{font-size:10px;color:#60798d;line-height:1.3;font-weight:750;white-space:normal}
.cvf-metric b{font-size:16px;font-weight:850;color:#133d59;font-variant-numeric:tabular-nums}
.cvf-metric:hover{border-color:#80c4ce;background:#f7fcfd}
.cvf-metric.active{border-color:#078d9b;background:#e9f8fa}
.cvf-exportbar {
  display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap;
  margin:3px 0 10px;padding:7px 9px;border:1px solid #e2edf2;
  border-radius:9px;background:#f9fcfd;
}
.cvf-exportbar>span{margin-right:auto;font-size:10px;font-weight:750;color:#667f91}
.cvf-exportbar>.btn{font-size:11px!important;min-height:31px!important;padding:7px 9px!important}
.cvf-row-select{width:14px;height:14px;vertical-align:middle;margin:0 7px 0 0;cursor:pointer;accent-color:#078d9d;}
.cvf-export-overlay{
  position:fixed;inset:0;z-index:999999;background:rgba(10,29,53,.57);
  display:flex;align-items:center;justify-content:center;padding:14px;
}
.cvf-export-dialog {
  width:min(510px,100%);max-height:95vh;overflow:auto;
  background:white;color:#183b56;border-radius:13px;
  box-shadow:0 20px 65px rgba(9,25,48,.28);
  padding:20px;font-family:Inter,system-ui,Arial,sans-serif;font-size:12px;
}
.cvf-export-dialog header{display:flex;align-items:center;justify-content:space-between;gap:9px;border-bottom:1px solid #e5edf2;padding-bottom:13px}
.cvf-export-dialog header b{font-size:17px}
.cvf-export-dialog header button{border:0;background:#f0f5f7;color:#385a73;border-radius:7px;padding:5px 10px;font-size:18px;cursor:pointer}
.cvf-export-dialog p{line-height:1.6;color:#6a8398}
.cvf-export-dialog label{display:flex;align-items:center;gap:8px;border:1px solid #dce8ee;padding:12px;border-radius:8px;margin:8px 0;cursor:pointer}
.cvf-export-dialog input[type=radio]{accent-color:#078d9d}
.cvf-export-dialog footer{display:flex;justify-content:flex-end;gap:8px;padding-top:13px}
.cvf-export-dialog footer button{border:1px solid #d6e5ed;border-radius:8px;padding:9px 13px;font-weight:800;background:white;cursor:pointer}
.cvf-export-dialog footer [data-cvf-run]{background:#078d9d;color:white;border-color:#078d9d}
:is(#view-students,#view-leads,#view-visitors,#view-followups,#view-counselling,#view-classes,#view-applications,#view-visa) .page-head{margin-bottom:12px!important;}
:is(#view-students,#view-leads,#view-visitors,#view-followups,#view-counselling,#view-classes,#view-applications,#view-visa) .page-head h2{color:#102e53;letter-spacing:-.02em}
:is(#view-students,#view-leads,#view-visitors,#view-followups,#view-counselling,#view-classes,#view-applications,#view-visa) .panel-body{padding-top:12px!important;}
:is(#view-classes,#view-applications,#view-visa) .data-table tr:has(.cvf-row-select:checked) td{background:#eef9fa}
:is(#view-students,#view-leads,#view-visitors,#view-followups,#view-counselling) tbody tr:has(.cvf-row-select:checked) td{background:#eef9fa}
@media(max-width:1180px){
  .cvf-mainfilters{grid-template-columns:repeat(3,minmax(0,1fr));}
  .cvf-mainfilters>.field:first-child{grid-column:span 2}
  .cvf-advanced{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:720px){
  .cvf-mainfilters{grid-template-columns:repeat(2,minmax(0,1fr));}
  .cvf-mainfilters>.field:first-child{grid-column:span 2}
  .cvf-advanced{grid-template-columns:repeat(2,minmax(0,1fr));}
  .cvf-exportbar>span{flex:1 1 100%}
  .cvf-metric{flex:1 1 calc(50% - 5px);justify-content:space-between;}
}

.cvf-class-tabs{display:flex;gap:6px;border-bottom:1px solid #dce8ee;margin:8px 0 14px;overflow-x:auto;padding-bottom:8px}
.cvf-class-tabs button{border:1px solid transparent;border-radius:8px;background:transparent;color:#54748b;font-size:12px;font-weight:800;padding:9px 13px;white-space:nowrap;cursor:pointer}
.cvf-class-tabs button.active{background:#e7f8f9;color:#078395;border-color:#c8e6e9}
#view-classes .panel[hidden],#view-classes #classWorkQueue[hidden]{display:none!important}


/* 03 Nov screenshot QA: override legacy 6-column grid specificity so the
   advanced-filter trigger is not forced onto a second line on desktop. */
@media(min-width:1181px){
  #view-classes .cvf-mainfilters,
  #view-leads .cvf-mainfilters,
  #view-visitors .cvf-mainfilters,
  #view-students .cvf-mainfilters,
  #view-followups .cvf-mainfilters,
  #view-counselling .cvf-mainfilters,
  #view-applications .cvf-mainfilters,
  #view-visa .cvf-mainfilters {
    grid-template-columns:minmax(165px,1.6fr) repeat(4,minmax(100px,1fr)) auto !important;
    gap:8px !important;
  }
  #view-classes .cvf-mainfilters>.field:first-child,
  #view-leads .cvf-mainfilters>.field:first-child,
  #view-visitors .cvf-mainfilters>.field:first-child,
  #view-applications .cvf-mainfilters>.field:first-child,
  #view-visa .cvf-mainfilters>.field:first-child {
    grid-column:auto !important;
  }
  #view-classes .cvf-mainfilters>.cvf-more {
    grid-column:6 !important;
    grid-row:1 !important;
    white-space:nowrap;
  }
}
#view-classes .cvf-mainfilters>.field:first-child {min-width:0!important}
#view-classes .cvf-more {width:auto!important;min-width:100px}
:is(#view-classes,#view-applications,#view-visa) .panel-body {min-width:0}
#view-classes .table-wrap,
#view-applications .table-wrap,
#view-visa .table-wrap {
  max-width:100%;min-width:0;
  overflow-x:auto!important;
  overscroll-behavior-x:contain;
}
#view-classes .data-table {min-width:1320px!important}
#view-classes #classBody td:first-child,
#view-classes .data-table th:first-child {
  min-width:155px!important;
}
#view-applications #appBody td:last-child,
#view-applications .data-table thead th:last-child {
  min-width:290px!important;
  width:290px!important;
}
#view-applications .application-actions {
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:4px!important;
  min-width:0!important;
}
#view-applications .application-actions .btn {
  min-width:0!important;
  white-space:normal!important;
  overflow-wrap:anywhere;
  line-height:1.15!important;
}
#view-applications .cvf-row-select {display:none!important}
#view-applications #appBody [data-app-select] {accent-color:#078d9d}
#view-visa #visaBody td:last-child {min-width:175px!important;width:175px!important}
#view-visa #visaBody .actions {
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  min-width:0!important;
}
#view-visa #visaBody .actions .btn {white-space:normal!important;overflow-wrap:anywhere}
@media(max-width:1180px){
  #view-classes .cvf-mainfilters>.field:first-child {grid-column:span 2!important}
}


/* 03 Nov 2026: keep the combined selection checkbox and row serial number
   fully inside the first column. Previous 40px slot clipped them at 100% zoom.
   All layouts retain existing right-side actions and horizontal scrolling. */
:is(#studentList,#leadList,#visitorList,#followupList,#counsellingList) .table-wrap {
  max-width:100%;
  overflow-x:auto!important;
  scroll-padding-inline-start:0;
}
:is(#studentList,#leadList,#visitorList,#followupList,#counsellingList) .operational-data-table {
  border-spacing:0;
}
:is(#studentList,#leadList,#visitorList,#followupList,#counsellingList) .operational-data-table :is(th,td):first-child {
  width:70px!important;
  min-width:70px!important;
  max-width:70px!important;
  box-sizing:border-box!important;
  padding:7px 7px!important;
  overflow:visible!important;
  text-align:left!important;
  white-space:nowrap!important;
  position:static!important;
  left:auto!important;
  box-shadow:none!important;
}
:is(#studentList,#leadList,#visitorList,#followupList,#counsellingList) .operational-data-table td.row-number {
  font-variant-numeric:tabular-nums;
  text-align:left!important;
}
:is(#studentList,#leadList,#visitorList,#followupList,#counsellingList) .operational-data-table td.row-number .cvf-row-select {
  display:inline-block!important;
  width:16px!important;
  height:16px!important;
  margin:0 9px 0 0!important;
  vertical-align:middle!important;
  flex:none;
}
#view-applications .data-table :is(th,td):first-child,
#view-visa .data-table :is(th,td):first-child {
  min-width:48px!important;
  width:48px!important;
  max-width:48px!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  padding-left:8px!important;
  padding-right:6px!important;
  text-align:left!important;
}
#view-visa .data-table td:first-child .cvf-row-select {
  display:inline-block!important;
  width:15px!important;
  height:15px!important;
  margin:0 6px 0 0!important;
  vertical-align:middle;
}
#view-applications .data-table :is(th,td):nth-child(2) {
  min-width:36px!important;
  width:36px!important;
  max-width:36px!important;
  box-sizing:border-box!important;
  text-align:center!important;
}
#leadList .leads-data-table tbody tr {
  height:auto!important;
  min-height:66px;
}
#leadList .leads-data-table td {
  padding-top:7px!important;
  padding-bottom:7px!important;
  line-height:1.23!important;
}
#leadList .lead-table-actions {
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:4px!important;
  align-content:center;
}
#leadList .lead-table-actions .btn {
  min-height:27px!important;
  padding:4px 6px!important;
  line-height:1.18!important;
  font-size:10px!important;
}
@media(max-width:760px){
  :is(#studentList,#leadList,#visitorList,#followupList,#counsellingList) .operational-data-table :is(th,td):first-child{
    min-width:66px!important;
    width:66px!important;
    max-width:66px!important;
  }
}


/* Screenshot QA: compact action rails, keeping every existing action available.
   Three short columns fit the existing 218-222px rail in two rows rather
   than stacking three buttons vertically. No role or business-rule changes. */
@media (min-width:1100px) {
  #leadList .lead-table-actions,
  #leadList .leads-data-table .workflow-table-actions,
  #visitorList .visitors-data-table .workflow-table-actions,
  #followupList .followups-data-table .workflow-table-actions,
  #counsellingList .counselling-data-table .workflow-table-actions {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    width:100%!important;
    min-width:0!important;
    align-content:center!important;
  }
  #leadList .lead-table-actions .btn,
  #visitorList .workflow-table-actions .btn,
  #followupList .workflow-table-actions .btn,
  #counsellingList .workflow-table-actions .btn {
    min-width:0!important;
    min-height:27px!important;
    padding:4px 3px!important;
    font-size:9.5px!important;
    line-height:1.12!important;
    border-radius:6px!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    margin:0!important;
  }
  #leadList .leads-data-table tbody tr,
  #visitorList .visitors-data-table tbody tr,
  #followupList .followups-data-table tbody tr,
  #counsellingList .counselling-data-table tbody tr {
    height:auto!important;
  }
  #leadList .leads-data-table tbody td,
  #visitorList .visitors-data-table tbody td,
  #followupList .followups-data-table tbody td,
  #counsellingList .counselling-data-table tbody td {
    padding-top:8px!important;
    padding-bottom:8px!important;
    vertical-align:middle!important;
  }
  #leadList .leads-data-table tbody td:last-child,
  #visitorList .visitors-data-table tbody td:last-child,
  #followupList .followups-data-table tbody td:last-child,
  #counsellingList .counselling-data-table tbody td:last-child {
    overflow:visible!important;
  }
}
/* For smaller screens, retain the existing scrollable two-column rail. */
