/* =====================================================
   PurpleLane Project Tracker — Sasi Institute
   Brand: PurpleLane purple + clean academic white
   ===================================================== */
:root {
  --pl-purple-900: #3B0A5E;
  --pl-purple-700: #5E2E91;   /* PurpleLane primary */
  --pl-purple-600: #6D28D9;
  --pl-purple-100: #EFE7FA;
  --pl-purple-50:  #F7F3FC;
  --ink:      #221A33;
  --muted:    #6B6478;
  --bg:       #F4F2F8;
  --card:     #FFFFFF;
  --line:     #E4DEEE;
  --red:      #C0263B;
  --green:    #167A4E;
  --radius:   14px;
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: var(--font-display); }

/* ---------- Header: Sasi logo left, PurpleLane right ---------- */
.site-header { background: #fff; border-bottom: 4px solid var(--pl-purple-700); }

.brand-bar {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand-logo img { height: 56px; width: auto; display: block; }
.brand-title { text-align: center; flex: 1; min-width: 0; }
.brand-title h1 {
  font-size: 24px; font-weight: 800; color: var(--pl-purple-900); letter-spacing: -0.3px;
}
.brand-title h1 span { color: var(--pl-purple-600); }
.brand-title p { font-size: 12.5px; color: var(--muted); }

.nav-bar { background: var(--pl-purple-900); }
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.nav-user { color: #fff; font-weight: 600; font-size: 13.5px; }
.nav-user em { font-style: normal; color: #C8B4E6; font-weight: 500; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: #EDE4F9; text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px;
}
.nav-links a:hover { background: rgba(255,255,255,.12); }
.nav-links .nav-logout { border: 1px solid rgba(255,255,255,.35); }

/* ---------- Layout ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 28px 20px 40px; width: 100%; flex: 1; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h2 { font-size: 22px; color: var(--pl-purple-900); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.text-purple { color: var(--pl-purple-700); font-weight: 600; }
.text-red { color: var(--red); font-weight: 600; }
.eyebrow {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--pl-purple-700);
}
.back-link {
  display: inline-block; margin-bottom: 12px; color: var(--pl-purple-700);
  font-weight: 600; text-decoration: none; font-size: 14px;
}
.back-link:hover { text-decoration: underline; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
.card-title { font-size: 16px; margin-bottom: 14px; color: var(--ink); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

a.team-card { text-decoration: none; color: inherit; display: block; transition: border-color .15s, box-shadow .15s; }
a.team-card:hover { border-color: var(--pl-purple-600); box-shadow: 0 4px 14px rgba(94,46,145,.10); }
.team-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.team-card h3 { font-size: 15.5px; line-height: 1.35; }
.team-card .next-line { margin-top: 10px; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid; white-space: nowrap;
}
.badge-gray   { background:#F3F3F5; color:#5A5A66; border-color:#D9D9E0; }
.badge-sky    { background:#EAF5FC; color:#0B6E99; border-color:#BEE0F2; }
.badge-indigo { background:#EDEDFC; color:#4338CA; border-color:#CDCDF5; }
.badge-purple { background:var(--pl-purple-100); color:var(--pl-purple-700); border-color:#DCC9F2; }
.badge-amber  { background:#FCF4E3; color:#92600A; border-color:#F1DCAE; }
.badge-orange { background:#FDEFE6; color:#B4530A; border-color:#F5D0B4; }
.badge-red    { background:#FCE9EB; color:var(--red); border-color:#F2C2C9; }
.badge-green  { background:#E8F6EE; color:var(--green); border-color:#BCE3CC; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  font-size: 12.5px; background: var(--pl-purple-50); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
}
.chip b { color: var(--pl-purple-700); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px;
}
.field input[type=text], .field input[type=password], .field input[type=email],
.field input[type=date], .field input[type=time], .field input[type=url],
.field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #CFC6DE; border-radius: 9px;
  font: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--pl-purple-600); outline-offset: 0; border-color: var(--pl-purple-600);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error {
  background: #FCE9EB; border: 1px solid #F2C2C9; color: var(--red);
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; margin-bottom: 12px;
}
.form-card { max-width: 640px; }

.member-row {
  display: grid; grid-template-columns: 24px 1fr 1.3fr; gap: 8px;
  align-items: center; margin-bottom: 8px;
}
.member-row input[type=text] {
  padding: 8px 11px; border: 1px solid #CFC6DE; border-radius: 9px; font: inherit;
}
.member-row input[type=radio] { accent-color: var(--pl-purple-700); }
.btn-link {
  background: none; border: none; color: var(--pl-purple-700); font-weight: 600;
  cursor: pointer; font-size: 13.5px; padding: 4px 0;
}
.btn-link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 9px; font-weight: 600;
  font-size: 14px; text-decoration: none; border: none; cursor: pointer; font-family: var(--font-body);
}
.btn-primary { background: var(--pl-purple-700); color: #fff; }
.btn-primary:hover { background: var(--pl-purple-600); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #3A2E52; }
.btn-outline { background: #fff; color: var(--pl-purple-700); border: 1px solid var(--pl-purple-700); }
.btn-block { width: 100%; }
.btn-small { padding: 6px 14px; font-size: 13px; }

/* ---------- Tables (HOD list) ---------- */
.table-card { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); background: var(--pl-purple-50); padding: 11px 16px;
}
td { padding: 12px 16px; border-top: 1px solid var(--line); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--pl-purple-50); }

/* ---------- Ledger (review history) ---------- */
.ledger-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.ledger-item:last-child { padding-bottom: 0; }
.ledger-item .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--pl-purple-700);
  margin-top: 6px; flex-shrink: 0; position: relative; z-index: 1;
}
.ledger-item:not(:last-child)::before {
  content: ''; position: absolute; left: 4.5px; top: 14px; bottom: 0; width: 1px; background: var(--line);
}
.ledger-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ledger-remarks { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

/* ---------- Next review ticket ---------- */
.next-review {
  border: 2px dashed rgba(94,46,145,.45); background: var(--pl-purple-50);
  border-radius: var(--radius); padding: 16px; margin-top: 14px;
}
.next-review strong { display: block; font-size: 17px; margin: 2px 0; }
.next-review em { display: block; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--pl-purple-700); margin-bottom: 8px; }
.next-review.overdue { border-color: rgba(192,38,59,.5); background: #FCF0F1; }
.next-review.overdue em { color: var(--red); }
.link-text { word-break: break-all; margin-top: 6px; }

/* ---------- Misc ---------- */
.flash { max-width: 1080px; margin: 0 0 16px; padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.flash-success { background: #E8F6EE; border: 1px solid #BCE3CC; color: var(--green); }
.flash-error   { background: #FCE9EB; border: 1px solid #F2C2C9; color: var(--red); }

.empty-state {
  border: 1.5px dashed #CFC6DE; border-radius: var(--radius); padding: 28px;
  text-align: center; color: var(--muted); background: #FBFAFD;
}
.empty-state.small { padding: 16px; font-size: 13.5px; text-align: left; }

.member-list { list-style: none; }
.member-list li {
  display: flex; justify-content: space-between; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.member-list li:last-child { border-bottom: none; }

/* ---------- Login ---------- */
.login-wrap { display: flex; justify-content: center; padding: 24px 0; }
.login-card { width: 100%; max-width: 430px; }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.role-tab {
  text-align: center; padding: 9px 4px; border-radius: 9px; font-weight: 600; font-size: 13.5px;
  text-decoration: none; color: var(--muted); border: 1px solid #CFC6DE; background: #fff;
}
.role-tab.active { background: var(--pl-purple-700); border-color: var(--pl-purple-700); color: #fff; }
.login-note {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); line-height: 1.8;
}
.login-note code { background: var(--pl-purple-50); padding: 1px 6px; border-radius: 5px; color: var(--pl-purple-900); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--pl-purple-900); color: #C8B4E6; text-align: center;
  padding: 16px 20px; font-size: 13px;
}
.site-footer strong { color: #fff; }

@media (max-width: 640px) {
  .brand-logo img { height: 40px; }
  .brand-title h1 { font-size: 17px; }
  .brand-title p { font-size: 11px; }
  .field-row { grid-template-columns: 1fr; }
}

/* ---------- Edit team page ---------- */
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.member-row-edit { grid-template-columns: 24px 1fr 1.3fr auto; }
.remove-box { font-size: 12.5px; color: var(--red); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.remove-box input { accent-color: var(--red); }
.danger-card { border-color: #F2C2C9; }
.danger-card .card-title { color: var(--red); }
.delete-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.delete-form input[type=text] {
  padding: 9px 12px; border: 1px solid #F2C2C9; border-radius: 9px; font: inherit; flex: 1; min-width: 200px;
}
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #A31F32; }

/* Official PurpleLane logo (left) — wide wordmark sizing */
.brand-logo img[src*="PurpleLane.svg"] { height: 42px; }
@media (max-width: 640px) { .brand-logo img[src*="PurpleLane.svg"] { height: 30px; } }

/* Official Sasi logo (right) — wide wordmark sizing */
.brand-logo img[src*="sasilogo.png"] { height: 44px; }
@media (max-width: 640px) { .brand-logo img[src*="sasilogo.png"] { height: 30px; } }

/* View tabs (My teams / All teams) + covering note */
.view-tabs { display: inline-flex; border: 1px solid #CFC6DE; border-radius: 9px; overflow: hidden; }
.view-tab { padding: 8px 16px; font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--muted); background: #fff; }
.view-tab.active { background: var(--pl-purple-700); color: #fff; }
.guide-line { margin-top: 6px; }
.covering-note {
  margin-top: 6px; color: #92600A; background: #FCF4E3; border: 1px solid #F1DCAE;
  border-radius: 8px; padding: 6px 10px; display: inline-block;
}

/* Help line under the Sign in button */
.login-help {
  margin-top: 14px; text-align: center; font-size: 12.5px; color: #9A93A8;
}
.login-help a { color: #9A93A8; font-weight: 600; text-decoration: underline; }
.login-help a:hover { color: var(--pl-purple-700); }

/* ---------- Document submissions ---------- */
.docs-state { border-radius: 9px; padding: 9px 12px; font-size: 13.5px; margin-bottom: 12px; }
.docs-state.on  { background: #E8F6EE; border: 1px solid #BCE3CC; color: var(--green); }
.docs-state.off { background: #F3F3F5; border: 1px solid #D9D9E0; color: #5A5A66; }
.docs-toggle-form { margin-bottom: 6px; }
.upload-form input[type=file] {
  width: 100%; padding: 9px 12px; border: 1.5px dashed #CFC6DE; border-radius: 9px;
  font: inherit; background: var(--pl-purple-50);
}
.upload-note { margin-top: 8px; }
.doc-history { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.doc-history-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.doc-list { list-style: none; }
.doc-list li {
  padding: 10px 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
}
.doc-list li:last-child { border-bottom: none; }
.doc-list .doc-main { grid-column: 1; }
.doc-list .doc-meta { grid-column: 1; }
.doc-list .btn { grid-column: 2; grid-row: 1 / span 2; }
.doc-phase {
  display: inline-block; background: var(--pl-purple-100); color: var(--pl-purple-700);
  border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; margin-right: 6px;
}
.doc-file { font-weight: 600; font-size: 14px; word-break: break-all; }

/* Offline review venue line */
.meet-venue {
  font-size: 13.5px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; display: inline-block;
}

/* Edit link on review ledger entries */
.ledger-edit { font-size: 12.5px; font-weight: 600; color: var(--pl-purple-700); text-decoration: none; }
.ledger-edit:hover { text-decoration: underline; }

/* ---------- Principal search & filter bar (themed) ---------- */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--pl-purple-50);
  border: 1px solid #E4D9F2; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(59,10,94,.05);
}
.fb-search { position: relative; flex: 1 1 260px; min-width: 220px; }
.fb-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--pl-purple-700); opacity: .55; pointer-events: none;
}
.fb-search input {
  width: 100%; height: 42px; padding: 0 14px 0 38px;
  border: 1px solid #D9CBEC; border-radius: 10px;
  font: inherit; font-size: 14px; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.fb-search input::placeholder { color: #A99CBF; }
.fb-select {
  height: 42px; padding: 0 36px 0 14px; min-width: 150px;
  border: 1px solid #D9CBEC; border-radius: 10px;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%235E2E91' stroke-width='2' stroke-linecap='round'/></svg>") no-repeat right 13px center;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.fb-search input:hover, .fb-select:hover { border-color: var(--pl-purple-600); }
.fb-search input:focus, .fb-select:focus {
  outline: none; border-color: var(--pl-purple-600);
  box-shadow: 0 0 0 3px rgba(109,40,217,.15);
}
.fb-btn {
  height: 42px; padding: 0 26px; border: none; border-radius: 10px;
  background: var(--pl-purple-700); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.fb-btn:hover { background: var(--pl-purple-600); }
.fb-clear {
  height: 42px; display: inline-flex; align-items: center; padding: 0 16px;
  border: 1px solid #D9CBEC; border-radius: 10px; background: #fff;
  color: var(--pl-purple-700); font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.fb-clear:hover { border-color: var(--pl-purple-600); background: var(--pl-purple-100); }
@media (max-width: 700px) {
  .fb-search, .fb-select, .fb-btn, .fb-clear { flex: 1 1 100%; width: 100%; justify-content: center; }
}

/* Login: 4 role tabs */
.role-tabs { grid-template-columns: repeat(4, 1fr); }
.role-tab { font-size: 12.5px; padding: 9px 2px; }

/* ---------- Super Admin (polished) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: linear-gradient(160deg, #fff 60%, var(--pl-purple-50));
  border: 1px solid #E4D9F2; border-left: 4px solid var(--pl-purple-700);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 1px 3px rgba(59,10,94,.06);
}
.stat-icon { font-size: 18px; line-height: 1; margin-bottom: 6px; }
.stat-card strong { font-size: 30px; line-height: 1.1; font-family: var(--font-display); color: var(--pl-purple-900); }
.stat-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Tables inside admin */
.table-title { padding: 16px 18px 6px; margin: 0; }
tr.static-row { cursor: default; }
tr.static-row:hover { background: var(--pl-purple-50); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.inline-form input[type=text] {
  width: 140px; padding: 8px 10px; border: 1px solid #D9CBEC; border-radius: 9px; font: inherit; font-size: 13px;
}
.inline-form select {
  padding: 8px 30px 8px 10px; border: 1px solid #D9CBEC; border-radius: 9px; font: inherit; font-size: 13px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%235E2E91' stroke-width='2' stroke-linecap='round'/></svg>") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none; max-width: 170px;
}
.inline-form input:focus, .inline-form select:focus { outline: 2px solid var(--pl-purple-600); border-color: var(--pl-purple-600); }

/* Mini action buttons (admin tables) */
.btn-mini, .btn-mini-danger {
  border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all .15s;
}
.btn-mini { background: var(--pl-purple-100); color: var(--pl-purple-700); border: 1px solid #DCC9F2; }
.btn-mini:hover { background: var(--pl-purple-700); color: #fff; }
.btn-mini-danger { background: #fff; color: var(--red); border: 1px solid #F2C2C9; }
.btn-mini-danger:hover { background: var(--red); color: #fff; }

/* Bulk upload */
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; margin-right: 6px;
  background: var(--pl-purple-700); color: #fff; font-size: 13px; font-weight: 700; vertical-align: -3px;
}
.tpl-links { display: flex; gap: 10px; margin: 10px 0 16px; flex-wrap: wrap; }
.tpl-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--pl-purple-50); border: 1px dashed #C9B4E4; border-radius: 999px;
  padding: 6px 14px; color: var(--pl-purple-700); font-weight: 600; font-size: 13px; text-decoration: none;
  transition: all .15s;
}
.tpl-chip:hover { background: var(--pl-purple-100); border-style: solid; }

input[type=file] {
  width: 100%; padding: 10px; border: 1.5px dashed #C9B4E4; border-radius: 10px;
  background: var(--pl-purple-50); font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer;
}
input[type=file]::file-selector-button {
  background: var(--pl-purple-700); color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; margin-right: 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--pl-purple-600); }

.result-list { list-style: none; max-height: 340px; overflow-y: auto; }
.result-list li { padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; font-size: 13.5px; }
.res-ok   { background: #E8F6EE; color: var(--green); }
.res-skip { background: #FCF4E3; color: #92600A; }
.res-error{ background: #FCE9EB; color: var(--red); }

/* Active nav tab */
.nav-links a.active { background: #fff; color: var(--pl-purple-900); }
.nav-links a.active:hover { background: #fff; }

/* Tab-less login */
.login-sub { font-size: 13px; color: var(--muted); margin: -6px 0 16px; }

/* Principal management card */
.principal-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: end; }
@media (max-width: 700px) { .principal-grid { grid-template-columns: 1fr; } }
.principal-reset .btn-mini { margin-top: 2px; }

/* Bulk upload: 3 cards */
.bulk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }

/* Admin students page */
.reg-input { max-width: 110px; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 4px; }
.pager-btn {
  padding: 8px 16px; border-radius: 9px; border: 1px solid #D9CBEC; background: #fff;
  color: var(--pl-purple-700); font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.pager-btn:hover { border-color: var(--pl-purple-600); background: var(--pl-purple-50); }
.pager-btn.disabled { color: #C4BBD4; border-color: #E7E0F1; cursor: default; }
.pager-btn.disabled:hover { background: #fff; }
.pager-info { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- Mentor review schedule ---------- */
.sched-filter { align-items: center; }
.sched-date-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.sched-date { height: 42px; padding: 0 12px; border: 1px solid #D9CBEC; border-radius: 10px; font: inherit; background: #fff; }
.sched-date:focus { outline: none; border-color: var(--pl-purple-600); box-shadow: 0 0 0 3px rgba(109,40,217,.15); }
.sched-card { padding-bottom: 12px; }
.sched-datehead {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--pl-purple-700); margin: 14px 0 4px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.sched-datehead:first-of-type { border-top: none; padding-top: 0; margin-top: 4px; }
.sched-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.sched-item:last-of-type { border-bottom: none; }
.sched-time { min-width: 74px; font-weight: 700; font-size: 14px; color: var(--pl-purple-900); padding-top: 2px; }
.sched-body { flex: 1; min-width: 0; }
.sched-title { font-weight: 700; color: var(--ink); text-decoration: none; }
.sched-title:hover { color: var(--pl-purple-700); }
.sched-mode { margin-top: 3px; }
.sched-mode a { color: var(--pl-purple-700); font-weight: 600; }
.sched-open { align-self: center; white-space: nowrap; }
.overdue-card { border-color: #F2C2C9; background: #FFFBFB; }
.sched-note { margin-top: 4px; }
.sched-note a { color: var(--pl-purple-700); font-weight: 600; }

/* Dashboard banner */
.sched-banner {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  background: var(--pl-purple-50); border: 1px solid #E4D9F2; border-left: 4px solid var(--pl-purple-700);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
  text-decoration: none; color: var(--ink); font-size: 14px;
}
.sched-banner.has-overdue { border-left-color: var(--red); }
.sched-banner:hover { background: var(--pl-purple-100); }
.sched-banner-link { margin-left: auto; font-weight: 700; color: var(--pl-purple-700); }

.result-line { margin: -6px 0 12px; }

/* ============================================================
   MOBILE (≤ 640px) — clean compact layout
   ============================================================ */
@media (max-width: 640px) {

  /* --- Header: logos flank a 2-line title, tight and centered --- */
  .brand-bar { padding: 10px 12px; gap: 10px; }
  .brand-logo img[src*="PurpleLane.svg"] { height: 26px; }
  .brand-logo img[src*="sasilogo.png"]   { height: 28px; }
  .brand-title h1 { font-size: 16.5px; line-height: 1.2; letter-spacing: 0; }
  .brand-title h1 span { display: block; }          /* "PurpleLane" / "Project Tracker" */
  .brand-title p { font-size: 10px; line-height: 1.35; margin-top: 2px; }

  /* --- Purple nav: user line + tidy wrapping chips --- */
  .nav-inner { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .nav-user { font-size: 12.5px; }
  .nav-links { gap: 6px; }
  .nav-links a { font-size: 12px; padding: 7px 11px; }

  /* --- Page chrome --- */
  .container { padding: 14px 12px 40px; }
  h2 { font-size: 21px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head .head-actions, .page-head .btn { width: 100%; }
  .page-head .btn { text-align: center; }
  .view-tabs { width: 100%; display: flex; }
  .view-tabs .view-tab { flex: 1; text-align: center; }

  /* --- Cards & stats --- */
  .card { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 14px; }
  .stat-card strong { font-size: 24px; }
  .two-col { grid-template-columns: 1fr; }
  .principal-grid { grid-template-columns: 1fr; }
  .bulk-grid { grid-template-columns: 1fr; }
  .quick-actions .btn { flex: 1 1 100%; text-align: center; }

  /* --- Tables: horizontal scroll instead of squishing --- */
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-card table { min-width: 560px; }
  .table-card th, .table-card td { padding: 10px 10px; font-size: 13px; }

  /* --- Filter bar: full-width stacked controls --- */
  .filter-bar { padding: 10px; gap: 8px; }
  .fb-search, .fb-select, .fb-btn, .fb-clear { flex: 1 1 100%; width: 100%; }
  .fb-clear { justify-content: center; }
  .sched-date-label { flex: 1 1 100%; }
  .sched-date { flex: 1 1 100%; width: 100%; }

  /* --- Schedule items --- */
  .sched-item { flex-wrap: wrap; gap: 8px; }
  .sched-time { min-width: 58px; font-size: 13px; }
  .sched-open { align-self: flex-start; margin-left: 66px; }
  .sched-banner { gap: 10px; font-size: 13px; padding: 10px 12px; }
  .sched-banner-link { margin-left: 0; flex-basis: 100%; }

  /* --- Forms & inline controls --- */
  .field-row { grid-template-columns: 1fr; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input[type=text], .inline-form select { flex: 1 1 130px; }
  .login-card { padding: 18px 16px; }
  .pager { gap: 10px; }
  .pager-btn { padding: 8px 12px; font-size: 12.5px; }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .brand-title p { display: none; }   /* keep the header to one clean line */
  .nav-links a { padding: 7px 9px; font-size: 11.5px; }
}

/* ---------- Hamburger nav (mobile) ---------- */
.nav-toggle { display: none; }

@media (max-width: 640px) {
  .nav-inner { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .nav-user { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4.5px;
    width: 42px; height: 38px; padding: 0 10px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28);
    border-radius: 9px; cursor: pointer;
  }
  .nav-toggle span {
    display: block; height: 2px; width: 100%; border-radius: 2px;
    background: #fff; transition: transform .22s ease, opacity .18s ease;
  }
  /* burger → X */
  .nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  .nav-links {
    flex-basis: 100%; flex-direction: column; gap: 4px;
    max-height: 0; overflow: hidden; margin-top: 0;
    transition: max-height .28s ease, margin-top .28s ease;
  }
  .nav-links.open { max-height: 420px; margin-top: 10px; }
  .nav-links a {
    display: block; width: 100%; font-size: 13.5px; padding: 11px 12px;
    border-radius: 9px; background: rgba(255,255,255,.06);
  }
  .nav-links a.active { background: #fff; }
  .nav-links .nav-logout { border: 1px solid rgba(255,255,255,.35); margin-top: 2px; text-align: center; }
}
