:root {
    --content-padding: 12px;
    --content-max: 1100px;

    /* colors */
    --bg: #eef5f9;
    --surface: rgba(255, 255, 255, .75);
    --surface2: rgba(255, 255, 255, .65);
    --text: rgba(45, 58, 69, .92);
    --muted: rgba(45, 58, 69, .70);
    --border: rgba(0, 0, 0, .08);
    --border2: rgba(0, 0, 0, .12);

    --brand: #2d7aa6;
    --accent: #a55200;
    --fade: rgb(123 150 173 / 85%);

    /* radii / shadows */
    --r12: 12px;
    --r14: 14px;
    --r16: 16px;
    --sh1: 0 6px 16px rgba(30, 60, 90, .06);
    --sh2: 0 10px 25px rgba(30, 60, 90, .10);

    /* compat */
    --light-bg: var(--bg);
    --blue: #bbccd5;

    /* materials */
    --material-hero-h: 180px;

    /* breakpoints */
    --bp: 420px;
}


/* ===== BASE / LAYOUT ===== */
html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body.layout {
    align-items: stretch;
    /* важно: не center */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.grow-main {
    width: 100%;
    flex: 1 0 auto;
}

.content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--content-padding);
    box-sizing: border-box;
}

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    box-sizing: border-box;
}

/* ===== TYPOGRAPHY ===== */
.txt-accent {
    color: var(--accent) !important;
}

h2 {
    font-size: 18px;
    font-weight: 900;
    color: rgba(45, 58, 69, .85);
    margin: 0 0 10px;
    letter-spacing: .2px;
}

.h2--compact {
    font-size: 16px;
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* ===== PAGE HEAD (title left, chips right) ===== */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 14px;
}

.page-head__title {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
    color: rgba(45, 58, 69, .85);
}

.page-head__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-head__description {
    margin: -10px 0 0 0;
}

@media (max-width: 420px) {
    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-head__actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ===== CHIPS ===== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .85);
    color: rgba(45, 58, 69, .92);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.chip:hover {
    border-color: rgba(0, 0, 0, .14);
}

.chip.is-active {
    border-color: rgba(45, 122, 166, .28);
    background: rgba(45, 122, 166, .12);
}

.chip--ghost {
    background: transparent;
    border-color: transparent;
}

.chip--sm {
    padding: 4px 8px;
    font-size: 13px;
}


/* tags */
.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(45, 122, 166, .10);
    color: rgba(45, 58, 69, .75);
    font-weight: 800;
    font-size: 12px;
}






/* ===== TABLE (base component) ===== */
.table-wrap {
    overflow: auto;
    background: rgba(255, 255, 255, .65);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(30, 60, 90, .06);
}

.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: rgba(255, 255, 255, .70);
}

.table__th,
.table__td {
    border: 1px solid rgba(0, 0, 0, .10);
    padding: 8px 10px;
    vertical-align: top;
}

.table__th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(45, 122, 166, .10);
    font-weight: 900;
    color: rgba(45, 58, 69, .85);
}

.table--compact .table__th,
.table--compact .table__td {
    padding: 6px 8px;
}

/* common narrow columns */
.col-date {
    width: 48px;
    text-align: center;
    white-space: nowrap;
    font-weight: 900;
}

.col-type {
    width: 90px;
}

.col-subj {
    width: 140px;
}

@media (max-width: 420px) {
    .col-date {
        width: 38px;
        font-size: 90%;
    }

    .col-subj {
        width: 90px;
    }

    .col-type {
        width: 70px;
    }
}











/* ===== "DAY CARD" (schedule + reuse) ===== */
.day {
    background: rgba(255, 255, 255, .65);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(30, 60, 90, .06);
    margin: 0 0 10px;
    overflow: hidden;
}

.day__head {
    padding: 8px 10px;
    background: rgba(45, 122, 166, .10);
    font-weight: 900;
    color: rgba(45, 58, 69, 0.61);
}

.day__list {
    padding: 6px 0;
}




/* ===== ITEM ROW (unified row component) ===== */
.item-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    padding: 5px 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.158);
}

.item-row:first-child {
    border-top: 0;
}

/* 3 columns variant (grades + cw, etc.) */
.item-row--3 {
    grid-template-columns: 190px 1fr 1fr;
}

.item-row__left {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.item-row__main {
    min-width: 0;
}

.item-row__aside {
    min-width: 0;
}

.num {
    width: 22px;
    text-align: right;
    font-weight: 900;
    color: var(--fade);
}

.subj {
    display: grid;
    line-height: 1.1;
}

.subj__full {
    font-weight: 700;
    color: rgba(45, 58, 69, .85);
}

.subj__short {
    display: none;
    font-weight: 900;
    color: rgba(45, 58, 69, .85);
}

@media (max-width: 420px) {
    .item-row {
        grid-template-columns: 70px 1fr;
        gap: 8px;
        padding: 3px 4px;
    }

    /* 3-col collapses: hide aside on mobile */
    .item-row--3 {
        grid-template-columns: 60px 1fr;
    }

    .item-row__aside {
        display: none;
    }

    .subj__full {
        display: none;
    }

    .subj__short {
        display: inline;
        font-size: 80%;
    }
    .classwork-pre, .comment-line {
        font-size: 80%;
    }
    .item-row__main {
        font-size: 90%;
    }
    .analytics-table thead .col-comment,.analytics-table thead  .col-classwork,.analytics-table thead  .col-grade {
        font-size: 80%;
    }


}



@media ((max-width: 720px) and (min-width:420px)) {
    .item-row {
        grid-template-columns: 100px 1fr;
    }

    .item-row--3 {
        grid-template-columns: 60px 1fr 1fr;
    }

    .subj__full {
        display: none;
    }

    .subj__short {
        font-weight: 600;
        display: inline;
    }
}

/* ===== MODAL (used by modal.js) ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}

.modal[aria-hidden="false"] {
    display: block;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.modal__panel {
    position: relative;
    max-width: 680px;
    margin: 12vh auto 0;
    background: rgba(255, 255, 255, .95);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    overflow: hidden;
}

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    background: rgba(45, 122, 166, .08);
}

.modal__title {
    font-weight: 900;
    color: rgba(45, 58, 69, .85);
}

.modal__x {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: rgba(45, 58, 69, .75);
}

.modal__body {
    padding: 12px;
    color: rgba(45, 58, 69, .92);
}

/* ===== Компактный футер: четыре смысловых блока без дублирования меню ===== */
.footer {
    margin-top: 20px;
    padding: 16px var(--content-padding);
    border-top: 1px solid rgba(45, 122, 166, .12);
    background: #e2edf3;
    color: var(--text);
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "lessons contacts"
        "birthdays news";
    align-items: start;
    gap: 18px 16px;
}

.footer-info {
    display: contents;
}

.footer-info .lessons-card {
    grid-area: lessons;
}

.footer-info .birthday-card {
    grid-area: birthdays;
}

.footer-info .news-card {
    grid-area: news;
}

.footer-contacts {
    grid-area: contacts;
    display: grid;
    align-content: start;
    gap: 0;
    min-width: 0;
}

.footer-title {
    margin: 0 0 var(--header-title-gap);
    font-size: 10px;
    line-height: 1.3;
    color: #627f90;
    font-weight: 700;
    letter-spacing: .04em;
}

.footer a,
.footer-contacts>span {
    color: #3c6982;
    font-size: 11px;
    line-height: var(--header-row-height);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.footer a:hover {
    text-decoration: underline;
}

.footer a:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 4px;
}

.footer-info .header-card {
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}

.footer-info .card-title {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 3px 6px;
    margin-bottom: var(--header-title-gap);
    font-size: 10px;
    color: #627f90;
}

.footer-info .birthday-lines {
    grid-template-columns: minmax(0, 1fr);
}

/* ===== FEEDBACK: override inline layout in feedback/all.html ===== */
.feedback .item-row--feedback {
    /* Inline HTML sets three columns, but the row has only two children. */
    grid-template-columns: 190px minmax(0, 1fr) !important;
    gap: 12px;
    padding: 8px 10px;
}

.feedback .item-row--feedback > .item-row__main {
    /* Remove inline padding so the period and text share the same inset. */
    padding: 0 !important;
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

@media ((max-width: 900px) and  (min-width: 420px)) {
    .feedback .item-row--feedback {
        grid-template-columns:120px minmax(0, 1fr) !important;
        gap: 6px;
    }

    .feedback .item-row--feedback > .item-row__main {
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .feedback .item-row--feedback {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 6px;
    }

    .feedback .item-row--feedback > .item-row__main {
        font-size: 14px;
    }
}
