:root {
    --bg: #ededed;
    --card: #f8f8f8;
    --card-border: #e4e4e4;
    --text: #141414;
    --muted: #4d4d4d;
    --green: #6ea80c;
    --green-dark: #5b9008;
    --line: #cacaca;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 20px 40px;
}

.top-brand {
    text-align: center;
    margin-top: 6px;
    margin-bottom: 18px;
}

.top-logo {
    width: 155px;
    height: auto;
    display: block;
    margin: 0 auto 6px;
}

.top-brand h1 {
    margin: 0;
    font-size: 74px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.top-brand p {
    margin: 6px 0 0;
    font-size: 18px;
    color: #2e2e2e;
}

.upload-card {
    display: flex;
    justify-content: center;
    margin: 12px 0 26px;
}

.upload-inner {
    width: 100%;
    max-width: 420px;
    background: #f9f9f9;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px 18px 14px;
    text-align: center;
}

.text-input,
.file-input {
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 16px;
    background: #b8b8b8;
    color: #111;
    margin-bottom: 14px;
}

.text-input::placeholder {
    color: #2f2f2f;
}

.file-input {
    background: #b8b8b8;
}

.green-btn {
    border: none;
    border-radius: 18px;
    background: var(--green);
    color: white;
    cursor: pointer;
    transition: 0.2s ease;
}

.green-btn:hover {
    background: var(--green-dark);
}

.upload-btn {
    padding: 10px 28px;
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-text {
    min-height: 22px;
    margin: 12px 0 0;
    font-size: 13px;
    color: #155c15;
    font-weight: 600;
}

.main-card {
    display: grid;
    gap: 12px;
}

.list-card,
.selected-card {
    background: #f7f7f7;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 14px 18px 18px;
}

.list-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.list-card-header h2,
.selected-card h2,
.results-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.list-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.subtle-btn {
    border: 1px solid #d8d8d8;
    background: white;
    color: #333;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.subtle-btn:hover {
    background: #f0f0f0;
}

.course-list {
    min-height: 310px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 8px;
    align-content: start;
    padding: 6px 2px 4px;
}

.course-chip {
    display: flex;
    align-items: center;
    min-width: 0;
}

.course-chip input {
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    accent-color: var(--green);
    flex-shrink: 0;
}

.course-chip span {
    display: inline-block;
    font-size: 14px;
    color: #222;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.selected-card {
    min-height: 190px;
}

.selected-course-list {
    min-height: 90px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
    margin-top: 10px;
}

.selected-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.selected-pill button {
    border: none;
    background: transparent;
    color: #8a1f1f;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

.generate-wrap {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.generate-btn {
    padding: 14px 28px;
    font-size: 17px;
    font-weight: 500;
}

.results-block {
    margin-top: 36px;
}

.results-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.result-summary {
    font-size: 14px;
    font-weight: 700;
    color: #3f6707;
}

.results-grid {
    display: grid;
    gap: 18px;
}

.empty-box {
    width: 100%;
    border: 1px dashed #cfcfcf;
    border-radius: 10px;
    padding: 18px;
    background: #fcfcfc;
    color: #666;
    text-align: center;
}

.routine-card {
    background: #ffffff;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.routine-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: #f4f4f4;
    border-bottom: 1px solid #e2e2e2;
}

.routine-card-header h3 {
    margin: 0;
    font-size: 20px;
}

.routine-meta {
    font-size: 13px;
    color: #555;
}

.routine-body {
    padding: 18px;
    display: grid;
    gap: 18px;
}

.section-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    border: 2px solid #111;
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
}

th {
    background: #111;
    color: white;
    font-weight: 700;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge-theory {
    background: #e8edff;
    color: #2545a3;
}

.badge-lab {
    background: #e6f4dd;
    color: #3e7306;
}

.timetable-wrapper {
    overflow-x: auto;
    border: 2px solid #111;
    background: white;
}

.timetable-grid {
    display: grid;
    min-width: 900px;
}

.tt-header {
    background: #111;
    color: white;
    font-weight: 700;
    text-align: center;
    padding: 12px;
    border-right: 2px solid #111;
    border-bottom: 2px solid #111;
}

.tt-time-cell {
    background: #f7f7f7;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 10px;
    border-right: 2px solid #111;
    border-bottom: 2px solid #111;
}

.tt-cell {
    min-height: 96px;
    padding: 8px;
    background: white;
    border-right: 2px solid #111;
    border-bottom: 2px solid #111;
}

.tt-cell.filled {
    background: #f9fff2;
}

.tt-course {
    font-weight: 700;
    margin-bottom: 4px;
}

.tt-section {
    font-size: 13px;
    margin-bottom: 6px;
    color: #333;
}

.tt-room,
.tt-faculty {
    font-size: 12px;
    line-height: 1.35;
    color: #555;
    margin-top: 4px;
}

.tt-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}

.tt-tag-theory {
    background: #e8edff;
    color: #2545a3;
}

.tt-tag-lab {
    background: #e6f4dd;
    color: #3e7306;
}

.tiny-footer {
    text-align: center;
    margin-top: 80px;
    font-size: 11px;
    color: #444;
    line-height: 1.45;
}

.tiny-footer p {
    margin: 2px 0;
}

.tiny-label {
    font-size: 10px;
    letter-spacing: 0.16em;
    font-weight: 700;
    color: #777;
    margin-bottom: 8px;
}

@media (max-width: 1100px) {
    .course-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .top-brand h1 {
        font-size: 52px;
    }

    .top-brand p {
        font-size: 16px;
    }

    .course-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .list-card-header,
    .results-head,
    .routine-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 16px 14px 28px;
    }

    .top-logo {
        width: 120px;
    }

    .top-brand h1 {
        font-size: 42px;
    }

    .course-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.faculty-search-card,
.preference-card {
    background: #f7f7f7;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 16px 18px 18px;
    margin: 18px 0;
}

.faculty-search-head h2,
.preference-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.faculty-search-head p,
.preference-head p {
    margin: 0 0 14px;
    color: #555;
    font-size: 14px;
}

.faculty-search-row,
.preference-grid {
    display: grid;
    gap: 12px;
}

.faculty-search-row {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-bottom: 14px;
}

.faculty-search-input {
    margin-bottom: 0;
}

.faculty-course-results {
    min-height: 70px;
}

.faculty-result-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.faculty-course-pill {
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
}

.preference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
}

.preference-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preference-field span,
.day-filter-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.preference-select {
    width: 100%;
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    padding: 12px 14px;
    background: white;
    font-size: 14px;
}

.day-filter-list {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.day-filter-list label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

@media (max-width: 640px) {
    .faculty-search-row,
    .preference-grid {
        grid-template-columns: 1fr;
    }
}