/**
 * National Council for Vocational Education & Research (NCVER)
 * Admin Portal & Dashboard Stylesheet
 * File: css/admin.css
 */

/* Admin Stats Overview Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.admin-stat-card {
  background: var(--surface, #ffffff);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.09);
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
}

.admin-stat-card.stat-blue::before { background: #2563EB; }
.admin-stat-card.stat-amber::before { background: #F59E0B; }
.admin-stat-card.stat-emerald::before { background: #10B981; }
.admin-stat-card.stat-purple::before { background: #8B5CF6; }
.admin-stat-card.stat-teal::before { background: #0D9488; }

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.stat-blue .stat-icon-wrapper { background: #EFF6FF; color: #2563EB; }
.stat-amber .stat-icon-wrapper { background: #FEF3C7; color: #D97706; }
.stat-emerald .stat-icon-wrapper { background: #ECFDF5; color: #059669; }
.stat-purple .stat-icon-wrapper { background: #F5F3FF; color: #7C3AED; }
.stat-teal .stat-icon-wrapper { background: #F0FDFA; color: #0D9488; }

.stat-info-wrapper {
  flex-grow: 1;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748B;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}

.stat-subtext {
  font-size: 0.76rem;
  color: #94A3B8;
  margin-top: 3px;
}

/* Admin Portal Layout: Tabs & Panes */
.admin-main-card {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #E2E8F0;
  overflow: hidden;
}

.admin-nav-tabs {
  display: flex;
  background: #F8FAFC;
  border-bottom: 2px solid #E2E8F0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-tab-btn {
  padding: 14px 20px;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  color: #0B1F3A;
  background: #F1F5F9;
}

.admin-tab-btn.active {
  color: #0B1F3A;
  background: #FFFFFF;
  border-bottom-color: #0B1F3A;
  font-weight: 700;
}

.admin-tab-content {
  padding: 26px;
}

.admin-pane {
  display: none;
}

.admin-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Data Table Styling */
.table-responsive-admin {
  overflow-x: auto;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-top: 14px;
}

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

.admin-table th {
  background: #F1F5F9;
  color: #334155;
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid #CBD5E1;
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
  vertical-align: middle;
}

.admin-table tr:hover {
  background: #F8FAFC;
}

/* Custom Badges */
.badge-paid {
  background: #DCFCE7;
  color: #166534;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-partial {
  background: #FEF3C7;
  color: #92400E;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-pending {
  background: #FEE2E2;
  color: #991B1B;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-issued {
  background: #EFF6FF;
  color: #1E40AF;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
}

/* Action Button Group */
.admin-action-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-admin-xs {
  padding: 4px 9px;
  font-size: 0.76rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  text-decoration: none;
}

.btn-xs-primary { background: #0B1F3A; color: #FFF; }
.btn-xs-primary:hover { background: #183A64; }

.btn-xs-green { background: #059669; color: #FFF; }
.btn-xs-green:hover { background: #047857; }

.btn-xs-amber { background: #D97706; color: #FFF; }
.btn-xs-amber:hover { background: #B45309; }

.btn-xs-outline {
  border-color: #CBD5E1;
  background: #FFF;
  color: #334155;
}
.btn-xs-outline:hover { background: #F1F5F9; }

/* Credential Alert Box */
.credentials-alert-box {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border: 2px dashed #059669;
  border-radius: 8px;
  padding: 20px;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credential-badge {
  background: #0F172A;
  color: #F8FAFC;
  font-family: monospace;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 1.15rem;
  letter-spacing: 1px;
}

/* Print Modals & Overlays */
.print-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.print-modal-overlay.active {
  display: flex;
}

.print-modal-container {
  background: #FFFFFF;
  border-radius: 12px;
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
}

.print-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  position: sticky;
  top: 0;
  z-index: 10;
}

.print-modal-body {
  padding: 28px;
  overflow-y: auto;
}

/* =========================================================================
   PRINTABLE DOCUMENTS STYLING (Receipt, Admit Card, Certificate, ID Card)
   ========================================================================= */

/* 1. Official Fee Receipt */
.official-receipt-box {
  border: 2px solid #0B1F3A;
  padding: 24px;
  background: #FFFFFF;
  font-family: Arial, sans-serif;
  color: #1E293B;
  position: relative;
}

.receipt-header-table {
  width: 100%;
  border-bottom: 2px solid #0B1F3A;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.receipt-council-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0B1F3A;
  text-transform: uppercase;
}

.receipt-badge-title {
  display: inline-block;
  background: #0B1F3A;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 4px;
  margin-top: 6px;
  text-transform: uppercase;
}

.receipt-grid-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.88rem;
}

.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.88rem;
}

.receipt-items-table th {
  background: #0B1F3A;
  color: #FFFFFF;
  padding: 8px 10px;
  border: 1px solid #0B1F3A;
}

.receipt-items-table td {
  border: 1px solid #CBD5E1;
  padding: 8px 10px;
}

.receipt-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 10px;
  font-size: 0.84rem;
  text-align: center;
}

/* 2. Official Admit Card */
.official-admit-card {
  border: 2px solid #1E3A8A;
  padding: 24px;
  background: #FFFFFF;
  font-family: Arial, sans-serif;
  color: #1E293B;
}

.admit-header-bar {
  text-align: center;
  border-bottom: 2px solid #1E3A8A;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.admit-candidate-flex {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.admit-photo-box {
  width: 120px;
  height: 140px;
  border: 1px dashed #64748B;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #64748B;
  background: #F8FAFC;
  flex-shrink: 0;
  text-align: center;
  padding: 6px;
}

/* 3. Official Certificate */
.official-certificate-container {
  border: 12px solid #0B1F3A;
  outline: 4px solid #D97706;
  outline-offset: -8px;
  padding: 40px;
  background: #FFFFFC;
  text-align: center;
  color: #1E293B;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.certificate-seal-img {
  width: 75px;
  height: 75px;
  margin: 0 auto 10px;
}

.cert-council-name {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0B1F3A;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cert-hindi-name {
  font-size: 1rem;
  color: #B45309;
  font-weight: 700;
  margin-bottom: 8px;
}

.cert-tagline {
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: #64748B;
  text-transform: uppercase;
}

.cert-ribbon-title {
  display: inline-block;
  border-top: 2px solid #D97706;
  border-bottom: 2px solid #D97706;
  padding: 6px 30px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0B1F3A;
  margin: 22px 0 16px;
  letter-spacing: 2px;
}

.cert-body-text {
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 650px;
  margin: 0 auto 24px;
}

.cert-candidate-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0B1F3A;
  border-bottom: 1px dashed #94A3B8;
  display: inline-block;
  padding: 0 14px;
}

.cert-signatures {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 36px;
  padding-top: 14px;
}

/* 4. Student ID Card */
.official-idcard-badge {
  max-width: 360px;
  margin: 0 auto;
  border: 2px solid #0B1F3A;
  border-radius: 12px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  font-family: Arial, sans-serif;
}

.idcard-header {
  background: #0B1F3A;
  color: #FFFFFF;
  padding: 12px 14px;
  text-align: center;
}

.idcard-body {
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.idcard-photo {
  width: 90px;
  height: 110px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #64748B;
  flex-shrink: 0;
  text-align: center;
}

.idcard-details {
  font-size: 0.82rem;
  line-height: 1.55;
  color: #1E293B;
}

.idcard-footer {
  background: #F8FAFC;
  padding: 8px 12px;
  font-size: 0.72rem;
  color: #64748B;
  text-align: center;
  border-top: 1px solid #E2E8F0;
}

/* PRINT MEDIA QUERY FOR HIGH RESOLUTION OFFICIAL DOCUMENTS */
@media print {
  body * {
    visibility: hidden;
  }
  .printable-area, .printable-area * {
    visibility: visible;
  }
  .printable-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 10px;
  }
  .no-print {
    display: none !important;
  }
}
