/* ════════════════════════════════════════════════════════════
   PEAK POTENTIA — TEACHER PORTAL STYLESHEET
   White / ink / teal academic theme. Rounded corners restored.
   Sidebar + table dashboard layout (matches the Peak Potentia
   admin panel look). Shared by teacher.html and ap-teacher.html.
   ════════════════════════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --card: #ffffff;
  --card2: #f6f7f9;
  --card3: #eef1f5;
  --border: #e2e5eb;
  --border2: #cdd3dc;
  --cream: #14161a;
  --muted: #62697a;
  --muted-dim: #97a0b1;

  /* Primary = blue (was teal/gold). Kept the same variable names so
     every existing rule automatically repaints. */
  --teal: #2454c7;
  --teal-light: #3d6ae0;
  --teal-dim: rgba(36, 84, 199, 0.10);
  --gold: #2454c7;
  --gold-dim: rgba(36, 84, 199, 0.10);
  --navy: #14161a;

  --green: #1f8a52;
  --green-dim: rgba(31, 138, 82, 0.12);
  --red: #c23b34;
  --red-dim: rgba(194, 59, 52, 0.12);
  --orange: #b25e18;
  --orange-dim: rgba(178, 94, 24, 0.12);
  --blue: #2454c7;
  --blue-dim: rgba(36, 84, 199, 0.10);
  --purple: #5a4fb8;
  --purple-dim: rgba(90, 79, 184, 0.12);
  --yellow: #8a6d16;
  --yellow-dim: rgba(138, 109, 22, 0.12);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-card-hover: 0 8px 22px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  outline: none;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(20, 20, 15, 0.15);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 20, 15, 0.28);
}

.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
}

.screen.active {
  display: block;
}

#toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  background: var(--cream);
  border: 1px solid var(--cream);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 99999;
  opacity: 0;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s;
  max-width: 90vw;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

#toast.ok {
  background: #1f6b45;
  border-color: #1f6b45;
  color: #fff;
}

#toast.err {
  background: #a13a36;
  border-color: #a13a36;
  color: #fff;
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(20, 20, 15, 0.18);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ════════════════════════════════════════════════
   LOGIN
════════════════════════════════════════════════ */
.login-wrap {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: var(--bg);
  overflow: hidden;
}

.login-deco {
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

.login-left {
  position: relative;
  padding: 56px 60px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  overflow: hidden;
  background: var(--card2);
}

.login-art {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
}

.login-art svg {
  position: absolute;
  bottom: 0;
  left: 0;
}

.login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 46px;
}

.login-brand-name img {
  height: 90px;
  width: 90px;
}

.login-tagline {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin-top: 4px;
}

.login-tagline em {
  font-style: normal;
}

.login-headline {
  position: relative;
  z-index: 2;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 46px;
  line-height: 1.12;
  color: var(--cream);
  margin: 0 0 16px;
  margin-top: -29px;
}

.login-headline em {
  color: var(--teal);
  font-style: italic;
}

.login-sub {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 420px;
  line-height: 1.65;
  margin: 0;
}

.role-pills {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  margin-top: 40px;
}

.role-pill {
  padding: 9px 22px;
  border-radius: 30px;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  transition: all .2s;
}

.role-pill.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

a:hover .role-pill:not(.active) {
  border-color: var(--teal);
  color: var(--teal);
}

.login-right {
  position: relative;
  z-index: 2;
  padding: 64px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}

.lr-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 6px;
}

.lr-tag {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 18px;
}

.teacher-badge {
  display: inline-block;
  background: var(--teal-dim);
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 20px;
  margin-bottom: 22px;
}

.fl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  margin-top: 18px;
}

.fl:first-of-type {
  margin-top: 0;
}

.fi,
.fi2,
.fsel {
  width: 100%;
  padding: 12px 14px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--cream);
  font-size: 13.5px;
  transition: border-color .2s, background .2s;
}

.fi:focus,
.fi2:focus,
.fsel:focus {
  border-color: var(--teal);
  background: var(--bg);
}

.login-btn {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  transition: filter .15s, transform .1s;
}

.login-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.login-btn:active:not(:disabled) {
  transform: scale(.99);
}

.login-btn:disabled {
  opacity: .6;
  cursor: default;
}

.login-err {
  display: none;
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-top: 14px;
}

.login-err:not(:empty) {
  display: block;
}

.login-note {
  text-align: center;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.login-note a {
  color: var(--teal);
  font-weight: 600;
}

/* ════════════════════════════════════════════════
   TOPBAR (used on subject-detail sub-views)
════════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}

.tb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tb-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
}

.tb-name span {
  color: var(--teal);
  font-style: italic;
}

.tb-sub-txt {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted-dim);
  font-weight: 700;
  margin-top: 1px;
}

.tb-badge {
  background: var(--teal-dim);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.breadcrumb {
  font-size: 12.5px;
  color: var(--muted);
}

.bc-cur {
  color: var(--cream);
  font-weight: 600;
}

.back-btn {
  padding: 7px 14px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all .15s;
}

.back-btn:hover {
  color: var(--teal);
  border-color: var(--teal);
}

.tb-sep {
  flex: 1;
}

.tb-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tb-uname {
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
}

.tb-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
}

.signout-btn {
  padding: 8px 16px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all .15s;
}

.signout-btn:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ════════════════════════════════════════════════
   APP SHELL — SIDEBAR + MAIN LAYOUT (dashboard screen)
════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  /* background: var(--card); */
  border-right: 1px solid var(--border);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
}

.sb-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-logo-row img {
  width: 48px;
  height: 48px;
  /* border-radius: 6px; */
  margin-top: 15px;
}

.sb-logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--cream);
}

.sb-logo-text span {
  color: var(--teal);
  font-style: italic;
}

.sb-role-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin: 3px 0 30px 38px;
}
#sb-role-tag{
  margin-top: -15px;
  margin-left: 4.2rem;
}

.sb-menu-lbl {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: 12px;
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: auto;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}

.sb-item .sb-ic {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.sb-item:hover {
  background: var(--card2);
  color: var(--cream);
}

.sb-item.active {
  background: var(--teal-dim);
  color: var(--teal);
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 9px;
  background: var(--card2);
  border: 1px solid var(--border);
  margin-top: 20px;
}

.sb-user .tb-av {
  width: 34px;
  height: 34px;
  font-size: 12px;
  flex-shrink: 0;
}

.sb-user-info {
  flex: 1;
  min-width: 0;
}

.sb-uname {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-uid {
  font-size: 10.5px;
  color: var(--muted);
}

.sb-logout {
  font-size: 15px;
  color: var(--muted);
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.sb-logout:hover {
  color: var(--red);
  background: var(--red-dim);
}

.main-area {
  flex: 1;
  min-width: 0;
  padding: 26px 34px 60px;
}

.topsearch {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.topsearch-input {
  flex: 1;
  max-width: 460px;
  padding: 11px 16px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--cream);
  font-size: 13px;
}

.topsearch-input::placeholder {
  color: var(--muted-dim);
}

.topsearch-input:focus {
  border-color: var(--teal);
  background: var(--bg);
}

.topsearch-bell {
  position: relative;
  font-size: 17px;
  padding: 9px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--card2);
  border: 1px solid var(--border);
}

.topsearch-bell:hover {
  color: var(--teal);
}

.view-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.view-tab {
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}

.view-tab:hover {
  color: var(--cream);
}

.view-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.banner-note {
  background: var(--blue-dim);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 13px;
  color: var(--cream);
  margin-bottom: 20px;
}

.data-view {
  display: none;
}

.data-view.active {
  display: block;
}

.data-table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table-card table {
  width: 100%;
}

.data-table-card th {
  background: var(--card2);
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table-card td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--cream);
}

.data-table-card tr:last-child td {
  border-bottom: none;
}

.row-subject {
  font-weight: 700;
  color: var(--cream);
}

.row-teacher {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.action-link {
  padding: 6px 14px;
  border: 1px solid var(--teal);
  color: var(--teal);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  cursor: pointer;
}

.action-link:hover {
  background: var(--teal);
  color: #fff;
}

.avg-score-badge {
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 20px;
  display: inline-block;
}

.avg-score-badge.high {
  color: var(--green);
  background: var(--green-dim);
}

.avg-score-badge.mid {
  color: var(--gold);
  background: var(--gold-dim);
}

.avg-score-badge.low {
  color: var(--red);
  background: var(--red-dim);
}

.avg-score-badge.none {
  color: var(--muted);
  background: var(--card3);
}

/* ════════════════════════════════════════════════
   PAGE LAYOUT (legacy detail/roster body wrapper)
════════════════════════════════════════════════ */
.page {}

.pc {
  max-width: 1220px;
  margin: 0 auto;
  padding: 36px 32px 64px;
}

.page-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}

.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--cream);
  margin: 0 0 6px;
}

.page-title em {
  color: var(--teal);
  font-style: italic;
}

.page-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 28px;
}

/* ── Stat cards ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-lbl {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 14px;
}

.stat-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.si-teal {
  background: var(--teal-dim);
  color: var(--teal);
}

.si-green {
  background: var(--green-dim);
  color: var(--green);
}

.si-blue {
  background: var(--blue-dim);
  color: var(--blue);
}

.si-yellow {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.si-yellow::before {
  content: "📝";
  font-size: 12px;
}

.stat-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}

.c-teal {
  color: var(--teal);
}

.c-green {
  color: var(--green);
}

.c-blue {
  color: var(--blue);
}

.c-yellow {
  color: var(--yellow);
}

.stat-bar {
  height: 5px;
  background: var(--card3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 9px;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.stat-sub b {
  color: var(--cream);
}

/* ── Payment breakdown ── */
.pay-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}

.pay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.pay-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
}

.pay-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 4px 12px;
  border-radius: 20px;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.pci {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.pci-board {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 5px;
}

.pci-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 10px;
}

.pci-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.pci-key {
  color: var(--muted);
}

.pci-val {
  color: var(--cream);
  font-weight: 600;
}

.pci-bar {
  height: 5px;
  background: var(--card3);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.pci-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
}

.pci-fill.partial {
  background: var(--orange);
}

.pci-fill.low {
  background: var(--red);
}

/* ── Curriculum grid ── */
.curr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.curr-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  padding-left: 24px;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
  overflow: hidden;
}

.curr-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.cc-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.cc-accent.cbse {
  background: var(--teal);
}

.cc-accent.icse {
  background: var(--blue);
}

.cc-accent.ib {
  background: var(--gold);
}

.cc-board-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.cc-board-tag.cbse {
  color: var(--teal);
  background: var(--teal-dim);
}

.cc-board-tag.icse {
  color: var(--blue);
  background: var(--blue-dim);
}

.cc-board-tag.ib {
  color: var(--gold);
  background: var(--gold-dim);
}

.cc-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 3px;
}

.cc-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.cc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cc-stat-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}

.cc-stat-val {
  font-size: 15px;
  font-weight: 700;
}

.cc-pending {
  margin-top: 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--orange);
  background: var(--orange-dim);
  padding: 6px 10px;
  border-radius: 8px;
}

/* ════════════════════════════════════════════════
   SUBJECT DETAIL
════════════════════════════════════════════════ */
.det-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.det-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.det-badge.cbse {
  color: var(--teal);
  background: var(--teal-dim);
}

.det-badge.icse {
  color: var(--blue);
  background: var(--blue-dim);
}

.det-badge.ib {
  color: var(--gold);
  background: var(--gold-dim);
}

.det-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--cream);
}

.det-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.dqs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dqs-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  text-align: center;
  min-width: 100px;
}

.dqs-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
}

.dqs-lbl {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* ── Student roster ── */
.stu-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}

.stu-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
}

.search-box-inp {
  padding: 9px 14px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  color: var(--cream);
  font-size: 12.5px;
  min-width: 220px;
}

.search-box-inp:focus {
  border-color: var(--teal);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 8px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--cream);
}

tr:last-child td {
  border-bottom: none;
}

.s-name-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.s-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.score-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 90px;
}

.score-bar {
  height: 4px;
  background: var(--card3);
  border-radius: 3px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 3px;
}

.score-fill.high {
  background: var(--green);
}

.score-fill.mid {
  background: var(--gold);
}

.score-fill.low {
  background: var(--red);
}

.pay-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 20px;
}

.pay-badge.paid {
  color: var(--green);
  background: var(--green-dim);
}

.pay-badge.pending {
  color: var(--orange);
  background: var(--orange-dim);
}

.pay-badge.overdue {
  color: var(--red);
  background: var(--red-dim);
}

/* ════════════════════════════════════════════════
   ASSIGNMENT / WORKSHEET WORKSPACE
════════════════════════════════════════════════ */
.aw {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.aw-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: var(--card2);
}

.aw-tab {
  padding: 15px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}

.aw-tab:hover {
  color: var(--cream);
}

.aw-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  background: var(--card);
}

.aw-body {
  padding: 26px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.fg label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.ftxt {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--cream);
  font-size: 13px;
  resize: vertical;
  margin-bottom: 18px;
  line-height: 1.6;
}

.ftxt:focus {
  border-color: var(--teal);
}

.drop-zone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-sm);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: border-color .2s, background .2s;
  margin-bottom: 16px;
}

.drop-zone:hover {
  border-color: var(--teal);
  background: var(--teal-dim);
}

.upl-file {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.upl-file-icon {
  font-size: 22px;
}

.upl-file>div:nth-child(2) {
  flex: 1;
}

.upl-rm {
  color: var(--red);
  font-size: 15px;
  padding: 4px 8px;
}

.up-btn {
  padding: 12px 26px;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
}

.up-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.up-btn:disabled {
  opacity: .6;
}

.mark-hd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 14px;
}

.save-btn {
  padding: 9px 18px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}

.save-btn:hover {
  filter: brightness(1.1);
}

.mark-row {
  display: grid;
  grid-template-columns: 1.5fr .6fr .6fr 1.4fr .3fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.m-score,
.m-remarks {
  padding: 8px 10px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 7px;
  color: var(--cream);
  font-size: 12.5px;
}

.m-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  justify-self: center;
}

.m-dot.saved {
  background: var(--green);
}

.m-dot.unsaved {
  background: var(--muted-dim);
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.fc {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.fc:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.fc.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.sub-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.sub-row:last-child {
  border-bottom: none;
}

.sub-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cream);
}

.sub-view {
  padding: 6px 14px;
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}

.sub-view:hover {
  background: var(--teal);
  color: #fff;
}

.not-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-dim);
  padding: 5px 11px;
  border-radius: 8px;
}

.notice-form {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 22px;
}

.notice-list-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.notice-list-hd {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.n-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.n-row:last-child {
  border-bottom: none;
}

.n-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }

  .login-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 40px 30px;
  }

  .login-right {
    padding: 40px 30px;
    max-width: 100%;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .mark-row {
    grid-template-columns: 1.5fr .7fr 1fr;
  }

  .mark-row>div:nth-child(3),
  .mark-row .m-dot {
    display: none;
  }

  .topbar {
    padding: 12px 18px;
  }

  .pc {
    padding: 24px 16px 48px;
  }

  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
  }

  .sb-role-tag {
    display: none;
  }

  .sb-nav {
    flex-direction: row;
    margin-bottom: 0;
  }

  .sb-user {
    margin-top: 0;
    margin-left: auto;
  }

  .main-area {
    padding: 20px 16px 48px;
  }
}

/* ════════════════════════════════════════════════
   PROFESSIONAL CARD SHADOWS (blue / white / grey theme)
════════════════════════════════════════════════ */
.stat-card,
.data-table-card,
.curr-card,
.dqs-box,
.stu-card,
.aw,
.wk-card,
.upload-form-wrap,
.notice-list-card,
.sub-review-modal,
.module-sidebar,
.roster-toggle,
.mod-tab,
.pci {
  box-shadow: var(--shadow-card);
}

.curr-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.wk-card:hover {
  box-shadow: var(--shadow-card-hover);
}

#toast {
  box-shadow: var(--shadow-card-hover);
}

.login-right,
.login-left {
  box-shadow: none;
}

/* ════════════════════════════════════════════════
   MODULE SIDEBAR (left-hand module navigation, styled like
   an IDE explorer panel — icon + label + active accent bar)
════════════════════════════════════════════════ */
.subject-workspace {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.module-sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 10px 14px;
  position: sticky;
  top: 90px;
}

.module-sidebar-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted-dim);
  padding: 10px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.module-sidebar-title::before {
  content: "📁";
  font-size: 12px;
}

.mod-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 10px 9px 9px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all .12s;
}

.mod-tab:hover {
  background: var(--card2);
  color: var(--cream);
}

.mod-tab.active {
  background: var(--teal-dim);
  color: var(--teal);
  font-weight: 700;
  border-left-color: var(--teal);
}

.mod-tab .mod-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: var(--card3);
  color: var(--muted);
  border-radius: 20px;
  padding: 1px 7px;
}

.mod-tab.active .mod-count {
  background: var(--teal);
  color: #fff;
}

.module-main {
  flex: 1;
  min-width: 0;
}

/* Breadcrumb trail above the module workspace — mirrors an
   editor's "file > symbol > symbol" path indicator */
.workspace-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin: -6px 0 16px;
  padding: 8px 12px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.workspace-breadcrumb b {
  color: var(--teal);
  font-weight: 700;
}

.workspace-breadcrumb .bc-sep {
  opacity: .5;
}

@media (max-width: 860px) {
  .subject-workspace {
    flex-direction: column;
  }

  .module-sidebar {
    width: 100%;
    position: relative;
    top: 0;
  }

  .mod-tab {
    width: auto;
  }
}

/* ════════════════════════════════════════════════
   SIDEBAR — restyled to look like a VS Code Explorer panel:
   dark rail, file-tree style nav items, blue active accent,
   account info pinned to the BOTTOM-LEFT (not top-right).
════════════════════════════════════════════════ */
.sidebar {
  background: #010a2f;
  border-right: 1px solid #14151b;
  /* height: 100vh;
  min-height: 100vh;
  overflow: hidden; */
}

.sb-logo-row {
  padding: 4px 2px 0;
}

/* .sb-logo-row img {
  border-radius: 5px;
} */

.sb-logo-text {
  color: #eef0f4;
  font-size: 15.5px;
}

.sb-logo-text span {
  color: #6f9bff;
}

.sb-role-tag {
  color: #6f9bff;
  opacity: .85;
}

.sb-menu-lbl {
  color: #6b7080;
}

.sb-item {
  color: #b6bac6;
  border-left: 3px solid transparent;
  border-radius: 4px;
  padding-left: 9px;
}

.sb-item:hover {
  background: #262832;
  color: #eef0f4;
}

.sb-item.active {
  background: rgba(111, 155, 255, .14);
  color: #a9c4ff;
  border-left-color: #6f9bff;
  font-weight: 700;
}

.sb-user {
  background: #22242d;
  border: 1px solid #2c2e39;
}

.sb-user .tb-av {
  background: #6f9bff;
  color: #0e0f14;
}

.sb-uname {
  color: #eef0f4;
}

.sb-uid {
  color: #7d8394;
}

.sb-logout {
  color: #8d92a0;
}

.sb-logout:hover {
  color: #ff8a80;
  background: rgba(255, 138, 128, .12);
}