:root {
    --ink: #122064;
    --muted: #68729b;
    --line: #cfe0f0;
    --soft: #f6fbff;
    --card: #ffffff;
    --blue: #1476e5;
    --sidebar: 290px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}
a { color: #0768df; }
.site-shell { max-width: 1200px; margin: 0 auto; padding: 42px 28px 60px; }
.class-header { margin: 0 0 34px 14px; }
.class-header h1 {
    margin: 0 0 2px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(42px, 6vw, 66px);
    line-height: 1;
    color: #07166d;
}
.class-meta { margin-top: 10px; font-size: 21px; color: #263787; }
.class-meta span { margin: 0 12px; color: #8b94bd; }
.page-grid { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 26px; align-items: start; }
.sidebar { position: sticky; top: 18px; }
.card { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.side-nav { margin-bottom: 22px; }
.side-nav a {
    display: flex; gap: 14px; align-items: center;
    padding: 18px 20px; color: var(--ink); text-decoration: none; font-size: 18px;
    border-left: 4px solid transparent;
}
.side-nav a:hover { background: #f5f9ff; }
.side-nav a.active { background: #eaf3ff; border-left-color: #176df0; font-weight: 700; }
.coming-up { padding-bottom: 10px; }
.coming-up h2 {
    margin: 0; padding: 17px 18px; font-family: Georgia, serif; font-size: 28px; color: #075dc4;
    border-bottom: 1px solid #e4eef7;
}
.coming-event { display: block; padding: 14px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid #eef4f9; }
.coming-event:last-child { border-bottom: 0; }
.coming-event strong { display: block; font-size: 16px; }
.coming-event span { display: block; color: #52629a; margin-top: 3px; }
.main-content { min-width: 0; }
.entry-card { border: 1px solid #a8ded7; border-radius: 9px; margin-bottom: 18px; overflow: hidden; }
.entry-date { margin: 0; padding: 11px 20px; background: linear-gradient(90deg,#f0fbf8,#eef7fc); font-family: Georgia, serif; font-size: 27px; color: #08165f; }
.entry-note { margin: 15px 20px 0; color: #59617c; font-style: italic; }
.item-row { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 18px; padding: 14px 20px; }
.item-row + .item-row { padding-top: 5px; }
.tag { display: inline-block; width: fit-content; padding: 5px 9px; border-radius: 5px; font-weight: 700; }
.tag-literature { color: #006be6; background: #e8f3ff; }
.tag-writing { color: #087943; background: #e8f8ef; }
.tag-grammar { color: #6d2bd0; background: #f0e9ff; }
.tag-vocab { color: #087943; background: #e8f8ef; }
.tag-homework { color: #e31c1c; background: #ffeaea; }
.tag-handout { color: #d46a00; background: #fff2df; }
.tag-other { color: #4d5873; background: #eef1f5; }
.item-body { font-size: 17px; white-space: pre-wrap; }
.due { display: block; margin-top: 3px; color: #596ca4; }
.attachments { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; }
.attachment-link { text-decoration: underline; font-size: 16px; }
.attachment-link small { color: #617099; }
.page-title { margin: 0 0 18px; font-family: Georgia, serif; font-size: 34px; }
.list-card { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 14px; padding: 18px 20px; }
.list-card h3 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 22px; }
.list-card .meta { color: var(--muted); margin-bottom: 8px; }
.muted { color: var(--muted); }
.empty { border: 1px dashed #b9cde1; border-radius: 9px; padding: 28px; color: var(--muted); }

/* Admin */
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 28px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 24px; }
.admin-top h1 { margin: 0; font-family: Georgia, serif; }
.admin-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-nav a, .button { display: inline-block; padding: 9px 14px; border: 1px solid #b9cce0; border-radius: 6px; background: #fff; color: #12306e; text-decoration: none; cursor: pointer; font-size: 15px; }
.button.primary { background: #1386df; border-color: #1386df; color: white; }
.button.danger { border-color: #efb1b1; color: #cf2424; background: #fffafa; }
.admin-card { border: 1px solid #d3e1ef; border-radius: 9px; background: #fff; padding: 20px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 12px 18px; align-items: start; }
label { font-weight: 700; padding-top: 8px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], select, textarea {
    width: 100%; padding: 10px 11px; border: 1px solid #bfcfe0; border-radius: 5px; color: #132466; background: white; font: inherit;
}
textarea { min-height: 82px; resize: vertical; }
.item-editor { border: 1px solid #d7e5f2; border-radius: 8px; padding: 16px; margin: 12px 0; background: #fbfdff; }
.item-editor-head { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; margin-bottom: 12px; }
.item-editor .field { margin-bottom: 10px; }
.item-editor .field > span { display: block; font-weight: 700; margin-bottom: 5px; }
.existing-files { margin: 8px 0; }
.existing-file { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; background: #f3f8fd; border-radius: 5px; margin-bottom: 5px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin: 18px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid #e3ebf3; vertical-align: top; }
.table th { color: #52607e; }
.flash { background: #ebf8ef; border: 1px solid #b6e1c1; color: #206230; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.error { background: #fff0f0; border: 1px solid #efc0c0; color: #8b2222; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.login-box { max-width: 430px; margin: 80px auto; }

@media (max-width: 820px) {
    .site-shell { padding: 24px 14px 40px; }
    .class-header { margin-left: 4px; }
    .page-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .side-nav { display: grid; grid-template-columns: 1fr 1fr; }
    .side-nav a { padding: 13px 14px; }
    .coming-up { margin-bottom: 18px; }
    .item-row { grid-template-columns: 1fr; gap: 7px; }
    .form-grid { grid-template-columns: 1fr; gap: 5px; }
    .item-editor-head { grid-template-columns: 1fr; }
}
