:root{
    --primary:#1565C0;
    --primary-dark:#0D47A1;
    --primary-light:#E3F2FD;

    --success:#2E7D32;
    --danger:#D32F2F;
    --warning:#F57F17;

    --surface:#FFFFFF;
    --bg:#F4F7F9;

    --text:#263238;
    --muted:#607D8B;

    --shadow:0 8px 24px rgba(0,0,0,.08);
    --radius:18px;

    --primary-blue: #1565C0;
    --success: #2E7D32;
    --border-radius: 16px;
    
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:'Segoe UI', Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
    padding-bottom:90px;
}

/* ================= HEADER ================= */

header{
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    color:#FFF;
    padding:18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    box-shadow:var(--shadow);
    position: relative; 
    z-index: 10;
    flex-wrap:nowrap;
}

.logo-img{
    background: rgba(255, 255, 255, 0.95);
    padding: 5px;
    border-radius:12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    object-fit:contain;
    width:clamp(40px, 8vw, 60px);
    height:auto;
    flex-shrink:0;
}

.header-center{
    text-align: center; 
    flex-grow: 1; 
    padding: 0 10px;
    min-width:220px;
}

.header-center h1{
    margin: 0;
    font-weight: 700; 
    letter-spacing: 0.5px;
    /*font-size: 22px; */
    font-size:clamp(1.2rem, 2vw, 2rem);
    line-height:1.2;
    margin-bottom:6px;
    word-break:break-word;
    
}

.header-center span { 
    font-size: 13px; 
    opacity: 0.9; 
    font-weight: 300; 
}

.header-center p{
    opacity:0.9;
    /*font-size:13px;*/
    font-size:clamp(.8rem, 1.2vw, 1rem);
    line-height:1.4;
}

/* ================= NAV ================= */

nav{
    position:sticky;
    top:0;
    z-index:999;
    background:#FFF;
    display:flex;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
}

.nav-btn{
    flex:1;
    padding: 15px 5px;
    border:none;
    background:transparent;
    padding:16px 6px;
    cursor:pointer;
    transition: all 0.3s;
    font-weight:700;
    color:var(--muted);
    border-bottom:4px solid transparent;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 6px;
}

.icon{ 
     font-size: 23px; 
 }

.nav-btn:hover{
    background:var(--primary-light);
}

.nav-btn.active{
    background:var(--primary-light);
    color:var(--primary);
    border-bottom-color:var(--primary);
}

/* ================= LAYOUT ================= */

.container{
    width:min(1200px,95%);
    margin:24px auto;
}

.section{
    display:none;
}

.section.active{
    display:block;
    animation:fade .3s ease;
}

@keyframes fade{
    from{
        opacity:0;
        transform:translateY(10px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.grid{
    display:grid;
}

.card{
    background:var(--surface);
    border-radius:var(--radius);
    padding:24px;
    box-shadow:var(--shadow);
    border-left: 5px solid var(--primary-blue);
    margin-bottom: 25px; 
}

.card-title{
    color:var(--primary);
    font-size:21px;
    font-weight:800;
    margin-bottom:20px;
}

/* ================= FORM ================= */

input,
select{
    width:100%;
    padding:14px;
    border-radius:12px;
    border:1px solid #CFD8DC;
    margin-top:8px;
    margin-bottom:16px;
    font-size:15px;
    background:#FAFAFA;
}

input:focus,
select:focus{
    outline:none;
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(21,101,192,.12);
}

.btn{
    border:none;
    border-radius:12px;
    padding:15px;
    font-weight:700;
    cursor:pointer;
    transition:.2s;
    color:#FFF;
    width:100%;
    font-size:15px;
}

.btn:hover{
    transform:translateY(-2px);
}

.btn-primary{ 
    background:var(--primary); 
}

.btn-success{ 
    background:var(--success); 
}

.btn-danger{ 
    background:var(--danger); 
}

.btn-warning{ 
    background:var(--warning); color:#222; 
}

.btn-dark{ 
    background:#263238; 
}

.btn-info{ 
    background:#0288D1; 
}

.flex{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.flex .btn{
    flex:1;
}

/* ================= SCANNER ================= */

#reader{
    width:100%;
    overflow:hidden;
    border-radius:16px;
    border:4px solid #263238;
    background:#000;
}

.feedback{
    margin-top:18px;
    padding:18px;
    border-radius:14px;
    min-height:85px;
    text-align:center;
    font-weight:700;
    background:#FAFAFA;
    transition:.25s;
}

/* ================= VALIDACAO ================= */

.validation-area{
    display:none;
    margin-top:18px;
}

.badge-preview{
    background:#FFF;
    border:2px solid var(--primary);
    border-radius:18px;
    padding:24px;
    text-align:center;
    position:relative;
    overflow:hidden;
    box-shadow:0 6px 20px rgba(0,0,0,.08);
}

.badge-preview::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:14px;
    background:var(--primary);
}

.preview-name{
    font-size:22px;
    font-weight:800;
    margin-top:12px;
    text-transform:uppercase;
}

.preview-id{
    margin-top:8px;
    color:var(--muted);
}

.preview-segment{
    display:inline-block;
    margin-top:12px;
    padding:8px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}

.validation-actions{
    display:flex;
    gap:12px;
    margin-top:16px;
}

/* ================= STUDENTS ================= */

.student-list{
    max-height:520px;
    overflow:auto;
    border-radius:14px;
    border:1px solid #ECEFF1;
}

.student-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:16px;
    border-bottom:1px solid #ECEFF1;
}

.student-row:nth-child(even){
    background:#FAFAFA;
}

.badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    margin-top:6px;
    font-size:11px;
    font-weight:800;
}

.badge-blue{
    background:#DBEAFE;
    color:#1D4ED8;
}

.badge-green{
    background:#DCFCE7;
    color:#15803D;
}

.badge-orange{
    background:#FFEDD5;
    color:#EA580C;
}

/* ================= DASHBOARD ================= */

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:16px;
    margin-bottom:24px;
}

.stat-card{
    background:#FFF;
    border-radius:16px;
    padding:20px;
    box-shadow:var(--shadow);
    border-left: 5px solid var(--primary-blue);
}

.stat-card h3{
    font-size:14px;
    color:var(--muted);
    margin-bottom:10px;
}

.stat-card strong{
    font-size:32px;
    color:var(--primary);
}

.info-box{
    padding:16px;
    border-radius:14px;
    margin-bottom:12px;
    line-height:1.5;
}

.info-blue{
    background:#E3F2FD;
    border-left:5px solid var(--primary);
}

.info-green{
    background:#E8F5E9;
    border-left:5px solid var(--success);
}

.info-red{
    background:#FFEBEE;
    border-left:5px solid var(--danger);
}

.chart-wrapper{
    position:relative;
    width:100%;
    height:340px;
}

/* ================= RESPONSIVO ================= */

@media(max-width:768px){

    .validation-actions{
        flex-direction:column;
    }

    .student-row{
        flex-direction:column;
        align-items:flex-start;
    }

    .student-row button{
        width:100%;
    }

    .header-center{
        order:0;
        width:100%;
    }

    /*.logo-img { height: 45px; }*/

    .logo-img{
        height:clamp(40px,8vw,60px);
        max-width:100px;
    }

    .header-center h1{
        /*font-size:12px;*/
        font-size:0.9rem;
    }

    .header-center p{
        /*font-size:8px;*/
        font-size:.5rem;
    }
}
