/* ============================================================
   ECBC Compliance Portal — Shared Component Library
   Prefix: ecp- (ECBC Compliance Portal)
   ============================================================ */

/* ── Buttons ───────────────────────────────────────────────── */

.ecp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--ecp-font-family);
  font-size: var(--ecp-font-body);
  font-weight: var(--ecp-weight-medium);
  line-height: 1;
  padding: 10px 20px;
  border-radius: var(--ecp-radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--ecp-transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.ecp-btn:active {
  transform: scale(0.97);
}
.ecp-btn:disabled,
.ecp-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.ecp-btn i {
  font-size: 15px;
  line-height: 1;
}

/* Primary */
.ecp-btn-primary {
  background: var(--ecp-primary);
  color: var(--ecp-white);
  border-color: var(--ecp-primary);
}
.ecp-btn-primary:hover {
  background: var(--ecp-primary-dark);
  border-color: var(--ecp-primary-dark);
  color: var(--ecp-white);
  box-shadow: 0 4px 12px rgba(var(--ecp-primary-rgb), 0.25);
}

/* Secondary */
.ecp-btn-secondary {
  background: var(--ecp-gray-100);
  color: var(--ecp-text-body);
  border-color: var(--ecp-gray-200);
}
.ecp-btn-secondary:hover {
  background: var(--ecp-gray-200);
  color: var(--ecp-text-primary);
}

/* Outline */
.ecp-btn-outline {
  background: transparent;
  color: var(--ecp-primary);
  border-color: var(--ecp-primary);
}
.ecp-btn-outline:hover {
  background: var(--ecp-primary);
  color: var(--ecp-white);
}

/* Ghost */
.ecp-btn-ghost {
  background: transparent;
  color: var(--ecp-primary);
  border-color: transparent;
}
.ecp-btn-ghost:hover {
  background: var(--ecp-primary-bg);
}

/* Success */
.ecp-btn-success {
  background: var(--ecp-success);
  color: var(--ecp-white);
  border-color: var(--ecp-success);
}
.ecp-btn-success:hover {
  background: var(--ecp-success-dark);
  border-color: var(--ecp-success-dark);
  color: var(--ecp-white);
}

/* Danger */
.ecp-btn-danger {
  background: transparent;
  color: var(--ecp-error);
  border-color: transparent;
}
.ecp-btn-danger:hover {
  background: var(--ecp-error-light);
}

/* Sizes */
.ecp-btn-sm {
  font-size: var(--ecp-font-small);
  padding: 6px 14px;
}
.ecp-btn-lg {
  font-size: 15px;
  padding: 12px 28px;
}
.ecp-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--ecp-radius-md);
}
.ecp-btn-icon.ecp-btn-sm {
  width: 30px;
  height: 30px;
}

/* Button with loading */
.ecp-btn-loading .ecp-btn-text {
  visibility: hidden;
}
.ecp-btn-loading .ecp-spinner {
  position: absolute;
}


/* ── Cards ─────────────────────────────────────────────────── */

.ecp-card {
  background: var(--ecp-white);
  border: 1px solid var(--ecp-gray-200);
  border-radius: var(--ecp-radius-lg);
  box-shadow: var(--ecp-shadow-1);
  transition: all var(--ecp-transition-base);
  overflow: hidden;
}
.ecp-card:hover {
  box-shadow: var(--ecp-shadow-2);
}

.ecp-card-header {
  padding: var(--ecp-space-5) var(--ecp-space-6);
  border-bottom: 1px solid var(--ecp-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ecp-space-4);
}

.ecp-card-title {
  font-size: var(--ecp-font-body);
  font-weight: var(--ecp-weight-semibold);
  color: var(--ecp-text-primary);
  margin: 0;
}

.ecp-card-body {
  padding: var(--ecp-space-6);
}

.ecp-card-footer {
  padding: var(--ecp-space-4) var(--ecp-space-6);
  border-top: 1px solid var(--ecp-gray-100);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ecp-space-3);
}

/* Clickable card */
.ecp-card-link {
  cursor: pointer;
}
.ecp-card-link:hover {
  border-color: var(--ecp-primary);
  transform: translateY(-2px);
}


/* ── Stat Cards ────────────────────────────────────────────── */

.ecp-stat-card {
  background: var(--ecp-white);
  border: 1px solid var(--ecp-gray-200);
  border-radius: var(--ecp-radius-lg);
  padding: var(--ecp-space-6);
  transition: all var(--ecp-transition-base);
  position: relative;
  overflow: hidden;
}
.ecp-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--ecp-primary);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity var(--ecp-transition-fast);
}
.ecp-stat-card:hover::before {
  opacity: 1;
}
.ecp-stat-card:hover {
  box-shadow: var(--ecp-shadow-2);
}

.ecp-stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--ecp-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: var(--ecp-space-4);
}
.ecp-stat-card-icon.primary { background: var(--ecp-primary-bg); color: var(--ecp-primary); }
.ecp-stat-card-icon.success { background: var(--ecp-success-light); color: var(--ecp-success); }
.ecp-stat-card-icon.warning { background: var(--ecp-warning-light); color: var(--ecp-warning); }
.ecp-stat-card-icon.error { background: var(--ecp-error-light); color: var(--ecp-error); }
.ecp-stat-card-icon.info { background: var(--ecp-info-light); color: var(--ecp-info); }

.ecp-stat-value {
  font-size: var(--ecp-font-h1);
  font-weight: var(--ecp-weight-extrabold);
  color: var(--ecp-text-primary);
  line-height: 1;
  margin-bottom: var(--ecp-space-1);
}

.ecp-stat-label {
  font-size: var(--ecp-font-small);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-text-light);
}

.ecp-stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--ecp-font-caption);
  font-weight: var(--ecp-weight-semibold);
  margin-top: var(--ecp-space-2);
  padding: 2px 8px;
  border-radius: 20px;
}
.ecp-stat-trend.up { color: var(--ecp-success); background: var(--ecp-success-light); }
.ecp-stat-trend.down { color: var(--ecp-error); background: var(--ecp-error-light); }
.ecp-stat-trend.neutral { color: var(--ecp-text-muted); background: var(--ecp-gray-100); }


/* ── Tables ────────────────────────────────────────────────── */

.ecp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ecp-gray-200);
  border-radius: var(--ecp-radius-lg);
  background: var(--ecp-white);
}

.ecp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ecp-font-small);
}

.ecp-table thead th {
  padding: var(--ecp-space-3) var(--ecp-space-4);
  font-size: var(--ecp-font-caption);
  font-weight: var(--ecp-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ecp-text-muted);
  background: var(--ecp-gray-50);
  border-bottom: 1px solid var(--ecp-gray-200);
  text-align: left;
  white-space: nowrap;
  user-select: none;
}

.ecp-table thead th.sortable {
  cursor: pointer;
  transition: color var(--ecp-transition-fast);
}
.ecp-table thead th.sortable:hover {
  color: var(--ecp-primary);
}
.ecp-table thead th.sortable::after {
  content: '\F282';
  font-family: 'bootstrap-icons';
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.3;
}
.ecp-table thead th.sort-asc::after { content: '\F235'; opacity: 1; color: var(--ecp-primary); }
.ecp-table thead th.sort-desc::after { content: '\F229'; opacity: 1; color: var(--ecp-primary); }

.ecp-table tbody td {
  padding: var(--ecp-space-3) var(--ecp-space-4);
  border-bottom: 1px solid var(--ecp-gray-100);
  color: var(--ecp-text-body);
  vertical-align: middle;
}

.ecp-table tbody tr {
  transition: background var(--ecp-transition-fast);
}
.ecp-table tbody tr:hover {
  background: var(--ecp-gray-50);
}

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

/* Row selection */
.ecp-table tbody tr.selected {
  background: var(--ecp-primary-bg);
}


/* ── Badges ────────────────────────────────────────────────── */

.ecp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--ecp-font-caption);
  font-weight: var(--ecp-weight-semibold);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.4;
}

.ecp-badge-primary { background: var(--ecp-primary-bg); color: var(--ecp-primary); }
.ecp-badge-success { background: var(--ecp-success-light); color: var(--ecp-success-dark); }
.ecp-badge-warning { background: var(--ecp-warning-light); color: var(--ecp-warning-dark); }
.ecp-badge-error { background: var(--ecp-error-light); color: var(--ecp-error-dark); }
.ecp-badge-info { background: var(--ecp-info-light); color: var(--ecp-info-dark); }
.ecp-badge-neutral { background: var(--ecp-gray-100); color: var(--ecp-gray-600); }

/* Status dot badges */
.ecp-badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Stage badges */
.ecp-badge-stage {
  font-size: 10px;
  font-weight: var(--ecp-weight-bold);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ecp-badge-stage.stage-1 { background: #DBEAFE; color: #1E40AF; }
.ecp-badge-stage.stage-2 { background: #FEF3C7; color: #92400E; }
.ecp-badge-stage.stage-3 { background: #D1FAE5; color: #065F46; }
.ecp-badge-stage.stage-4 { background: #E0E7FF; color: #3730A3; }


/* ── Form Controls ─────────────────────────────────────────── */

.ecp-form-group {
  margin-bottom: var(--ecp-space-5);
}

.ecp-label {
  display: block;
  font-size: var(--ecp-font-small);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-text-primary);
  margin-bottom: var(--ecp-space-2);
}
.ecp-label .required {
  color: var(--ecp-error);
  margin-left: 2px;
}

.ecp-input,
.ecp-select,
.ecp-textarea {
  width: 100%;
  font-family: var(--ecp-font-family);
  font-size: var(--ecp-font-body);
  padding: 10px 14px;
  border: 1.5px solid var(--ecp-gray-300);
  border-radius: var(--ecp-radius-md);
  background: var(--ecp-white);
  color: var(--ecp-text-primary);
  transition: all var(--ecp-transition-fast);
  outline: none;
}
.ecp-input:focus,
.ecp-select:focus,
.ecp-textarea:focus {
  border-color: var(--ecp-primary);
  box-shadow: 0 0 0 3px rgba(var(--ecp-primary-rgb), 0.1);
}
.ecp-input::placeholder,
.ecp-textarea::placeholder {
  color: var(--ecp-gray-400);
}
.ecp-input.is-invalid,
.ecp-select.is-invalid,
.ecp-textarea.is-invalid {
  border-color: var(--ecp-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.ecp-input.is-valid {
  border-color: var(--ecp-success);
}

.ecp-form-hint {
  font-size: var(--ecp-font-caption);
  color: var(--ecp-text-muted);
  margin-top: var(--ecp-space-1);
}

.ecp-form-error {
  font-size: var(--ecp-font-caption);
  color: var(--ecp-error);
  margin-top: var(--ecp-space-1);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* File Upload Zone */
.ecp-upload-zone {
  border: 2px dashed var(--ecp-gray-300);
  border-radius: var(--ecp-radius-lg);
  padding: var(--ecp-space-10) var(--ecp-space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--ecp-transition-base);
  background: var(--ecp-gray-50);
}
.ecp-upload-zone:hover,
.ecp-upload-zone.dragging {
  border-color: var(--ecp-primary);
  background: var(--ecp-primary-bg);
}
.ecp-upload-zone-icon {
  font-size: 32px;
  color: var(--ecp-gray-400);
  margin-bottom: var(--ecp-space-3);
}
.ecp-upload-zone:hover .ecp-upload-zone-icon,
.ecp-upload-zone.dragging .ecp-upload-zone-icon {
  color: var(--ecp-primary);
}
.ecp-upload-zone-text {
  font-size: var(--ecp-font-body);
  color: var(--ecp-text-body);
  margin-bottom: var(--ecp-space-1);
}
.ecp-upload-zone-hint {
  font-size: var(--ecp-font-caption);
  color: var(--ecp-text-muted);
}


/* ── Alert / Info Boxes ────────────────────────────────────── */

.ecp-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--ecp-space-3);
  padding: var(--ecp-space-4) var(--ecp-space-5);
  border-radius: var(--ecp-radius-lg);
  font-size: var(--ecp-font-small);
  border: 1px solid transparent;
}

.ecp-alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ecp-alert-info {
  background: var(--ecp-info-light);
  border-color: #BAE6FD;
  color: var(--ecp-info-dark);
}
.ecp-alert-info .ecp-alert-icon { background: rgba(14, 165, 233, 0.15); color: var(--ecp-info); }

.ecp-alert-success {
  background: var(--ecp-success-light);
  border-color: #BBF7D0;
  color: var(--ecp-success-dark);
}
.ecp-alert-success .ecp-alert-icon { background: rgba(22, 163, 74, 0.15); color: var(--ecp-success); }

.ecp-alert-warning {
  background: var(--ecp-warning-light);
  border-color: #FDE68A;
  color: var(--ecp-warning-dark);
}
.ecp-alert-warning .ecp-alert-icon { background: rgba(217, 119, 6, 0.15); color: var(--ecp-warning); }

.ecp-alert-error {
  background: var(--ecp-error-light);
  border-color: #FECACA;
  color: var(--ecp-error-dark);
}
.ecp-alert-error .ecp-alert-icon { background: rgba(220, 38, 38, 0.15); color: var(--ecp-error); }


/* ── Stage Stepper ─────────────────────────────────────────── */

.ecp-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--ecp-space-8);
  padding: 0;
  list-style: none;
}

.ecp-stepper-item {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}

.ecp-stepper-item:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--ecp-gray-200);
  margin: 0 var(--ecp-space-3);
  transition: background var(--ecp-transition-base);
}
.ecp-stepper-item.completed:not(:last-child)::after {
  background: var(--ecp-success);
}
.ecp-stepper-item.active:not(:last-child)::after {
  background: linear-gradient(to right, var(--ecp-primary) 50%, var(--ecp-gray-200) 50%);
}

.ecp-stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ecp-font-caption);
  font-weight: var(--ecp-weight-bold);
  flex-shrink: 0;
  transition: all var(--ecp-transition-base);
  border: 2px solid var(--ecp-gray-300);
  background: var(--ecp-white);
  color: var(--ecp-gray-400);
}

.ecp-stepper-item.active .ecp-stepper-circle {
  border-color: var(--ecp-primary);
  background: var(--ecp-primary);
  color: var(--ecp-white);
  box-shadow: 0 0 0 4px rgba(var(--ecp-primary-rgb), 0.15);
}

.ecp-stepper-item.completed .ecp-stepper-circle {
  border-color: var(--ecp-success);
  background: var(--ecp-success);
  color: var(--ecp-white);
}

.ecp-stepper-label {
  font-size: var(--ecp-font-caption);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-text-muted);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: var(--ecp-space-2);
  white-space: nowrap;
  text-align: center;
}
.ecp-stepper-item.active .ecp-stepper-label {
  color: var(--ecp-primary);
  font-weight: var(--ecp-weight-semibold);
}
.ecp-stepper-item.completed .ecp-stepper-label {
  color: var(--ecp-success);
}

/* Vertical stepper (for form workflow) */
.ecp-stepper-vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.ecp-stepper-vertical .ecp-stepper-item {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--ecp-space-4);
  flex: unset;
  padding-bottom: var(--ecp-space-6);
}
.ecp-stepper-vertical .ecp-stepper-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 36px;
  width: 2px;
  height: calc(100% - 36px);
  flex: unset;
  margin: 0;
}
.ecp-stepper-vertical .ecp-stepper-label {
  position: static;
  transform: none;
  margin-top: 0;
  padding-top: 6px;
}


/* ── Form Workflow Stepper ─────────────────────────────────── */

.ecp-workflow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--ecp-space-6);
  background: var(--ecp-white);
  border: 1px solid var(--ecp-gray-200);
  border-radius: var(--ecp-radius-lg);
  margin-bottom: var(--ecp-space-6);
}

.ecp-workflow-step {
  display: flex;
  align-items: center;
  gap: var(--ecp-space-2);
  padding: var(--ecp-space-2) var(--ecp-space-4);
  border-radius: 20px;
  font-size: var(--ecp-font-small);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-text-muted);
  transition: all var(--ecp-transition-base);
}
.ecp-workflow-step .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--ecp-weight-bold);
  background: var(--ecp-gray-100);
  color: var(--ecp-text-muted);
  flex-shrink: 0;
}

.ecp-workflow-step.active {
  background: var(--ecp-primary-bg);
  color: var(--ecp-primary);
}
.ecp-workflow-step.active .step-num {
  background: var(--ecp-primary);
  color: var(--ecp-white);
}

.ecp-workflow-step.completed {
  color: var(--ecp-success);
}
.ecp-workflow-step.completed .step-num {
  background: var(--ecp-success);
  color: var(--ecp-white);
}

.ecp-workflow-arrow {
  color: var(--ecp-gray-300);
  margin: 0 var(--ecp-space-1);
  font-size: 12px;
}
.ecp-workflow-step.completed + .ecp-workflow-arrow {
  color: var(--ecp-success);
}


/* ── Modals ────────────────────────────────────────────────── */

.ecp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--ecp-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ecp-space-6);
  animation: ecp-fadeIn 0.2s ease;
}

.ecp-modal {
  background: var(--ecp-white);
  border-radius: var(--ecp-radius-xl);
  box-shadow: var(--ecp-shadow-4);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  animation: ecp-scaleIn 0.25s ease;
}

.ecp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ecp-space-5) var(--ecp-space-6);
  border-bottom: 1px solid var(--ecp-gray-100);
}

.ecp-modal-title {
  font-size: var(--ecp-font-h3);
  font-weight: var(--ecp-weight-semibold);
  color: var(--ecp-text-primary);
  margin: 0;
}

.ecp-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--ecp-radius-sm);
  border: none;
  background: none;
  color: var(--ecp-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--ecp-transition-fast);
}
.ecp-modal-close:hover {
  background: var(--ecp-gray-100);
  color: var(--ecp-text-primary);
}

.ecp-modal-body {
  padding: var(--ecp-space-6);
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.ecp-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ecp-space-3);
  padding: var(--ecp-space-4) var(--ecp-space-6);
  border-top: 1px solid var(--ecp-gray-100);
}


/* ── Toast Notifications ───────────────────────────────────── */

.ecp-toast-container {
  position: fixed;
  top: var(--ecp-space-5);
  right: var(--ecp-space-5);
  z-index: var(--ecp-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--ecp-space-3);
  max-width: 380px;
}

.ecp-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--ecp-space-3);
  padding: var(--ecp-space-4) var(--ecp-space-5);
  background: var(--ecp-white);
  border-radius: var(--ecp-radius-lg);
  box-shadow: var(--ecp-shadow-3);
  border-left: 4px solid var(--ecp-primary);
  animation: ecp-slideInRight 0.3s ease;
  min-width: 300px;
}
.ecp-toast.success { border-left-color: var(--ecp-success); }
.ecp-toast.warning { border-left-color: var(--ecp-warning); }
.ecp-toast.error { border-left-color: var(--ecp-error); }
.ecp-toast.info { border-left-color: var(--ecp-info); }

.ecp-toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.ecp-toast.success .ecp-toast-icon { color: var(--ecp-success); }
.ecp-toast.warning .ecp-toast-icon { color: var(--ecp-warning); }
.ecp-toast.error .ecp-toast-icon { color: var(--ecp-error); }
.ecp-toast.info .ecp-toast-icon { color: var(--ecp-info); }

.ecp-toast-content { flex: 1; }
.ecp-toast-title {
  font-size: var(--ecp-font-body);
  font-weight: var(--ecp-weight-semibold);
  color: var(--ecp-text-primary);
  margin-bottom: 2px;
}
.ecp-toast-message {
  font-size: var(--ecp-font-small);
  color: var(--ecp-text-light);
}

.ecp-toast-close {
  background: none;
  border: none;
  color: var(--ecp-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}


/* ── Dropdown ──────────────────────────────────────────────── */

.ecp-dropdown {
  position: relative;
  display: inline-block;
}

.ecp-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--ecp-white);
  border: 1px solid var(--ecp-gray-200);
  border-radius: var(--ecp-radius-lg);
  box-shadow: var(--ecp-shadow-3);
  min-width: 200px;
  padding: var(--ecp-space-2) 0;
  z-index: var(--ecp-z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--ecp-transition-base);
}
.ecp-dropdown.open .ecp-dropdown-menu,
.ecp-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ecp-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--ecp-space-3);
  padding: var(--ecp-space-2) var(--ecp-space-4);
  font-size: var(--ecp-font-small);
  color: var(--ecp-text-body);
  cursor: pointer;
  transition: background var(--ecp-transition-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.ecp-dropdown-item:hover {
  background: var(--ecp-gray-50);
  color: var(--ecp-text-primary);
}
.ecp-dropdown-item i {
  font-size: 15px;
  color: var(--ecp-text-muted);
  width: 18px;
  text-align: center;
}

.ecp-dropdown-divider {
  height: 1px;
  background: var(--ecp-gray-100);
  margin: var(--ecp-space-2) 0;
}

.ecp-dropdown-header {
  padding: var(--ecp-space-2) var(--ecp-space-4);
  font-size: var(--ecp-font-caption);
  font-weight: var(--ecp-weight-semibold);
  color: var(--ecp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ── Tabs ──────────────────────────────────────────────────── */

.ecp-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--ecp-gray-200);
  margin-bottom: var(--ecp-space-6);
}

.ecp-tab {
  padding: var(--ecp-space-3) var(--ecp-space-5);
  font-size: var(--ecp-font-body);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color var(--ecp-transition-fast);
  white-space: nowrap;
}
.ecp-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background var(--ecp-transition-fast);
}
.ecp-tab:hover {
  color: var(--ecp-text-body);
}
.ecp-tab.active {
  color: var(--ecp-primary);
  font-weight: var(--ecp-weight-semibold);
}
.ecp-tab.active::after {
  background: var(--ecp-primary);
}

.ecp-tab .ecp-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: var(--ecp-weight-bold);
  background: var(--ecp-gray-100);
  color: var(--ecp-text-muted);
  margin-left: 6px;
}
.ecp-tab.active .ecp-tab-count {
  background: var(--ecp-primary-bg);
  color: var(--ecp-primary);
}


/* ── Timeline ──────────────────────────────────────────────── */

.ecp-timeline {
  position: relative;
  padding-left: var(--ecp-space-8);
}
.ecp-timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ecp-gray-200);
}

.ecp-timeline-item {
  position: relative;
  padding-bottom: var(--ecp-space-6);
}
.ecp-timeline-item:last-child {
  padding-bottom: 0;
}

.ecp-timeline-dot {
  position: absolute;
  left: calc(-1 * var(--ecp-space-8) + 8px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ecp-white);
  border: 2px solid var(--ecp-gray-300);
  z-index: 1;
}
.ecp-timeline-item.success .ecp-timeline-dot { border-color: var(--ecp-success); background: var(--ecp-success); }
.ecp-timeline-item.primary .ecp-timeline-dot { border-color: var(--ecp-primary); background: var(--ecp-primary); }
.ecp-timeline-item.warning .ecp-timeline-dot { border-color: var(--ecp-warning); background: var(--ecp-warning); }
.ecp-timeline-item.error .ecp-timeline-dot { border-color: var(--ecp-error); background: var(--ecp-error); }

.ecp-timeline-time {
  font-size: var(--ecp-font-caption);
  color: var(--ecp-text-muted);
  margin-bottom: 2px;
}
.ecp-timeline-title {
  font-size: var(--ecp-font-small);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-text-primary);
}
.ecp-timeline-desc {
  font-size: var(--ecp-font-small);
  color: var(--ecp-text-light);
  margin-top: 2px;
}


/* ── Pagination ────────────────────────────────────────────── */

.ecp-pagination {
  display: flex;
  align-items: center;
  gap: var(--ecp-space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.ecp-page-item {
  display: flex;
}

.ecp-page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--ecp-space-2);
  font-size: var(--ecp-font-small);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-text-body);
  border-radius: var(--ecp-radius-sm);
  transition: all var(--ecp-transition-fast);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
}
.ecp-page-link:hover {
  background: var(--ecp-gray-100);
  color: var(--ecp-text-primary);
}
.ecp-page-item.active .ecp-page-link {
  background: var(--ecp-primary);
  color: var(--ecp-white);
}
.ecp-page-item.disabled .ecp-page-link {
  color: var(--ecp-gray-300);
  cursor: not-allowed;
}


/* ── Tooltips ──────────────────────────────────────────────── */

[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  font-size: var(--ecp-font-caption);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-white);
  background: var(--ecp-gray-800);
  border-radius: var(--ecp-radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--ecp-transition-fast);
  pointer-events: none;
  z-index: var(--ecp-z-dropdown);
}
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}


/* ── Notification Dot ──────────────────────────────────────── */

.ecp-notif-dot {
  position: relative;
}
.ecp-notif-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ecp-error);
  border: 2px solid var(--ecp-white);
}

.ecp-notif-count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: var(--ecp-weight-bold);
  color: var(--ecp-white);
  background: var(--ecp-error);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ecp-white);
}


/* ── Auto-save Indicator ───────────────────────────────────── */

.ecp-autosave {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ecp-font-caption);
  color: var(--ecp-text-muted);
}
.ecp-autosave.saving { color: var(--ecp-warning); }
.ecp-autosave.saved { color: var(--ecp-success); }
.ecp-autosave-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ecp-text-muted);
}
.ecp-autosave.saving .ecp-autosave-dot {
  background: var(--ecp-warning);
  animation: ecp-pulse 1s infinite;
}
.ecp-autosave.saved .ecp-autosave-dot { background: var(--ecp-success); }


/* ── Progress Bar ──────────────────────────────────────────── */

.ecp-progress {
  width: 100%;
  height: 6px;
  background: var(--ecp-gray-100);
  border-radius: 3px;
  overflow: hidden;
}
.ecp-progress-bar {
  height: 100%;
  background: var(--ecp-primary);
  border-radius: 3px;
  transition: width var(--ecp-transition-smooth);
}
.ecp-progress-bar.success { background: var(--ecp-success); }
.ecp-progress-bar.warning { background: var(--ecp-warning); }
.ecp-progress-bar.error { background: var(--ecp-error); }


/* ── Avatar ────────────────────────────────────────────────── */

.ecp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ecp-font-body);
  font-weight: var(--ecp-weight-semibold);
  color: var(--ecp-white);
  background: var(--ecp-primary);
  flex-shrink: 0;
  overflow: hidden;
}
.ecp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ecp-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.ecp-avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.ecp-avatar-xl { width: 64px; height: 64px; font-size: 24px; }


/* ── Chip / Tag ────────────────────────────────────────────── */

.ecp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: var(--ecp-font-small);
  font-weight: var(--ecp-weight-medium);
  color: var(--ecp-text-body);
  background: var(--ecp-gray-100);
  border-radius: 20px;
  border: 1px solid var(--ecp-gray-200);
}
.ecp-chip-closable {
  cursor: pointer;
}
.ecp-chip-close {
  font-size: 14px;
  color: var(--ecp-text-muted);
  cursor: pointer;
  line-height: 1;
}
.ecp-chip-close:hover {
  color: var(--ecp-error);
}


/* ── OTP Inputs ────────────────────────────────────────────── */

.ecp-otp-container {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.ecp-otp-input {
  width: 48px !important;
  min-width: 48px;
  max-width: 48px;
  height: 52px;
  flex: 0 0 48px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--ecp-font-family);
  border: 1.5px solid var(--ecp-gray-200);
  border-radius: var(--ecp-radius-md);
  outline: none;
  background: var(--ecp-white);
  color: var(--ecp-text-primary);
  padding: 0;
  transition: border-color var(--ecp-transition-fast), box-shadow var(--ecp-transition-fast);
  -moz-appearance: textfield;
}
.ecp-otp-input::-webkit-outer-spin-button,
.ecp-otp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ecp-otp-input:focus {
  border-color: var(--ecp-primary);
  box-shadow: 0 0 0 3px rgba(var(--ecp-primary-rgb), 0.12);
}
.ecp-otp-input.is-invalid {
  border-color: var(--ecp-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

@media (max-width: 575.98px) {
  .ecp-otp-container { gap: 6px; }
  .ecp-otp-input {
    width: 42px !important;
    min-width: 42px;
    max-width: 42px;
    height: 46px;
    flex: 0 0 42px;
    font-size: 18px;
  }
}


/* ============================================================
   FLOATING FEEDBACK WIDGET
   ============================================================ */
.ecp-feedback-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--ecp-font-family, 'Inter', sans-serif);
}

.ecp-feedback-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--ecp-primary, #2563EB); color: #fff;
  border: none; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ecp-feedback-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}

.ecp-feedback-panel {
  position: absolute; bottom: 60px; right: 0;
  width: 320px; background: #fff;
  border: 1px solid var(--ecp-gray-200, #E2E8F0);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  opacity: 0; transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.ecp-feedback-panel.open {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ecp-feedback-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--ecp-gray-100, #F1F5F9);
  font-size: 14px; font-weight: 700; color: var(--ecp-text-primary, #0F172A);
}
.ecp-feedback-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--ecp-text-muted, #94A3B8); line-height: 1;
}
.ecp-feedback-close:hover { color: var(--ecp-text-primary, #0F172A); }

.ecp-feedback-body { padding: 16px 18px; }

.ecp-feedback-types {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.ecp-feedback-type {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border: 1.5px solid var(--ecp-gray-200, #E2E8F0);
  border-radius: 10px; font-size: 11px; font-weight: 600;
  color: var(--ecp-text-muted, #94A3B8); cursor: pointer;
  transition: all 0.2s; text-align: center;
}
.ecp-feedback-type input { display: none; }
.ecp-feedback-type i { font-size: 18px; }
.ecp-feedback-type:hover { border-color: var(--ecp-primary, #2563EB); color: var(--ecp-primary, #2563EB); }
.ecp-feedback-type.active {
  border-color: var(--ecp-primary, #2563EB);
  background: rgba(37, 99, 235, 0.06);
  color: var(--ecp-primary, #2563EB);
}

.ecp-feedback-input {
  width: 100%; border: 1.5px solid var(--ecp-gray-200, #E2E8F0);
  border-radius: 10px; padding: 10px 12px;
  font-size: 13px; font-family: inherit; resize: none;
  outline: none; transition: border-color 0.2s;
}
.ecp-feedback-input:focus { border-color: var(--ecp-primary, #2563EB); }

.ecp-feedback-meta {
  font-size: 10.5px; color: var(--ecp-text-muted, #94A3B8);
  margin: 8px 0 12px; font-family: monospace;
}

.ecp-feedback-submit {
  width: 100%; padding: 10px;
  background: var(--ecp-primary, #2563EB); color: #fff;
  border: none; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s;
}
.ecp-feedback-submit:hover { opacity: 0.9; }

.ecp-feedback-success {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 40px 18px;
  text-align: center; color: #16A34A;
  font-size: 14px; font-weight: 600;
}
.ecp-feedback-success i { font-size: 36px; }

@media (max-width: 575.98px) {
  .ecp-feedback-widget { bottom: 16px; right: 16px; }
  .ecp-feedback-panel { width: calc(100vw - 32px); right: -8px; }
}

/* ── Login Split Layout ─────────────────────────────────────── */

body { margin: 0; overflow-x: hidden; }

.login-wrapper {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1E3A5F 0%, #1D4ED8 50%, #2563EB 100%);
}
.login-left::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    top: -120px;
    right: -120px;
}
.login-left::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
}
.login-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 460px;
}
.login-logo-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}
.login-logo-gok { height: 52px; filter: brightness(0) invert(1); opacity: 0.85; }
.login-logo-emc { height: 48px; filter: brightness(0) invert(1); opacity: 0.9; }
.login-left-content h2 { color: #fff; font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.login-left-content p { color: rgba(255,255,255,0.7); font-size: 14px; line-height: 1.7; max-width: 400px; margin: 0 auto; }

.login-features { display: flex; flex-direction: column; gap: 12px; margin-top: 36px; text-align: left; }
.login-feature-item { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500; }
.login-feature-icon {
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: rgba(255,255,255,0.7); flex-shrink: 0;
}
.login-left-footer { margin-top: 48px; position: relative; z-index: 1; }
.login-left-stats {
    display: flex; align-items: center; justify-content: center;
    gap: 24px; padding: 16px 28px;
    background: rgba(255,255,255,0.08); border-radius: 14px; backdrop-filter: blur(8px);
}
.login-stat { text-align: center; }
.login-stat strong { display: block; font-size: 20px; font-weight: 800; color: #fff; line-height: 1; }
.login-stat span { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 500; }
.login-stat-divider { width: 1px; height: 30px; background: rgba(255,255,255,0.15); }

.login-right {
    width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--ecp-white);
    flex-shrink: 0;
}
.login-form-wrap { width: 100%; max-width: 380px; }
.login-step-hidden { display: none !important; }

.login-role-header { margin-bottom: 32px; }
.login-role-tabs {
    display: flex;
    background: var(--ecp-gray-100);
    border-radius: var(--ecp-radius-lg);
    padding: 4px; gap: 4px;
}
.login-role-tab {
    flex: 1; text-align: center; padding: 10px 16px;
    font-size: 13px; font-weight: 600; color: var(--ecp-text-muted);
    border-radius: var(--ecp-radius-md);
    transition: all var(--ecp-transition-base);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    text-decoration: none;
}
.login-role-tab:hover { color: var(--ecp-text-body); }
.login-role-tab.active { background: var(--ecp-white); color: var(--ecp-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.login-role-tab i { font-size: 15px; }

.login-step-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--ecp-primary-bg); color: var(--ecp-primary);
    font-size: 24px; display: inline-flex; align-items: center; justify-content: center;
}
.login-step-icon-success { background: var(--ecp-success-light); color: var(--ecp-success); }

.login-title { font-size: 20px; font-weight: 800; color: var(--ecp-text-primary); text-align: center; margin-bottom: 4px; }
.login-subtitle { text-align: center; font-size: 13px; color: var(--ecp-text-muted); margin-bottom: 24px; line-height: 1.6; }

.login-country-code {
    font-size: 14px; font-weight: 600;
    background: var(--ecp-gray-50);
    border: 1.5px solid var(--ecp-gray-200); border-right: none;
    border-radius: var(--ecp-radius-md) 0 0 var(--ecp-radius-md);
    color: var(--ecp-text-body); padding: 10px 14px;
}
.login-mobile-input {
    border-radius: 0 var(--ecp-radius-md) var(--ecp-radius-md) 0 !important;
    border: 1.5px solid var(--ecp-gray-200);
    padding: 12px 14px; font-size: 15px; font-family: var(--ecp-font-family);
}
.login-mobile-input:focus { border-color: var(--ecp-primary); box-shadow: 0 0 0 3px rgba(var(--ecp-primary-rgb),0.1); }
.login-mobile-input.is-invalid { border-color: var(--ecp-error); }
.login-submit-btn { width: 100%; padding: 12px; font-size: 14px; font-weight: 700; margin-top: 16px; }

.login-otp-inputs { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; }
.login-otp-inputs .ecp-otp-input { width: 48px !important; min-width: 48px; max-width: 48px; height: 52px; flex: 0 0 48px; }

.login-resend-text { font-size: 13px; color: var(--ecp-text-muted); }
.login-resend-link { font-size: 13px; font-weight: 600; color: var(--ecp-primary); margin-left: 4px; }
.login-back-link { font-size: 12px; color: var(--ecp-text-muted); display: inline-flex; align-items: center; gap: 4px; }
.login-back-link:hover { color: var(--ecp-primary); }

.login-form-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--ecp-gray-100); }
.login-footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; }
.login-footer-links a {
    font-size: 12px; font-weight: 500; color: var(--ecp-text-muted);
    display: flex; align-items: center; gap: 4px; transition: color var(--ecp-transition-fast);
}
.login-footer-links a:hover { color: var(--ecp-primary); }
.login-footer-copy { text-align: center; font-size: 11px; color: var(--ecp-gray-400); }
.login-version { display: block; text-align: center; font-size: 10px; color: var(--ecp-gray-300); margin-top: 4px; font-family: monospace; }

/* Panel-specific left gradient overrides */
.panel-auditor .login-left {
    background: linear-gradient(135deg, #1E3A5F 0%, #1D4ED8 50%, #2563EB 100%);
}
.panel-builder .login-left {
    background: linear-gradient(135deg, #064E3B 0%, #047857 50%, #059669 100%);
}
.panel-admin .login-left {
    background: linear-gradient(135deg, #1E1B4B 0%, #4338CA 50%, #6366F1 100%);
}

@media (max-width: 991.98px) {
    .login-left { display: none; }
    .login-right { width: 100%; padding: 32px 20px; }
    .login-form-wrap { max-width: 400px; margin: 0 auto; }
}
@media (max-width: 575.98px) {
    .login-role-tabs { flex-direction: column; }
    .login-otp-inputs { gap: 6px; }
    .ecp-otp-input { width: 40px; height: 44px; font-size: 16px; }
}
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--ecp-sidebar-width);
    height: 100vh;
    background: var(--ecp-sidebar-bg);
    z-index: var(--ecp-z-overlay);
    display: flex;
    flex-direction: column;
    transition: width var(--ecp-transition-base);
    overflow: hidden;
}

/* Collapsed sidebar — icons only */
.sidebar.collapsed {
    width: var(--ecp-sidebar-collapsed);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 10px 0;
    border-left: 3px solid transparent;
}

.sidebar.collapsed .sidebar-link i {
    font-size: 19px;
    width: auto;
}

/* Tooltip on hover when collapsed */
.sidebar.collapsed .sidebar-link {
    position: relative;
}

.sidebar.collapsed .sidebar-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: var(--ecp-space-3);
    background: var(--ecp-gray-900);
    color: var(--ecp-white);
    padding: 5px 10px;
    border-radius: var(--ecp-radius-sm);
    font-size: var(--ecp-font-caption);
    font-weight: var(--ecp-weight-semibold);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ecp-transition-fast);
    z-index: calc(var(--ecp-z-overlay) + 10);
}

.sidebar.collapsed .sidebar-link:hover::after {
    opacity: 1;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-3);
    padding: 0 18px;
    height: var(--ecp-topbar-height);
    border-bottom: 1px solid var(--ecp-sidebar-border);
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--ecp-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand-text {
    color: var(--ecp-sidebar-active);
    font-weight: var(--ecp-weight-bold);
    font-size: var(--ecp-font-body);
    line-height: var(--ecp-line-height-tight);
}

.sidebar-brand-text small {
    display: block;
    font-weight: var(--ecp-weight-regular);
    font-size: var(--ecp-font-caption);
    color: var(--ecp-sidebar-section);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--ecp-space-2) 0;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 2px; }

.nav-section-title {
    font-size: 10px;
    font-weight: var(--ecp-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ecp-sidebar-section);
    padding: 18px 18px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-3);
    padding: 9px 18px;
    color: var(--ecp-sidebar-text);
    font-size: var(--ecp-font-small);
    font-weight: var(--ecp-weight-medium);
    transition: all var(--ecp-transition-fast);
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.sidebar-link i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: var(--ecp-sidebar-hover-bg);
    color: var(--ecp-sidebar-active);
}

.sidebar-link.active {
    background: var(--ecp-sidebar-active-bg);
    color: var(--ecp-sidebar-active);
    border-left-color: var(--ecp-primary-light);
    font-weight: var(--ecp-weight-semibold);
}

.sidebar-link .badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: var(--ecp-weight-semibold);
}

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--ecp-sidebar-border);
    font-size: var(--ecp-font-caption);
    color: var(--ecp-sidebar-section);
    text-align: center;
}


/* ========================================
   SIDEBAR TOGGLE / OVERLAY
   ======================================== */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--ecp-gray-200);
    border-radius: var(--ecp-radius-sm);
    font-size: 18px;
    color: var(--ecp-text-light);
    cursor: pointer;
    transition: all var(--ecp-transition-fast);
}

.sidebar-toggle:hover {
    background: var(--ecp-gray-50);
    color: var(--ecp-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: calc(var(--ecp-z-overlay) - 5);
}


/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: var(--ecp-sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--ecp-transition-base);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--ecp-sidebar-collapsed);
}


/* ========================================
   TOP BAR
   ======================================== */
.topbar {
    height: var(--ecp-topbar-height);
    background: var(--ecp-white);
    border-bottom: 1px solid var(--ecp-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--ecp-space-6);
    position: sticky;
    top: 0;
    z-index: var(--ecp-z-sticky);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-left h1 {
    font-size: 17px;
    font-weight: var(--ecp-weight-bold);
    margin: 0;
    color: var(--ecp-text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-3);
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--ecp-radius-md);
    border: 1px solid var(--ecp-gray-200);
    background: var(--ecp-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ecp-text-light);
    font-size: 17px;
    cursor: pointer;
    transition: all var(--ecp-transition-fast);
    position: relative;
}

.topbar-icon-btn:hover {
    background: var(--ecp-gray-50);
    color: var(--ecp-primary);
}

.topbar-icon-btn .notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    background: var(--ecp-error);
    border-radius: var(--ecp-radius-full);
    border: 2px solid var(--ecp-white);
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-2);
    padding: 5px 10px 5px 5px;
    border-radius: var(--ecp-radius-md);
    cursor: pointer;
    transition: background var(--ecp-transition-fast);
}

.topbar-profile:hover {
    background: var(--ecp-gray-50);
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--ecp-radius-md);
    background: var(--ecp-primary);
    color: var(--ecp-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ecp-font-small);
    font-weight: var(--ecp-weight-bold);
}

.topbar-profile-info {
    line-height: var(--ecp-line-height-tight);
}

.topbar-profile-name {
    font-size: 12.5px;
    font-weight: var(--ecp-weight-semibold);
    color: var(--ecp-text-primary);
}

.topbar-profile-role {
    font-size: var(--ecp-font-caption);
    color: var(--ecp-text-muted);
}


/* ---- Profile Dropdown ---- */
.profile-dropdown {
    width: 260px;
    padding: 0;
    border-radius: var(--ecp-radius-lg) !important;
    box-shadow: var(--ecp-shadow-4) !important;
    border: 1px solid var(--ecp-gray-100);
    overflow: hidden;
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-3);
    padding: var(--ecp-space-4);
    background: var(--ecp-gray-50);
    border-bottom: 1px solid var(--ecp-gray-100);
}

.profile-dropdown-body {
    padding: var(--ecp-space-2);
}

.profile-dropdown-footer {
    padding: var(--ecp-space-2);
    border-top: 1px solid var(--ecp-gray-100);
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-3);
    padding: 9px var(--ecp-space-3);
    border-radius: var(--ecp-radius-sm);
    font-size: var(--ecp-font-small);
    font-weight: var(--ecp-weight-medium);
    color: var(--ecp-text-body);
    transition: all var(--ecp-transition-fast);
}

.profile-dropdown-item:hover {
    background: var(--ecp-gray-50);
    color: var(--ecp-primary);
    text-decoration: none;
}

.profile-dropdown-item.text-danger:hover {
    background: var(--ecp-error-light);
    color: var(--ecp-error);
}

.profile-dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--ecp-text-light);
}

.profile-dropdown-item:hover i {
    color: inherit;
}


/* ---- Notification Dropdown ---- */
.notification-dropdown {
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    padding: 0;
    border-radius: var(--ecp-radius-lg) !important;
    box-shadow: var(--ecp-shadow-4) !important;
}

.notification-dropdown .dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--ecp-space-4);
    font-size: var(--ecp-font-body);
    font-weight: var(--ecp-weight-bold);
    color: var(--ecp-text-primary);
    border-bottom: 1px solid var(--ecp-gray-100);
}

.notification-item {
    display: flex;
    gap: var(--ecp-space-3);
    padding: var(--ecp-space-3) var(--ecp-space-4);
    border-bottom: 1px solid var(--ecp-gray-100);
    transition: background var(--ecp-transition-fast);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--ecp-gray-50);
}

.notification-item.unread {
    background: var(--ecp-primary-bg);
}

.notification-item-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--ecp-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.notification-item-text {
    flex: 1;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--ecp-text-body);
}

.notification-item-time {
    font-size: var(--ecp-font-caption);
    color: var(--ecp-text-muted);
    margin-top: 3px;
}


/* ---- Settings Vertical Nav ---- */
.settings-nav {
    gap: 2px;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-3);
    padding: 10px 14px;
    border-radius: var(--ecp-radius-md);
    font-size: var(--ecp-font-small);
    font-weight: var(--ecp-weight-medium);
    color: var(--ecp-text-light);
    transition: all var(--ecp-transition-fast);
}

.settings-nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.settings-nav-link:hover {
    background: var(--ecp-gray-50);
    color: var(--ecp-text-body);
    text-decoration: none;
}

.settings-nav-link.active {
    background: var(--ecp-primary-bg);
    color: var(--ecp-primary);
    font-weight: var(--ecp-weight-semibold);
}

.settings-nav-link.active i {
    color: var(--ecp-primary);
}


/* ========================================
   PAGE CONTENT
   ======================================== */
.page-content {
    padding: var(--ecp-space-6);
}


/* ========================================
   CONTENT CARDS
   ======================================== */
.content-card {
    background: var(--ecp-white);
    border: 1px solid var(--ecp-gray-200);
    border-radius: var(--ecp-radius-lg);
    overflow: hidden;
}
.content-card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--ecp-gray-100);
}
.content-card-title {
    font-size: 14px; font-weight: 700; color: var(--ecp-text-primary); margin: 0;
    display: flex; align-items: center;
}
.content-card-body { padding: 20px; }


/* ========================================
   STAT CARDS
   ======================================== */
.stat-card {
    background: var(--ecp-white); border: 1px solid var(--ecp-gray-200);
    border-radius: var(--ecp-radius-lg); padding: 14px 18px;
    border-left: 4px solid var(--ecp-gray-300);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
    display: flex; align-items: center; gap: 14px;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card.blue   { border-left-color: var(--admin-blue); }
.stat-card.green  { border-left-color: #16A34A; }
.stat-card.orange { border-left-color: #EA580C; }
.stat-card.red    { border-left-color: #DC2626; }
.stat-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.stat-card-body { flex: 1; min-width: 0; }
.stat-card-value { font-size: 22px; font-weight: 800; color: var(--ecp-text-primary); line-height: 1; }
.stat-card-label { font-size: 11.5px; color: var(--ecp-text-muted); margin-top: 2px; }
.stat-card-change { font-size: 10.5px; font-weight: 600; margin-top: 4px; }
.stat-card-change.up { color: #16A34A; }
.stat-card-change.down { color: #DC2626; }

/* Soft background colors */
.bg-primary-soft { background: rgba(var(--ecp-primary-rgb), 0.1); color: var(--ecp-primary); }
.bg-success-soft { background: #F0FDF4; color: #16A34A; }
.bg-danger-soft  { background: #FEF2F2; color: #DC2626; }
.bg-info-soft    { background: #F0F9FF; color: #0EA5E9; }
.bg-accent-soft  { background: #FFF7ED; color: #EA580C; }


/* ========================================
   EMC TABLE
   ======================================== */
.emc-table { font-size: 13px; margin: 0; }
.emc-table thead th {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--ecp-text-muted); background: var(--ecp-gray-50);
    padding: 10px 14px; border-bottom: 1px solid var(--ecp-gray-200);
    white-space: nowrap;
}
.emc-table tbody td {
    padding: 12px 14px; vertical-align: middle;
    border-bottom: 1px solid var(--ecp-gray-100); color: var(--ecp-text-body);
}
.emc-table tbody tr:hover { background: var(--ecp-gray-50); }
.emc-table tbody tr:last-child td { border-bottom: none; }


/* ========================================
   UPLOAD ZONE
   ======================================== */
.upload-zone {
    border: 2px dashed var(--ecp-gray-300); border-radius: var(--ecp-radius-lg);
    padding: 40px 24px; text-align: center; cursor: pointer;
    transition: all 0.2s; background: var(--ecp-gray-50);
}
.upload-zone:hover { border-color: var(--ecp-primary); background: var(--ecp-primary-bg); }
.upload-zone-icon { font-size: 36px; color: var(--ecp-primary); margin-bottom: 10px; }
.upload-zone-text { font-size: 14px; font-weight: 600; color: var(--ecp-text-primary); margin-bottom: 4px; }
.upload-zone-hint { font-size: 12px; color: var(--ecp-text-muted); }


/* ========================================
   STATUS BADGES
   ======================================== */
.status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; padding: 3px 10px;
    border-radius: 20px; white-space: nowrap;
}
.status-badge.active   { background: #DCFCE7; color: #15803D; }
.status-badge.inactive { background: var(--ecp-gray-100); color: var(--ecp-text-muted); }
.status-badge.stage-1  { background: #EFF6FF; color: #2563EB; }
.status-badge.stage-2  { background: #F0F9FF; color: #0EA5E9; }
.status-badge.stage-3  { background: #FFF7ED; color: #EA580C; }
.status-badge.stage-4  { background: #F0FDF4; color: #16A34A; }


/* ========================================
   EMC BUTTONS
   ======================================== */
.btn-emc-outline {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; padding: 7px 16px;
    border: 1px solid var(--ecp-gray-300); border-radius: var(--ecp-radius-md);
    background: var(--ecp-white); color: var(--ecp-text-body);
    cursor: pointer; transition: all 0.2s;
}
.btn-emc-outline:hover { border-color: var(--ecp-primary); color: var(--ecp-primary); background: var(--ecp-primary-bg); }

.btn-emc-accent {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; padding: 7px 16px;
    border: none; border-radius: var(--ecp-radius-md);
    background: var(--ecp-primary); color: var(--ecp-white);
    cursor: pointer; transition: all 0.2s;
}
.btn-emc-accent:hover { opacity: 0.9; color: var(--ecp-white); }


/* ========================================
   STAGE PROGRESS DOTS (admin-specific)
   ======================================== */
.stage-progress {
    display: flex;
    align-items: center;
    gap: 0;
}

.stage-dot {
    width: 26px;
    height: 26px;
    border-radius: var(--ecp-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ecp-font-caption);
    font-weight: var(--ecp-weight-bold);
    color: var(--ecp-white);
    background: var(--ecp-gray-300);
    position: relative;
    z-index: 1;
}

.stage-dot.completed {
    background: var(--ecp-success);
}

.stage-dot.current {
    background: var(--ecp-primary);
    box-shadow: 0 0 0 3px rgba(var(--ecp-primary-rgb), 0.2);
}

.stage-line {
    width: 28px;
    height: 2px;
    background: var(--ecp-gray-300);
}

.stage-line.completed {
    background: var(--ecp-success);
}


/* ========================================
   FEE SLABS (admin-specific)
   ======================================== */
.fee-slab-card {
    border: 1.5px solid var(--ecp-gray-200);
    border-radius: var(--ecp-radius-lg);
    padding: var(--ecp-space-5);
    transition: border-color var(--ecp-transition-fast);
}

.fee-slab-card:hover {
    border-color: var(--ecp-primary);
}


/* ========================================
   DETAIL PAGE — HEADER (admin-specific)
   ======================================== */
.detail-header {
    background: var(--ecp-white);
    border-radius: var(--ecp-radius-lg);
    box-shadow: var(--ecp-shadow-1);
    border: 1px solid var(--ecp-gray-100);
    padding: var(--ecp-space-6);
}

.detail-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ecp-space-4);
    flex-wrap: wrap;
}

.detail-title {
    font-size: var(--ecp-font-h2);
    font-weight: var(--ecp-weight-extrabold);
    color: var(--ecp-text-primary);
    margin: 0 0 var(--ecp-space-1);
}

.detail-subtitle {
    font-size: var(--ecp-font-small);
    color: var(--ecp-text-muted);
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--ecp-space-4);
    margin-top: var(--ecp-space-5);
    padding-top: var(--ecp-space-5);
    border-top: 1px solid var(--ecp-gray-100);
}

.detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-meta-label {
    font-size: var(--ecp-font-caption);
    font-weight: var(--ecp-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ecp-text-muted);
}

.detail-meta-value {
    font-size: var(--ecp-font-small);
    font-weight: var(--ecp-weight-semibold);
    color: var(--ecp-text-body);
}


/* ========================================
   STAGE TIMELINE — HORIZONTAL (admin-specific)
   ======================================== */
.stage-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: var(--ecp-space-6) 0;
}

.stage-timeline-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}

.stage-timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 22px;
    left: calc(50% + 22px);
    width: calc(100% - 44px);
    height: 3px;
    background: var(--ecp-gray-200);
}

.stage-timeline-item.completed:not(:last-child)::after {
    background: var(--ecp-success);
}

.stage-timeline-item.current:not(:last-child)::after {
    background: linear-gradient(90deg, var(--ecp-primary) 50%, var(--ecp-gray-200) 50%);
}

.stage-timeline-dot {
    width: 44px;
    height: 44px;
    border-radius: var(--ecp-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: var(--ecp-weight-bold);
    color: var(--ecp-text-muted);
    background: var(--ecp-gray-50);
    border: 3px solid var(--ecp-gray-200);
    position: relative;
    z-index: 2;
    transition: all var(--ecp-transition-base);
}

.stage-timeline-item.completed .stage-timeline-dot {
    background: var(--ecp-success);
    border-color: var(--ecp-success);
    color: var(--ecp-white);
}

.stage-timeline-item.current .stage-timeline-dot {
    background: var(--ecp-primary);
    border-color: var(--ecp-primary);
    color: var(--ecp-white);
    box-shadow: 0 0 0 5px rgba(var(--ecp-primary-rgb), 0.15);
}

.stage-timeline-label {
    margin-top: var(--ecp-space-3);
    font-size: 12.5px;
    font-weight: var(--ecp-weight-semibold);
    color: var(--ecp-text-light);
}

.stage-timeline-item.completed .stage-timeline-label {
    color: var(--ecp-success);
}

.stage-timeline-item.current .stage-timeline-label {
    color: var(--ecp-primary);
}

.stage-timeline-date {
    font-size: var(--ecp-font-caption);
    color: var(--ecp-text-muted);
    margin-top: 2px;
}


/* ========================================
   CERTIFICATE CARDS (admin-specific)
   ======================================== */
.cert-card {
    border: 1.5px solid var(--ecp-gray-200);
    border-radius: var(--ecp-radius-lg);
    padding: var(--ecp-space-4);
    transition: all var(--ecp-transition-fast);
}

.cert-card:hover {
    border-color: var(--ecp-primary);
    box-shadow: var(--ecp-shadow-2);
}

.cert-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--ecp-space-3);
}

.cert-card-title {
    font-size: var(--ecp-font-small);
    font-weight: var(--ecp-weight-bold);
    color: var(--ecp-text-primary);
}

.cert-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
    color: var(--ecp-text-light);
}

.cert-card-footer {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-2);
    margin-top: var(--ecp-space-3);
    padding-top: var(--ecp-space-3);
    border-top: 1px solid var(--ecp-gray-100);
}


/* ========================================
   ACTIVITY LOG / TIMELINE LIST
   ======================================== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    gap: var(--ecp-space-3);
    padding: var(--ecp-space-3) 0;
    border-bottom: 1px solid var(--ecp-gray-100);
    font-size: var(--ecp-font-small);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--ecp-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
    line-height: 1.5;
}

.activity-time {
    font-size: var(--ecp-font-caption);
    color: var(--ecp-text-muted);
    white-space: nowrap;
}


/* ========================================
   CONFIRMATION DIALOG (admin-specific)
   ======================================== */
.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--ecp-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto var(--ecp-space-4);
}

.confirm-icon.danger  { background: var(--ecp-error-light);   color: var(--ecp-error); }
.confirm-icon.warning { background: var(--ecp-warning-light); color: var(--ecp-warning); }
.confirm-icon.success { background: var(--ecp-success-light); color: var(--ecp-success); }
.confirm-icon.info    { background: var(--ecp-info-light);    color: var(--ecp-info); }


/* ========================================
   AGING TAGS (admin-specific)
   ======================================== */
.aging-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--ecp-radius-sm);
    font-size: var(--ecp-font-caption);
    font-weight: var(--ecp-weight-semibold);
}

.aging-tag.normal   { background: var(--ecp-success-light); color: var(--ecp-success-dark); }
.aging-tag.warning  { background: var(--ecp-warning-light); color: var(--ecp-warning-dark); }
.aging-tag.danger   { background: var(--ecp-error-light);   color: var(--ecp-error-dark); }
.aging-tag.critical { background: var(--ecp-error-dark);    color: var(--ecp-white); }


/* ========================================
   SESSION / DEVICE CARD (admin-specific)
   ======================================== */
.session-card {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-3);
    padding: 14px;
    border: 1px solid var(--ecp-gray-100);
    border-radius: var(--ecp-radius-lg);
    transition: border-color var(--ecp-transition-fast);
}

.session-card:hover {
    border-color: var(--ecp-gray-200);
}

.session-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ecp-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--ecp-gray-50);
    color: var(--ecp-text-light);
    flex-shrink: 0;
}

.session-card-info {
    flex: 1;
}

.session-card .badge-current {
    background: var(--ecp-success-light);
    color: var(--ecp-success);
    font-size: 10px;
    font-weight: var(--ecp-weight-semibold);
    padding: 3px 8px;
    border-radius: 20px;
}


/* ========================================
   UPLOAD RESULT (admin-specific)
   ======================================== */
.upload-result {
    border-radius: var(--ecp-radius-lg);
    padding: var(--ecp-space-6);
    text-align: center;
}

.upload-result-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--ecp-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 14px;
}

.upload-result.success .upload-result-icon { background: var(--ecp-success-light); color: var(--ecp-success); }
.upload-result.error .upload-result-icon   { background: var(--ecp-error-light);   color: var(--ecp-error); }

.upload-result-stats {
    display: flex;
    justify-content: center;
    gap: var(--ecp-space-6);
    margin-top: var(--ecp-space-4);
}

.upload-result-stat {
    text-align: center;
}

.upload-result-stat-value {
    font-size: var(--ecp-font-h2);
    font-weight: var(--ecp-weight-extrabold);
}

.upload-result-stat-label {
    font-size: var(--ecp-font-caption);
    color: var(--ecp-text-muted);
    margin-top: 2px;
}


/* ========================================
   BACK BUTTON (admin-specific)
   ======================================== */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--ecp-font-small);
    font-weight: var(--ecp-weight-semibold);
    color: var(--ecp-text-light);
    background: none;
    border: none;
    padding: 6px var(--ecp-space-3) 6px var(--ecp-space-2);
    border-radius: var(--ecp-radius-md);
    cursor: pointer;
    transition: all var(--ecp-transition-fast);
}

.btn-back:hover {
    background: var(--ecp-gray-50);
    color: var(--ecp-primary);
}


/* ========================================
   TAB PILLS (Bootstrap override)
   ======================================== */
.nav-pills .nav-link {
    color: var(--ecp-text-light);
    border: 1px solid var(--ecp-gray-200);
    border-radius: var(--ecp-radius-md);
    background: var(--ecp-white);
}

.nav-pills .nav-link:hover {
    background: var(--ecp-gray-50);
    color: var(--ecp-text-body);
}

.nav-pills .nav-link.active {
    background: var(--ecp-primary);
    color: var(--ecp-white);
    border-color: var(--ecp-primary);
}

.nav-pills .nav-link.active .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: var(--ecp-white) !important;
}


/* ========================================
   FORM OVERRIDES (Bootstrap compatibility)
   ======================================== */
.form-control:focus,
.form-select:focus {
    border-color: var(--ecp-primary);
    box-shadow: 0 0 0 3px rgba(var(--ecp-primary-rgb), 0.1);
}

.form-label {
    font-size: 12.5px;
    font-weight: var(--ecp-weight-semibold);
    color: var(--ecp-text-light);
    margin-bottom: 5px;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--ecp-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.invalid-feedback {
    font-size: var(--ecp-font-caption);
    color: var(--ecp-error);
    margin-top: var(--ecp-space-1);
}


/* ========================================
   INLINE ALERTS (admin-specific)
   ======================================== */
.alert-inline {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-2);
    padding: 10px 14px;
    border-radius: var(--ecp-radius-md);
    font-size: 12.5px;
    font-weight: var(--ecp-weight-medium);
}

.alert-inline.alert-error {
    background: var(--ecp-error-light);
    color: var(--ecp-error-dark);
    border: 1px solid #FECACA;
}

.alert-inline.alert-success {
    background: var(--ecp-success-light);
    color: var(--ecp-success-dark);
    border: 1px solid #BBF7D0;
}


/* ========================================
   BUTTON LOADING STATE
   ======================================== */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--ecp-white);
    border-radius: var(--ecp-radius-full);
    animation: admin-spinner 0.6s linear infinite;
}

@keyframes admin-spinner {
    to { transform: rotate(360deg); }
}


/* ========================================
   LOGIN PAGE
   ======================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #3730A3 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ecp-space-12);
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--ecp-radius-full);
    top: -100px;
    right: -100px;
}

.login-left::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--ecp-radius-full);
    bottom: -50px;
    left: -50px;
}

.login-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 440px;
}

.login-left-content h2 {
    color: var(--ecp-white);
    font-size: 30px;
    font-weight: var(--ecp-weight-extrabold);
    margin-bottom: 14px;
}

.login-left-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--ecp-font-body);
    line-height: var(--ecp-line-height-relaxed);
}

.login-icon-main {
    width: 88px;
    height: 88px;
    border-radius: var(--ecp-radius-2xl);
    padding: var(--ecp-space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--ecp-space-6);
    overflow: hidden;
}

.login-icon-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: var(--ecp-space-3);
    margin-top: var(--ecp-space-8);
    text-align: left;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: var(--ecp-space-3);
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--ecp-font-small);
}

.login-feature-item i {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
}

.login-right {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ecp-space-12);
    background: var(--ecp-white);
}

.login-form-wrap {
    width: 100%;
    max-width: 360px;
}

.login-form-wrap h3 {
    font-size: var(--ecp-font-h2);
    font-weight: var(--ecp-weight-extrabold);
    color: var(--ecp-text-primary);
    margin-bottom: var(--ecp-space-1);
}

.login-form-wrap p {
    color: var(--ecp-text-light);
    font-size: var(--ecp-font-small);
    margin-bottom: var(--ecp-space-6);
}

.otp-inputs {
    display: flex;
    gap: var(--ecp-space-2);
    justify-content: center;
}

.otp-input {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: var(--ecp-font-h2);
    font-weight: var(--ecp-weight-bold);
    border: 1.5px solid var(--ecp-gray-200);
    border-radius: var(--ecp-radius-lg);
    outline: none;
    transition: border-color var(--ecp-transition-fast);
}

.otp-input:focus {
    border-color: var(--ecp-primary);
    box-shadow: 0 0 0 3px rgba(var(--ecp-primary-rgb), 0.1);
}


/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--ecp-sidebar-width) !important;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: var(--ecp-sidebar-width) !important;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content,
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    .login-left {
        display: none;
    }

    .login-right {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: var(--ecp-space-4);
    }

    .otp-input {
        width: 40px;
        height: 46px;
        font-size: 18px;
    }
}
