/* House Allocation UI Styles */
.allocation-filters-container {
  display: flex;
  gap: 16px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.allocation-filters-container .form-item {
  flex: 1;
  margin: 0;
}

/* 2-Step House Config Card */
.house-config-card {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 14px 18px !important;
  margin-bottom: 20px !important;
}

.house-config-card legend {
  font-weight: 700 !important;
  color: #0f172a !important;
  font-size: 14px !important;
  padding: 0 6px !important;
}

.house-checkboxes-inline {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  margin: 10px 0 14px 0 !important;
}

.house-checkboxes-inline .form-type-checkbox {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #ffffff !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #334155 !important;
}

.house-checkboxes-inline .form-type-checkbox:hover {
  border-color: #94a3b8 !important;
  background: #f1f5f9 !important;
}

.btn-save-houses {
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #0f172a !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
  font-size: 12px !important;
  cursor: pointer !important;
  transition: all 0.2s ease-in-out !important;
}

.btn-save-houses:hover {
  background-color: #2563eb !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3) !important;
}

.auto-allocation-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.btn-auto-allocate {
  background-color: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #1d4ed8 !important;
  border-radius: 6px !important;
  padding: 8px 16px !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  font-size: 13px !important;
  transition: all 0.2s ease-in-out !important;
}

.btn-auto-allocate:hover {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  border-color: #1e40af !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-1px);
}

.btn-reset-all {
  background-color: #fff1f2 !important;
  color: #e11d48 !important;
  border: 1px solid #fecdd3 !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  padding: 8px 16px !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  font-size: 13px !important;
  transition: all 0.2s ease-in-out !important;
}

.btn-reset-all:hover {
  background-color: #e11d48 !important;
  color: #ffffff !important;
  border-color: #be123c !important;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35) !important;
  transform: translateY(-1px);
}

.btn-print-summary {
  background-color: #f8fafc !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  padding: 8px 16px !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  font-size: 13px !important;
  transition: all 0.2s ease-in-out !important;
}

.btn-print-summary:hover {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35) !important;
  transform: translateY(-1px);
}

.btn-export-csv {
  background-color: #f0fdf4 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  padding: 8px 16px !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  font-size: 13px !important;
  transition: all 0.2s ease-in-out !important;
}

.btn-export-csv:hover {
  background-color: #15803d !important;
  color: #ffffff !important;
  border-color: #166534 !important;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35) !important;
  transform: translateY(-1px);
}

/* Capacity Cards */
.section-capacity-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.capacity-card {
  flex: 1;
  min-width: 150px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.capacity-card.status-yellow {
  border-left: 4px solid #ea580c;
  background: #fff7ed;
}

.capacity-card .card-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.capacity-card .card-metric {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

/* 2D Matrix Table */
.house-matrix-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.matrix-header {
  background: #f1f5f9;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  border-bottom: 1px solid #cbd5e1;
}

.house-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.house-matrix-table th {
  background: #f8fafc;
  padding: 8px 12px;
  font-weight: 700;
  border-bottom: 2px solid #e2e8f0;
  text-align: center;
}

.house-matrix-table th:first-child {
  text-align: left;
}

.house-matrix-table td {
  padding: 6px 12px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
}

.house-matrix-table td.sec-matrix-title {
  text-align: left;
  font-weight: 700;
  color: #0f172a;
}

.m-count { color: #2563eb; font-weight: 600; }
.f-count { color: #db2777; font-weight: 600; }

/* Student Table */
.student-allocation-count {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}

.student-allocation-table-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.student-allocation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}

.student-allocation-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 10px;
  white-space: nowrap;
}

.student-allocation-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.student-id-cell {
  font-weight: 700;
  color: #0f172a;
}

.student-name-cell {
  font-weight: 600;
}

.student-house-radios-wrapper .form-radios {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  width: 100% !important;
}

.student-house-radios-wrapper .form-type-radio {
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
}

.student-house-radios-wrapper label {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  transition: all 0.15s ease;
  white-space: nowrap !important;
  display: inline-block !important;
}

.student-house-radios-wrapper input[type="radio"]:checked + label {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

/* Inline Radio Buttons Flex Layout */
.house-radios-inline {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 24px !important;
  margin-top: 8px !important;
}

.house-radios-inline .form-type-radio {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  cursor: pointer !important;
}

.house-radios-inline .form-type-radio label {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  cursor: pointer !important;
  margin: 0 !important;
}

.house-radios-inline input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  cursor: pointer !important;
  accent-color: #2563eb !important;
}

/* Custom SVG Dropdown Chevron Arrow for Select Fields */
.form-select-arrow {
  width: 100% !important;
  padding: 10px 40px 10px 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 14px center / 16px 16px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  cursor: pointer !important;
}

.form-select-arrow:focus {
  border-color: #2563eb !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Header Card Styles for Batch House Configuration */
.batch-config-header-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 20px 24px !important;
  margin-bottom: 24px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04) !important;
}

.batch-breadcrumb {
  font-size: 12px !important;
  color: #2563eb !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 4px !important;
}

.batch-config-header-card h2 {
  margin: 0 0 4px 0 !important;
  color: #0f172a !important;
  font-size: 22px !important;
  font-weight: 800 !important;
}

.batch-config-header-card p {
  margin: 0 0 16px 0 !important;
  color: #64748b !important;
  font-size: 13.5px !important;
}

.batch-info-badges {
  display: flex !important;
  gap: 32px !important;
  font-size: 14px !important;
  color: #334155 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  padding: 10px 20px !important;
  border-radius: 8px !important;
}

.batch-info-badges div strong {
  font-size: 15px !important;
  margin-left: 4px !important;
}

.batch-stats-box {
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 12px !important;
  padding: 16px 24px !important;
  text-align: right !important;
  min-width: 210px !important;
}

.batch-stats-total {
  font-weight: 800 !important;
  color: #1e40af !important;
  font-size: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.batch-stats-gender {
  font-size: 13.5px !important;
  color: #2563eb !important;
  margin-top: 6px !important;
  font-weight: 600 !important;
}

/* Color Circle in Table */
.house-color-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.house-color-circle {
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  margin-right: 6px !important;
  vertical-align: middle !important;
}

.house-color-circle[data-color*="dc2626"] { background-color: #dc2626 !important; }
.house-color-circle[data-color*="2563eb"] { background-color: #2563eb !important; }
.house-color-circle[data-color*="16a34a"] { background-color: #16a34a !important; }
.house-color-circle[data-color*="d97706"] { background-color: #d97706 !important; }
.house-color-circle[data-color*="7c3aed"] { background-color: #7c3aed !important; }
.house-color-circle[data-color*="0891b2"], .house-color-circle[data-color*="06b6d4"] { background-color: #0891b2 !important; }
.house-color-circle[data-color*="e11d48"] { background-color: #e11d48 !important; }
.house-color-circle[data-color*="059669"] { background-color: #059669 !important; }
.house-color-circle[data-color*="4f46e5"] { background-color: #4f46e5 !important; }
.house-color-circle[data-color*="854d0e"] { background-color: #854d0e !important; }
.house-color-circle[data-color*="ea580c"] { background-color: #ea580c !important; }
.house-color-circle[data-color*="4b5563"] { background-color: #4b5563 !important; }
.house-color-circle[data-color*="db2777"] { background-color: #db2777 !important; }
.house-color-circle[data-color*="0d9488"] { background-color: #0d9488 !important; }

/* Top Analytics Dashboard Container - Exact Reference Image Layout */
.analytics-dashboard-wrapper {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

/* TOP ROW: 5 Metric Stat Cards in 1 Row */
.analytics-top-cards-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 1280px) {
  .analytics-top-cards-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .analytics-top-cards-row {
    grid-template-columns: 1fr;
  }
}

.top-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.stat-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.icon-blue-users { background: #eff6ff; color: #2563eb; }
.icon-blue-male { background: #eff6ff; color: #2563eb; }
.icon-pink-female { background: #fdf2f8; color: #ec4899; }
.icon-green-sections { background: #f0fdf4; color: #16a34a; }
.icon-blue-houses { background: #f0f9ff; color: #0284c7; }

.stat-card-content {
  flex: 1;
  min-width: 0;
}

.stat-card-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  display: block;
  margin-bottom: 1px;
}

.stat-val-pct-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-card-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.stat-card-pct {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.stat-card-sub {
  font-size: 9.5px;
  font-weight: 600;
  color: #64748b;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-progress-track {
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.stat-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.fill-blue { background: #2563eb; }
.fill-pink { background: #ec4899; }

/* BOTTOM ROW: 4 Equal Analytics Columns in 1 Row */
.analytics-bottom-row {
  display: grid;
  grid-template-columns: 210px 1fr 1fr 1fr;
  gap: 10px;
}

@media (max-width: 1200px) {
  .analytics-bottom-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .analytics-bottom-row {
    grid-template-columns: 1fr;
  }
}

.analytics-bottom-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

.card-title-header {
  background: #ebf5ff;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #1e3a8a;
  border-bottom: 1px solid #bfdbfe;
  letter-spacing: 0.2px;
}

/* Donut Chart Card (Column 1) */
.card-donut-ratio .donut-chart-flex {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.css-donut-chart {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
}

.css-donut-center {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.css-donut-center .donut-center-num {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.css-donut-center .donut-center-text {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
}

.donut-legend-vertical {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.legend-pill {
  font-size: 10px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.dot-blue { background: #007bff; }
.dot-pink { background: #ff499e; }

/* Summary Tables (Columns 2, 3, 4) */
.summary-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.summary-mini-table th {
  background: #ebf5ff;
  color: #1e3a8a;
  padding: 4px 6px;
  font-weight: 700;
  border-bottom: 1px solid #bfdbfe;
  font-size: 9.5px;
}

.summary-mini-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.summary-mini-table tr:hover td {
  background: #f8fafc;
}

.summary-tot-row td {
  background: #ebf5ff !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  border-top: 1.5px solid #93c5fd;
}
