:root {
  --bg: #777;
  --panel: #c0c0c0;
  --soft-panel: #f5f5f5;
  --teal: #008080;
  --teal-dark: #008080;
  --teal-mid: #008080;
  --student-primary: #234569;
  --student-dark: #234569;
  --text: #2f2f2f;
  --white: #f5f5f5;
  --shadow: rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 10px;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: calc(100vh - 20px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen {
  display: none;
  width: 100%;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 8px 18px var(--shadow);
  padding: 18px;
  text-align: center;
}

.screen.active {
  display: block;
}

h1,
h2,
h3 {
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  font-weight: normal;
  margin-top: 0;
  color: var(--teal);
}

.admin-theme {
  background: #a8a8a8;
}

.admin-theme h2,
.admin-theme h3 {
  color: var(--teal-dark);
}

.student-theme {
  background: #a8a8a8;
}


.student-theme h1 {color: var(--student-dark);}
.student-theme h2 {color: var(--student-dark);}
.student-theme h3 { color: var(--student-dark);}

.student-theme {
  --teal: #234569;
  --teal-dark: #234569;
  --teal-mid: #234569;
}

.student-theme .auth-box {
  border-color: rgba(35, 69, 105, 0.35);
}

.student-theme input,
.student-theme select {
  border-color: #234569;
  color: #234569;
}

.student-theme button {
  background: #234569;
}

.student-theme h1,
.student-theme h2,
.student-theme h3 {
  color: #234569;
}

.app-logo {
  width: 38vw;
  max-width: 120px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 15px;
  display: block;
}

#auth-screen.student-theme {
  --teal: #234569;
  --teal-dark: #234569;
  --teal-mid: #234569;
  --student-primary: #234569;
  --student-dark: #234569;
}

#auth-screen.student-theme h1,
#auth-screen.student-theme h2,
#auth-screen.student-theme h3 {
  color: #234569;
}

#auth-screen.student-theme button {
  background: #234569;
}

#auth-screen.student-theme input,
#auth-screen.student-theme select {
  border-color: #234569;
  color: #234569;
}

#auth-screen.student-theme .auth-box {
  border-color: rgba(35, 69, 105, 0.35);
}


.subtitle,
.helper-text,
.mini-text {
  color: #444;
  font-size: 0.95rem;
  line-height: 1.4;
}

.auth-box {
  background: var(--soft-panel);
  border-radius: 14px;
  padding: 16px;
  margin-top: 18px;
  border: 1px solid rgba(0, 128, 128, 0.25);
}

.hidden {
  display: none;
}

input,
select {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid var(--teal);
  font-size: 1rem;
  color: var(--teal-dark);
  margin: 10px 0 14px;
  background: var(--white);
}

#modify-subject-select {
  min-height: 64px;
  padding: 18px;
  font-size: 1.1rem;
}


button {
  border: 0;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 1rem;
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  color: var(--white);
  background: var(--teal);
  box-shadow: 0 4px 8px rgba(0,0,0,0.16);
  width: 100%;
  min-height: 48px;
}

button:active {
  transform: scale(0.97);
}

.admin-theme button {
  background: var(--teal-dark);
}

.student-theme button {
  background: var(--student-dark);
}

.small-btn {
  width: auto;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.top-bar,
.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-bottom: 2px solid rgba(0, 0, 0, 0.18);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.home-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  text-align: left;
  padding: 18px;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: white;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-btn {
  text-align: left;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap; 
  overflow-x: auto;
   flex-shrink: 0; 
  gap: 10px;     
  justify-content: space-between;
  align-items: center;
}

.dashboard-section {
  background: var(--soft-panel);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  text-align: left;
}

.task-card {
  background: #f5f5f5;
  border-radius: 14px;
  padding: 14px;
  text-align: left;
  border-left: 6px solid var(--student-dark);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  margin-bottom: 10px;
}

.admin-task-card {
  border-left-color: var(--teal-dark);
}

.task-title {
  font-weight: bold;
  color: #222;
  margin-bottom: 5px;
}

.task-meta {
  font-size: 0.85rem;
  color: #555;
}


.status-pill {
  display: inline-block;     
  
  margin-top: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #e5e4e2;
  color: #222;
}

.error-message {
  color: #8b0000;
  font-weight: bold;
  min-height: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: var(--soft-panel);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--teal-dark);
}
.subject-panel h3 {
  margin-bottom: 14px;
}

.subject-add-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.subject-add-row input {
  margin: 0;
}

.enter-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 14px;
  font-size: 1.4rem;
  font-family: Arial, sans-serif;
}

.pending-subject-chip {
  background: #e5e4e2;
  color: #333;
  border-radius: 999px;
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pending-subject-chip button {
  width: auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.75rem;
  margin-left: 8px;
}

.save-btn {
  margin-top: 12px;
}

#modify-subject-box {
  margin-top: 12px;
}

.status-action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.status-display {
  background: #e5e4e2;
  color: #333;
  border-radius: 12px;
  padding: 12px;
  font-weight: bold;
  text-align: left;
  font-size: 0.95rem;
}

.status-toggle-btn {
  width: auto;
  min-width: 130px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.8rem;
}

@media (max-width: 420px) {
  .status-action-row {
    grid-template-columns: 1fr;
  }

  .status-toggle-btn {
    width: 100%;
  }
}

.subject-heading {
  background: var(--teal-dark);
  color: var(--white);
  padding: 10px 12px;
  border-radius: 12px;
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  text-align: left;
  margin-top: 12px;
}

.student-theme .subject-heading {
  background: var(--student-dark);
}

.progress-bar-wrap {
  background: #ddd;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--teal-dark);
  border-radius: 999px;
}

.student-theme .progress-bar-fill {
  background: var(--student-dark);
}

.task-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.task-status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clickable-card {
  cursor: pointer;
}

.mini-progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.mini-progress-box {
  background: #e5e4e2;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.mini-progress-number {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--teal-dark);
}

.progress-list-button {
  background: var(--teal);
  color: var(--white);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  text-align: left;
  gap: 10px;
}

.progress-list-title {
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  font-size: 1.1rem;
}

.progress-indicators {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.progress-pill {
  background: #e5e4e2;
  color: var(--teal);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.student-status-row {
  background: #696969;
  color: var(--white);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
  text-align: left;
}

.student-status-name {
  font-weight: bold;
}

.status-action {
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
}

.status-tick {
  font-size: 1.4rem;
  font-weight: bold;
}

.group-heading {
  background: var(--teal);
  color: var(--white);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-family: 'Gagalin', Arial, sans-serif;
  margin: 15px 0 8px;
}

@media (max-width: 520px) {
  .student-status-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .student-status-name {
    text-align: center;
  }
}

.status-action {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.save-btn {
  margin-top: 16px;
}

.progress-list-button {
  background: var(--teal);
  color: var(--white);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr 220px;
  align-items: center;
  text-align: left;
  gap: 14px;
}

.progress-list-title {
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  font-size: 1.1rem;
}

.progress-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-label {
  width: 68px;
  font-size: 0.78rem;
  color: var(--white);
  opacity: 0.95;
  text-align: right;
}

.progress-track {
  flex: 1;
  height: 14px;
  background: silver;
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
}

.progress-fill-complete {
  background: limegreen;
}

.progress-fill-verified {
  background: gold;
}

.student-status-row {
  background: #696969;
  color: var(--white);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
  text-align: left;
}

.student-status-name {
  font-weight: bold;
}

.status-action {
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-tick {
  font-size: 1.4rem;
  font-weight: bold;
}

.status-tick-complete {
  color: limegreen;
}

.status-tick-verified {
  color: gold;
}

.group-heading {
  background: var(--teal);
  color: var(--white);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-family: 'Gagalin', Arial, sans-serif;
  margin: 15px 0 8px;
}

@media (max-width: 700px) {
  .progress-list-button {
    grid-template-columns: 1fr;
  }

  .progress-bar-label {
    width: 60px;
    font-size: 0.74rem;
  }
}

@media (max-width: 520px) {
  .student-status-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    align-items: center;
    text-align: left;
    padding: 10px;
  }

  .student-status-name {
    flex: 1 0 110px;
    min-width: 110px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .status-action {
    flex: 0 0 82px;
    width: 82px;
    min-width: 82px;
    min-height: 44px;
    font-size: 0.68rem;
    line-height: 1.05;
    white-space: normal;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .status-tick {
    font-size: 1.6rem;
  }
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.progress-button-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.progress-drill-button {
  width: 100%;
  border: 1px solid rgba(192, 192, 192, 0.45);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.progress-drill-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.45);
}

.progress-button-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.dual-progress {
  display: grid;
  gap: 8px;
}

.progress-line {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 10px;
}

.progress-label {
  font-size: 0.78rem;
  opacity: 0.82;
}

.progress-track {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: silver;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.progress-fill-complete {
  background: limegreen;
}

.progress-fill-verified {
  background: gold;
}

.progress-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-group-block {
  margin-top: 18px;
}

.progress-group-block h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.progress-student-list {
  display: grid;
  gap: 10px;
}

.progress-student-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(192, 192, 192, 0.35);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.progress-student-name {
  font-weight: 650;
}

.status-toggle {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
}

.status-toggle.is-complete {
  color: limegreen;
  border-color: rgba(50, 205, 50, 0.45);
}

.status-toggle.is-verified {
  color: gold;
  border-color: rgba(255, 215, 0, 0.5);
}

.status-toggle.is-off {
  color: lightgrey;
  border-color: rgba(211, 211, 211, 0.25);
}

.save-progress-button {
  margin-top: 20px;
  width: 100%;
}

@media (max-width: 640px) {
  .progress-student-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    align-items: center;
    text-align: left;
    padding: 10px;
  }

  .progress-student-name {
    flex: 1 0 110px;
    min-width: 110px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .status-toggle {
    flex: 0 0 82px;
    width: 82px;
    min-width: 82px;
    min-height: 44px;
    padding: 5px 4px;
    font-size: 0.68rem;
    line-height: 1.05;
    white-space: normal;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}


/* Reusable Save Changes and Return button */
.save-return-btn {
  width: auto;
  min-width: 155px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: center;
}

.save-return-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Progress headers: stronger teal divider under the header */
#progress-subjects-screen .nav-header,
#progress-tasks-screen .nav-header,
#progress-task-students-screen .nav-header {
  border-bottom: 3px solid var(--teal);
}

.student-theme#progress-subjects-screen .nav-header,
.student-theme#progress-tasks-screen .nav-header,
.student-theme#progress-task-students-screen .nav-header {
  border-bottom-color: var(--student-dark);
}

/* Thin separator used instead of thick teal group rows */
.group-separator-line {
  height: 3px;
  background: var(--teal);
  border-radius: 999px;
  margin: 18px 0 12px;
}

@media (max-width: 520px) {
  .save-return-btn {
    min-width: 145px;
    padding: 9px 10px;
    font-size: 0.78rem;
  }
}


/* Student Resources */
.resource-subject-button {
  background: var(--student-dark);
  color: var(--white);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  text-align: left;
  gap: 12px;
}

.resource-subject-title {
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  font-size: 1.08rem;
}

.resource-count-pill {
  background: #e5e4e2;
  color: var(--student-dark);
  padding: 6px 10px;
  border-radius: 999px;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: bold;
  white-space: nowrap;
}

.resource-section {
  background: var(--soft-panel);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  text-align: left;
}

.resource-section h3 {
  margin-bottom: 12px;
}

.resource-list {
  display: grid;
  gap: 10px;
}

.task-resource-group {
  margin-top: 12px;
}

.task-resource-heading {
  background: var(--student-dark);
  color: var(--white);
  padding: 9px 11px;
  border-radius: 10px;
  font-weight: bold;
  margin-bottom: 8px;
}

.resource-card {
  background: #e5e4e2;
  border-radius: 14px;
  padding: 12px;
  border-left: 5px solid var(--student-dark);
}

.resource-card-main {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.resource-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--student-dark);
  color: var(--white);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: bold;
  min-width: 58px;
}

.resource-name {
  font-weight: bold;
  color: #222;
  line-height: 1.25;
}

.resource-player {
  width: 100%;
  margin: 6px 0 10px;
}

.resource-open-btn {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 0.82rem;
  width: 100%;
}

@media (max-width: 420px) {
  .resource-subject-button {
    grid-template-columns: 1fr;
  }

  .resource-count-pill {
    justify-self: start;
  }

  .resource-card-main {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Student Resource Category Layout */
.resource-category-grid {
  display: grid;
  gap: 12px;
}

.resource-category-button {
  background: var(--student-dark);
  color: var(--white);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  text-align: left;
  gap: 12px;
}

.resource-category-button.is-empty {
  opacity: 0.55;
  cursor: not-allowed;
}

.resource-category-main {
  display: grid;
  gap: 4px;
}

.resource-category-title {
  font-family: 'Gagalin', Arial, sans-serif;
  letter-spacing: 1px;
  font-size: 1.08rem;
}

.resource-category-subtitle {
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  opacity: 0.9;
  letter-spacing: 0;
}

.resource-subject-group h3 {
  border-bottom: 2px solid var(--student-dark);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.resource-task-list {
  display: grid;
  gap: 8px;
}

.student-resource-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  align-items: center;
  background: #e5e4e2;
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  border-left: 5px solid var(--student-dark);
}

.student-resource-row-main {
  min-width: 0;
}

.student-resource-title {
  font-weight: bold;
  color: #1f3f60;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.student-resource-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: #555;
  font-size: 0.82rem;
}

.small-badge {
  min-width: 46px;
  padding: 4px 7px;
  font-size: 0.68rem;
}

.resource-arrow-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  font-family: Arial, sans-serif;
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-arrow-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 420px) {
  .resource-category-button {
    grid-template-columns: 1fr;
  }

  .resource-count-pill {
    justify-self: start;
  }
}


/* Inline audio player for student resources */
.inline-audio-player {
  grid-column: 1 / -1;
  margin-top: 10px;
  width: 100%;
}

.resource-audio-control {
  width: 100%;
  display: block;
  margin-top: 8px;
}

.student-resource-meta .resource-type-badge {
  margin-right: 0;
}
