/* ===========================
   GLOBAL
=========================== */

*{
    box-sizing:border-box;
}

body{
    margin:0;
    padding:20px;
    font-family:Arial, Helvetica, sans-serif;
    background:#f4f4f4;
    color:#333;
}

.container{
    max-width:1400px;
    margin:auto;
    background:#fff;
    padding:20px;
    border-radius:8px;
    box-shadow:0 2px 8px rgba(0,0,0,.08);
}

/* ===========================
   HEADER
=========================== */

h1{
    margin:0;
    color:#003366;
    font-size:32px;
}

.subtitle{
    margin-top:8px;
    margin-bottom:30px;
    color:#666;
    font-size:18px;
}

/* ===========================
   FILTERS
=========================== */

.filters{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
    align-items:flex-end;
    margin-bottom:25px;
}

.filters label{
    display:flex;
    flex-direction:column;
    min-width:180px;
    font-weight:bold;
}

.filters span{
    margin-bottom:6px;
}

.filters select{
    padding:10px;
    border:1px solid #ccc;
    border-radius:5px;
    font-size:15px;
}

.filters button{
    padding:11px 20px;
    background:#003366;
    color:#fff;
    border:none;
    border-radius:5px;
    cursor:pointer;
    transition:.2s;
    font-size:15px;
}

.filters button:hover{
    background:#0057b8;
}


/* ===========================
   CSS GRID TABLE
=========================== */


.table-container{

    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;

}


.permit-grid{

    display:grid;

    grid-template-columns:
    45px
    110px
    130px
    120px
    350px
    80px
    600px
    140px
    100px
    300px
    120px
    70px
    300px
    650px
    450px
    80px
    300px
    120px
    250px
    90px;

    width:max-content;
    min-width:3500px;

}


.permit-grid > div{

    padding:10px;

    border-bottom:1px solid #ddd;

    overflow-wrap:break-word;

    white-space:normal;

    min-width:0;

}



.permit-header{

    background:#003366;

    color:white;

    font-weight:bold;

    position:sticky;

    top:0;

    z-index:5;

}



.permit-row:nth-child(even){

    background:#fafafa;

}


.permit-row:hover{

    background:#eef6ff;

}



.contractor{

    max-width:600px;

}


.summary{

    max-width:650px;

}


.wrap-job{

    max-width:300px;

}


.building{

    max-width:450px;

}


.customer{

    max-width:250px;

}


@media(max-width:1100px) and (min-width:769px){

.permit-grid{

grid-template-columns:

40px
80px
110px
90px
300px
60px
400px
120px
80px
250px
90px
60px
250px
500px
350px
70px
250px
90px
200px
70px;

min-width:2800px;

}

}

/* ===========================
   MOBILE CARDS
=========================== */

.mobile-card{
    display:none;
}

.score-badge{
    color:#fff;
    padding:5px 12px;
    border-radius:20px;
    font-weight:bold;
    display:inline-block;
    min-width:45px;
    text-align:center;
}

.mobile-links{
    margin-top:15px;
}

.mobile-links a{
    display:inline-block;
    margin-right:18px;
    margin-top:6px;
    font-weight:bold;
}

/* ===========================
   TABLET
=========================== */

@media (max-width:1100px){

body{
    padding:15px;
}

.container{
    padding:18px;
}

.permit-grid > div{

    font-size:13px;
    padding:8px;

}

}

/* ===========================
   MOBILE
=========================== */

@media (max-width:768px){

body{
    padding:8px;
}

.container{
    padding:12px;
}

h1{
    font-size:24px;
    line-height:1.3;
}

.subtitle{
    font-size:16px;
    margin-bottom:20px;
}

.filters{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.filters label{
    width:100%;
}

.filters select{
    width:100%;
    font-size:16px;
}

.filters button{
    width:100%;
    font-size:17px;
}

.permit-grid{
    display:none;
}

.table-container{
    overflow:visible;
}

.mobile-card{
    display:block;
    width:100%;
    background:#fff;
    border:1px solid #ddd;
    border-radius:10px;
    padding:14px;
    margin-bottom:18px;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
}

.mobile-card h3{
    margin:0 0 12px;
    color:#003366;
    font-size:18px;
    line-height:1.4;
    word-break:break-word;
}

.mobile-row{
    margin-bottom:10px;
    line-height:1.5;
    word-break:break-word;
    overflow-wrap:anywhere;
}

.mobile-label{
    display:block;
    font-weight:bold;
    color:#666;
    margin-bottom:2px;
}

.mobile-links{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:15px;
}

.mobile-links a{
    background:#003366;
    color:#fff;
    padding:10px 14px;
    border-radius:6px;
    text-decoration:none;
    font-size:15px;
}

.mobile-links a:hover{
    background:#0057b8;
}

.details-button{
    margin-top:15px;
    width:100%;
    background:#e8eef8;
    border:none;
    padding:12px;
    border-radius:6px;
    cursor:pointer;
    font-size:15px;
    font-weight:bold;
}

.details-button:hover{
    background:#d5e3f8;
}

.details{
    display:none;
    margin-top:15px;
    padding-top:15px;
    border-top:1px solid #ddd;
}

.details.open{
    display:block;
}

}

/* ===========================
   EXTRA SMALL PHONES
=========================== */

@media (max-width:480px){

body{
    padding:5px;
}

.container{
    padding:10px;
}

h1{
    font-size:21px;
}

.subtitle{
    font-size:14px;
}

.mobile-card{
    padding:12px;
}

.mobile-card h3{
    font-size:16px;
}

.mobile-links{
    flex-direction:column;
}

.mobile-links a{
    text-align:center;
    width:100%;
}

}

/* ===========================
   320px DEVICES
=========================== */

@media (max-width:320px){

body{
    padding:2px;
}

.container{
    padding:8px;
}

h1{
    font-size:18px;
}

.subtitle{
    font-size:13px;
}

.filters select,
.filters button{
    font-size:15px;
}

.mobile-card{
    padding:10px;
}

.mobile-card h3{
    font-size:15px;
}

.mobile-row{
    font-size:14px;
}

}


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

.pagination{

    display:flex;
    justify-content:center;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    margin:25px 0;
    width:100%;

}


.pagination button{

    background:#003366;
    color:white;
    border:none;
    padding:10px 14px;
    border-radius:6px;
    cursor:pointer;
    font-size:14px;
    white-space:nowrap;

}


.pagination button:disabled{

    background:#999;
    cursor:not-allowed;

}


.pagination span{

    font-weight:bold;
    padding:8px 10px;
    white-space:nowrap;

}



/* ===========================
   TABLET
=========================== */

@media (max-width:1100px){

    .pagination{

        gap:8px;

    }


    .pagination button{

        padding:9px 12px;
        font-size:13px;

    }


}



/* ===========================
   MOBILE
=========================== */

@media (max-width:768px){


    .pagination{

        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
        margin:20px 0;

    }


    .pagination span{

        grid-column:1 / 3;
        grid-row:1;
        text-align:center;
        font-size:14px;

    }


    .pagination button{

        width:100%;
        padding:12px 8px;
        font-size:14px;

    }


}



/* ===========================
   320px PHONES
=========================== */

@media (max-width:320px){


    .pagination button{

        font-size:12px;
        padding:10px 5px;

    }


    .pagination span{

        font-size:13px;

    }


}