:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-secondary: #f8fafc;

    --text: #172033;
    --text-secondary: #667085;
    --text-muted: #98a2b3;

    --border: #e6eaf0;

    --primary: #315efb;
    --primary-hover: #244de1;
    --primary-soft: #edf2ff;

    --success: #159455;
    --success-soft: #eaf8f0;

    --warning: #d78200;
    --warning-soft: #fff5df;

    --danger: #d92d20;
    --danger-soft: #fff0ee;

    --purple: #7756d8;
    --purple-soft: #f2efff;

    --sidebar-width: 245px;

    --radius: 16px;
    --radius-small: 10px;

    --shadow:
        0 1px 2px rgba(16, 24, 40, 0.02),
        0 2px 8px rgba(16, 24, 40, 0.04);
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    min-height: 100%;
}


body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);

    font-size: 15px;
    line-height: 1.45;
}


button,
input,
textarea {
    font: inherit;
}


a {
    color: inherit;
    text-decoration: none;
}


button {
    cursor: pointer;
}


/* Layout */

.app-layout {
    display: flex;
    min-height: 100vh;
}


.sidebar {
    width: var(--sidebar-width);
    height: 100vh;

    position: fixed;
    left: 0;
    top: 0;

    display: flex;
    flex-direction: column;

    background: #101828;
    color: white;

    z-index: 100;
}


.sidebar-header {
    height: 84px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 20px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}


.brand-icon {
    width: 40px;
    height: 40px;

    border-radius: 12px;

    display: grid;
    place-items: center;

    background: var(--primary);

    color: white;

    font-size: 18px;
    font-weight: 700;
}


.brand-text {
    display: flex;
    flex-direction: column;
}


.brand-text strong {
    font-size: 15px;
}


.brand-text span {
    margin-top: 2px;

    font-size: 11px;

    color: #98a2b3;
}


.sidebar-nav {
    padding: 18px 12px;

    display: flex;
    flex-direction: column;

    gap: 5px;
}


.nav-item {
    min-height: 46px;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 0 13px;

    border-radius: 10px;

    color: #b8c0ce;

    font-weight: 500;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.nav-item:hover {
    background:
        rgba(255, 255, 255, 0.06);

    color: white;
}


.nav-item.active {
    background:
        rgba(49, 94, 251, 0.2);

    color: white;
}


.nav-icon {
    width: 22px;

    text-align: center;

    font-size: 16px;
}


.sidebar-footer {
    margin-top: auto;

    padding: 16px;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);
}


.bot-state {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 11px;

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.05);
}


.status-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: #3dd68c;

    box-shadow:
        0 0 0 4px rgba(61, 214, 140, 0.12);
}


.bot-state div {
    display: flex;
    flex-direction: column;
}


.bot-state strong {
    font-size: 12px;
}


.bot-state span:not(.status-dot) {
    font-size: 10px;
    color: #98a2b3;
}


.main {
    width:
        calc(100% - var(--sidebar-width));

    margin-left:
        var(--sidebar-width);
}


.topbar {
    min-height: 84px;

    display: flex;
    align-items: center;

    padding:
        18px
        clamp(20px, 4vw, 46px);

    background:
        rgba(255, 255, 255, 0.9);

    border-bottom:
        1px solid var(--border);
}


.topbar h1 {
    margin: 0;

    font-size: 24px;
    letter-spacing: -0.02em;
}


.page-subtitle {
    margin: 3px 0 0;

    color: var(--text-secondary);

    font-size: 13px;
}


.page-content {
    width: 100%;

    max-width: 1440px;

    margin: 0 auto;

    padding:
        28px
        clamp(20px, 4vw, 46px)
        60px;
}


/* Generic cards */

.card {
    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    padding: 22px;
}


.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.card-header h2 {
    margin: 2px 0 0;

    font-size: 18px;
}


.eyebrow {
    display: block;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.06em;

    text-transform: uppercase;
}


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


/* Alerts */

.alert {
    position: relative;

    display: flex;
    align-items: center;

    gap: 10px;

    margin-bottom: 20px;

    padding: 13px 16px;

    border-radius: 11px;

    border: 1px solid transparent;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}


.alert.success {
    color: #087443;
    background: var(--success-soft);
    border-color: #c9eed9;
}


.alert.error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #ffd1cc;
}


.alert.fade-out {
    opacity: 0;
    transform: translateY(-5px);
}


/* Buttons */

.button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 17px;

    border: 0;

    border-radius: 10px;

    font-weight: 600;

    transition:
        background 0.15s ease,
        transform 0.1s ease;
}


.button:active {
    transform: translateY(1px);
}


.button.primary {
    background: var(--primary);
    color: white;
}


.button.primary:hover {
    background: var(--primary-hover);
}


.button.secondary {
    background: var(--surface-secondary);
    color: var(--text);

    border:
        1px solid var(--border);
}


.button.small {
    min-height: 34px;
    padding: 0 12px;

    font-size: 13px;
}


.button.full {
    width: 100%;
}


.button.danger-text {
    background: transparent;

    color: var(--danger);
}


.button.danger-text:hover {
    background: var(--danger-soft);
}


.text-link {
    color: var(--primary);

    font-size: 13px;
    font-weight: 600;
}


/* Forms */

.form {
    display: flex;
    flex-direction: column;

    gap: 17px;
}


.field {
    display: flex;
    flex-direction: column;

    gap: 7px;
}


.field > span {
    color: #344054;

    font-size: 13px;
    font-weight: 600;
}


.field input,
.field textarea {
    width: 100%;

    border:
        1px solid #d0d5dd;

    border-radius: 10px;

    background: white;

    color: var(--text);

    outline: none;

    transition:
        border 0.15s ease,
        box-shadow 0.15s ease;
}


.field input {
    height: 43px;

    padding: 0 12px;
}


.field textarea {
    min-height: 150px;

    padding: 12px 13px;

    resize: vertical;

    line-height: 1.6;
}


.field input:focus,
.field textarea:focus {
    border-color: #84a0ff;

    box-shadow:
        0 0 0 3px rgba(49, 94, 251, 0.1);
}


/* Dashboard */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 18px;
}


.stat-card {
    display: flex;
    align-items: center;

    gap: 15px;

    padding: 20px;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    background: white;

    box-shadow: var(--shadow);
}


.stat-icon {
    flex: 0 0 auto;

    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    font-size: 18px;
    font-weight: 700;
}


.stat-icon.blue {
    background: var(--primary-soft);
    color: var(--primary);
}


.stat-icon.purple {
    background: var(--purple-soft);
    color: var(--purple);
}


.stat-icon.green {
    background: var(--success-soft);
    color: var(--success);
}


.stat-icon.orange {
    background: var(--warning-soft);
    color: var(--warning);
}


.stat-card > div:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.stat-label {
    color: var(--text-secondary);

    font-size: 12px;
}


.stat-value {
    margin-top: 1px;

    font-size: 23px;

    line-height: 1.2;
}


.stat-value.small {
    font-size: 17px;
}


.stat-hint {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 11px;
}


.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(280px, 0.65fr);

    gap: 18px;

    margin-bottom: 18px;
}


.people-list.large {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;
}


.person-chip {
    min-width: 220px;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 12px;

    border-radius: 12px;

    background: var(--surface-secondary);
}


.avatar {
    width: 39px;
    height: 39px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--primary-soft);
    color: var(--primary);

    font-weight: 700;
}


.person-chip > div:last-child {
    display: flex;
    flex-direction: column;
}


.person-chip span {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 11px;
}


.task-list {
    list-style: none;

    display: flex;
    flex-direction: column;

    gap: 10px;

    margin: 0;
    padding: 0;
}


.task-list li {
    display: flex;
    align-items: center;

    gap: 10px;
}


.task-check {
    width: 23px;
    height: 23px;

    display: grid;
    place-items: center;

    border-radius: 7px;

    background: var(--success-soft);

    color: var(--success);

    font-size: 11px;
    font-weight: 800;
}


.schedule-list {
    display: flex;
    flex-direction: column;
}


.schedule-row {
    min-height: 70px;

    display: grid;
    grid-template-columns:
        70px 1fr 25px;

    align-items: center;

    gap: 15px;

    padding: 10px 4px;

    border-bottom:
        1px solid var(--border);
}


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


.schedule-row:hover {
    background: var(--surface-secondary);
}


.schedule-date {
    display: flex;
    flex-direction: column;
}


.schedule-date strong {
    font-size: 19px;
}


.schedule-date span {
    color: var(--text-muted);

    font-size: 10px;
}


.schedule-people {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;
}


.schedule-people span {
    padding: 5px 9px;

    border-radius: 8px;

    background: var(--primary-soft);

    color: #244abf;

    font-size: 12px;
}


.row-arrow {
    color: var(--text-muted);

    font-size: 24px;
}


/* Empty states */

.empty-state {
    min-height: 260px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}


.empty-state.compact {
    min-height: 190px;
}


.empty-state h3 {
    margin: 10px 0 5px;
}


.empty-state p {
    max-width: 320px;

    margin: 0 0 16px;

    color: var(--text-secondary);
}


.empty-icon {
    font-size: 31px;
}


/* Students */

.content-grid.students-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(270px, 330px);

    gap: 18px;

    align-items: start;
}


.search-box {
    width: 220px;
    height: 38px;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 0 11px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background: var(--surface-secondary);
}


.search-box input {
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;
}


.student-list {
    display: flex;
    flex-direction: column;
}


.student-row {
    min-height: 68px;

    display: grid;

    grid-template-columns:
        minmax(210px, 1fr)
        180px
        80px;

    align-items: center;

    gap: 15px;

    padding: 10px 4px;

    border-bottom:
        1px solid var(--border);
}


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


.student-main {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 11px;
}


.student-main > div:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.student-main strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.student-id {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 10px;
}


.badge {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding: 6px 9px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 600;
}


.badge > span {
    width: 7px;
    height: 7px;

    border-radius: 50%;
}


.badge.success {
    background: var(--success-soft);
    color: #087443;
}


.badge.success > span {
    background: var(--success);
}


.badge.warning {
    background: var(--warning-soft);
    color: #a15b00;
}


.badge.warning > span {
    background: var(--warning);
}


.student-actions {
    display: flex;
    justify-content: flex-end;

    gap: 6px;
}


.icon-button {
    width: 34px;
    height: 34px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background: white;
}


.icon-button:hover {
    background: var(--surface-secondary);
}


.icon-button.copied {
    background: var(--success-soft);
    color: var(--success);
}


.sticky-card {
    position: sticky;

    top: 20px;
}


.info-box {
    margin-top: 20px;

    padding: 14px;

    border-radius: 11px;

    background: var(--primary-soft);
}


.info-box strong {
    font-size: 12px;
}


.info-box p {
    margin: 5px 0 0;

    color: #52627f;

    font-size: 11px;

    line-height: 1.55;
}


/* Calendar */

.duty-layout {
    display: grid;

    grid-template-columns:
        minmax(600px, 1fr)
        minmax(280px, 350px);

    align-items: start;

    gap: 18px;
}


.calendar-card {
    padding: 20px;
}


.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 20px;

    margin-bottom: 18px;
}


.calendar-header h2 {
    min-width: 190px;

    margin: 0;

    text-align: center;

    font-size: 19px;
}


.calendar-nav {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background: white;

    font-size: 24px;
}


.calendar-nav:hover {
    background: var(--surface-secondary);
}


.calendar-weekdays {
    display: grid;

    grid-template-columns:
        repeat(7, 1fr);

    gap: 5px;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;

    text-align: center;
}


.calendar-grid {
    display: grid;

    grid-template-columns:
        repeat(7, 1fr);

    gap: 5px;
}


.calendar-day {
    aspect-ratio: 1.05 / 1;

    min-height: 82px;

    display: flex;
    flex-direction: column;

    padding: 8px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: white;

    overflow: hidden;

    transition:
        border 0.15s ease,
        background 0.15s ease;
}


.calendar-day:hover {
    border-color: #b4c3ff;

    background: #fbfcff;
}


.calendar-day.other-month {
    opacity: 0.38;
}


.calendar-day.selected {
    border-color: var(--primary);

    background: var(--primary-soft);

    box-shadow:
        inset 0 0 0 1px var(--primary);
}


.day-number {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    border-radius: 7px;

    font-size: 12px;
    font-weight: 600;
}


.calendar-day.today .day-number {
    background: var(--primary);
    color: white;
}


.calendar-people {
    margin-top: auto;

    display: flex;
    flex-direction: column;

    gap: 2px;

    min-width: 0;
}


.calendar-people span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    color: #536179;

    font-size: 9px;
}


.calendar-more {
    color: var(--primary) !important;

    font-weight: 600;
}


.assignment-card {
    position: sticky;

    top: 20px;
}


.assignment-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 12px;

    font-size: 12px;
}


.assignment-toolbar span {
    color: var(--text-muted);
}


.checkbox-list {
    max-height: 470px;

    overflow-y: auto;

    display: flex;
    flex-direction: column;

    border:
        1px solid var(--border);

    border-radius: 11px;
}


.student-checkbox {
    min-height: 55px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 9px 11px;

    border-bottom:
        1px solid var(--border);

    cursor: pointer;
}


.student-checkbox:last-child {
    border-bottom: 0;
}


.student-checkbox:hover {
    background: var(--surface-secondary);
}


.student-checkbox input {
    position: absolute;
    opacity: 0;

    pointer-events: none;
}


.custom-checkbox {
    width: 21px;
    height: 21px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border:
        1px solid #cbd2dc;

    border-radius: 6px;

    color: transparent;

    font-size: 10px;

    transition:
        background 0.15s ease,
        border 0.15s ease;
}


.student-checkbox input:checked
+ .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);

    color: white;
}


.student-checkbox-name {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.student-checkbox-name strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    font-size: 12px;
}


.student-checkbox-name small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 9px;
}


.form-actions {
    margin-top: 15px;
}


.delete-duty-form {
    margin-top: 6px;
}


/* Settings */

.settings-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(280px, 340px);

    gap: 18px;

    align-items: start;
}


.settings-main {
    display: flex;
    flex-direction: column;

    gap: 18px;
}


.settings-section {
    display: flex;
    justify-content: space-between;

    gap: 30px;
}


.settings-description {
    display: flex;

    gap: 13px;

    max-width: 580px;
}


.settings-description h2 {
    margin: 0 0 5px;

    font-size: 17px;
}


.settings-description p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 12px;
}


.settings-icon {
    width: 42px;
    height: 42px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background: var(--purple-soft);
}


.settings-control {
    min-width: 150px;
}


.settings-control input[type="time"] {
    font-size: 17px;
    font-weight: 600;
}


.settings-save {
    display: flex;
    justify-content: flex-end;
}


.connection-state {
    margin-top: 16px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 13px;

    border-radius: 11px;
}


.connection-state > div {
    width: 31px;
    height: 31px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    font-weight: 700;
}


.connection-state span {
    display: flex;
    flex-direction: column;
}


.connection-state small {
    margin-top: 2px;

    opacity: 0.7;
}


.connection-state.success {
    background: var(--success-soft);
    color: #087443;
}


.connection-state.success > div {
    background: #ccefdc;
}


.connection-state.warning {
    background: var(--warning-soft);
    color: #945500;
}


.connection-state.warning > div {
    background: #ffe5b1;
}


/* Mobile */

.mobile-menu {
    display: none;

    margin-right: 12px;

    width: 38px;
    height: 38px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background: white;
}


.sidebar-overlay {
    display: none;
}


@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .stats-grid .stat-card:last-child {
        grid-column: span 2;
    }


    .dashboard-grid {
        grid-template-columns: 1fr;
    }


    .duty-layout {
        grid-template-columns: 1fr;
    }


    .assignment-card {
        position: static;
    }


    .content-grid.students-layout,
    .settings-layout {
        grid-template-columns: 1fr;
    }


    .sticky-card {
        position: static;
    }

}


@media (max-width: 760px) {

    :root {
        --sidebar-width: 250px;
    }


    .sidebar {
        transform:
            translateX(-100%);

        transition:
            transform 0.2s ease;
    }


    .sidebar.open {
        transform:
            translateX(0);
    }


    .sidebar-overlay {
        position: fixed;

        inset: 0;

        z-index: 90;

        background:
            rgba(16, 24, 40, 0.4);
    }


    .sidebar-overlay.visible {
        display: block;
    }


    .main {
        width: 100%;

        margin-left: 0;
    }


    .mobile-menu {
        display: block;
    }


    .topbar {
        min-height: 72px;

        padding: 14px 16px;
    }


    .topbar h1 {
        font-size: 20px;
    }


    .page-content {
        padding:
            18px 14px 50px;
    }


    .stats-grid {
        grid-template-columns: 1fr;
    }


    .stats-grid .stat-card:last-child {
        grid-column: auto;
    }


    .card {
        padding: 17px;
    }


    .student-row {
        grid-template-columns:
            1fr auto;
    }


    .student-row > div:nth-child(2) {
        grid-column: 1;
        margin-left: 50px;
    }


    .student-actions {
        grid-row: 1 / 3;
        grid-column: 2;
    }


    .search-box {
        width: 100%;
    }


    .students-layout .card-header {
        flex-direction: column;
    }


    .calendar-card {
        padding: 11px;
    }


    .calendar-grid {
        gap: 3px;
    }


    .calendar-weekdays {
        gap: 3px;
    }


    .calendar-day {
        min-height: 65px;

        padding: 5px;

        border-radius: 8px;
    }


    .calendar-people span {
        font-size: 8px;
    }


    .settings-section {
        flex-direction: column;

        gap: 18px;
    }


    .settings-control {
        min-width: 0;
    }

}


@media (max-width: 480px) {

    .calendar-day {
        min-height: 54px;
    }


    .calendar-people span {
        display: none;
    }


    .calendar-people span:first-child {
        display: block;

        width: 6px;
        height: 6px;

        border-radius: 50%;

        background: var(--primary);

        color: transparent;
    }


    .schedule-row {
        grid-template-columns:
            55px 1fr 18px;
    }

}

/* =========================================================
   Deadlines
   ========================================================= */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}


.section-heading h2 {
    margin: 3px 0 0;

    font-size: 21px;
}


.deadline-list {
    display: flex;
    flex-direction: column;

    gap: 11px;
}


.deadline-card {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(180px, 260px)
        25px;

    align-items: center;

    gap: 25px;

    padding: 18px 20px;

    background: white;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    transition:
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.deadline-card:hover {
    border-color: #c6d1ff;

    transform:
        translateY(-1px);

    box-shadow:
        0 5px 18px
        rgba(16, 24, 40, 0.07);
}


.deadline-card-main {
    min-width: 0;

    display: flex;
    align-items: flex-start;

    gap: 14px;
}


.deadline-icon {
    width: 44px;
    height: 44px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: var(--purple-soft);

    font-size: 18px;
}


.deadline-icon.small {
    width: 36px;
    height: 36px;

    border-radius: 10px;

    font-size: 14px;
}


.deadline-card-content {
    min-width: 0;
}


.deadline-title-row {
    display: flex;
    align-items: center;

    gap: 9px;
}


.deadline-title-row h3 {
    margin: 0;

    font-size: 16px;
}


.deadline-card-content p {
    max-width: 650px;

    margin: 5px 0 9px;

    color: var(--text-secondary);

    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.deadline-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    color: var(--text-muted);

    font-size: 10px;
}


.badge.danger {
    background: var(--danger-soft);
    color: var(--danger);
}


.deadline-progress-area {
    min-width: 0;
}


.deadline-progress-label {
    display: flex;
    justify-content: space-between;

    margin-bottom: 7px;

    font-size: 11px;
}


.deadline-progress-label span {
    color: var(--text-secondary);
}


.deadline-progress-area small {
    display: block;

    margin-top: 5px;

    color: var(--text-muted);

    text-align: right;

    font-size: 9px;
}


.progress-track {
    width: 100%;
    height: 7px;

    overflow: hidden;

    border-radius: 999px;

    background: #edf0f5;
}


.progress-track.large {
    height: 10px;

    margin-bottom: 20px;
}


.progress-value {
    height: 100%;

    border-radius: inherit;

    background: var(--primary);

    transition:
        width 0.25s ease;
}


/* Modal */

body.modal-open {
    overflow: hidden;
}


.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 500;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 25px;

    background:
        rgba(15, 23, 42, 0.48);

    backdrop-filter:
        blur(3px);
}


.modal-overlay.visible {
    display: flex;
}


.modal {
    width: min(
        680px,
        100%
    );

    max-height:
        calc(100vh - 50px);

    overflow-y: auto;

    border-radius: 18px;

    background: white;

    box-shadow:
        0 25px 70px
        rgba(16, 24, 40, 0.22);

    padding: 24px;
}


.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.modal-header h2 {
    margin: 3px 0 0;
}


.modal-close {
    width: 35px;
    height: 35px;

    border: 0;

    border-radius: 9px;

    background: var(--surface-secondary);

    color: var(--text-secondary);

    font-size: 23px;
}


.modal-actions {
    display: flex;
    justify-content: flex-end;

    gap: 10px;

    padding-top: 5px;
}


.form-section {
    padding-top: 4px;
}


.form-section > strong {
    display: block;

    margin-bottom: 9px;

    font-size: 13px;
}


.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 9px;
}


.form-section-header > div {
    display: flex;
    flex-direction: column;
}


.form-section-header strong {
    font-size: 13px;
}


.form-section-header small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 10px;
}


.text-button {
    border: 0;

    padding: 0;

    background: transparent;

    color: var(--primary);

    font-size: 12px;
    font-weight: 600;
}


.radio-cards {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 9px;
}


.radio-card {
    position: relative;

    display: flex;

    padding: 13px;

    border:
        1px solid var(--border);

    border-radius: 11px;

    cursor: pointer;
}


.radio-card:hover {
    border-color: #b7c5ff;
}


.radio-card input {
    margin-right: 10px;

    accent-color:
        var(--primary);
}


.radio-card span {
    display: flex;
    flex-direction: column;
}


.radio-card strong {
    font-size: 12px;
}


.radio-card small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 10px;
}


.deadline-student-picker {
    margin-top: 4px;
}


.deadline-checkbox-list {
    max-height: 230px;
}


.reminder-list {
    display: flex;
    flex-direction: column;

    gap: 7px;
}


.reminder-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(180px, 220px)
        35px;

    gap: 7px;
}


.reminder-row input,
.reminder-row select,
.select-control {
    width: 100%;
    height: 42px;

    padding: 0 10px;

    border:
        1px solid #d0d5dd;

    border-radius: 9px;

    background: white;

    color: var(--text);
}


.remove-reminder {
    width: 35px;
    height: 42px;

    border: 0;

    border-radius: 9px;

    background: var(--danger-soft);

    color: var(--danger);

    font-size: 20px;
}


/* Deadline detail */

.deadline-detail-header {
    margin-bottom: 14px;
}


.back-link {
    color: var(--primary);

    font-size: 12px;
    font-weight: 600;
}


.deadline-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;

    margin-bottom: 18px;
}


.deadline-detail-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(280px, 340px);

    gap: 18px;

    align-items: start;
}


.progress-percent {
    color: var(--primary);

    font-size: 20px;
}


.deadline-participants {
    display: flex;
    flex-direction: column;
}


.deadline-participant {
    min-height: 68px;

    display: grid;

    grid-template-columns:
        minmax(200px, 1fr)
        130px
        90px;

    align-items: center;

    gap: 12px;

    padding: 9px 3px;

    border-bottom:
        1px solid var(--border);
}


.deadline-participant:last-child {
    border-bottom: 0;
}


.deadline-participant.completed {
    opacity: 0.72;
}


.participant-status {
    display: flex;
    justify-content: flex-start;
}


.deadline-detail-sidebar {
    display: flex;
    flex-direction: column;

    gap: 15px;
}


.deadline-detail-sidebar > .card {
    padding: 19px;
}


.deadline-detail-sidebar h2 {
    margin: 3px 0 0;

    font-size: 17px;
}


.deadline-description {
    margin: 11px 0 0;

    color: var(--text-secondary);

    font-size: 12px;

    white-space: pre-line;
}


.deadline-info-list {
    display: flex;
    flex-direction: column;

    gap: 11px;

    margin-top: 18px;
}


.deadline-info-list > div {
    display: flex;
    justify-content: space-between;

    gap: 15px;

    padding-top: 11px;

    border-top:
        1px solid var(--border);
}


.deadline-info-list span {
    color: var(--text-secondary);

    font-size: 11px;
}


.deadline-info-list strong {
    text-align: right;

    font-size: 11px;
}


.deadline-reminders {
    display: flex;
    flex-direction: column;

    gap: 9px;
}


.deadline-reminder-item {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px;

    border-radius: 10px;

    background: var(--surface-secondary);
}


.reminder-time-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: var(--purple-soft);
}


.deadline-reminder-item > div:last-child {
    display: flex;
    flex-direction: column;
}


.deadline-reminder-item strong {
    font-size: 11px;
}


.deadline-reminder-item span {
    font-size: 12px;
}


.deadline-reminder-item small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 9px;
}


/* Dashboard deadlines */

.dashboard-deadlines {
    margin-top: 18px;
}


.dashboard-deadline-list {
    display: flex;
    flex-direction: column;
}


.dashboard-deadline-row {
    min-height: 66px;

    display: grid;

    grid-template-columns:
        40px
        minmax(0, 1fr)
        90px
        20px;

    align-items: center;

    gap: 12px;

    padding: 9px 3px;

    border-bottom:
        1px solid var(--border);
}


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


.dashboard-deadline-row:hover {
    background: var(--surface-secondary);
}


.dashboard-deadline-main {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.dashboard-deadline-main strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    font-size: 12px;
}


.dashboard-deadline-main span {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 10px;
}


.dashboard-deadline-progress {
    display: flex;
    flex-direction: column;

    text-align: right;
}


.dashboard-deadline-progress strong {
    font-size: 12px;
}


.dashboard-deadline-progress span {
    color: var(--text-muted);

    font-size: 9px;
}


@media (max-width: 900px) {

    .deadline-card {
        grid-template-columns:
            minmax(0, 1fr)
            20px;
    }


    .deadline-progress-area {
        grid-column: 1 / -1;
    }


    .deadline-detail-layout {
        grid-template-columns:
            1fr;
    }


    .deadline-summary-grid {
        grid-template-columns:
            repeat(3, 1fr);
    }

}


@media (max-width: 650px) {

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }


    .deadline-summary-grid {
        grid-template-columns:
            1fr;
    }


    .deadline-card {
        padding: 15px;
    }


    .deadline-card-main {
        gap: 10px;
    }


    .deadline-meta {
        gap: 7px;
    }


    .radio-cards {
        grid-template-columns:
            1fr;
    }


    .reminder-row {
        grid-template-columns:
            1fr;
    }


    .remove-reminder {
        width: 100%;
        height: 34px;
    }


    .deadline-participant {
        grid-template-columns:
            1fr auto;
    }


    .participant-status {
        grid-column: 1;
        margin-left: 50px;
    }


    .deadline-participant form {
        grid-row: 1 / 3;
        grid-column: 2;
    }


    .dashboard-deadline-row {
        grid-template-columns:
            38px
            minmax(0, 1fr)
            18px;
    }


    .dashboard-deadline-progress {
        display: none;
    }

}

/* =========================================================
   Knowledge base
   ========================================================= */

.knowledge-list {
    display: flex;
    flex-direction: column;

    gap: 11px;
}


.knowledge-card {
    display: grid;

    grid-template-columns:
        40px
        50px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 14px;

    padding: 17px 19px;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    background: white;

    box-shadow: var(--shadow);
}


.knowledge-card.inactive {
    opacity: 0.62;
}


.knowledge-order {
    display: flex;
    flex-direction: column;

    gap: 3px;
}


.order-button {
    width: 30px;
    height: 27px;

    border:
        1px solid var(--border);

    border-radius: 7px;

    background: white;

    color: var(--text-secondary);
}


.order-button:hover {
    background:
        var(--surface-secondary);
}


.knowledge-emoji {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background:
        var(--primary-soft);

    font-size: 21px;
}


.knowledge-card-main {
    min-width: 0;
}


.knowledge-title-row {
    display: flex;
    align-items: center;

    gap: 10px;
}


.knowledge-title-row h3 {
    margin: 0;

    font-size: 15px;
}


.knowledge-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 4px;

    color: var(--text-muted);

    font-size: 10px;
}


.knowledge-preview {
    max-width: 700px;

    margin: 8px 0 0;

    color: var(--text-secondary);

    font-size: 11px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.knowledge-actions {
    display: flex;
    align-items: center;

    gap: 7px;
}


.knowledge-edit-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(250px, 310px);

    align-items: start;

    gap: 18px;
}


.knowledge-title-fields {
    display: grid;

    grid-template-columns:
        90px 1fr;

    gap: 12px;
}


.emoji-field input {
    text-align: center;

    font-size: 20px;
}


.knowledge-file-section {
    padding: 15px;

    border:
        1px dashed #cbd5e1;

    border-radius: 12px;

    background:
        var(--surface-secondary);
}


.knowledge-file-section[hidden] {
    display: none;
}


.current-file {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 12px;

    padding: 11px;

    border-radius: 10px;

    background: white;

    border:
        1px solid var(--border);
}


.current-file-icon {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background:
        var(--primary-soft);

    font-size: 17px;
}


.current-file > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.current-file strong {
    font-size: 11px;
}


.current-file span:last-child {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 10px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.selected-file-name {
    margin-top: 8px;

    color: var(--primary);

    font-size: 11px;
}


.form-hint {
    margin: -8px 0 0;

    color: var(--text-muted);

    font-size: 10px;
}


.switch-row {
    display: flex;
    align-items: center;

    gap: 11px;

    cursor: pointer;
}


.switch-row input {
    position: absolute;

    opacity: 0;
}


.switch {
    position: relative;

    width: 42px;
    height: 24px;

    flex: 0 0 auto;

    border-radius: 999px;

    background: #cbd5e1;

    transition:
        background 0.15s ease;
}


.switch::after {
    content: "";

    position: absolute;

    width: 18px;
    height: 18px;

    left: 3px;
    top: 3px;

    border-radius: 50%;

    background: white;

    transition:
        transform 0.15s ease;
}


.switch-row input:checked
+ .switch {
    background:
        var(--primary);
}


.switch-row input:checked
+ .switch::after {
    transform:
        translateX(18px);
}


.switch-row > span:last-child {
    display: flex;
    flex-direction: column;
}


.switch-row strong {
    font-size: 12px;
}


.switch-row small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 10px;
}


.knowledge-form-actions {
    display: flex;

    justify-content:
        flex-end;

    gap: 9px;
}


.telegram-preview {
    margin-top: 16px;

    padding: 18px;

    border-radius: 14px;

    background: #dce9f4;
}


.telegram-preview button {
    width: 100%;

    padding: 11px 12px;

    border:
        1px solid #c7d6e2;

    border-radius: 8px;

    background: white;

    color: #1f2937;

    font-weight: 500;
}


@media (max-width: 900px) {

    .knowledge-edit-layout {
        grid-template-columns:
            1fr;
    }

}


@media (max-width: 700px) {

    .knowledge-card {
        grid-template-columns:
            34px
            42px
            minmax(0, 1fr);
    }


    .knowledge-actions {
        grid-column:
            2 / -1;

        justify-content:
            flex-start;
    }


    .knowledge-title-fields {
        grid-template-columns:
            75px 1fr;
    }

}

/* =========================================================
   Authentication
   ========================================================= */

.topbar {
    justify-content: space-between;
    gap: 20px;
}


.topbar-left {
    min-width: 0;

    display: flex;
    align-items: center;
}


.topbar-user {
    display: flex;
    align-items: center;

    gap: 14px;
}


.admin-profile {
    display: flex;
    align-items: center;

    gap: 9px;
}


.admin-avatar {
    width: 35px;
    height: 35px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border-radius: 50%;

    background:
        var(--primary-soft);

    color:
        var(--primary);

    font-size: 13px;
    font-weight: 700;
}


.admin-profile-text {
    display: flex;
    flex-direction: column;
}


.admin-profile-text strong {
    font-size: 11px;
}


.admin-profile-text span {
    color:
        var(--text-muted);

    font-size: 9px;
}


.logout-button {
    min-height: 34px;

    padding: 0 11px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background: white;

    color:
        var(--text-secondary);

    font-size: 11px;
    font-weight: 600;
}


.logout-button:hover {
    background:
        var(--surface-secondary);

    color:
        var(--text);
}


/* Login */

.login-page {
    min-height: 100vh;

    margin: 0;

    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(
                49,
                94,
                251,
                0.10
            ),
            transparent 35%
        ),
        var(--bg);
}


.login-wrapper {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;
}


.login-card {
    width: min(
        420px,
        100%
    );

    padding: 32px;

    border:
        1px solid var(--border);

    border-radius: 20px;

    background: white;

    box-shadow:
        0 20px 60px
        rgba(
            16,
            24,
            40,
            0.10
        );
}


.login-brand {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 34px;
}


.login-logo {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border-radius: 13px;

    background:
        var(--primary);

    color: white;

    font-size: 19px;
    font-weight: 700;
}


.login-brand > div:last-child {
    display: flex;
    flex-direction: column;
}


.login-brand strong {
    font-size: 14px;
}


.login-brand span {
    margin-top: 2px;

    color:
        var(--text-muted);

    font-size: 10px;
}


.login-heading {
    margin-bottom: 23px;
}


.login-heading h1 {
    margin: 0;

    font-size: 25px;

    letter-spacing:
        -0.025em;
}


.login-heading p {
    margin:
        7px 0 0;

    color:
        var(--text-secondary);

    font-size: 12px;

    line-height: 1.55;
}


.login-form {
    gap: 17px;
}


.login-button {
    margin-top: 5px;
}


.login-alert {
    margin-bottom: 18px;
}


.login-note {
    margin:
        22px 0 0;

    color:
        var(--text-muted);

    text-align: center;

    font-size: 9px;
}


.password-field {
    position: relative;
}


.password-field input {
    padding-right: 80px;
}


.password-toggle {
    position: absolute;

    right: 7px;
    top: 50%;

    transform:
        translateY(-50%);

    border: 0;

    padding: 5px 7px;

    border-radius: 6px;

    background:
        transparent;

    color:
        var(--primary);

    font-size: 10px;
    font-weight: 600;
}


.password-toggle:hover {
    background:
        var(--primary-soft);
}


@media (max-width: 760px) {

    .admin-profile-text {
        display: none;
    }


    .topbar-user {
        gap: 7px;
    }


    .admin-avatar {
        display: none;
    }


    .login-wrapper {
        padding: 15px;
    }


    .login-card {
        padding: 25px 20px;
    }

}