/* =========================================================
   Global tokens
   ========================================================= */
:root {
  /* Space between the screen edge and BOTH the white page card and
     the footer card. Change this one number to move both together. */
  --page-gutter: 1.5rem;
}

/* =========================================================
   Evaluation pages
   ========================================================= */
.evalpage,
.evalpage * { box-sizing: border-box; }

.evalpage {
  --ev-green-900: #0a3d1f;
  --ev-green: #14612f;
  --ev-ink: #12351f;
  --ev-orange: #ff6a13;
  --ev-orange-bg: #fff0e6;
  --ev-line: #bcd9c6;
  --ev-star-off: #c5d2c9;
  font-size: 17px;              /* change this ONE number to scale the whole page */
  color: var(--ev-ink);
  padding: 28px 40px 36px;      /* lower this if your .app-main already has padding */
  width: 100%;
}

.evalpage :focus-visible {
  outline: 3px solid var(--ev-orange);
  outline-offset: 2px;
}

/* Headings */
.evalpage .ev-title { margin: 0; font-size: 1.45em; font-weight: 700; color: var(--ev-green-900); }
.evalpage .ev-sub   { margin: .45em 0 1.25em; font-size: 1.05em; color: var(--ev-green); }
.evalpage .ev-h3    { margin: 0 0 .9em; font-size: 1em; font-weight: 700; }

/* Orange "Evaluating" banner */
.ev-banner {
  background: linear-gradient(90deg, #fff0e6, #fff6ef);
  border-left: 4px solid var(--ev-orange);
  border-radius: 6px;
  padding: .85em 1.8em;
  margin-bottom: 1.6em;
  color: var(--ev-orange);
  font-size: 1em;
}
.ev-banner b { margin: 0 .3em; font-weight: 700; }
.ev-dash { margin: 0 .4em; }

/* Ratings */
.ev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3em 2.4em;
  margin-bottom: 1.6em;
}
.evalpage .ev-rlabel { font-size: 1em; margin: 0 0 .55em; }

.ev-stars {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: .2em;
}
.ev-stars input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.evalpage .ev-stars label {
  margin: 0;
  font-size: 1.7em;
  line-height: 1;
  cursor: pointer;
  color: var(--ev-star-off);
}
.ev-stars input:checked ~ label { color: var(--ev-orange); }
.ev-stars:hover input ~ label { color: var(--ev-star-off); }
.ev-stars:hover label:hover,
.ev-stars:hover label:hover ~ label { color: var(--ev-orange); }
.ev-stars input:focus-visible + label {
  outline: 3px solid var(--ev-orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Comment */
.ev-clabel { font-weight: 700; font-size: 1em; margin-bottom: .7em; }
.ev-clabel span { font-weight: 400; color: var(--ev-green); margin-left: .25em; }
.evalpage textarea {
  display: block;
  width: 100%;
  min-height: 5.6em;
  resize: vertical;
  border: 1.5px solid var(--ev-line);
  border-radius: 10px;
  padding: .8em 1.1em;
  font: inherit;
  font-size: .98em;
  line-height: 1.95;
  background: rgba(255, 255, 255, .85);
  color: var(--ev-ink);
}

/* Quality check bar + submit button */
.ev-check {
  margin: 1.3em 0;
  border: 1px solid #e3ebe5;
  border-left: 4px solid var(--ev-green);
  background: rgba(232, 240, 234, .9);
  border-radius: 6px;
  padding: .85em 1.6em;
  color: var(--ev-green);
}
.ev-check.bad { border-left-color: #c0392b; color: #b03a2e; }

.ev-submit {
  background: var(--ev-green-900);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .85em 1.4em;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ev-submit:disabled { opacity: .5; cursor: not-allowed; }

/* Chips + empty state */
.ev-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1em; }
.ev-chip {
  padding: .4em .8em;
  border: 1.5px solid var(--ev-line);
  border-radius: 20px;
  text-decoration: none;
  color: var(--ev-ink);
  font-size: .9em;
}
.ev-chip.on { background: #dcebdd; border-color: var(--ev-green); }
.ev-empty {
  padding: 1.5em;
  border: 1.5px dashed var(--ev-line);
  border-radius: 10px;
  color: var(--ev-green);
}

/* Dashboard cards */
.ev-cards { display: flex; gap: 1.2em; flex-wrap: wrap; margin: 0 0 1.6em; }
.ev-card {
  min-width: 11em;
  padding: 1em 1.6em;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #dfe8e2;
  border-top: 4px solid var(--ev-green);
  box-shadow: 0 2px 8px rgba(10, 61, 31, .08);
}
.ev-card.pending { border-top-color: var(--ev-orange); }
.ev-card-num { font-size: 2.2em; font-weight: 700; line-height: 1.1; color: var(--ev-green); }
.ev-card.pending .ev-card-num { color: var(--ev-orange); }
.ev-card-label { margin-top: .2em; font-size: .95em; color: var(--ev-ink); }

/* Submitted table */
.ev-tablewrap {
  border: 1px solid #cfdcd3;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 8px rgba(10, 61, 31, .06);
}
.ev-table { width: 100%; border-collapse: collapse; font-size: .95em; }
.ev-table th,
.ev-table td {
  text-align: left;
  padding: .85em 1.1em;
  border-bottom: 1px solid #e3ebe5;
  border-right: 1px solid #eef3ef;
}
.ev-table th:last-child,
.ev-table td:last-child { border-right: 0; }
.ev-table thead th {
  background: #dcebdd;
  color: var(--ev-green-900);
  font-weight: 700;
  border-bottom: 1px solid #cfdcd3;
}
.ev-table tbody tr:last-child td { border-bottom: 0; }
.ev-table tbody tr:hover { background: #f4f9f5; }
.ev-none { text-align: center; color: var(--ev-green); padding: 1.4em; }

.ev-badge {
  display: inline-block;
  padding: .25em .8em;
  border-radius: 12px;
  font-size: .85em;
  text-decoration: none;
}
.ev-badge.ok   { background: #dcebdd; color: var(--ev-green-900); }
.ev-badge.pend { background: var(--ev-orange-bg); color: var(--ev-orange); }

/* =========================================================
   Sidebar
   ========================================================= */
.sidebar-link {
  display: block;
  padding: .75em 1.6em .75em 2em;
  border-left: 5px solid transparent;
  text-decoration: none;
  color: #12351f;
}
.sidebar-link.active { background: #dcebdd; border-left-color: #0a3d1f; font-weight: 700; }
.sidebar-title { color: #14612f; font-weight: 700; }

/* =========================================================
   Topbar: AY + profile menu
   ========================================================= */
.login-topbar,
.login-topbar__content { overflow: visible; }

.login-topbar__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.login-topbar__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5em;
  flex: none;
  color: #fff;
}
.login-topbar__year { margin: 0; position: static; }

.user-menu { position: relative; }
.user-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .6em;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  user-select: none;
}
.user-trigger::-webkit-details-marker { display: none; }
.user-trigger:hover .user-avatar { border-color: #fff; }
.user-trigger:focus-visible {
  outline: 3px solid #ff6a13;
  outline-offset: 3px;
  border-radius: 24px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: #1c6a35;
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .45);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chevron { font-size: 1.2em; line-height: 1; margin-top: -.25em; }
.user-menu[open] .user-chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + .5em);
  min-width: 11em;
  z-index: 100;
  background: #fff;
  border: 1px solid #dfe8e2;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  padding: .35em;
}
.user-dropdown a {
  display: block;
  padding: .65em 1em;
  border-radius: 7px;
  color: #12351f;
  text-decoration: none;
  font-weight: 500;
}
.user-dropdown a:hover { background: #dcebdd; }
.user-dropdown hr { border: 0; border-top: 1px solid #e3ebe5; margin: .35em 0; }
.user-dropdown a.logout { color: #b03a2e; }
.user-dropdown a.logout:hover { background: #fdecea; }

/* =========================================================
   Page layout (#content)
   ========================================================= */
#content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start !important;
}

/* Remove stray spacing from leftover wrappers */
#content > *:not(nav):not(.card):not(.container-fluid) {
  min-height: 0 !important;
  height: auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* White card that holds the page. Same side margin as the footer
   (--page-gutter), so both cards line up. */
#content > .card,
#content > .container-fluid {
  margin-top: 1.25rem !important;
  margin-left: var(--page-gutter) !important;
  margin-right: var(--page-gutter) !important;
  width: auto !important;
  max-width: none !important;
}

/* Slightly more top space on evaluation pages */
body #content .card:has(.evalpage),
body #content > .container-fluid:has(.evalpage) {
  margin-top: 1.75rem !important;
}

/* Center the "STUDENT DASHBOARD" title text (the h6) */
#content .card > .card-header {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
#content .card h6,
#content .card .h6 {
  color: #0a3d1f;
  font-size: 1.45em;
  font-weight: 700;
  width: 100%;
  margin: 0;
  text-align: center;
}

/* =========================================================
   Footer: white card, green text, aligned with the table
   ========================================================= */
footer,
.sticky-footer,
.app-footer,
#footer {
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  width: auto !important;
  padding: 1rem var(--page-gutter) 1.5rem !important;
}

footer > *,
.sticky-footer > *,
.app-footer > *,
#footer > * {
  width: 100% !important;
  max-width: none !important;   /* cancels Bootstrap .container max-width */
  margin: 0 !important;
  padding: .85em 1.6em;
  background: #fff !important;
  color: #14612f !important;
  font-weight: 700;
  text-align: center;
  border: 1px solid #dfe8e2;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(10, 61, 31, .12);
}

footer span,
footer p,
footer a {
  color: #14612f !important;
  background: transparent !important;
}

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 700px) {
  :root { --page-gutter: 1rem; }
  .evalpage { padding: 18px 14px; font-size: 15px; }
  .ev-grid { grid-template-columns: 1fr; }
  .ev-table { display: block; overflow-x: auto; }
}

.ev-q {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
  }
  .ev-q.is-missing {
    border-color: #e5484d;
    box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.25);
  }
  .ev-title {
    display: flex;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 12px;
  }
  .ev-num {
    color: #e3bd4f;
  }
  .ev-optional {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
  }
  .ev-legend {
    display: flex;
    justify-content: space-between;
    max-width: 340px;
    font-size: 0.82rem;
    opacity: 0.7;
    margin-bottom: 8px;
  }

  .ev-rating {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .ev-rating input,
  .ev-opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .ev-rating label {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-weight: 700;
    cursor: pointer;
    transition:
      background 0.15s,
      color 0.15s;
  }
  .ev-rating label:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  .ev-rating input:checked + label {
    background: #e3bd4f;
    border-color: #e3bd4f;
    color: #10281d;
  }
  .ev-rating input:focus-visible + label,
  .ev-opt input:focus-visible + .ev-box {
    outline: 2px solid #e3bd4f;
    outline-offset: 2px;
  }

  .ev-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 400;
  }
  .ev-opt:hover {
    background: rgba(255, 255, 255, 0.08);
  }
  .ev-box {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
  }
  .ev-opt.is-multi .ev-box {
    border-radius: 5px;
  }
  .ev-opt input:checked + .ev-box {
    background: #e3bd4f;
    border-color: #e3bd4f;
  }
  .ev-opt input:checked + .ev-box::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10281d;
  }
  .ev-opt.is-multi input:checked + .ev-box::after {
    width: 5px;
    height: 10px;
    border-radius: 0;
    background: none;
    border: solid #10281d;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
  }

  .ev-counter {
    text-align: right;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 4px;
  }
.ap-btn.ap-btn-danger:disabled {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

/* Evaluate / Answer buttons: green (View buttons stay grey) */
a.ap-btn-grey[href^="/student-evalform"] {
  background: linear-gradient(135deg, #1f9d5b 0%, #157347 100%);
  border: 1px solid #1f9d5b;
  color: #fff;
  box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

a.ap-btn-grey[href^="/student-evalform"]:hover,
a.ap-btn-grey[href^="/student-evalform"]:focus {
  background: linear-gradient(135deg, #25b36a 0%, #198754 100%);
  border-color: #25b36a;
  color: #fff;
  text-decoration: none;
}