:root {
    color-scheme: light;
    --bg: #eef3f7;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #182230;
    --muted: #667085;
    --line: #d7dee8;
    --brand: #116466;
    --brand-dark: #0b4f51;
    --brand-soft: #d9f0ee;
    --accent: #d69e2e;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --shadow: 0 16px 40px rgba(16, 24, 40, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(135deg, rgba(17, 100, 102, 0.08), transparent 34%),
        linear-gradient(315deg, rgba(214, 158, 46, 0.12), transparent 28%),
        var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: var(--brand-dark);
    font-weight: 700;
}

h1,
h2 {
    margin: 0 0 12px;
    line-height: 1.2;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 20px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 268px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, #12343b 0%, #0a2429 100%);
    color: #fff;
    padding: 28px 18px;
    box-shadow: 10px 0 30px rgba(16, 24, 40, 0.12);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 12px;
    margin-bottom: 30px;
    border-left: 4px solid var(--accent);
    font-size: 25px;
    font-weight: 800;
}

.nav {
    display: grid;
    gap: 7px;
}

.nav form {
    margin: 10px 0 0;
}

.nav a,
.nav button {
    width: 100%;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 12px;
    text-align: left;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.nav a:hover,
.nav button:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.content {
    width: min(1180px, 100%);
    padding: 36px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(215, 222, 232, 0.9);
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
    color: var(--brand-dark);
    font-size: 34px;
    font-weight: 800;
}

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

.form-grid {
    display: grid;
    gap: 15px;
    max-width: 780px;
}

fieldset.panel {
    box-shadow: none;
    background: var(--surface-soft);
    padding: 16px;
}

legend {
    padding: 0 6px;
    color: var(--brand-dark);
    font-weight: 800;
}

label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
    outline: none;
}

textarea {
    min-height: 104px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 10px 15px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 120ms ease, background 140ms ease, box-shadow 140ms ease;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
    box-shadow: 0 10px 20px rgba(17, 100, 102, 0.22);
    transform: translateY(-1px);
}

.button.secondary,
button.secondary {
    background: #475467;
}

.button.secondary:hover,
button.secondary:hover {
    background: #344054;
}

.button.danger,
button.danger {
    background: var(--danger);
}

.button.danger:hover,
button.danger:hover {
    background: #912018;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
}

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

th {
    background: #f3f6f8;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #fbfcfd;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-box {
    width: min(430px, 100%);
}

.login-box h1 {
    color: var(--brand-dark);
}

.alert {
    border: 1px solid #f7c566;
    background: #fff7e6;
    color: #7a4b00;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

@media (max-width: 800px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        padding: 20px;
    }

    .brand {
        margin-bottom: 18px;
    }

    .grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 20px;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}
.question-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 190px 90px;
    gap: 14px;
    align-items: end;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.question-row:last-child {
    border-bottom: 0;
}

.question-row textarea {
    min-height: 72px;
}

@media (max-width: 900px) {
    .question-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

.question-row {
    grid-template-columns: minmax(260px, 1fr) 190px 90px auto;
}

.question-row[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .question-row {
        grid-template-columns: 1fr;
    }
}

.feedback-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.feedback-card {
    width: min(560px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(215, 222, 232, 0.9);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.feedback-card h1 {
    color: var(--brand-dark);
    margin-bottom: 18px;
}

.feedback-wizard {
    display: grid;
    gap: 22px;
}

.wizard-progress {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.wizard-bar {
    width: 100%;
    height: 9px;
    overflow: hidden;
    background: #e6ebf0;
    border-radius: 999px;
}

.wizard-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    border-radius: inherit;
    transition: width 180ms ease;
}

.wizard-step {
    min-height: 260px;
}

.wizard-question {
    display: grid;
    gap: 18px;
    color: var(--text);
}

.wizard-question > span {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 800;
}

.wizard-question select,
.wizard-question textarea {
    font-size: 18px;
    padding: 14px;
}

.rating-options {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.rating-options label {
    display: block;
    min-width: 0;
}

.rating-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating-options span {
    display: grid;
    place-items: center;
    min-height: 62px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--brand-dark);
    font-size: 24px;
    font-weight: 900;
}

.rating-options input:checked + span {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 4px rgba(17, 100, 102, 0.12);
}

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

.wizard-actions button:only-child,
.wizard-actions button[hidden] + button,
.wizard-actions button[hidden] + button[hidden] + button {
    grid-column: 1 / -1;
}

.wizard-actions button[hidden] {
    display: none;
}

@media (max-width: 640px) {
    body {
        background: var(--bg);
    }

    .feedback-page {
        align-items: start;
        padding: 0;
    }

    .feedback-card {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        padding: 22px 16px;
        box-shadow: none;
    }

    .feedback-card h1 {
        font-size: 25px;
    }

    .wizard-step {
        min-height: calc(100vh - 260px);
    }

    .wizard-question > span {
        font-size: 22px;
    }

    .rating-options {
        gap: 8px;
    }

    .rating-options span {
        min-height: 58px;
        font-size: 22px;
    }

    .wizard-actions {
        position: sticky;
        bottom: 0;
        margin: 0 -16px -22px;
        padding: 12px 16px 18px;
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--line);
    }
}

.lecturer-picker {
    display: grid;
    gap: 14px;
}

.lecturer-picker label {
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.lecturer-picker input[type="search"] {
    font-size: 18px;
}

.lecturer-assignment {
    display: grid;
    gap: 14px;
}

.lecturer-results {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.lecturer-result {
    justify-content: flex-start;
    background: #fff;
    color: var(--brand-dark);
    border: 1px solid var(--line);
    box-shadow: none;
}

.lecturer-result:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
    box-shadow: none;
}

.selected-lecturers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 44px;
    padding-top: 4px;
}

.selected-lecturer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    padding: 7px 8px 7px 12px;
    font-weight: 800;
}

.selected-lecturer button {
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff;
    color: var(--danger);
    font-size: 13px;
    box-shadow: none;
}

.selected-lecturer button:hover {
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: none;
    transform: none;
}

.feedback-page,
.feedback-card,
.feedback-wizard,
.wizard-step {
    overflow-x: clip;
}

.rating-options {
    direction: rtl;
}

.rating-options label {
    cursor: pointer;
}

.rating-options span {
    border-color: #d8dee7;
    background: #fff;
    color: #c6ced8;
    font-size: 34px;
    line-height: 1;
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.rating-options label:hover span,
.rating-options label:hover ~ label span,
.rating-options input:checked + span,
.rating-options label:has(input:checked) ~ label span {
    border-color: var(--accent);
    background: #fff7e6;
    color: var(--accent);
}

.rating-options label:hover span,
.rating-options label:hover ~ label span {
    transform: translateY(-1px);
}

.rating-options.has-error span {
    border-color: var(--danger);
}

.wizard-error {
    border: 1px solid var(--danger-soft);
    background: #fff5f5;
    color: var(--danger);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 800;
}

.rating-options {
    direction: ltr;
}

.rating-options label.is-filled span,
.rating-options label:hover span {
    border-color: var(--accent);
    background: #fff7e6;
    color: var(--accent);
}

.rating-options label.is-preview span,
.rating-options label.is-filled span {
    border-color: var(--accent);
    background: #fff7e6;
    color: var(--accent);
}

.rating-options.is-previewing label:not(.is-preview) span {
    border-color: #d8dee7;
    background: #fff;
    color: #c6ced8;
}

.results-filter {
    max-width: none;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.chart-panel h2 {
    margin-bottom: 18px;
}

.pie-layout {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(220px, 1fr);
    gap: 28px;
    align-items: center;
}

.pie-chart {
    width: min(320px, 100%);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 10px solid #fff;
    box-shadow: var(--shadow);
    background: #e6ebf0;
}

.pie-legend {
    display: grid;
    gap: 10px;
}

.legend-row {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

@media (max-width: 760px) {
    .pie-layout {
        grid-template-columns: 1fr;
    }

    .pie-chart {
        justify-self: center;
    }
}

.choice-settings {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.choice-settings[hidden] {
    display: none;
}

.choice-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.choice-answer-options {
    display: grid;
    gap: 10px;
}

.choice-answer-options label {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 54px;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.choice-answer-options input {
    width: 20px;
    height: 20px;
    accent-color: var(--brand);
}

.choice-answer-options label:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.choice-answer-options.has-error label {
    border-color: var(--danger);
}

.question-breakdown-list {
    display: grid;
    gap: 14px;
}

.question-breakdown {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.question-breakdown h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.question-average {
    display: inline-grid;
    justify-items: start;
    gap: 2px;
    color: var(--brand-dark);
}

.question-average strong {
    font-size: 30px;
    line-height: 1;
}

.question-average span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.rating-bars,
.overall-bars {
    display: grid;
    gap: 9px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 150px) 1fr auto;
    gap: 10px;
    align-items: center;
}

.bar-row > span {
    color: var(--muted);
    font-weight: 800;
}

.bar-track {
    height: 14px;
    overflow: hidden;
    background: #e6ebf0;
    border-radius: 999px;
}

.bar-track span {
    display: block;
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    border-radius: inherit;
}

.charts-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 26px;
    align-items: center;
}

@media (max-width: 820px) {
    .charts-grid,
    .bar-row {
        grid-template-columns: 1fr;
    }
}

/* Final star rating rules: only JS classes decide which stars are filled. */
.rating-options label span {
    border-color: #d8dee7 !important;
    background: #fff !important;
    color: #c6ced8 !important;
    transform: none !important;
}

.rating-options label.is-filled span,
.rating-options label.is-preview span {
    border-color: var(--accent) !important;
    background: #fff7e6 !important;
    color: var(--accent) !important;
}

.rating-options.is-previewing label.is-filled:not(.is-preview) span {
    border-color: #d8dee7 !important;
    background: #fff !important;
    color: #c6ced8 !important;
}

/* Final feedback layout guard: keeps the mobile wizard from creating sideways scroll. */
html,
body {
    width: 100%;
    scrollbar-gutter: stable;
    max-width: 100%;
    overflow-x: hidden;
}

.feedback-page,
.feedback-card,
.feedback-wizard,
.wizard-step,
.wizard-actions {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.feedback-card {
    width: min(560px, calc(100% - 36px));
}

.feedback-wizard,
.wizard-step,
.wizard-actions {
    width: 100%;
}

.wizard-step[hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .feedback-card {
        width: 100%;
    }

    .wizard-actions {
        left: 0;
        right: 0;
    }
}
.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.table-actions form {
    margin: 0;
}

.table-actions .button,
.table-actions button {
    white-space: nowrap;
}
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }
}
.lecturer-combobox {
    position: relative;
}

.lecturer-combobox .lecturer-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: grid;
    gap: 4px;
    max-height: 300px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.lecturer-combobox .lecturer-results[hidden] {
    display: none;
}

.lecturer-empty {
    padding: 10px 12px;
    color: var(--muted);
    font-weight: 700;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-fields {
    display: grid;
    gap: 15px;
}

.login-fields[hidden] {
    display: none;
}
.suggestion-panel {
    max-width: 720px;
}

.suggestion-mail {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    margin-top: 8px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--brand-dark);
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
}

.suggestion-mail:hover {
    background: var(--brand-soft);
}
.feedback-thanks {
    text-align: left;
}

.feedback-thanks .suggestion-mail {
    width: 100%;
    justify-content: center;
    text-align: center;
    overflow-wrap: anywhere;
}
.answer-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    overflow: hidden;
}

.answer-details summary {
    padding: 12px 14px;
    color: var(--brand-dark);
    font-weight: 800;
    cursor: pointer;
}

.answer-list {
    display: grid;
    gap: 10px;
    padding: 0 14px 14px;
}

.answer-list blockquote {
    margin: 0;
    padding: 12px 14px;
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
}
.table-toolbar {
    margin-bottom: 14px;
    max-width: 420px;
}

.course-title-cell {
    max-width: 360px;
}

.course-title-cell span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 800px) {
    .course-title-cell {
        max-width: 260px;
    }
}
.course-combobox {
    position: relative;
}

.course-suggestions {
    position: absolute;
    z-index: 25;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: grid;
    gap: 4px;
    max-height: 300px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.course-suggestions[hidden] {
    display: none;
}

.course-suggestions button {
    justify-content: flex-start;
    background: #fff;
    color: var(--brand-dark);
    border: 1px solid var(--line);
    box-shadow: none;
    text-align: left;
}

.course-suggestions button:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
    box-shadow: none;
}