/* ----- shared palette (unchanged) ---------------------------- */
:root{
    --deep-blue:#004d9c;
    --lt-grey:#f4f6f8;
    --med-grey:#d1d5db;
    --dk-grey:#374151;
}

/* ----- page reset & global layout ---------------------------- */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;font-family:"Inter",Arial,sans-serif;background:var(--lt-grey);}
body{display:flex;flex-direction:column}

/* ----- header strip ------------------------------------------ */
header{
    display:flex;align-items:center;justify-content:space-between;
    padding:.6rem 1rem;background:#fff;border-bottom:1px solid var(--med-grey);
}
header .logo{display:flex;align-items:center;gap:.55rem}
header img{height:42px;width:auto}
header a.logout{
    font-size:.9rem;font-weight:600;color:var(--dk-grey);text-decoration:none;
    padding:.35rem .75rem;border:1px solid var(--med-grey);border-radius:6px;
    transition:background .2s}
header a.logout:hover{background:var(--med-grey);color:#000}

/* ----- main wrapper / tabs ----------------------------------- */
main{flex:1;display:flex;flex-direction:column;padding:1rem;overflow:auto}
.tabs{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem}
.tabs button{
    padding:.5rem .85rem;border:none;border-radius:6px;background:#fff;
    border:1px solid var(--med-grey);cursor:pointer;font-weight:600}
.tabs button.active{background:var(--deep-blue);color:#fff;border-color:var(--deep-blue)}

.chart-wrap{width:100%;max-width:1100px;margin:auto}
.chart-wrap canvas{width:100%!important;max-height:460px!important}

/* shrink pie-chart on wide screens */
@media(min-width:1000px){
    #chart_channel{max-height:320px!important}
}

/* ----- auth forms -------------------------------------------- */
.auth-box{
    width:100%;max-width:420px;margin:auto;margin-top:10vh;background:#fff;
    border:1px solid var(--med-grey);border-radius:8px;padding:2rem;
}
.auth-box h1{font-size:1.25rem;font-weight:700;margin-bottom:1rem;color:var(--dk-grey)}
.auth-box label{display:block;font-size:.9rem;margin:.75rem 0 .3rem}
.auth-box input{width:100%;padding:.55rem .75rem;border:1px solid var(--med-grey);
                border-radius:6px;font-size:.95rem}
.auth-box button{margin-top:1.1rem;width:100%;padding:.6rem 0;border:none;
                 border-radius:6px;background:var(--deep-blue);color:#fff;
                 font-size:1rem;font-weight:600;cursor:pointer}
.auth-box button:hover{opacity:.9}

/* fully responsive: stack tabs / shrink paddings ----------------*/
@media(max-width:600px){
    header{padding:.5rem}
    main{padding:.55rem}
    .tabs{gap:.35rem}
    header a.logout{padding:.25rem .55rem;font-size:.8rem}
}

/* legend boxes */
.legend{margin:.5rem 0;display:flex;flex-wrap:wrap;gap:.8rem;font-size:.85rem}
.legend label{cursor:pointer;user-select:none}

/* header tweaks for “Logged In” */
header .who{margin-left:auto;margin-right:1rem;font-size:.9rem;color:#555}


/* grid styles */
.grid-toolbar{margin:.5rem 0;font-size:.9rem;display:flex;align-items:center;gap:.6rem}
#exportBtn{padding:.35rem .8rem;border:1px solid var(--med-grey);
           background:var(--deep-blue);color:#fff;border-radius:6px;cursor:pointer}
#exportBtn:hover{opacity:.9}
.grid-box{overflow:auto;max-height:520px;border:1px solid var(--med-grey)}
#gridTbl{border-collapse:collapse;width:100%;font-size:.85rem}
#gridTbl th,#gridTbl td{border:1px solid var(--med-grey);padding:.35rem .5rem}
#gridTbl th{position:sticky;top:0;background:#fafafa}
.grid-legend label{display:inline-flex;align-items:center;margin-right:1rem;font-size:.8rem;cursor:pointer}



