/* ===========================================================
   VÝCHOVNÁ OPATŘENÍ
   Verze 1.0
   Autor: Jan Nývlt
=========================================================== */

/* ===========================================================
   ZÁKLAD
=========================================================== */

html{
    font-size:17px;
}

body{
    background:#f4f6f9;
    font-family:"Segoe UI",Roboto,Arial,sans-serif;
    font-size:1rem;
    color:#212529;
}

/* ===========================================================
   NAVBAR
=========================================================== */

.navbar{
    box-shadow:0 2px 12px rgba(0,0,0,.12);
    padding:.9rem 1rem;
}

.navbar-brand{
    text-decoration:none;
}

.app-logo{
    height:60px;
    max-width:90px;
    object-fit:contain;
}

.app-brand-title{
    font-size:1.45rem;
    font-weight:700;
    line-height:1.1;
    color:white;
}

.app-brand-subtitle{
    font-size:.90rem;
    color:#dddddd;
    line-height:1.2;
}

.app-brand-school{
    font-size:.95rem;
    color:#bbbbbb;
    line-height:1.2;
}

.navbar-nav .nav-link{

    font-size:1.02rem;

    font-weight:500;

    padding:.70rem .95rem;

    transition:.15s;
}

.navbar-nav .nav-link:hover{

    color:white;

    transform:translateY(-1px);
}

.navbar-text{

    font-size:1rem;

    font-weight:500;
}

/* ===========================================================
   KARTY
=========================================================== */

.card{

    border:none;

    border-radius:18px;

    box-shadow:0 5px 18px rgba(0,0,0,.08);

    transition:.2s;
}

.card:hover{

    box-shadow:0 8px 26px rgba(0,0,0,.12);
}

.card-header{

    background:white;

    border-bottom:1px solid #ececec;

    font-weight:600;

    font-size:1.05rem;
}

.card-body{

    padding:1.5rem;
}

/* ===========================================================
   TABULKY
=========================================================== */

.table{
    margin-bottom:0;
    font-size:1rem;
}

.table thead{
    background:#f3f5f7;
}

.table th{
    font-size:1rem;
    font-weight:700;
    padding:.55rem .75rem;
    border-bottom:2px solid #dee2e6;
}

.table td{
    font-size:1rem;
    padding:.50rem .75rem;
    vertical-align:middle;
}

.table tbody tr:hover{
    background:#f8fbff;
}

/* ===========================================================
   FORMULÁŘE
=========================================================== */

.form-label{

    font-weight:600;
}

.form-control,
.form-select{

    border-radius:10px;

    font-size:1rem;

    padding:.65rem .80rem;
}

.form-control:focus,
.form-select:focus{

    box-shadow:0 0 0 .15rem rgba(13,110,253,.15);

    border-color:#86b7fe;
}

/* ===========================================================
   TLAČÍTKA
=========================================================== */

.btn{

    border-radius:10px;

    font-size:1rem;

    font-weight:600;

    padding:.60rem 1.30rem;
}

.btn-sm{

    padding:.35rem .75rem;

    font-size:.90rem;
}

/* ===========================================================
   BADGE
=========================================================== */

.badge{

    font-size:.90rem;

    padding:.50rem .80rem;

    border-radius:8px;
}

/* ===========================================================
   BODY
=========================================================== */

.points-plus{

    color:#198754;

    font-weight:700;
}

.points-minus{

    color:#dc3545;

    font-weight:700;
}

/* ===========================================================
   NADPISY
=========================================================== */

h2{

    font-size:2rem;

    font-weight:700;

    margin-bottom:1rem;
}

h3{

    font-size:1.6rem;

    font-weight:600;
}

h4{

    font-size:1.35rem;

    font-weight:600;
}

h5{

    font-size:1.15rem;

    font-weight:600;
}

/* ===========================================================
   ALERTY
=========================================================== */

.alert{

    border-radius:12px;
}

/* ===========================================================
   ODKAZY
=========================================================== */

a{

    text-decoration:none;
}

a:hover{

    text-decoration:underline;
}

/* ===========================================================
   FOOTER
=========================================================== */

.app-footer{

    margin-top:40px;

    padding-top:15px;

    padding-bottom:20px;

    border-top:1px solid #ddd;

    color:#666;

    font-size:.90rem;

    text-align:center;
}

/* ===========================================================
   RESPONSIVE
=========================================================== */

@media(max-width:768px){

    html{

        font-size:16px;
    }

    .app-logo{

        height:46px;
    }

    .app-brand-title{

        font-size:1.15rem;
    }

    .app-brand-subtitle{

        display:none;
    }

    .app-brand-school{

        display:none;
    }

    .navbar-nav .nav-link{

        padding:.55rem;
    }

}

/* ===========================================================
   DASHBOARD
=========================================================== */

.dashboard-card{
    min-height:130px;
}

.dashboard-number{
    font-size:2.25rem;
    font-weight:800;
    line-height:1;
    margin-top:.35rem;
}

.dashboard-icon{
    font-size:2.4rem;
    opacity:.75;
}
/* ===========================================================
   PŘEPÍNAČ ŠKOLNÍHO ROKU
=========================================================== */

.year-switcher{
    background:white;
    border-radius:14px;
    padding:.75rem 1rem;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
    min-width:240px;
}

.year-switcher .form-label{
    font-size:.85rem;
    font-weight:700;
    color:#6c757d;
}

.year-switcher .form-select{
    min-width:200px;
    padding-right:3rem !important;
    background-position:right 1rem center;
}

/* Zarovnání polí ve filtrech */
.filter-card .row {
    align-items: end;
}

.filter-card .form-label {
    margin-bottom: .35rem;
}
/* Sestavy */
.report-section-nav { display:grid; grid-template-columns:repeat(4,minmax(170px,1fr)); gap:1rem; }
.report-section-tile { display:flex; flex-direction:column; gap:.25rem; padding:1rem 1.15rem; border:1px solid #d9d9d9; border-radius:1rem; background:#fff; color:#333; text-decoration:none; box-shadow:0 2px 8px rgba(0,0,0,.04); }
.report-section-tile span { color:#6c757d; font-size:.88rem; }
.report-section-tile.active { border-color:#7A0035; box-shadow:0 0 0 2px rgba(122,0,53,.1); }
.report-section-tile.active strong { color:#7A0035; }
.report-section-tile.disabled { opacity:.55; cursor:not-allowed; }
.report-preview { max-width:1200px; margin:0 auto; }
.report-heading { border-bottom:3px solid #7A0035; padding-bottom:1rem; }
.report-heading h3 { color:#7A0035; font-weight:700; }
.report-part-title { border-bottom:1px solid #d9d9d9; padding-bottom:.5rem; }
.report-part-title-measures { color:#dc3545; border-bottom-color:rgba(220,53,69,.35); }
.report-part-title-praises { color:#198754; border-bottom-color:rgba(25,135,84,.35); }
.report-part-title-summary { color:#343a40; }
.report-group { border:1px solid #d9d9d9; border-radius:.65rem; overflow:hidden; }
.report-group-header { display:flex; justify-content:space-between; gap:1rem; padding:.65rem .85rem; color:#fff; font-weight:700; }
.report-group-header.measure { background:#dc3545; }
.report-group-header.praise { background:#198754; }
.report-detail-table th { background:#f7f7f7; }
.summary-table thead th { background:#343a40; color:#fff; }
.summary-table tfoot th { background:#343a40; color:#fff; }
.summary-table .summary-row-measure td:first-child { color:#dc3545; font-weight:700; }
.summary-table .summary-row-praise td:first-child { color:#198754; font-weight:700; }
.summary-table .summary-row-measure { border-left:4px solid #dc3545; }
.summary-table .summary-row-praise { border-left:4px solid #198754; }
@media (max-width: 900px) { .report-section-nav { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 520px) { .report-section-nav { grid-template-columns:1fr; } .report-group-header { flex-direction:column; } }

/* ===========================================================
   SESTAVA TŘÍDY
=========================================================== */

.report-options-grid{
    display:grid;
    grid-template-columns:repeat(5,minmax(150px,1fr));
    gap:.75rem;
}
.report-option{
    display:flex;
    align-items:center;
    gap:.65rem;
    padding:.8rem .9rem;
    background:#f8f9fa;
    border:1px solid #e1e4e8;
    border-radius:12px;
    cursor:pointer;
    font-weight:600;
}
.report-option:hover{
    background:#fff;
    border-color:#bfc5cc;
}
.class-report-summary{
    display:grid;
    grid-template-columns:repeat(5,minmax(130px,1fr));
    gap:.8rem;
}
.class-summary-card{
    padding:1rem;
    border:1px solid #d9d9d9;
    border-top:4px solid #7A0035;
    border-radius:12px;
    background:#fff;
}
.class-summary-card span{
    display:block;
    color:#6c757d;
    font-size:.88rem;
    margin-bottom:.25rem;
}
.class-summary-card strong{
    font-size:1.45rem;
}
.class-summary-card.incident{ border-top-color:#dc3545; }
.class-summary-card.praise{ border-top-color:#198754; }
.class-report-table tbody .student-main-row:nth-of-type(4n+1){
    background:#f8f9fa;
}
.class-expand-col{ width:42px; }
.class-expand-btn{
    width:32px;
    height:32px;
    padding:0;
    border:1px solid #d9d9d9;
    background:#fff;
    font-size:1.5rem;
    line-height:1;
    transition:transform .15s ease;
}
.class-expand-btn.open{ transform:rotate(90deg); }
.class-student-link{
    color:#212529;
    font-weight:700;
}
.class-student-link:hover{ color:#7A0035; }
.student-record-panel{
    padding:.75rem 1rem 1rem 3.5rem;
    background:#f5f6f7;
    border-bottom:1px solid #dee2e6;
}
.student-record-table{
    background:#fff;
    border:1px solid #dee2e6;
}
.student-record-table thead th{
    background:#eef0f2;
}
@media(max-width:1100px){
    .report-options-grid{ grid-template-columns:repeat(2,1fr); }
    .class-report-summary{ grid-template-columns:repeat(2,1fr); }
}
@media(max-width:600px){
    .report-options-grid,
    .class-report-summary{ grid-template-columns:1fr; }
    .student-record-panel{ padding:.75rem; }
}

/* Výběr žáků v sestavě třídy */
.student-selection-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(180px,1fr));
    gap:.65rem;
}
.student-selection-option{
    display:flex;
    align-items:center;
    gap:.65rem;
    padding:.75rem .85rem;
    background:#fff;
    border:1px solid #e1e4e8;
    border-radius:12px;
    cursor:pointer;
    font-weight:600;
}
.student-selection-option:hover{
    background:#f8f9fa;
    border-color:#bfc5cc;
}
.student-selection-option:has(input:checked){
    border-color:#7A0035;
    box-shadow:0 0 0 2px rgba(122,0,53,.08);
}
@media(max-width:1100px){
    .student-selection-grid{ grid-template-columns:repeat(2,1fr); }
}
@media(max-width:600px){
    .student-selection-grid{ grid-template-columns:1fr; }
}

/* ===========================================================
   INDIVIDUÁLNÍ SESTAVA ŽÁKA
=========================================================== */

.student-chart-card{
    background:#fff;
    border:1px solid #d9d9d9;
    border-radius:14px;
    padding:1rem;
}

.student-timeline{
    position:relative;
    margin-left:.5rem;
}
.student-timeline::before{
    content:"";
    position:absolute;
    left:96px;
    top:.35rem;
    bottom:.35rem;
    width:2px;
    background:#d9d9d9;
}
.student-timeline-item{
    display:grid;
    grid-template-columns:80px 1fr;
    gap:2rem;
    position:relative;
    padding:.5rem 0 1rem;
}
.student-timeline-item::after{
    content:"";
    position:absolute;
    left:91px;
    top:1rem;
    width:12px;
    height:12px;
    border-radius:50%;
    background:#7A0035;
    border:3px solid #fff;
    box-shadow:0 0 0 1px #d9d9d9;
}
.student-timeline-item.incident::after{
    background:#dc3545;
}
.student-timeline-item.praise::after{
    background:#198754;
}
.student-timeline-date{
    color:#6c757d;
    font-weight:700;
    font-size:.9rem;
    text-align:right;
}
.student-timeline-content{
    background:#fff;
    border:1px solid #e0e0e0;
    border-radius:12px;
    padding:.9rem 1rem;
}
.student-timeline-item.incident .student-timeline-content{
    border-left:4px solid #dc3545;
}
.student-timeline-item.praise .student-timeline-content{
    border-left:4px solid #198754;
}

@media(max-width:700px){
    .student-timeline::before{
        left:10px;
    }
    .student-timeline-item{
        grid-template-columns:1fr;
        gap:.3rem;
        padding-left:2rem;
    }
    .student-timeline-item::after{
        left:5px;
    }
    .student-timeline-date{
        text-align:left;
    }
}



/* Jednání se zákonným zástupcem / výchovná komise */
.meeting-report-block{
    border-left:4px solid var(--app-primary, #7A0035);
    background:#f8f9fa;
    border-radius:10px;
    padding:1rem 1.1rem;
}
.meeting-report-row{
    display:grid;
    grid-template-columns:180px 1fr;
    gap:1rem;
    padding:.25rem 0;
}
.meeting-write-box{
    min-height:90px;
    border:1px solid #d9d9d9;
    border-radius:10px;
    padding:.9rem 1rem;
    white-space:pre-wrap;
    background:#fff;
}
.meeting-signatures{
    display:grid;
    grid-template-columns:repeat(2,minmax(240px,1fr));
    gap:1.6rem 2rem;
    padding-top:.5rem;
}
@media(max-width:700px){
    .meeting-report-row{grid-template-columns:1fr;gap:.15rem}
    .meeting-signatures{grid-template-columns:1fr}
}


/* V4 – účastníci jednání a větší zapisovací plochy */
.meeting-participants{
    display:flex;
    flex-direction:column;
    gap:.55rem;
}
.meeting-participant-row{
    display:grid;
    grid-template-columns:220px minmax(180px,1fr) 230px;
    gap:1rem;
    align-items:end;
    padding:.35rem 0;
    border-bottom:1px solid #ececec;
}
.meeting-signature-line{
    white-space:nowrap;
    color:#495057;
}
.meeting-write-box{
    min-height:150px;
}
@media(max-width:900px){
    .meeting-participant-row{
        grid-template-columns:1fr;
        gap:.2rem;
    }
}


/* ===========================================================
   CELKOVÉ STATISTIKY ŠKOLY
=========================================================== */

.school-overview-summary{
    display:grid;
    grid-template-columns:repeat(7,minmax(120px,1fr));
    gap:.8rem;
}

.school-overview-chart{
    background:#fff;
    border:1px solid #d9d9d9;
    border-radius:14px;
    padding:1rem;
}

.school-overview-preview .report-part-title{
    margin-top:.4rem;
}

@media(max-width:1400px){
    .school-overview-summary{
        grid-template-columns:repeat(4,1fr);
    }
}

@media(max-width:900px){
    .school-overview-summary{
        grid-template-columns:repeat(2,1fr);
    }
}

@media(max-width:600px){
    .school-overview-summary{
        grid-template-columns:1fr;
    }
}


/* ===========================================================
   JEDNOTNÉ SOUHRNNÉ KARTY SESTAV
=========================================================== */

.report-stat-strip{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
    gap:.4rem;
}

.report-stat-card{
    background:#fff;
    border:1px solid #d9d9d9;
    border-top:4px solid var(--app-primary, #7A0035);
    min-height:78px;
    padding:.45rem .65rem .55rem;
    text-align:center;
}

.report-stat-card span{
    display:block;
    font-size:.88rem;
    font-weight:700;
    line-height:1.15;
    color:#212529;
}

.report-stat-card strong{
    display:block;
    margin-top:.25rem;
    font-size:1.55rem;
    line-height:1;
    font-weight:800;
}

.report-stat-card.praise{
    border-top-color:#198754;
}

.report-stat-card.incident{
    border-top-color:#dc3545;
}

.report-stat-card.neutral{
    border-top-color:var(--app-primary, #7A0035);
}

.report-stat-status{
    font-size:1.15rem !important;
}

.report-stat-strip-school{
    grid-template-columns:repeat(auto-fit,minmax(115px,1fr));
}

@media(max-width:700px){
    .report-stat-strip,
    .report-stat-strip-school{
        grid-template-columns:repeat(2,1fr);
    }
}

/* Dynamické načítání žáků v sestavě třídy */
.student-selection-status{
    min-height:54px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:.85rem 1rem;
    border:1px dashed #cfd4da;
    border-radius:12px;
    background:#f8f9fa;
    color:#6c757d;
    font-weight:600;
}

.student-selection-status.is-loading::before{
    content:"";
    width:18px;
    height:18px;
    margin-right:.65rem;
    border:2px solid #ced4da;
    border-top-color:var(--app-primary, #7A0035);
    border-radius:50%;
    animation:student-selection-spin .8s linear infinite;
}

@keyframes student-selection-spin{
    to{ transform:rotate(360deg); }
}


/* Finální zapisovací plochy jednání */
.meeting-write-box-7{ min-height: 185px; }
.meeting-write-box-5{ min-height: 135px; }
@media print{
    .meeting-write-box-7{ min-height: 185px; }
    .meeting-write-box-5{ min-height: 135px; }
    .meeting-write-box,
    .meeting-signature-final,
    .meeting-signature-table tr{
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
