:root{
    --bg:#f7f9fc;
    --card:#fff;
    --text:#102235;
    --muted:#647386;
    --line:#dce4ee;
    --accent:#16458f;
    --shadow:0 12px 30px rgba(15,37,64,.07);
    --radius:16px;
}

*{box-sizing:border-box}

body{
    margin:0;
    background:linear-gradient(180deg,#fff 0%,var(--bg) 50%,#fff 100%);
    color:var(--text);
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
    font-size:15px;
    line-height:1.5;
}

.container{
    max-width:1120px;
    margin:0 auto;
    padding:32px 20px;
}

.narrow{max-width:520px}

.page-head{
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:flex-start;
    margin-bottom:24px;
}

.kicker{
    margin:0 0 8px;
    color:var(--accent);
    font-weight:800;
}

h1{
    margin:0 0 10px;
    font-size:clamp(32px,4vw,48px);
    line-height:1.05;
    letter-spacing:-.035em;
}

h2{margin:0 0 8px;font-size:20px}
p{margin:0 0 10px}
.muted{color:var(--muted)}
.lead{font-size:18px;color:var(--muted);max-width:720px}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:10px 14px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
    color:var(--accent);
    font-weight:700;
    text-decoration:none;
    cursor:pointer;
}

.btn-primary{
    background:var(--accent);
    border-color:var(--accent);
    color:#fff;
}

.danger{color:#b42318}

.filters{
    display:grid;
    grid-template-columns:1.4fr repeat(3,1fr) auto auto;
    gap:10px;
    margin-bottom:22px;
}

input,select,textarea{
    width:100%;
    min-height:40px;
    padding:10px 12px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
    color:var(--text);
    font:inherit;
}

textarea{min-height:92px;resize:vertical}

.events{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
    gap:18px;
}

.event-card,.panel{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:20px;
    box-shadow:var(--shadow);
}

.event-top{
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:center;
    margin-bottom:12px;
}

.badge,.status{
    display:inline-flex;
    padding:5px 9px;
    border-radius:999px;
    background:#eef3fb;
    color:var(--accent);
    font-size:12px;
    font-weight:700;
}

.status{
    color:var(--muted);
    background:#f2f4f7;
}

.meta{
    display:grid;
    gap:2px;
    margin:14px 0;
}

.meta p{margin:0}

.comment{
    padding:12px;
    border-left:3px solid var(--accent);
    background:#f4f7fc;
    border-radius:10px;
}

.empty{
    color:var(--muted);
}

.admin-form{
    display:grid;
    gap:14px;
    margin-bottom:24px;
}

.admin-form label{
    display:grid;
    gap:6px;
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
}

.admin-list{
    grid-template-columns:1fr;
}

@media(max-width:900px){
    .page-head{display:grid}
    .filters{grid-template-columns:1fr}
    .form-grid{grid-template-columns:1fr}
}

.admin-actions{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    margin-top:12px;
}

.admin-actions form{
    margin:0;
}

.event-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}

.narrow-event{
    max-width:820px;
}

.back-link{
    display:inline-block;
    margin-bottom:18px;
    color:var(--accent);
    font-weight:700;
    text-decoration:none;
}

.event-full{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:28px;
    box-shadow:var(--shadow);
}

.details-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:12px;
    margin:24px 0;
}

.details-grid div{
    padding:14px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#f8fafc;
}

.details-grid b{
    display:block;
    margin-bottom:4px;
    font-size:13px;
    color:var(--muted);
}

.details-grid span{
    font-weight:700;
}

.event-comment{
    margin:20px 0;
}

.big-actions{
    margin-top:22px;
}

.event-card .badge,
.event-full .badge{
    background:#eef3fb;
}

.event-card:has(.badge){
    position:relative;
}

@media(max-width:700px){
    .details-grid{
        grid-template-columns:1fr;
    }
}

.event-title-link{
    color:inherit;
    text-decoration:none;
}

.event-title-link:hover{
    color:var(--accent);
    text-decoration:none;
}

.dropdown{
    position:relative;
    display:inline-flex;
}

.dropdown-menu{
    display:none;
    position:absolute;
    left:0;
    top:calc(100% + 8px);
    min-width:210px;
    padding:8px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fff;
    box-shadow:var(--shadow);
    z-index:20;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu{
    display:grid;
    gap:4px;
}

.dropdown-menu a{
    display:block;
    padding:10px 12px;
    border-radius:9px;
    color:var(--text);
    text-decoration:none;
    font-weight:650;
}

.dropdown-menu a:hover{
    background:#f4f7fc;
    color:var(--accent);
}

.event-card{
    position:relative;
}

.card-menu{
    position:absolute;
    top:14px;
    right:14px;
}

.menu-button{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border:1px solid transparent;
    border-radius:10px;
    background:transparent;
    color:var(--muted);
    font-size:18px;
    line-height:1;
    letter-spacing:1px;
    cursor:pointer;
}

.menu-button:hover,
.card-menu:focus-within .menu-button{
    background:#f4f7fc;
    border-color:var(--line);
    color:var(--accent);
}

.card-menu .dropdown-menu{
    left:auto;
    right:0;
    top:calc(100% + 6px);
}

.event-card h2{
    padding-right:42px;
}

.event-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:12px;
}

.event-badges{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    padding-right:8px;
}

.card-menu{
    position:relative;
    top:auto;
    right:auto;
    flex:0 0 auto;
}

.dropdown-menu{
    display:none;
}

.dropdown.open .dropdown-menu{
    display:grid;
    gap:4px;
}

.dropdown:hover .dropdown-menu{
    display:none;
}

.dropdown.open:hover .dropdown-menu{
    display:grid;
}

.event-card h2{
    padding-right:0;
}

.import-panel{
    margin-bottom:24px;
}

.import-form{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    margin-top:14px;
}

.import-form input[type="file"]{
    max-width:360px;
}

.toolbar{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin:0 0 24px;
}

.toolbar-row{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.toolbar-row-calendar{
    padding-top:12px;
    border-top:1px solid var(--line);
}

.seg-control{
    display:inline-flex;
    gap:2px;
    padding:4px;
    background:var(--bg);
    border-radius:12px;
}

.seg-control-sm{
    padding:3px;
    border-radius:10px;
}

.seg-btn{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:9px 16px;
    border:none;
    border-radius:9px;
    background:transparent;
    color:var(--muted);
    font-weight:700;
    font-size:14px;
    font-family:inherit;
    cursor:pointer;
    transition:background .15s ease, color .15s ease, box-shadow .15s ease;
}

.seg-control-sm .seg-btn{
    padding:7px 14px;
    font-size:13px;
}

.seg-btn:hover{
    color:var(--text);
}

.seg-btn.active{
    background:#fff;
    color:var(--text);
    box-shadow:0 1px 3px rgba(15,37,64,.14);
}

.seg-icon{
    font-size:13px;
}

.toolbar-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.chip-toggle{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:9px 14px;
    border:1px solid var(--line);
    border-radius:999px;
    background:#fff;
    color:var(--text);
    font-weight:700;
    font-size:13px;
    font-family:inherit;
    cursor:pointer;
    transition:background .15s ease, border-color .15s ease, color .15s ease;
}

.chip-toggle:hover{
    border-color:var(--accent);
}

.chip-toggle.active{
    background:var(--accent);
    border-color:var(--accent);
    color:#fff;
}

.filter-chips{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.filter-chip{
    position:relative;
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:6px 12px 6px 10px;
    border:1px solid transparent;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
    color:var(--muted);
    background:var(--bg);
    cursor:pointer;
    user-select:none;
    transition:background .15s ease, color .15s ease, border-color .15s ease;
}

.filter-chip input{
    position:absolute;
    opacity:0;
    width:0;
    height:0;
}

.filter-chip .chip-dot{
    width:8px;
    height:8px;
}

.filter-chip:hover{
    border-color:var(--accent);
}

.filter-chip .chip-dot{
    background:#d1d5db;
}

.filter-chip:has(input:checked) .chip-dot{
    background:currentColor;
}

.filter-chip.chip-registration:has(input:checked){background:#e0f2fe;color:#075985;}
.filter-chip.chip-selection:has(input:checked){background:#d1fae5;color:#065f46;}
.filter-chip.chip-second_stage:has(input:checked){background:#ede9fe;color:#5b21b6;}
.filter-chip.chip-main:has(input:checked){background:#fef3c7;color:#92400e;}
.filter-chip.chip-final:has(input:checked){background:#ffe4e6;color:#9f1239;}
.filter-chip.chip-project_defense:has(input:checked){background:#fae8ff;color:#86198f;}
.filter-chip.chip-results:has(input:checked){background:#e5e9f0;color:#334155;}

.filter-chip:not(:has(input:checked)){
    background:#fff;
    border-color:var(--line);
    color:var(--muted);
}

.calendar-view{
    background:transparent;
}

.calendar-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
    margin-bottom:20px;
}

.calendar-head-title h2{
    text-transform:capitalize;
    margin:0;
    font-size:24px;
}

.calendar-subtitle{
    margin:3px 0 0;
    color:var(--muted);
    font-size:13px;
}

.calendar-head-nav{
    display:flex;
    align-items:center;
    gap:8px;
}

.month-nav{
    display:inline-flex;
    align-items:stretch;
    border:1px solid var(--line);
    border-radius:999px;
    overflow:hidden;
}

.month-nav .icon-btn{
    width:36px;
    height:36px;
    border:none;
    border-radius:0;
}

.month-nav .icon-btn:first-child{
    border-right:1px solid var(--line);
}

.icon-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    border:1px solid var(--line);
    border-radius:999px;
    background:#fff;
    color:var(--muted);
    font-weight:800;
    font-size:17px;
    cursor:pointer;
}

.icon-btn:hover{
    color:var(--accent);
    background:#f4f8ff;
}

.calendar-weekdays{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    padding-bottom:10px;
    border-bottom:1px solid var(--line);
    color:var(--muted);
    font-size:12.5px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.calendar-weekdays span{
    padding-left:8px;
}

.calendar-weekdays .is-weekend{
    color:#c4320a;
}

.calendar-grid{
    display:flex;
    flex-direction:column;
}

.cal-week{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    border-bottom:1px solid var(--line);
    position:relative;
}

.cal-daycell{
    grid-row:1 / -1;
    border-left:1px solid var(--line);
    padding:8px 10px;
    position:relative;
    min-height:140px;
    text-align:right;
}

.cal-daycell:first-child{
    border-left:none;
}

.cal-daycell:nth-child(6),
.cal-daycell:nth-child(7){
    background:#f8f8fa;
}

.cal-daycell.cal-outside{
    background:#fbfcfd;
}

.cal-daycell.cal-outside .cal-daynum{
    opacity:.35;
}

.cal-daynum{
    display:inline-block;
    font-size:14.5px;
    font-weight:700;
    color:var(--text);
    line-height:1;
}

.cal-daycell.cal-today .cal-daynum{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:25px;
    height:25px;
    border-radius:999px;
    background:var(--accent);
    color:#fff;
}

.cal-band{
    position:relative;
    z-index:1;
    display:flex;
    align-items:center;
    gap:6px;
    align-self:stretch;
    margin:0;
    padding:3px 9px;
    font-size:12.5px;
    line-height:20px;
    white-space:nowrap;
    overflow:hidden;
    text-decoration:none;
    text-align:left;
    background:#eef3fb;
    color:var(--accent);
}

.cal-band:hover{
    filter:brightness(.95);
}

.cal-band.is-hovered{
    box-shadow:0 0 0 1.5px currentColor, 0 2px 6px rgba(15,37,64,.18);
    filter:brightness(.97);
    z-index:3;
}

.cal-band .band-label{
    overflow:hidden;
    text-overflow:ellipsis;
    font-weight:700;
}

.cal-band.is-continued .band-label{
    font-weight:500;
    opacity:.85;
}

.cal-band .band-dot{
    flex:none;
    width:7px;
    height:7px;
    border-radius:999px;
    background:var(--band-dot-color, currentColor);
}

.cal-band .band-continue{
    flex:none;
    opacity:.55;
    font-weight:800;
}

.cal-band.is-pin{
    display:inline-flex;
    justify-self:start;
    align-self:center;
    width:auto;
    max-width:calc(100% - 4px);
    margin:0 2px;
    padding:2px 9px 2px 7px;
    border-radius:999px;
}

.cal-band.is-start:not(.is-continuing){
    border-radius:4px;
    margin-left:4px;
    margin-right:4px;
}

.cal-band.is-start.is-continuing{
    border-radius:4px 0 0 4px;
    margin-left:4px;
}

.cal-band.is-continued:not(.is-continuing){
    border-radius:0 4px 4px 0;
    margin-right:4px;
}

.cal-band.is-pin{
    border-radius:999px;
}

.cal-band.is-selected{
    box-shadow:inset 0 0 0 1.5px currentColor;
}

.cal-more{
    position:absolute;
    z-index:2;
    right:6px;
    bottom:6px;
    display:inline-flex;
    align-items:center;
    height:20px;
    padding:0 8px;
    border:1px solid var(--line);
    border-radius:999px;
    background:#fff;
    font-family:inherit;
    font-size:11px;
    font-weight:800;
    color:var(--muted);
    cursor:pointer;
    box-shadow:0 1px 2px rgba(15,37,64,.08);
}

.cal-more:hover{
    color:#fff;
    background:var(--accent);
    border-color:var(--accent);
}

.calendar-hints{
    display:flex;
    flex-wrap:wrap;
    gap:8px 18px;
    margin-top:20px;
    padding-top:16px;
    border-top:1px solid var(--line);
    font-size:12px;
    color:var(--muted);
}

.filter-reset{
    border:none;
    background:transparent;
    font-family:inherit;
    font-size:12px;
    font-weight:600;
    color:var(--muted);
    cursor:pointer;
    padding:6px 4px;
    text-decoration:underline;
    text-underline-offset:2px;
}

.filter-reset:hover{
    color:var(--accent);
}

.event-detail{
    position:fixed;
    z-index:40;
    right:28px;
    bottom:28px;
    width:340px;
    max-width:calc(100vw - 24px);
    background:var(--card);
    border:1px solid var(--line);
    border-radius:14px;
    padding:16px 18px 14px;
    box-shadow:0 24px 48px -20px rgba(16,24,40,.35), var(--shadow);
}

.event-detail-top{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}

.event-detail-top .icon-btn{
    width:26px;
    height:26px;
    font-size:13px;
}

.event-detail-chip{
    display:inline-flex;
    align-items:center;
    height:24px;
    padding:0 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.event-detail-title{
    margin:12px 0 0;
    font-size:16px;
    line-height:1.3;
    letter-spacing:-.01em;
}

.event-detail-org{
    margin:5px 0 0;
    color:var(--muted);
    font-size:13px;
}

.event-detail-divider{
    height:1px;
    background:var(--line);
    margin:16px 0;
}

.event-detail-row{
    display:flex;
    justify-content:space-between;
    gap:12px;
    font-size:13px;
    padding:5px 0;
}

.event-detail-row span:first-child{
    color:var(--muted);
}

.event-detail-row span:last-child{
    font-weight:700;
    text-align:right;
}

.event-detail-deadline span:last-child{
    color:#b42318;
}

.event-detail-open{
    display:flex;
    width:100%;
    margin-top:16px;
}

@media(max-width:800px){
    .calendar-scroll{
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
        scroll-snap-type:x mandatory;
        position:relative;
    }

    .calendar-weekdays,
    .calendar-grid{
        min-width:760px;
    }

    .calendar-scroll::after{
        content:"";
        position:absolute;
        top:0;
        right:0;
        bottom:0;
        width:26px;
        pointer-events:none;
        background:linear-gradient(to left, rgba(17,24,39,.12), rgba(17,24,39,0));
    }

    .cal-week{
        scroll-snap-align:start;
    }

    .calendar-head{
        flex-direction:column;
        align-items:stretch;
    }

    .calendar-head-nav{
        justify-content:space-between;
    }

    .event-detail{
        left:12px;
        right:12px;
        bottom:12px;
        width:auto;
        max-width:none;
    }
}

[hidden]{
    display:none !important;
}

.deadline-pill{
    display:inline-flex;
    width:max-content;
    max-width:100%;
    margin:8px 0 10px;
    padding:6px 10px;
    border-radius:999px;
    background:#fff6ed;
    color:#c4320a;
    font-size:12px;
    font-weight:800;
}

.big-deadline{
    font-size:14px;
    padding:8px 12px;
}

.check-label{
    display:flex !important;
    grid-template-columns:auto 1fr !important;
    align-items:center;
    gap:10px;
    color:var(--text) !important;
    font-size:14px !important;
}

.check-label input{
    width:auto;
    min-height:auto;
}

.featured-section{
    margin:0 0 22px;
}

.featured-section h2{
    margin-bottom:12px;
}

.featured-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:12px;
}

.featured-card{
    display:flex;
    gap:12px;
    align-items:flex-start;
    padding:16px;
    border:1px solid #fedf89;
    border-radius:14px;
    background:#fffbeb;
    color:var(--text);
    text-decoration:none;
    box-shadow:var(--shadow);
}

.featured-card:hover{
    text-decoration:none;
    border-color:#fdb022;
}

.featured-card small{
    display:block;
    margin-top:4px;
    color:var(--muted);
}

.featured-star{
    line-height:1.2;
}

.featured-label,
.featured-admin{
    display:inline-flex;
    width:max-content;
    margin:0 0 8px;
    padding:5px 9px;
    border-radius:999px;
    background:#fffbeb;
    color:#b54708;
    font-size:12px;
    font-weight:800;
}

.category-section{
    margin:0 0 24px;
}

.category-section h2{
    margin-bottom:12px;
}

.category-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
    gap:12px;
}

.category-card{
    display:grid;
    gap:6px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    color:var(--text);
    text-decoration:none;
    box-shadow:var(--shadow);
}

.category-card:hover{
    text-decoration:none;
    border-color:var(--accent);
    transform:translateY(-1px);
}

.category-card span{
    font-size:24px;
}

.category-card strong{
    line-height:1.25;
}

.category-card small{
    color:var(--muted);
    line-height:1.35;
}
EOFcat >> calendar/static/style.css <<'EOF'

.category-section{
    margin:0 0 24px;
}

.category-section h2{
    margin-bottom:12px;
}

.category-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
    gap:12px;
}

.category-card{
    display:grid;
    gap:6px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    color:var(--text);
    text-decoration:none;
    box-shadow:var(--shadow);
}

.category-card:hover{
    text-decoration:none;
    border-color:var(--accent);
    transform:translateY(-1px);
}

.category-card span{
    font-size:24px;
}

.category-card strong{
    line-height:1.25;
}

.category-card small{
    color:var(--muted);
    line-height:1.35;
}

.admin-top-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.favorite-btn{
    position:absolute;
    right:54px;
    top:14px;
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border:1px solid transparent;
    border-radius:10px;
    background:transparent;
    color:#b54708;
    font-size:22px;
    line-height:1;
    cursor:pointer;
}

.favorite-btn:hover,
.favorite-btn.active{
    background:#fffbeb;
    border-color:#fedf89;
}

.event-card h2{
    padding-right:76px;
}

.event-card[data-status="завершено"]{
    opacity:.72;
}

.event-card[data-status="завершено"]::after{
    content:"Архив";
    position:absolute;
    left:20px;
    bottom:16px;
    padding:4px 8px;
    border-radius:999px;
    background:#f2f4f7;
    color:var(--muted);
    font-size:11px;
    font-weight:800;
}

.force-archive-hidden{
    display:none !important;
}

.bulk-actions{
    margin:0 0 16px;
}

.bulk-check{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0 0 12px;
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}

.bulk-check input{
    width:auto;
    min-height:auto;
}

@media(max-width:700px){
    .container{
        padding:22px 14px;
    }

    .page-head{
        gap:14px;
    }

    h1{
        font-size:30px;
    }

    .lead{
        font-size:15px;
    }

    .view-switch{
        display:grid;
        grid-template-columns:1fr 1fr;
    }

    .view-switch .btn{
        width:100%;
    }

    .filters{
        grid-template-columns:1fr !important;
    }

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

    .event-card{
        padding:16px;
    }

    .event-card h2{
        padding-right:64px;
        font-size:18px;
    }

    .favorite-btn{
        right:48px;
        top:12px;
    }

    .card-menu{
        margin-top:-2px;
    }

    .category-grid,
    .featured-grid{
        grid-template-columns:1fr;
    }

    .calendar-view{
        padding:14px;
        margin-left:-2px;
        margin-right:-2px;
    }

    .calendar-head{
        display:grid;
        grid-template-columns:auto 1fr auto;
    }

    .calendar-head h2{
        grid-column:1 / -1;
        grid-row:1;
        text-align:center;
        margin-bottom:8px;
    }

    #prevMonth{
        grid-column:1;
        grid-row:2;
    }

    #todayMonth{
        grid-column:2;
        grid-row:2;
    }

    #nextMonth{
        grid-column:3;
        grid-row:2;
    }

    .calendar-weekdays,
    .calendar-grid{
        min-width:640px;
        gap:6px;
    }

    .calendar-cell{
        min-height:96px;
        padding:7px;
    }

    .calendar-event{
        padding:5px 6px;
        font-size:11px;
    }

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

    .event-full{
        padding:18px;
    }
}

.grade-field{
    display:grid;
    gap:8px;
}

.grade-field p{
    margin:0;
    color:var(--muted);
    font-size:13px;
    font-weight:700;
}

.grade-checkboxes{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.grade-checkboxes label{
    display:flex !important;
    align-items:center;
    gap:6px;
    min-width:54px;
    padding:8px 10px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
    color:var(--text) !important;
    font-size:14px !important;
    font-weight:700 !important;
}

.grade-checkboxes input{
    width:auto;
    min-height:auto;
}

.page-actions{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}

.admin-temp{
    border-color:#fedf89;
    background:#fffbeb;
    color:#b54708;
}

.stages-block{
    margin:26px 0;
}

.stages-block h2{
    margin-bottom:14px;
}

.stages-timeline{
    display:grid;
    gap:12px;
    position:relative;
}

.stage-card{
    display:grid;
    grid-template-columns:22px 1fr;
    gap:12px;
    padding:16px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fbfcfe;
}

.stage-dot{
    width:14px;
    height:14px;
    margin-top:5px;
    border-radius:999px;
    background:var(--accent);
}

.stage-card[data-stage-type="registration"] .stage-dot{background:#0ea5e9;}
.stage-card[data-stage-type="selection"] .stage-dot{background:#10b981;}
.stage-card[data-stage-type="second_stage"] .stage-dot{background:#8b5cf6;}
.stage-card[data-stage-type="final"] .stage-dot{background:#f43f5e;}
.stage-card[data-stage-type="results"] .stage-dot{background:#64748b;}
.stage-card[data-stage-type="project_defense"] .stage-dot{background:#d946ef;}
.stage-card[data-stage-type="main"] .stage-dot{background:#f59e0b;}

.stage-head{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
    margin-bottom:4px;
}

.stage-head h3{
    margin:0;
}

.stage-head span{
    padding:4px 8px;
    border-radius:999px;
    background:#eef3fb;
    color:var(--accent);
    font-size:12px;
    font-weight:800;
}

.stage-dates{
    margin:0 0 6px;
    font-weight:800;
}

.stage-deadline{
    display:inline-flex;
    width:max-content;
    margin:0 0 8px;
    padding:5px 9px;
    border-radius:999px;
    background:#fff6ed;
    color:#c4320a;
    font-size:12px;
    font-weight:800;
}

@media(max-width:700px){
    .stage-card{
        grid-template-columns:18px 1fr;
        padding:14px;
    }

    .stage-head{
        display:grid;
    }
}

.admin-stages{
    display:grid;
    gap:18px;
}

.admin-stage-list{
    display:grid;
    gap:12px;
}

.admin-stage-card{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
    padding:14px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fbfcfe;
    cursor:grab;
}

.admin-stage-card.dragging{
    opacity:.4;
}

.drag-handle{
    color:var(--muted);
    font-size:16px;
    line-height:1;
    padding-top:2px;
    cursor:grab;
}

.drag-hint{
    margin:-6px 0 4px;
}

.admin-stage-card form{
    margin:0;
}

.stage-add-form{
    display:grid;
    gap:14px;
}

@media(max-width:700px){
    .admin-stage-card{
        display:grid;
    }
}

.event-detail-chip[data-stage-type="registration"]{background:#e0f2fe;color:#075985;}
.event-detail-chip[data-stage-type="selection"]{background:#d1fae5;color:#065f46;}
.event-detail-chip[data-stage-type="second_stage"]{background:#ede9fe;color:#5b21b6;}
.event-detail-chip[data-stage-type="main"]{background:#fef3c7;color:#92400e;}
.event-detail-chip[data-stage-type="final"]{background:#ffe4e6;color:#9f1239;}
.event-detail-chip[data-stage-type="project_defense"]{background:#fae8ff;color:#86198f;}
.event-detail-chip[data-stage-type="results"]{background:#e5e9f0;color:#334155;}

.admin-stage-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}

.admin-stage-actions form{
    margin:0;
}

.stage-filter-panel{
    display:flex;
    flex-wrap:wrap;
    gap:10px 14px;
    align-items:center;
    margin:0 0 16px;
    padding:14px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    box-shadow:var(--shadow);
}

.stage-filter-title{
    width:100%;
    color:var(--muted);
    font-size:13px;
    font-weight:800;
}

.stage-filter-panel label{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:13px;
    font-weight:700;
    color:var(--text);
}

.stage-filter-panel input{
    width:auto;
    min-height:auto;
}

.stage-dot-mini{
    width:11px;
    height:11px;
    display:inline-block;
    border-radius:999px;
    background:var(--accent);
}

.stage-dot-mini.registration{background:#0ea5e9;}
.stage-dot-mini.selection{background:#10b981;}
.stage-dot-mini.second_stage{background:#8b5cf6;}
.stage-dot-mini.final{background:#f43f5e;}
.stage-dot-mini.results{background:#64748b;}
.stage-dot-mini.project_defense{background:#d946ef;}
.stage-dot-mini.main{background:#f59e0b;}

@media(max-width:700px){
    .stage-filter-panel{
        display:grid;
        grid-template-columns:1fr 1fr;
    }

    .stage-filter-title{
        grid-column:1 / -1;
    }
}

.stage-filter-panel input[type="checkbox"]{
    width:14px;
    height:14px;
    min-height:14px;
    margin:0;
    accent-color:var(--accent);
}

.stage-filter-panel label{
    line-height:1.2;
}

.stage-filter-panel{
    gap:8px 12px;
}

.stage-dot-mini{
    width:9px;
    height:9px;
}

.calendar-mode-switch{
    display:flex;
    gap:10px;
    margin:0 0 12px;
}


.import-table{
    width:100%;
    border-collapse:collapse;
    font-size:13px;
}

.import-table th,
.import-table td{
    text-align:left;
    padding:8px 10px;
    border-bottom:1px solid var(--line);
    vertical-align:top;
}

.import-summary p{
    margin:0 0 6px;
}

.import-summary p:last-child{
    margin-bottom:0;
}

.import-error{
    border-color:#b42318;
    color:#b42318;
}

.import-row-error{
    background:#fff1f0;
}

.import-row-warning{
    background:#fffbeb;
}

.import-row-skipped{
    background:#f2f4f7;
    color:var(--muted);
}

.event-share{
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
    margin:18px 0;
}

.event-share img{
    width:120px;
    height:120px;
    border-radius:10px;
    border:1px solid var(--line);
}

.copy-link-btn{
    position:relative;
}

.copy-link-btn.copied::after{
    content:"Скопировано";
    position:absolute;
    left:0;
    top:calc(100% + 6px);
    font-size:12px;
    font-weight:700;
    color:#027a48;
    white-space:nowrap;
}

.stage-status-icon{
    display:inline-block;
    margin-right:6px;
    font-weight:800;
}

.stage-status-icon.done{color:#027a48;}
.stage-status-icon.active{color:var(--accent);}
.stage-status-icon.upcoming{color:var(--muted);}
