/* ── Reset & Base ── */
*{box-sizing:border-box;margin:0;padding:0}
html{font-size:17px;-webkit-text-size-adjust:100%}
body{font-family:'Segoe UI',system-ui,-apple-system,Arial,sans-serif;line-height:1.6;color:#1a2a1e;background:#eef4f0;min-height:100vh}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation}
[hidden]{display:none!important}

/* ── Tokens ── */
:root{
  --g900:#0b1f16;
  --g700:#1a4a3a;
  --g600:#236649;
  --g500:#2d7a5c;
  --g400:#4a9d7a;
  --g200:#b8deca;
  --g100:#e0f0e8;
  --g50:#f0f8f4;
  --blue:#1d4ed8;
  --green:#15803d;
  --amber:#b45309;
  --red:#b91c1c;
  --white:#fff;
  --surface:#fff;
  --border:#d4e5d9;
  --muted:#5a7065;
  --r:14px;
  --r-sm:10px;
  --r-pill:50px;
  --shadow-sm:0 1px 4px rgba(26,74,58,.10);
  --shadow:0 4px 14px rgba(26,74,58,.12);
  --shadow-lg:0 8px 32px rgba(26,74,58,.16);
}

/* ════════════════════════════════════════
   HOME PAGE
════════════════════════════════════════ */

/* ── Header ── */
.site-header{
  background:linear-gradient(135deg,var(--g900) 0%,var(--g700) 60%,var(--g600) 100%);
  color:#fff;
  padding:0 28px;
  height:68px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  position:sticky;top:0;z-index:100;
  box-shadow:0 2px 16px rgba(0,0,0,.3);
}
.header-brand{display:flex;align-items:center;gap:12px;min-width:0}
.crest{
  width:42px;height:42px;flex:none;
  background:rgba(255,255,255,.15);
  border:1.5px solid rgba(255,255,255,.35);
  border-radius:10px;
  display:grid;place-items:center;
  font-family:Georgia,serif;font-size:18px;font-weight:bold;
  letter-spacing:-.5px;
}
.college-name{
  font-size:15px;font-weight:700;line-height:1.25;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.college-sub{font-size:12px;opacity:.65;margin-top:1px}
.btn-register{
  flex:none;
  background:linear-gradient(135deg,#f5a623,#e8891a);
  color:#fff;
  padding:10px 22px;border-radius:var(--r-pill);
  font-size:14px;font-weight:700;letter-spacing:.02em;
  border:none;
  box-shadow:0 3px 10px rgba(245,166,35,.45);
  transition:transform .15s,box-shadow .15s,background .2s;
  white-space:nowrap;
}
.btn-register:hover{
  background:linear-gradient(135deg,#f7b43a,#f0991e);
  transform:translateY(-1px);
  box-shadow:0 5px 16px rgba(245,166,35,.55);
}
.btn-register:active{transform:translateY(0)}

/* ── Alert bar ── */
.alert-bar{
  background:#fffbeb;border:1px solid #fde68a;border-radius:var(--r-sm);
  padding:11px 16px;font-size:15px;margin-bottom:14px;color:#92400e;
  display:flex;align-items:center;gap:8px;
}
.alert-bar::before{content:'⚠';font-size:16px}

/* ── Main wrap ── */
.home-main{max-width:980px;margin:0 auto;padding:22px 18px 56px}

/* ── Course Tabs ── */
.course-tabs{
  display:grid;grid-template-columns:1fr 1fr;
  background:var(--g900);
  border-radius:var(--r) var(--r) 0 0;
  padding:8px 8px 0;
  gap:4px;
}
.ctab{
  flex:1;border:none;
  background:rgba(255,255,255,.07);
  color:rgba(255,255,255,.55);
  border-radius:10px 10px 0 0;
  padding:14px 16px 16px;
  display:flex;flex-direction:column;align-items:center;gap:2px;
  cursor:pointer;
  transition:background .2s,color .2s;
  position:relative;
}
.ctab::after{
  content:'';
  position:absolute;bottom:0;left:16px;right:16px;height:3px;
  background:transparent;border-radius:3px 3px 0 0;
  transition:background .2s;
}
.ctab:hover{background:rgba(255,255,255,.12);color:rgba(255,255,255,.8)}
.ctab.active{background:var(--white);color:var(--g700)}
.ctab.active::after{background:var(--g500)}
.ctab-code{
  font-size:1.3rem;font-weight:800;line-height:1;
  letter-spacing:.01em;
}
.ctab-name{font-size:.78rem;font-weight:500;opacity:.7}
.ctab.active .ctab-name{opacity:.65;color:var(--muted)}

/* ── Panel ── */
.course-panel{
  background:var(--surface);
  border-radius:0 0 var(--r) var(--r);
  box-shadow:var(--shadow-lg);
  border:1px solid var(--border);border-top:none;
  margin-bottom:24px;
  overflow:hidden;
}

/* ── Stat Row ── */
.stats-row{
  display:grid;grid-template-columns:repeat(3,1fr);
  background:linear-gradient(180deg,var(--g50) 0%,var(--white) 100%);
  border-bottom:1px solid var(--border);
}
.stat-box{
  padding:20px 16px 18px;
  text-align:center;
  position:relative;
}
.stat-box+.stat-box{border-left:1px solid var(--border)}
.stat-box::before{
  content:'';
  position:absolute;top:0;left:0;right:0;height:4px;
  border-radius:0;
}
.stat-total::before{background:linear-gradient(90deg,#3b82f6,#6366f1)}
.stat-done::before {background:linear-gradient(90deg,#22c55e,#16a34a)}
.stat-pend::before {background:linear-gradient(90deg,#f59e0b,#ea580c)}
.stat-icon{font-size:1.5rem;margin-bottom:4px;line-height:1}
.stat-num{
  font-size:2.6rem;font-weight:900;line-height:1;
  margin-bottom:4px;
}
.stat-total .stat-num{color:#2563eb}
.stat-done  .stat-num{color:#16a34a}
.stat-pend  .stat-num{color:#b45309}
.stat-label{
  font-size:.75rem;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--muted);
}

/* ── Panel Toolbar ── */
.panel-toolbar{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:14px 18px;
  background:var(--g50);
  border-bottom:1px solid var(--border);
}

/* ── Filter tabs ── */
.filter-tabs{display:flex;gap:6px;flex-wrap:wrap;flex:1;align-items:center}
.ftab{
  padding:7px 16px;
  border:1.5px solid var(--border);
  border-radius:var(--r-pill);
  background:var(--white);
  font-size:.88rem;font-weight:600;
  color:var(--muted);
  transition:all .15s;white-space:nowrap;
}
.ftab:hover{border-color:var(--g400);color:var(--g600);background:var(--g50)}
.ftab.active{
  background:var(--g700);color:#fff;border-color:var(--g700);
  box-shadow:0 2px 8px rgba(26,74,58,.3);
}

/* ── Search ── */
.search-wrap{position:relative}
.search-wrap::before{
  content:'🔍';
  position:absolute;left:12px;top:50%;transform:translateY(-50%);
  font-size:13px;pointer-events:none;opacity:.55;
}
.search-input{
  padding:8px 16px 8px 34px;
  border:1.5px solid var(--border);
  border-radius:var(--r-pill);
  font-size:.88rem;
  width:220px;
  background:var(--white);
  outline:none;
  transition:border-color .2s,box-shadow .2s;
}
.search-input:focus{border-color:var(--g500);box-shadow:0 0 0 3px rgba(45,122,92,.12)}

/* ── Count ── */
.count-line{
  font-size:.82rem;color:var(--muted);
  text-align:right;padding:8px 18px 4px;
}

/* ── Roster ── */
.table-wrap{overflow-x:auto}
.roster{width:100%;border-collapse:collapse;font-size:.93rem}
.roster thead th{
  background:var(--g700);color:#fff;
  padding:11px 14px;
  font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;
  text-align:left;white-space:nowrap;
}
.roster thead th:first-child{padding-left:18px}
.roster tbody tr{border-bottom:1px solid var(--g100);transition:background .1s}
.roster tbody tr:last-child{border-bottom:none}
.roster tbody tr:hover{background:var(--g50)}
.roster td{
  padding:11px 14px;vertical-align:middle;
  overflow-wrap:anywhere;
}
.roster td:first-child{padding-left:18px}
.col-name{font-weight:600;font-size:.97rem}
.col-company{max-width:220px;font-size:.88rem}
.company-address{display:block;font-size:.8rem;color:var(--muted);margin-top:2px}
.loading-cell{
  text-align:center;padding:36px 16px!important;
  color:var(--muted);font-size:.95rem;font-style:italic;
}

/* ── Badges ── */
.status-badge{
  display:inline-flex;align-items:center;gap:4px;
  padding:4px 12px;border-radius:var(--r-pill);
  font-size:.78rem;font-weight:700;letter-spacing:.02em;white-space:nowrap;
}
.badge-done{background:#dcfce7;color:#15803d}
.badge-pending{background:#fef9c3;color:#a16207}

/* ── Footer ── */
.site-footer{
  border-top:1px solid var(--border);
  text-align:center;padding:18px 24px;
  font-size:.82rem;color:var(--muted);
  display:flex;justify-content:center;gap:20px;flex-wrap:wrap;
}

/* ════════════════════════════════════════
   REGISTER PAGE
════════════════════════════════════════ */
.page-register{background:#f0f4fb}

.reg-header{
  background:linear-gradient(135deg,#0f2340 0%,#1e3a5f 60%,#2a5080 100%);
  color:#fff;
  height:60px;padding:0 28px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  box-shadow:0 2px 12px rgba(0,0,0,.25);
}
.reg-back{
  color:rgba(255,255,255,.8);font-size:14px;font-weight:600;
  padding:7px 16px;border-radius:var(--r-pill);
  border:1.5px solid rgba(255,255,255,.3);
  transition:background .15s,color .15s;white-space:nowrap;
}
.reg-back:hover{background:rgba(255,255,255,.15);color:#fff}
.reg-brand{font-size:15px;font-weight:700}

.reg-main{max-width:680px;margin:0 auto;padding:32px 18px 64px}

.reg-title-block{margin-bottom:24px}
.reg-heading{
  font-size:clamp(24px,5vw,36px);font-weight:900;
  color:#1e3a5f;line-height:1.15;margin-bottom:6px;
}
.reg-sub{font-size:15px;color:#3a5a7a;margin-bottom:4px}
.reg-note{font-size:14px;color:#607a9a;font-style:italic}

.reg-card{
  background:#fff;
  border-radius:var(--r);
  box-shadow:0 4px 18px rgba(30,58,95,.10);
  border:1px solid #cdd8ea;
  padding:26px 26px 22px;
  margin-bottom:16px;
}
.reg-step-label{
  font-size:11px;font-weight:800;letter-spacing:.09em;
  text-transform:uppercase;color:#5b92cc;
  margin-bottom:4px;
}
.reg-step-title{
  font-size:19px;font-weight:800;color:#1e3a5f;margin-bottom:4px;
}
.reg-step-desc{font-size:15px;color:#5a6a7a;line-height:1.65;margin-bottom:22px}

.field-group{margin-bottom:16px}
.field-label{
  display:block;font-size:14px;font-weight:700;color:#2a3a4a;margin-bottom:5px;
}
.field-label-guj{display:block;font-size:13px;color:#607a9a;font-weight:400;margin-top:2px}
.field-input,.field-select{
  width:100%;padding:12px 15px;
  border:2px solid #c8d8e8;border-radius:var(--r-sm);
  font-size:16px;background:#fff;color:#1a2a3a;
  outline:none;transition:border-color .2s,box-shadow .2s;
}
.field-input:focus,.field-select:focus{
  border-color:#2f6097;
  box-shadow:0 0 0 3px rgba(47,96,151,.12);
}

.lookup-msg{
  padding:9px 14px;border-radius:var(--r-sm);
  font-size:14px;margin-top:8px;
}
.lookup-msg.error{background:#fef2f2;color:#b91c1c;border:1px solid #fca5a5}
.lookup-msg.info{background:#e8f0f8;color:#1e3a5f;border:1px solid #bfd0e8}

.student-found{
  background:linear-gradient(135deg,#e8f0f8,#f0f6ff);
  border:2px solid #5b92cc;
  border-radius:var(--r);padding:14px 16px;margin:12px 0;
}
.student-found-name{font-size:19px;font-weight:800;color:#1e3a5f;margin-bottom:3px}
.student-found-meta{font-size:13px;color:#3a5a7a}

.confirm-row{
  display:flex;align-items:flex-start;gap:11px;
  padding:13px 0 5px;border-top:1px solid #d0dce8;margin-top:14px;
}
.confirm-row input[type=checkbox]{
  width:20px;height:20px;accent-color:#1e3a5f;
  cursor:pointer;flex-shrink:0;margin-top:2px;
}
.confirm-row label{font-size:14px;color:#2a3a4a;cursor:pointer;line-height:1.5}

.reg-btn{
  width:100%;padding:14px;border:none;
  border-radius:var(--r-sm);cursor:pointer;
  font-size:16px;font-weight:700;letter-spacing:.02em;
  transition:all .18s;
}
.reg-btn:active{transform:scale(.98)}
.reg-btn:disabled{opacity:.48;cursor:not-allowed;transform:none;box-shadow:none!important}

.btn-primary{
  background:linear-gradient(135deg,#1e3a5f,#2a5080);
  color:#fff;
  box-shadow:0 3px 12px rgba(30,58,95,.3);
}
.btn-primary:hover:not(:disabled){
  background:linear-gradient(135deg,#172f4e,#1e3a5f);
  box-shadow:0 5px 18px rgba(30,58,95,.4);
  transform:translateY(-1px);
}
.btn-secondary{
  background:linear-gradient(135deg,#1a4a3a,#236649);
  color:#fff;margin-top:10px;
  box-shadow:0 3px 12px rgba(26,74,58,.3);
}
.btn-secondary:hover:not(:disabled){
  box-shadow:0 5px 18px rgba(26,74,58,.4);
  transform:translateY(-1px);
}

.save-msg{
  padding:10px 14px;border-radius:var(--r-sm);
  font-size:14px;margin-top:10px;
}
.save-msg.error{background:#fef2f2;color:#b91c1c;border:1px solid #fca5a5}
.save-msg.info{background:#e8f0f8;color:#1e3a5f;border:1px solid #bfd0e8}

.success-card{
  background:#fff;border-radius:var(--r);
  box-shadow:0 6px 28px rgba(26,74,58,.14);
  padding:36px 28px;text-align:center;
  border-top:5px solid #22c55e;
}
.success-icon{font-size:3.5rem;margin-bottom:10px}
.success-title{font-size:clamp(22px,4vw,30px);font-weight:900;color:#1a4a3a;margin-bottom:7px}
.success-sub{font-size:15px;color:var(--muted);margin-bottom:22px}
.receipt-table{width:100%;border-collapse:collapse;font-size:15px;text-align:left;margin-bottom:22px}
.receipt-table td{padding:9px 12px;border-bottom:1px solid var(--g100)}
.receipt-table td:first-child{color:var(--muted);font-size:13px;font-weight:600;width:42%}
.receipt-table td:last-child{font-weight:700;color:#1c3a30}
.receipt-table tr:last-child td{border-bottom:none}

/* ════════════════════════════════════════
   MOBILE ≤ 620px
════════════════════════════════════════ */
@media(max-width:620px){
  html{font-size:15px}

  /* Header */
  .site-header{height:auto;padding:12px 14px;flex-wrap:wrap;position:static}
  .header-brand{flex:1;min-width:0}
  .crest{width:36px;height:36px;font-size:15px;border-radius:8px}
  .college-name{font-size:14px}
  .college-sub{font-size:11px}
  .btn-register{font-size:13px;padding:8px 16px}

  /* Main */
  .home-main{padding:12px 10px 48px}

  /* Course tabs */
  .course-tabs{padding:6px 6px 0;gap:3px}
  .ctab{padding:12px 8px 14px}
  .ctab-code{font-size:1.2rem}
  .ctab-name{font-size:.72rem}

  /* Stats: 3-col compact */
  .stats-row{gap:0}
  .stat-box{padding:16px 8px 14px}
  .stat-num{font-size:2.1rem}
  .stat-label{font-size:.7rem}
  .stat-icon{font-size:1.2rem}

  /* Toolbar */
  .panel-toolbar{flex-direction:column;align-items:stretch;gap:8px;padding:12px 12px}
  .filter-tabs{justify-content:center}
  .ftab{font-size:.82rem;padding:6px 13px}
  .search-wrap{width:100%}
  .search-input{width:100%;min-width:0}

  /* Mobile card table */
  .table-wrap{overflow-x:visible}
  .roster,.roster thead,.roster tbody,.roster tr,.roster th,.roster td{display:block}
  .roster thead{position:absolute;width:1px;height:1px;clip:rect(0,0,0,0);overflow:hidden}
  .roster tbody tr{
    background:#fff;
    border-radius:var(--r);
    box-shadow:var(--shadow-sm);
    border:1px solid var(--border);
    margin:0 0 8px;
    padding:10px 12px;
  }
  .roster tbody tr:last-child{border-bottom:1px solid var(--border)}
  .roster tbody tr:hover{background:var(--g50)}
  .roster td{
    display:flex;justify-content:space-between;align-items:flex-start;
    padding:5px 0;
    border-bottom:1px solid #edf3ee;
    font-size:.88rem;
  }
  .roster td:last-child{border-bottom:none;padding-bottom:0}
  .roster td:first-child{padding-top:0}
  .roster td::before{
    content:attr(data-label);
    font-size:.72rem;font-weight:700;color:#8a9e90;
    text-transform:uppercase;letter-spacing:.05em;
    flex:0 0 70px;margin-right:8px;padding-top:2px;
  }
  .col-name{font-size:.93rem}
  .loading-cell{padding:24px 8px!important}

  /* Register mobile */
  .reg-header{height:auto;padding:12px 14px;flex-wrap:wrap;gap:8px}
  .reg-main{padding:20px 12px 52px}
  .reg-card{padding:18px 14px 16px}
  .reg-btn{font-size:15px;padding:13px}
  .field-input,.field-select{font-size:15px;padding:11px 13px}
}

/* ════════════════════════════════════════
   PRINT
════════════════════════════════════════ */
@media print{
  .site-header,.reg-header,.panel-toolbar,.course-tabs,
  .site-footer,.btn-register,.count-line{display:none!important}
  .course-panel{box-shadow:none;border:none}
  .roster thead th{background:#333;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .course-panel[hidden]{display:block!important}
  .table-wrap{overflow:visible}
}
