/* =============================================
   ADMISSION REGISTER — admission-register.css
   Royal Crystal Academy
   ============================================= */

/* ── STATS ROW ───────────────────────────── */
.ar-stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.ar-stat-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ar-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ar-stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.ar-stat-icon.green  { background: #d1fae5; color: #065f46; }
.ar-stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.ar-stat-icon.teal   { background: #ccfbf1; color: #0f766e; }
.ar-stat-icon.orange { background: #ffedd5; color: #c2410c; }
.ar-stat-icon.yellow { background: #fef9c3; color: #a16207; }
.ar-stat-num {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}
.ar-stat-label {
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 3px;
  font-weight: 500;
}

/* ── TOOLBAR ─────────────────────────────── */
.ar-toolbar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ar-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.ar-search-wrap .ar-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 0.95rem;
  pointer-events: none;
}
#arSearch {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: #111827;
  background: #f9fafb;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
#arSearch:focus {
  outline: none;
  border-color: #1d4ed8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29,78,216,0.08);
}
.ar-filter-select {
  padding: 9px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--font-body);
  color: #374151;
  background: #f9fafb;
  cursor: pointer;
  min-width: 130px;
}
.ar-filter-select:focus {
  outline: none;
  border-color: #1d4ed8;
}
.ar-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.ar-toolbar-count {
  font-size: 0.8rem;
  color: #6b7280;
  white-space: nowrap;
  margin-right: 4px;
}
.ar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.ar-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}
.ar-btn-secondary:hover { background: #e5e7eb; }
.ar-btn-primary {
  background: #1d4ed8;
  color: #fff;
}
.ar-btn-primary:hover { background: #1e40af; }
.ar-btn-import {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.ar-btn-import:hover { background: #dcfce7; }

/* ── TABLE CARD ──────────────────────────── */
.ar-table-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  overflow: hidden;
}
.ar-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f3f4f6;
}
.ar-table-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
}
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #f3f4f6;
  white-space: nowrap;
  background: #fafafa;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.82rem;
  color: #374151;
  vertical-align: middle;
}
.data-table tbody tr:hover td { background: #f9fafb; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Column sizing */
.col-serial    { width: 52px; }
.col-admno     { width: 120px; }
.col-name      { min-width: 180px; }
.col-class     { width: 100px; }
.col-dob       { width: 110px; }
.col-admission { width: 110px; }
.col-parent    { min-width: 150px; }
.col-status    { width: 110px; }
.col-actions   { width: 230px; }

.ar-admno {
  font-family: monospace;
  font-size: 0.78rem;
  background: #f3f4f6;
  border-radius: 5px;
  padding: 3px 7px;
  color: #374151;
}
.ar-name { font-weight: 600; color: #111827; font-size: 0.83rem; }
.ar-sub  { font-size: 0.73rem; color: #9ca3af; margin-top: 1px; }
.ar-parent-name { font-weight: 500; font-size: 0.82rem; }

/* Avatars */
.row-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.ar-avatar-male   { background: linear-gradient(135deg,#1d4ed8,#6366f1); }
.ar-avatar-female { background: linear-gradient(135deg,#db2777,#ec4899); }

/* Status badges */
.ar-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.ar-badge-active      { background: #d1fae5; color: #065f46; }
.ar-badge-graduated   { background: #ede9fe; color: #7c3aed; }
.ar-badge-transferred { background: #dbeafe; color: #1d4ed8; }
.ar-badge-withdrawn   { background: #ffedd5; color: #c2410c; }
.ar-badge-deceased    { background: #f3f4f6; color: #6b7280; }

/* Row action buttons */
.row-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.row-action-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.73rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.13s;
  font-family: var(--font-body);
  white-space: nowrap;
}
.row-action-btn:hover { border-color: #1d4ed8; color: #1d4ed8; }
.ar-btn-promote { color: #16a34a !important; border-color: #bbf7d0 !important; }
.ar-btn-promote:hover { background: #f0fdf4 !important; }

/* Empty state */
.ar-no-results {
  display: none;
  text-align: center;
  padding: 48px 24px;
  color: #9ca3af;
}
.ar-no-results-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ── MODALS ───────────────────────────────── */
.ar-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ar-modal-overlay.open { display: flex; }

.ar-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.ar-modal-wide { max-width: 820px; }

.ar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid #f3f4f6;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  border-radius: 16px 16px 0 0;
}
.ar-modal-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
}
.ar-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.13s;
  flex-shrink: 0;
}
.ar-modal-close:hover { background: #e5e7eb; color: #111827; }
.ar-modal-body { padding: 20px 24px; }
.ar-modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

/* Section dividers inside form */
.ar-section-divider {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f3f4f6;
}

/* Form grid */
.ar-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ar-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 120px;
}
.ar-form-group-wide { flex: 2; min-width: 180px; }
.ar-form-group-full { flex: 1 1 100%; }
.ar-form-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #374151;
}
.ar-form-input,
.ar-form-select {
  padding: 9px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--font-body);
  color: #111827;
  background: #fff;
  transition: border-color 0.13s;
  width: 100%;
  box-sizing: border-box;
}
.ar-form-input:focus,
.ar-form-select:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29,78,216,0.08);
}
.ar-form-input[readonly] {
  background: #f9fafb;
  color: #6b7280;
  cursor: default;
}

/* Documents checkboxes */
.ar-docs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 0;
}
.ar-doc-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
  font-weight: 500;
}
.ar-doc-check input[type=checkbox] { cursor: pointer; }

/* ── VIEW MODAL TABS ─────────────────────── */
.ar-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid #f3f4f6;
  padding: 0 24px;
  background: #fafafa;
}
.ar-tab {
  padding: 11px 18px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.13s;
}
.ar-tab:hover { color: #1d4ed8; }
.ar-tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }

.ar-tab-panel { }

/* Profile info grid */
.ar-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.ar-info-row {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid #f9fafb;
}
.ar-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.ar-info-value {
  font-size: 0.87rem;
  color: #111827;
  font-weight: 500;
}

/* Large avatar for view modal */
.ar-avatar-lg {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* Document status rows */
.ar-doc-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.ar-doc-have    { background: #f0fdf4; color: #16a34a; }
.ar-doc-missing { background: #fef2f2; color: #dc2626; }

/* ── PRINT OPTIONS MODAL ─────────────────── */
.ar-print-options { display: flex; flex-direction: column; gap: 10px; }
.ar-print-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.13s;
}
.ar-print-option:hover {
  border-color: #1d4ed8;
  background: #f0f4ff;
}
.ar-print-icon { font-size: 1.5rem; }
.ar-print-label { font-weight: 700; font-size: 0.88rem; color: #111827; }
.ar-print-desc  { font-size: 0.76rem; color: #6b7280; margin-top: 2px; }

/* ── PRINT AREA (screen hidden, print visible) ── */
#arPrintArea { display: none; }

@media print {
  .admin-shell,
  .ar-modal-overlay,
  .ar-toolbar,
  .ar-stats-row,
  .ar-table-card { display: none !important; }

  #arPrintArea {
    display: block !important;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #000;
    padding: 20px;
  }

  #arPrintArea h2 {
    text-align: center;
    font-size: 16px;
    margin: 0 0 4px;
    text-transform: uppercase;
  }
  #arPrintArea h3 {
    text-align: center;
    font-size: 13px;
    margin: 0 0 4px;
    color: #333;
  }
  #arPrintArea h4 {
    font-size: 12px;
    margin: 16px 0 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ccc;
  }
  #arPrintArea p {
    text-align: center;
    font-size: 11px;
    color: #555;
    margin: 0 0 16px;
  }

  .ar-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin-top: 8px;
  }
  .ar-print-table th {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 5px 6px;
    text-align: left;
    font-weight: bold;
  }
  .ar-print-table td {
    border: 1px solid #ccc;
    padding: 4px 6px;
  }
  .ar-print-table tr:nth-child(even) td { background: #fafafa; }
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 1300px) {
  .ar-stats-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .ar-stats-row { grid-template-columns: repeat(2, 1fr); }
  .ar-toolbar    { flex-direction: column; align-items: stretch; }
  .ar-toolbar-right { margin-left: 0; }
  .ar-modal      { max-width: 100%; }
  .ar-view-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ar-stats-row  { grid-template-columns: 1fr 1fr; }
  .ar-form-row   { flex-direction: column; }
  .ar-form-group-wide { flex: 1; }
}
