/* BS/MS Pathway */

:root {
    --garnet:      #782F40;
    --garnet-dark: #5b2430;
    --garnet-tint: #f4eef0;
    --gold:        #ceb888;
    --gold-dark:   #b89b5e;
    --ink:         #21242a;
    --muted:       #6b7280;
    --line:        #e3e5ea;
    --bg:          #f5f6f8;
    --panel:       #ffffff;
    --green:       #1a7f37;
    --red:         #b4232a;
    --radius:      6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}

h1, h2, h3, .serif {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
    color: var(--ink);
}

a { color: var(--garnet); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Masthead */
.masthead {
    background: var(--garnet);
    border-bottom: 3px solid var(--gold);
    color: #fff;
}
.masthead__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.masthead__brand { display: flex; flex-direction: column; }
.masthead__brand a { color: #fff; text-decoration: none; }
.masthead__eyebrow {
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
}
.masthead__title { font-family: Georgia, serif; font-size: 22px; line-height: 1.1; }
.masthead__user { font-size: 13px; color: #f0e6e9; }
.masthead__user a { color: #fff; text-decoration: underline; }

/* Section nav */
.subnav { background: var(--panel); border-bottom: 1px solid var(--line); }
.subnav__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}
.subnav a {
    display: inline-block;
    padding: 12px 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    text-decoration: none;
}
.subnav a:hover { color: var(--garnet); text-decoration: none; }
.subnav a.active { color: var(--garnet); border-bottom-color: var(--garnet); }

/* Layout */
.wrap { max-width: 1140px; margin: 0 auto; padding: 26px 20px 60px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; font-size: 26px; }
.pagehead p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 18px; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile__num { font-family: Georgia, serif; font-size: 30px; font-weight: 600; line-height: 1; }
.tile__label { color: var(--muted); font-size: 13px; margin-top: 6px; text-transform: uppercase; letter-spacing: .05em; }
.tile--good .tile__num { color: var(--green); }
.tile--warn .tile__num { color: var(--red); }

/* Tables */
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; min-width: 240px; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid thead th { background: var(--garnet-tint); color: var(--garnet); font-weight: 600; border-bottom: 2px solid var(--gold); white-space: nowrap; }
table.grid tbody tr:hover { background: #fafafa; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid thead th.sortable { cursor: pointer; user-select: none; }
table.grid thead th.sortable:hover { background: var(--garnet); color: #fff; }
table.grid thead th.sortable::after { content: '\2195'; opacity: .35; font-size: 10px; margin-left: 5px; }
table.grid thead th.sorted-asc::after { content: '\2191'; opacity: 1; }
table.grid thead th.sorted-desc::after { content: '\2193'; opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 26px; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge--free { background: #e6f4ea; color: var(--green); }
.badge--full { background: #f0e1e1; color: var(--red); }
.badge--guest { background: #fbf3e0; color: var(--gold-dark); border: 1px solid var(--gold); }
.badge--muted { background: #eef0f3; color: var(--muted); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    background: #eef0f3;
    color: var(--ink);
}
.btn:hover { text-decoration: none; filter: brightness(0.97); }
.btn--primary { background: var(--garnet); color: #fff; }
.btn--primary:hover { background: var(--garnet-dark); color: #fff; }
.btn--outline { background: #fff; border-color: var(--line); color: var(--garnet); }
.btn--danger { background: var(--red); color: #fff; }
.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn--link { background: none; padding: 5px 8px; color: var(--garnet); }
.actions-cell { white-space: nowrap; }
.actions-cell a { margin-right: 6px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.field .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.field input[type=text], .field input[type=number], .field input[type=password], .field input[type=email], .field select, .field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--garnet); box-shadow: 0 0 0 2px var(--garnet-tint); }
.form-narrow { max-width: 560px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; }

/* Flash */
.flash { padding: 11px 15px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash--success { background: #e9f6ee; border-color: #b6dcc2; color: #14612b; }
.flash--error { background: #fbebec; border-color: #e2b6b9; color: #8c1c22; }
.flash--info { background: #f4f5f7; border-color: var(--line); color: var(--ink); }
.flash p { margin: 0 0 4px; } .flash p:last-child { margin-bottom: 0; }

/* Login */
.login-wrap { max-width: 380px; margin: 8vh auto; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--garnet); border-radius: var(--radius); padding: 28px; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

/* Footer */
.foot { max-width: 1140px; margin: 0 auto; padding: 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Confirm modal */
.modal-back { position: fixed; inset: 0; background: rgba(20,20,25,.5); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-back.show { display: flex; }
.modal { background: #fff; border-radius: 8px; max-width: 440px; width: 92%; overflow: hidden; border-top: 5px solid var(--garnet); }
.modal--danger { border-top-color: var(--red); }
.modal--wide { max-width: 640px; max-height: 90vh; display: flex; flex-direction: column; }
.modal--wide .modal__body { overflow-y: auto; }
.modal__body { padding: 22px 24px; }
.modal__body h3 { margin: 0 0 8px; color: var(--garnet); font-size: 19px; }
.modal--danger .modal__body h3 { color: var(--red); }
.modal__body p { margin: 0 0 6px; font-size: 14px; }
.modal__foot { padding: 14px 24px; background: #faf7f7; display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 640px) {
    .row2 { grid-template-columns: 1fr; }
}

/* Coursework, archive, course editor */
.kv dd.gpa { font-size: 17px; font-weight: 700; }
.row-muted td { color: var(--muted); }
.timeline__note { font-size: 14px; }
.view-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.view-tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.view-tabs a:hover { color: var(--garnet); text-decoration: none; }
.view-tabs a.active { color: var(--garnet); border-bottom-color: var(--garnet); }
.elective-row, .new-course-row { display: grid; gap: 8px; align-items: center; margin-bottom: 8px; }
.elective-row { grid-template-columns: 150px 1fr 70px 170px 32px; }
.new-course-row { grid-template-columns: 130px 140px 1fr 70px 170px 32px; }
.elective-row input, .elective-row select, .new-course-row input, .new-course-row select,
.input-hours { padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; background: #fff; min-width: 0; width: 100%; }
.input-hours { width: 70px; }
.rm-row { background: none; border: none; color: var(--red); cursor: pointer; font-size: 20px; line-height: 1; padding: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
details.panel > summary { cursor: pointer; }
details.panel > summary h2 { display: inline; margin: 0 8px 0 0; }
details.panel[open] > summary { margin-bottom: 14px; }

/* Settings, announcement */
                padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.setting-row { display: grid; grid-template-columns: 150px 1fr 70px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.setting-row--course { grid-template-columns: 140px 1fr 70px 32px; }
.setting-row--2 { grid-template-columns: 160px 1fr; }
.setting-row input, .setting-row select, .input-code, .input-wide {
    padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; background: #fff; min-width: 0; width: 100%; }
.input-code { width: 120px; }
.major-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.panel code { background: #f3f3f3; padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.prose p { margin: 0 0 10px; line-height: 1.6; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 22px; line-height: 1.7; }

/* Table column widths */
table.course-table, table.edit-table { table-layout: fixed; }
.course-table td, .edit-table td { overflow-wrap: anywhere; }
col.col-code { width: 110px; }
col.col-hours { width: 70px; }
col.col-grade { width: 230px; }
col.col-group { width: 120px; }
col.col-remove { width: 100px; }
.course-table td select, .edit-table td select { width: 100%; max-width: 100%; }
.edit-table .input-hours { width: 60px; }
tr.row-current td { background: var(--garnet-tint); }

/* Phones */
@media (max-width: 640px) {
    .masthead__inner { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 16px; }
    .masthead__eyebrow { display: block; font-size: 10px; }
    .masthead__title { font-size: 20px; }
    .subnav__inner { flex-wrap: nowrap; overflow-x: auto; padding: 0 8px; -webkit-overflow-scrolling: touch; }
    .subnav a { white-space: nowrap; padding: 12px 10px; }
    .wrap { padding: 18px 14px 40px; }
    .panel { padding: 16px 14px; }
    .pagehead h1 { font-size: 22px; }
    .app-head { flex-direction: column; }
    .timeline__date { min-width: 0; width: 100%; }

    /* Tables become one card per row. */
    table.stack thead { display: none; }
    table.stack, table.stack tbody, table.stack tr { display: block; width: 100%; }
    table.stack tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; margin-bottom: 10px; background: #fff; }
    table.stack tbody tr:hover { background: #fff; }
    table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px;
                     border: none; padding: 6px 0; text-align: right; }
    table.stack td::before { content: attr(data-label); font-weight: 600; font-size: 13px; color: var(--muted); text-align: left; flex-shrink: 0; }
    table.stack td:not([data-label])::before { content: none; }
    table.stack td.empty { display: block; text-align: center; }
    table.stack td.num { text-align: right; }
    table.stack td select { min-width: 0; max-width: 65%; }
    table.stack .actions-cell { justify-content: flex-end; flex-wrap: wrap; }
    table.stack .actions-cell::before { content: none; }
    .filters .search { min-width: 0; }
    .setting-row, .setting-row--course, .setting-row--2 { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
    .elective-row, .new-course-row { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
    .elective-row .rm-row, .new-course-row .rm-row { justify-self: end; }
}

/* Print */
@media print {
    .masthead, .subnav, .table-tools, .btn, .actions-cell, .foot, .no-print { display: none !important; }
    body { background: #fff; }
    .wrap { max-width: none; padding: 0; }
    .panel { border: none; padding: 0; }
    table.grid th, table.grid td { border-bottom: 1px solid #999; }
    table.grid thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Misc */
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.sub-h { font-size: 15px; margin: 18px 0 8px; }
.panel h2 .hint { margin-left: 6px; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.row3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; }
.field textarea { font-family: inherit; resize: vertical; }
.radios { border: none; padding: 0; margin: 0 0 16px; }
.radios legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.radios label { display: block; font-weight: 400; margin: 4px 0; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; }
.grid select { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; background: #fff; max-width: 100%; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters select { padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; background: #fff; }
.filters .search { margin-left: auto; min-width: 220px; }

.tile--link { color: inherit; text-decoration: none; }
.tile--link:hover { border-color: var(--garnet); text-decoration: none; }

.app-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.app-head h2 { margin: 0 0 2px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dt .hint { font-size: 12px; }
.kv dd { margin: 2px 0 0; font-weight: 600; }
.kv dd.bad { color: var(--red); }
.kv--tight { grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.kv--tight > div { display: grid; grid-template-columns: 200px 1fr; gap: 12px; }
.kv--tight dd { font-weight: 500; margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.timeline li:last-child { border-bottom: none; }
.timeline__date { color: var(--muted); min-width: 160px; font-variant-numeric: tabular-nums; }

.checklist, .steps { margin: 0; padding-left: 20px; }
.checklist li, .steps li { margin: 6px 0; }

@media (max-width: 760px) {
    .row3 { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .filters select { flex: 1 1 100%; max-width: 100%; }
    .filters .search { margin-left: 0; width: 100%; }
    .kv--tight > div { grid-template-columns: 1fr; gap: 0; }
}

/* Department header and footer (header.inc / footer.inc) */
.modal-back .modal { display: block; position: static; }
.modal-back.show { display: flex !important; }
.col-sm-push-3:has(#content) { left: 0; width: 100%; }
/* Hide the app banner (keep the sign-in / log out link) */
.masthead { background: none; border: 0; color: var(--muted); }
.masthead__brand, .foot { display: none; }
.masthead__inner { justify-content: flex-end; padding: 10px 20px 0; }
/* The theme restyles every link; keep the app's own look */
#content a { color: var(--garnet); font-weight: inherit; background-image: none; transition: none; }
#content .masthead__user { color: var(--muted); }
#content a.btn { color: var(--ink); font-weight: 500; border: 1px solid transparent; }
#content a.btn--primary, #content a.btn--danger, #content .btn--primary:hover, #content .btn--danger:hover { color: #fff; }
#content a.btn--outline { border-color: var(--line); color: var(--garnet); }
#content a.btn--link { color: var(--garnet); }
#content .subnav a { color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; }
#content .subnav a:hover, #content .subnav a.active { color: var(--garnet); }
#content .subnav a.active { border-bottom-color: var(--garnet); }
#content a.tile--link { color: inherit; }
#content .view-tabs a { color: var(--muted); font-weight: 600; }
#content .view-tabs a:hover, #content .view-tabs a.active { color: var(--garnet); }
