:root{
  --blue:#3f5d8a;
  --blue2:#2f4d7a;
  --bg:#eef3fb;
  --card:#ffffff;
  --muted:#6b778c;
  --text:#0f172a;
  --border:#dbe3f2;
  --shadow: 0 12px 30px rgba(15, 23, 42, .10);
  --radius: 18px;
}
html.app-ready body{
  visibility: visible;
}
*{ box-sizing:border-box; }
html,body{ 
  height:100%;
  max-width: 100%;
  overflow-x: hidden;
}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background: linear-gradient(#f4f7ff, #e8effb);
}

/* =========================
   TOP BAR (HEADER)
========================= */
.topbar{
  background: var(--blue);
  color:#fff;
  padding: 10px 0;          /* was 10px 8px */
  position: sticky;
  top:0;
  z-index:10;
}
.topbar-inner{
  width: 100%;
  max-width: none;          /* ✅ remove max width */
  margin: 0;                /* ✅ no centering gap */
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px;          /* ✅ consistent edge padding */
}
.brand{
  display:flex;
  align-items:center;
  gap: 6px;              /* ✅ tiny space between logo/text */
}

.logo-badge{
  width:42px;
  height:42px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:#fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.logo-badge.big{
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.logo-badge img{
  width:100%;
  height:100%;
  object-fit: contain;
  padding: 4px;
  display:block;
  background:#fff;
}

.brand-title{
  font-weight: 700;
  font-size: 14px;
  line-height:1.2;
}
.brand-sub{
  font-size: 12px;
  opacity:.9;
}

/* Bigger header text inside Admit Card only */
#admitCardWrap .brand-title{
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}
#admitCardWrap .brand-sub{
  font-size: 13px;
  font-weight: 800;
  opacity: 0.95;
}

.nav{
  display:flex;
  gap: 6px;              /* ✅ buttons closer */
  align-items:center;
  margin-left: auto;     /* ✅ REALLY pushes nav to right */
}

.user-menu{
  position: relative;
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: 6px;      /* ✅ avatar near Contact */
}
.user-menu.active{
  display: flex;
}
.user-avatar{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: var(--blue2);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  cursor:pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
.user-dropdown{
  position: absolute;
  right: 0;
  top: 42px;
  background:#fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding: 6px 0;
  min-width: 160px;
  display:none;
  z-index: 20;
}
.user-dropdown.open{
  display:block;
}
.dropdown-item{
  width:100%;
  text-align:left;
  padding: 8px 14px;
  border:none;
  background:transparent;
  font-size: 13px;
  font-weight: 700;
  cursor:pointer;
}
.dropdown-item:hover{
  background:#f4f7ff;
}

.pill{
  border:1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.12);
  color:#fff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 600;
}
.pill:hover{ background: rgba(255,255,255,.20); }
.pill-disabled{
  opacity:.5;
  cursor:not-allowed;
}

/* =========================
   PAGE / VIEWS
========================= */
.page{
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 18px 90px;
  min-height: calc(100vh - 120px);
}
.view{ display:none; }
.view.active{ display:block; }

/* =========================
   HOME HERO
========================= */
.hero-card{
  margin: 28px auto 0;
  max-width: 860px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 44px 34px;
  text-align:center;
  position: relative;
  overflow:hidden;
}
.hero-card::before{
  content:"";
  position:absolute;
  right:-140px; top:-160px;
  width: 360px; height: 360px;
  background: radial-gradient(circle at 30% 30%, rgba(63,93,138,.30), rgba(63,93,138,0));
  transform: rotate(20deg);
}
.hero-card h1{
  margin:0;
  font-size: 46px;
  letter-spacing: .2px;
}
.subtext{
  margin: 12px 0 26px;
  color: var(--muted);
  font-weight: 600;
}
.cta-row{
  display:flex;
  justify-content:center;
  gap: 14px;
  margin-bottom: 18px;
}
#homeCtaRow{ flex-wrap: wrap; }

.chip{
  display:inline-block;
  border: 1px dashed #c7d4ef;
  color:#24324a;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 700;
  background:#f6f9ff;
}

/* =========================
   BUTTONS / CARDS
========================= */
.btn{
  border:1px solid var(--border);
  background:#fff;
  color:#15223a;
  padding: 10px 16px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
}
.btn:hover{ filter: brightness(.98); }
.btn.primary{
  background: var(--blue2);
  color:#fff;
  border-color: rgba(255,255,255,.0);
}
.btn.secondary{ background:#f4f7ff; }
.btn.small{ padding: 8px 12px; border-radius: 10px; }

.form-card, .login-card, .admit-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 920px;
  margin: 18px auto 0;
  padding: 20px;
}

/* ===============================
   ✅ ADMIT CARD AS A REAL TABLE BOX
   - Now supports 3 columns (photo/sign inside table)
   - Includes Instructions sub-table
================================= */

#admitCardWrap{
  background:#fff;
  padding: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.admit-table-box{
  border: 2px solid #000;
  background:#fff;
  overflow: visible;
}

#admitCardWrap::before,
#admitCardWrap::after{
  content: none !important;
}

/* Header row */
.admit-top{
  position: relative;
  display:flex;
  justify-content:center;
  align-items:center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #000;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
}

.admit-date{
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.admit-brand{
  display:flex;
  align-items:center;
  gap: 12px;
}

/* Title row */
.admit-title{
  width: 100%;
  text-align:center;
  padding: 10px 14px;
  font-size: 20px;
  font-weight: 900;
  border-bottom: 1px solid #000;  /* ✅ divider line under heading */
  border-left: 1px solid #000;
  border-right: 1px solid #000;
}

/* Remove old admit-media row completely */
.admit-media{ display:none !important; }

/* DETAILS area now is a real 3-column grid */
.admit-details{
  margin: 0;
  padding: 0;
}

/* 3-column grid */
.admit-details-grid{
  position: relative;
  border-left: 1px solid #000;
  border-right: 1px solid #000;

  /* reserve space so rows never go under media column */
  padding-right: 220px;
}

.admit-details-grid .row{
  display:grid;
  grid-template-columns: 260px 1fr; /* ✅ only 2 columns now */
  border-bottom: 1px solid #000;
}

.admit-details-grid .row .k,
.admit-details-grid .row .v{
  padding: 8px 10px;
  font-size: 12px;
  color:#000;
  font-weight: 800;
}

.admit-details-grid .row .k{
  font-weight: 900;
  border-right: 1px solid #000;
}

/* ✅ media column floats and never changes row height */
.mediaCell{
  position: absolute;
  top: 0;
  right: 0;
  width: 220px;
  height: 100%;
  border-left: 1px solid #000;
  padding: 10px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  background:#fff;
  border-bottom: 1px solid #000;
}

/* smaller photo/sign sizes */
.photo-box.small{
  width: 180px;
  height: 180px;
  border: 1px solid #000;
  border-radius: 10px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.photo-box.small img{
  width:100%;
  height:100%;
  object-fit: cover;
}

.sig-box.small{
  width: 180px;
  text-align:center;
}
.sig-box.small .sig-label{
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  color:#000;
}
.sig-box.small img{
  width: 100%;
  height: 50px;
  object-fit: contain;
  border: 1px solid #000;
  border-radius: 8px;
  background:#fff;
}

/* Instructions sub-table connected to outer borders */
.instructionsTable{
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}
.instHead{
  padding: 8px 10px;
  font-weight: 900;
  border-bottom: 1px solid #000;
}
#acInstructions .instRow{
  padding: 8px 10px;
  border-bottom: 1px solid #000;
  font-weight: 800;
  font-size: 12px;
  color:#000;
}
#acInstructions .instRow:last-child{
  border-bottom: none;
}

/* Officer signature row (reuse existing kv styles) */
.kv{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  border-bottom: 1px solid #000;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
}
.kv.examiner-row{ border-bottom: none; }
.examiner-row{ border-top: 1px solid #000; }

.k, .v{
  padding: 8px 10px;
  font-size: 12px;
  color:#000;
}
.k{ font-weight: 900; }
.v{ font-weight: 800; }

.examiner-sign{
  display:flex;
  flex-direction: column;
  align-items:flex-end;
  gap: 6px;
}
.examiner-sign img{
  width: 140px;
  height: auto;
  object-fit: contain;
  opacity: 0.95;
}
.examiner-text{
  font-weight: 800;
  font-size: 12px;
  color:#000;
  text-align:right;
}

/* buttons area (outside table border) */
.admit-actions{
  display:flex;
  justify-content:flex-end;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

/* =========================
   FORMS / GRID
========================= */
.form-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.form-header h2{ margin:0; font-size: 18px; }
.muted{ margin: 4px 0 0; color: var(--muted); font-weight: 600; font-size: 12px; }

.tag{
  font-size: 11px;
  font-weight: 800;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #cbd7f1;
  background: #f6f9ff;
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  padding-top: 14px;
}
@media (max-width: 900px){
  .grid-2{ grid-template-columns: 1fr; }
  .cta-row{ flex-direction: column; }
}

.field label{
  display:block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}
.req{ color:#d12c2c; }
.field input, .field select{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline:none;
  background:#fff;
}
.field input:focus, .field select:focus{
  border-color:#b6c7ee;
  box-shadow: 0 0 0 4px rgba(99, 136, 255, .10);
}

.hint{
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.side-by-side{
  margin-top: 14px;
  align-items:start;
}

.upload-box{
  border: 1px dashed #c9d7f2;
  border-radius: 14px;
  padding: 14px;
  background:#f7faff;
}
.upload-title{ font-weight: 900; font-size: 13px; }
.upload-sub{
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  margin-top: 4px;
}
.upload-row{ margin-top: 10px; }

.preview{
  margin-top:10px;
  border:1px solid #dbe6fb;
  border-radius:12px;
  background:#fff;
  height:160px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.preview img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
  background:#fff;
}
.preview-placeholder{
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.form-actions{
  display:flex;
  gap: 12px;
  justify-content:center;
  margin-top: 16px;
}
.note{
  text-align:center;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  margin-top: 10px;
}

/* Login */
.login-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.login-head h2{ margin:0; }
.login-actions{
  display:flex;
  gap: 12px;
  margin-top: 14px;
}

/* Footer */
.footer{
  position: fixed;
  bottom:0; left:0; right:0;
  background: var(--blue);
  color:#fff;
  text-align:center;
  padding: 12px 10px;
  font-weight: 800;
  font-size: 14px;
  border-top: 1px solid rgba(255,255,255,.2);
}

/* Toast */
.toast{
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color:#fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12px;
  opacity: 0;
  pointer-events:none;
  transition: opacity .2s ease;
}
.toast.show{ opacity: 1; }

/* ===============================
   PRINT
================================= */
@media print{
  @page{
    size: A4;
    margin: 10mm;
  }

  header.topbar,
  footer.footer,
  .admit-actions,
  .toast{
    display:none !important;
  }

  html, body{
    background:#fff !important;
    height:auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page{
    max-width:none !important;
    padding:0 !important;
    margin:0 !important;
    min-height:auto !important;
  }

  #view-admit{ display:block !important; }

  .admit-card{
    box-shadow:none !important;
    border:none !important;
    padding:0 !important;
    margin:0 !important;
    max-width:none !important;
  }

  #admitCardWrap{
    width: 100% !important;
    max-width: 190mm !important;
    margin: 0 auto !important;
    box-shadow:none !important;
    border:none !important;
    overflow: visible !important;
  }
  .admit-table-box{
    border: 2px solid #000 !important;
    overflow: visible !important;
  }

  #admitCardWrap, .admit-top, .admit-title, .admit-details{
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Links under forms */
.form-link{
  margin-top: 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}
.link-btn{
  border: none;
  background: transparent;
  color: var(--blue2);
  font-weight: 900;
  cursor: pointer;
  padding: 0 4px;
}
.link-btn:hover{ text-decoration: underline; }

/* Table wrap */
.table-wrap{
  margin-top: 14px;
  overflow:auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:#fff;
}
.data-table{
  width:100%;
  border-collapse: collapse;
  min-width: 860px;
}
.data-table th, .data-table td{
  padding: 10px 12px;
  border-bottom: 1px solid #e7eefc;
  font-size: 12px;
  font-weight: 700;
  text-align:left;
  vertical-align: top;
}
.data-table th{
  background: #f6f9ff;
  font-weight: 900;
  color:#2b3b57;
}
.row-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.cell-input{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline:none;
}
.btn.danger{
  background: #ffecec;
  border-color: #ffcdcd;
  color:#8a1f1f;
}

/* Admit blocked */
.admit-blocked{
  max-width: 900px;
  margin: 18px auto;
  border: 1px solid #ffd7d7;
  background: #fff5f5;
  border-radius: 14px;
  padding: 16px 18px;
}
.admit-blocked h3{
  margin: 0 0 8px 0;
  font-size: 18px;
}
.admit-blocked .blocked-reason{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #ffe0e0;
}
.blocked-reason-title{
  font-weight: 800;
  margin-bottom: 6px;
}
.hidden{ display: none !important; }

/* Table edit inputs */
.data-table input,
.data-table select{
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #dbe6fb;
  outline: none;
  background: #fff;
}
.data-table td{ vertical-align: top; }

.badge{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #dbe6fb;
}
.badge.approve{ background: #ecfff3; border-color:#bfe7cf; }
.badge.reject{ background: #fff0f0; border-color:#f0bcbc; }
.badge.pending{ background: #f5f8ff; border-color:#dbe6fb; }

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: grid;
  place-items: center;
  z-index: 9999;
}
.modal-card{
  width: min(520px, 92vw);
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
}
.modal-title{
  font-weight: 900;
  margin-bottom: 10px;
}
#rejectReasonInput{
  width: 100%;
  border: 1px solid #dbe6fb;
  border-radius: 12px;
  padding: 10px;
  resize: vertical;
}
.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top: 10px;
}

/* Blur background when modal open (for center modal etc.) */
body.modal-open .page{
  filter: blur(2px);
}

/* Applicants Details full width */
#view-applicants-details{
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 18px;
}
#view-applicants-details .form-card.wide{
  max-width: none !important;
  width: 100% !important;
  margin: 18px 0 0 !important;
}
#view-applicants-details .app-toolbar{
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  margin: 14px 0;
}
#view-applicants-details .applicants-table-scroll{
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  max-height: calc(100vh - 260px);
}
#view-applicants-details .data-table{
  width: max-content;
  min-width: 1750px;
  border-collapse: collapse;
}
#view-applicants-details .data-table th,
#view-applicants-details .data-table td{
  white-space: nowrap;
  font-size: 13px;
}
#view-applicants-details .data-table thead th{
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f6f9ff;
}
#view-applicants-details .data-table td:last-child,
#view-applicants-details .data-table th:last-child{
  min-width: 180px;
}

/* Contact table */
#view-contact .kv{
  display:grid;
  grid-template-columns: 220px 1fr;
  border-bottom:none;
}
#view-contact .k, 
#view-contact .v{
  padding: 12px 12px;
  font-size: 14px;
}

#publicContactTable{
  min-width: 100%;
}

#publicContactTable th,
#publicContactTable td{
  white-space: normal;
}

/* Loading overlay */
.loading-overlay{
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.45);
  backdrop-filter: blur(1px);
  display: grid;
  place-items: center;
  z-index: 100000;
}
.loading-overlay.hidden{ display: none; }
.spinner{
  width: 60px;
  height: 60px;
  border: 6px solid #dbe3f2;
  border-top-color: var(--blue2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin{ to { transform: rotate(360deg); } }

.app-summary{
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #f6f9ff;
  border-radius: 14px;
  font-weight: 800;
  text-align: center;
}
.app-summary .muted{
  margin-top: 6px;
  display:block;
}
/* Home hero top chip */
.home-chip-top{
  display:flex;
  justify-content:center;
  margin-bottom: 14px;
}

/* Logged in "Hello, Name" + summary line */
#homeSubText{
  margin: 10px 0 8px;
  font-weight: 800;
  color: #24324a;
}

#employeeAppSummary{
  margin: 8px 0 18px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  text-align: center;
  font-weight: 800;
}

#employeeAppSummary .muted{
  display: inline;
  font-weight: 700;
  color: var(--muted);
}
#empRegSuccessBox{
  margin-top: 14px;
}
.chip-approved{
  background:#e9fff0;
  color:#0f6a35;
  border:1px solid #bde6ca;
}

.chip-rejected{
  background:#fff0f0;
  color:#9c1f1f;
  border:1px solid #efc2c2;
}
.status-action-box{
  min-width: 200px;
}
.status-action-box .status-initial,
.status-action-box .status-approve-confirm{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.status-reject-text{
  width:100%;
  min-height:80px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
  resize:vertical;
}
.applicant-view-card.full-page{
  max-width: none !important;
  width: calc(100vw - 36px);
  min-height: calc(100vh - 140px);
}
#view-applicant-view{
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 18px;
}
.password-wrap{
  position: relative;
}
.password-wrap input{
  padding-right: 46px !important;
}
.password-toggle{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  color: var(--blue2);
}
.password-toggle:hover{
  text-decoration: underline;
}
.notifications-card{
  max-width: 860px;
  margin: 18px auto 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.notifications-head h3{
  margin: 0;
  font-size: 20px;
}

.notifications-scroll{
  margin-top: 12px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9fbff;
}

.notification-item{
  padding: 12px 14px;
  border-bottom: 1px solid #e7eefc;
}

.notification-item:last-child{
  border-bottom: none;
}

.notification-date{
  font-size: 12px;
  font-weight: 900;
  color: var(--blue2);
  margin-bottom: 6px;
}

.notification-text{
  font-size: 13px;
  font-weight: 700;
  color: #24324a;
  white-space: pre-wrap;
  word-break: break-word;
}

.notification-empty{
  padding: 18px 14px;
  color: var(--muted);
  font-weight: 800;
}
#applicantViewDeleteBtn{
  margin-right: auto;
}
#view-batch-center .chip{
  min-width: 70px;
  text-align: center;
}

#presentBatchTable td,
#savedBatchTable td{
  vertical-align: middle;
}











