/* Common Components CSS */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--primary-500);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
  background-color: var(--primary-600);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--surface-0);
  color: var(--surface-700);
  border-color: var(--surface-300);
}
.btn-secondary:hover {
  background-color: var(--surface-100);
  border-color: var(--surface-400);
  color: var(--surface-900);
}

.btn-success {
  background-color: #10B981;
  color: #ffffff;
}
.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: #EF4444;
  color: #ffffff;
}
.btn-danger:hover {
  background-color: #DC2626;
}

.btn-warning {
  background-color: #F59E0B;
  color: #ffffff;
}
.btn-warning:hover {
  background-color: #D97706;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-500);
  border-color: var(--primary-500);
}
.btn-outline-primary:hover {
  background: var(--primary-50);
  border-color: var(--primary-600);
  color: var(--primary-600);
}

.btn-ghost {
  background: transparent;
  color: var(--surface-600);
}
.btn-ghost:hover {
  background: var(--surface-100);
  color: var(--surface-900);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  min-width: 36px;
  min-height: 36px;
}

/* --- Cards --- */
.card {
  background: var(--surface-0);
  border: 1px solid var(--surface-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card-hover:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--surface-300);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--surface-200);
  background-color: var(--surface-50);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* --- Form Controls --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--surface-700);
  margin-bottom: 0.4rem;
}

.form-label.required::after {
  content: ' *';
  color: #EF4444;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  color: var(--surface-800);
  background-color: var(--surface-0);
  border: 1px solid var(--surface-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control:disabled, .form-select:disabled, .form-textarea:disabled {
  background-color: var(--surface-100);
  cursor: not-allowed;
  color: var(--surface-500);
}

.form-control.is-invalid, .form-select.is-invalid {
  border-color: #EF4444;
  background-color: #FEF2F2;
}

.invalid-feedback {
  font-size: 0.8rem;
  color: #EF4444;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--surface-500);
  margin-top: 0.35rem;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--surface-300);
  cursor: pointer;
  accent-color: var(--primary-500);
}

.form-check-label {
  font-size: 0.925rem;
  color: var(--surface-700);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.3;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Status specific badges */
.badge-pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}
.badge-pending .badge-dot { background-color: #F59E0B; }

.badge-review {
  background-color: var(--status-review-bg);
  color: var(--status-review-text);
  border: 1px solid var(--status-review-border);
}
.badge-review .badge-dot { background-color: #0284C7; }

.badge-approved {
  background-color: var(--status-approved-bg);
  color: var(--status-approved-text);
  border: 1px solid var(--status-approved-border);
}
.badge-approved .badge-dot { background-color: #16A34A; }

.badge-danger {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}
.badge-danger .badge-dot { background-color: #DC2626; }

.badge-neutral {
  background-color: var(--surface-100);
  color: var(--surface-700);
  border: 1px solid var(--surface-300);
}

.badge-primary {
  background-color: var(--primary-100);
  color: var(--primary-700);
  border: 1px solid var(--primary-200);
}

/* --- Alerts / Callouts --- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.alert-info {
  background-color: var(--primary-50);
  border: 1px solid var(--primary-200);
  color: var(--primary-800);
}

.alert-warning {
  background-color: #FFFBEB;
  border: 1px solid #FCD34D;
  color: #92400E;
}

.alert-success {
  background-color: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #166534;
}

.alert-danger {
  background-color: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

/* --- Data Tables --- */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--surface-200);
  border-radius: var(--radius-lg);
  background: var(--surface-0);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.table th {
  background-color: var(--surface-50);
  color: var(--surface-600);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--surface-200);
  white-space: nowrap;
}

.table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--surface-200);
  color: var(--surface-800);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background-color: var(--surface-50);
}

/* --- Modals & Popups --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--surface-0);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}

.modal-dialog.modal-lg { max-width: 800px; }
.modal-dialog.modal-xl { max-width: 1100px; }

.modal-backdrop.show .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--surface-200);
  background-color: var(--surface-50);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* --- Toast Notifications --- */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: var(--surface-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--surface-200);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  animation: slideInRight 0.3s ease-out forwards;
  transition: all var(--transition-fast);
}

.toast.toast-success { border-left: 4px solid #10B981; }
.toast.toast-error { border-left: 4px solid #EF4444; }
.toast.toast-warning { border-left: 4px solid #F59E0B; }
.toast.toast-info { border-left: 4px solid var(--primary-500); }

/* --- Stepper Navigation --- */
.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 2rem;
}

.stepper-nav::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: var(--surface-200, #e2e8f0);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  transition: all var(--transition-fast, 0.2s);
}

.step-item.active .step-circle {
  border-color: #0284c7 !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.2) !important;
  font-weight: 900;
}

.step-item.completed .step-circle {
  border-color: #0284c7 !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25) !important;
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  transition: color 0.2s ease;
}

.step-item.active .step-label {
  color: #0284c7 !important;
  font-weight: 800 !important;
}

.step-item.completed .step-label {
  color: #0369a1 !important;
  font-weight: 700 !important;
}

@media (max-width: 640px) {
  .stepper-nav {
    margin-bottom: 1.25rem;
  }
  .stepper-nav::before {
    top: 17px;
    left: 20px;
    right: 20px;
  }
  .step-circle {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }
  .step-label {
    font-size: 0.7rem;
    max-width: 75px;
    line-height: 1.2;
  }
}

/* Tabs */
.tabs-header {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--surface-200);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--surface-500);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.tab-btn:hover {
  color: var(--primary-600);
}

.tab-btn.active {
  color: var(--primary-600);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-500);
}

/* ==========================================================================
   EDIT APPLICATION FORM STYLES & SHARED METHODS SELECTOR
   ========================================================================== */
.edit-form-wrapper {
  max-width: 1040px;
  margin: 0 auto;
}

.edit-panel-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.edit-panel-card:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
}

.edit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.35rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.edit-panel-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-panel-card.theme-personal {
  border-color: #bfdbfe;
}
.edit-panel-card.theme-personal .edit-panel-header {
  background: #eff6ff;
  border-bottom-color: #dbeafe;
}
.edit-panel-card.theme-personal .edit-panel-header h4 {
  color: #1e40af;
}

.edit-panel-card.theme-methods {
  border-color: #ddd6fe;
}
.edit-panel-card.theme-methods .edit-panel-header {
  background: #f5f3ff;
  border-bottom-color: #ede9fe;
}
.edit-panel-card.theme-methods .edit-panel-header h4 {
  color: #6d28d9;
}

.edit-panel-card.theme-wishes {
  border-color: #c7d2fe;
}
.edit-panel-card.theme-wishes .edit-panel-header {
  background: #eef2ff;
  border-bottom-color: #e0e7ff;
}
.edit-panel-card.theme-wishes .edit-panel-header h4 {
  color: #3730a3;
}

.edit-panel-card.theme-proofs {
  border-color: #a7f3d0;
}
.edit-panel-card.theme-proofs .edit-panel-header {
  background: #ecfdf5;
  border-bottom-color: #d1fae5;
}
.edit-panel-card.theme-proofs .edit-panel-header h4 {
  color: #065f46;
}

.edit-panel-body {
  padding: 1.35rem;
}

/* Methods Selector Grid */
.edit-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.edit-method-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.edit-method-card:hover {
  border-color: #38bdf8;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.edit-method-card.selected {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12);
}

.edit-method-card .method-check-box {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #0284c7;
  flex-shrink: 0;
}

.edit-method-card .method-info {
  flex: 1;
  min-width: 0;
}

.edit-method-card .method-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.edit-method-card .method-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

.edit-method-card.selected .method-title {
  color: #0369a1;
}

.edit-method-card .method-code-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
  font-family: monospace;
}

.edit-method-card.selected .method-code-pill {
  background: #0284c7;
  color: #ffffff;
}

.edit-method-card .method-desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}

.edit-method-card .method-selected-badge {
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0284c7;
  margin-top: 6px;
}

.edit-method-card.selected .method-selected-badge {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Wishlist in Edit Form */
.edit-wish-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 8px;
  gap: 12px;
  transition: all 0.15s ease;
}

.edit-wish-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.edit-wish-priority {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.edit-wish-priority span {
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1;
}

.edit-wish-info {
  flex: 1;
  min-width: 0;
}

.edit-wish-name {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  margin-bottom: 2px;
}

.edit-wish-meta {
  font-size: 0.82rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.edit-wish-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.edit-wish-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #334155;
  transition: all 0.15s ease;
}

.edit-wish-btn:hover:not(:disabled) {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.edit-wish-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.edit-wish-btn-delete {
  color: #ef4444;
}

.edit-wish-btn-delete:hover:not(:disabled) {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Sticky Edit Actions Footer */
.edit-form-footer {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1.5px solid #e2e8f0;
  padding: 1rem 1.5rem;
  margin: 2rem -1rem -1rem -1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  border-radius: 0 0 12px 12px;
  z-index: 100;
}

/* ==========================================================================
   GRADE MATRIX COMPONENT ENHANCED STYLES
   ========================================================================== */
.grade-matrix-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.grade-matrix-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.grade-matrix-badge-optional {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #bae6fd;
}

.grade-matrix-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grade-matrix-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.grade-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.grade-matrix-table th {
  padding: 0.75rem 1rem;
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.grade-matrix-table th.th-subject {
  text-align: left;
  background: #f8fafc;
  color: #334155;
  min-width: 200px;
}

.grade-matrix-table th.th-g10 {
  background: #eff6ff;
  color: #1d4ed8;
  border-left: 1px solid #dbeafe;
}

.grade-matrix-table th.th-g11 {
  background: #eef2ff;
  color: #4338ca;
  border-left: 1px solid #e0e7ff;
}

.grade-matrix-table th.th-g12 {
  background: #f5f3ff;
  color: #6d28d9;
  border-left: 1px solid #ede9fe;
}

.grade-matrix-table th.th-avg {
  background: #ecfdf5;
  color: #047857;
  border-left: 1px solid #d1fae5;
  width: 120px;
}

.grade-matrix-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.grade-matrix-table tr:hover td {
  background-color: #f8fafc;
}

.grade-subj-col {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: #1e293b;
}

.grade-subj-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}

.grade-matrix-table td.td-input-cell {
  text-align: center;
  padding: 0.35rem 0.5rem;
}

.grade-matrix-table td.td-g10 { border-left: 1px solid #f0f6ff; }
.grade-matrix-table td.td-g11 { border-left: 1px solid #f3f4ff; }
.grade-matrix-table td.td-g12 { border-left: 1px solid #f8f6ff; }
.grade-matrix-table td.td-avg { border-left: 1px solid #ecfdf5; background: #fcfdfd; text-align: center; }

.grade-cell-input {
  width: 100%;
  max-width: 90px;
  height: 38px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  transition: all 0.15s ease;
  outline: none;
  font-family: inherit;
}

.grade-cell-input:focus {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.grade-cell-input.is-invalid {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.grade-row-avg {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.9rem;
  color: #047857;
  background: #d1fae5;
  min-width: 44px;
}

.grade-row-avg.empty {
  background: #f1f5f9;
  color: #94a3b8;
  font-weight: 600;
}

/* Summary Footer Bar */
.grade-matrix-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
}

.grade-summary-item {
  background: #ffffff;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.grade-summary-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

.grade-summary-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.grade-summary-item.overall {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #0284c7;
  color: #ffffff;
}

.grade-summary-item.overall .grade-summary-label {
  color: #e0f2fe;
}

.grade-summary-item.overall .grade-summary-val {
  color: #ffffff;
  font-size: 1.25rem;
}

/* ==========================================================================
   APPLICATION VIEWER SECTION THEMES (ALTERNATING COLOR PALETTES)
   ========================================================================== */
.app-section-card {
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  overflow: hidden;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.app-section-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}

.app-section-header {
  padding: 0.95rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid transparent;
}

.app-section-header h4 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-section-body {
  padding: 1.35rem;
}

/* 1. Theme Personal (Ocean Blue) */
.app-section-card.theme-personal {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.app-section-card.theme-personal .app-section-header {
  background: #eff6ff;
  border-bottom-color: #dbeafe;
}
.app-section-card.theme-personal .app-section-header h4 {
  color: #1e40af;
}

/* 2. Theme Wishes (Indigo / Purple) */
.app-section-card.theme-wishes {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}
.app-section-card.theme-wishes .app-section-header {
  background: #eef2ff;
  border-bottom-color: #e0e7ff;
}
.app-section-card.theme-wishes .app-section-header h4 {
  color: #3730a3;
}

/* 3. Theme Proofs (Emerald / Teal) */
.app-section-card.theme-proofs {
  border-color: #a7f3d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}
.app-section-card.theme-proofs .app-section-header {
  background: #ecfdf5;
  border-bottom-color: #d1fae5;
}
.app-section-card.theme-proofs .app-section-header h4 {
  color: #065f46;
}

/* 4. Theme History (Warm Amber) */
.app-section-card.theme-history {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%);
}
.app-section-card.theme-history .app-section-header {
  background: #fffbeb;
  border-bottom-color: #fef3c7;
}
.app-section-card.theme-history .app-section-header h4 {
  color: #92400e;
}

/* Info tile styling inside personal info */
.app-info-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.15s ease;
}
.app-info-tile:hover {
  border-color: #93c5fd;
}
.app-info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.app-info-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

/* Candidate Logged-in Header Badge & Logout Button */
.candidate-user-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding: 5px 12px;
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 30px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.08);
  transition: all 0.2s ease;
}

.candidate-user-menu:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.btn-candidate-logout-pill {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-candidate-logout-pill:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}


