*{
    box-sizing:border-box;
}

html{
    width:100%;
    min-height:100%;
}

body{
    margin:0;
    width:100%;
    min-height:100vh;
    font-family:Inter,Arial,sans-serif;
    background:#f1f4f8;
    color:#263238;
}


/* =====================================================
   TOP BAR
===================================================== */

.topbar{
    height:72px;
    background:#f44336;
    color:#fff;

    display:flex;
    align-items:center;
    justify-content:space-between;

    padding:0 36px;

    position:sticky;
    top:0;
    z-index:10;

    box-shadow:0 2px 10px #0002;
}

.brand{
    font-size:24px;
    line-height:28px;
    font-weight:800;
}

.top-actions,
.public-link{
    font-size:13px;
    line-height:18px;
    color:#fff;
    text-decoration:none;
}

.pulse{
    display:inline-block;

    width:8px;
    height:8px;

    background:#fff;
    border-radius:50%;

    margin-right:8px;
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar{
    position:fixed;

    top:72px;
    bottom:0;
    left:0;

    width:286px;

    background:#fff;

    border-right:1px solid #e0e4e8;
}

.profile{
    height:223px;

    padding:70px 24px;

    background:linear-gradient(
        145deg,
        #ff5722,
        #ff9800
    );

    color:#fff;

    display:flex;
    flex-direction:column;

    gap:8px;

    font-size:21px;
    line-height:26px;
}

.profile span{
    font-size:14px;
    line-height:20px;
}

.sidebar nav a{
    height:55px;

    display:flex;
    align-items:center;

    gap:17px;

    padding:0 24px;

    color:#455a64;

    text-decoration:none;

    border-bottom:1px solid #eee;
}

.sidebar nav a.active,
.sidebar nav a:hover{
    background:#f44336;
    color:#fff;
}

.side-note{
    position:absolute;

    bottom:20px;

    padding:0 24px;

    color:#90a4ae;

    font-size:11px;
    line-height:16px;
}


/* =====================================================
   MAIN CONTENT
===================================================== */

.main{
    margin-left:286px;

    width:calc(100% - 286px);

    max-width:1800px;

    padding:34px 40px;
}

.hero{
    display:flex;
    justify-content:space-between;
    align-items:center;

    gap:30px;

    margin-bottom:25px;
}

.hero small,
.panel small,
.login small,
.admin-head small{
    font-size:11px;
    line-height:16px;

    letter-spacing:1.3px;

    font-weight:800;

    color:#78909c;
}

.hero h1{
    font-size:31px;
    line-height:38px;

    margin:7px 0;
}

.hero p{
    color:#607d8b;

    font-size:15px;
    line-height:22px;

    margin:0;
}

.latest{
    background:#fff;

    border-left:5px solid #f44336;

    padding:17px 22px;

    border-radius:12px;

    font-size:14px;
    line-height:20px;

    font-weight:700;

    white-space:nowrap;

    box-shadow:0 5px 20px #26323812;
}


/* =====================================================
   SUMMARY CARDS
===================================================== */

.cards{
    display:grid;

    /*
       Four equal columns.
       minmax(0,1fr) prevents content
       from changing the column width.
    */

    grid-template-columns:
        repeat(4,minmax(0,1fr));

    gap:22px;

    width:100%;

    margin-bottom:28px;
}


/* =====================================================
   INDIVIDUAL CARD
===================================================== */

.card{
    width:100%;
    min-width:0;

    /*
       Fixed card dimensions.
       Screen width does NOT change
       the card height.
    */

    height:128px;
    min-height:128px;
    max-height:128px;

    padding:20px 22px;

    color:#fff;

    border-radius:15px;

    display:flex;
    align-items:center;

    gap:16px;

    overflow:hidden;

    box-shadow:0 8px 22px #26323818;
}


/* =====================================================
   CARD ICON
===================================================== */

.card .ico{
    width:46px;
    height:46px;

    min-width:46px;
    max-width:46px;

    border:2px solid #ffffff99;

    border-radius:50%;

    display:grid;
    place-items:center;

    font-size:22px;
    line-height:1;

    flex-shrink:0;
}


/* =====================================================
   CARD CONTENT
===================================================== */

.card-content{
    width:100%;
    min-width:0;

    flex:1;

    overflow:hidden;
}


/* Card heading */

.card-content small{
    display:block;

    width:100%;

    font-size:12px;
    line-height:18px;

    font-weight:600;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;
}


/* Main value */

.card-content strong{
    display:block;

    width:100%;

    font-size:24px;
    line-height:30px;

    font-weight:800;

    margin:4px 0;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;
}


/* Description */

.card-content span{
    display:block;

    width:100%;

    font-size:12px;
    line-height:18px;

    font-weight:400;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

    opacity:.92;
}


/* =====================================================
   CARD COLORS
===================================================== */

.pink{
    background:#e91e63;
}

.cyan{
    background:#08b4cc;
}

.green{
    background:#8bc34a;
}

.orange{
    background:#ff9800;
}


/* =====================================================
   PANELS
===================================================== */

.panel{
    width:100%;

    background:#fff;

    border-radius:16px;

    padding:25px;

    margin-bottom:25px;

    box-shadow:0 5px 18px #26323812;
}

.panel-head{
    display:flex;

    justify-content:space-between;
    align-items:center;

    gap:20px;

    margin-bottom:20px;
}

.panel h2{
    margin:5px 0 0;

    font-size:19px;
    line-height:26px;
}

.chart{
    width:100%;
    height:360px;
}


/* =====================================================
   SEARCH / TOOLS
===================================================== */

.tools{
    display:flex;
    gap:10px;
}

.tools input,
select{
    height:42px;

    border:1px solid #d8dee4;

    border-radius:8px;

    padding:0 12px;

    background:#fff;

    font-size:14px;
}

.tools input{
    min-width:220px;
}

button{
    font:inherit;

    cursor:pointer;

    border-radius:8px;

    padding:10px 15px;

    font-weight:700;
}

.tools button,
.outline{
    border:1px solid #cfd8dc;

    background:#fff;

    color:#455a64;
}

.primary{
    border:0;

    background:#f44336;

    color:#fff;
}


/* =====================================================
   TABLE
===================================================== */

.table-wrap{
    width:100%;

    overflow-x:auto;
}

table{
    width:100%;

    border-collapse:collapse;

    min-width:680px;
}

th,
td{
    padding:15px 14px;

    text-align:left;

    border-bottom:1px solid #edf0f2;

    font-size:14px;
    line-height:20px;
}

th{
    font-size:12px;
    line-height:18px;

    color:#607d8b;

    text-transform:uppercase;
}

.empty{
    text-align:center;

    color:#90a4ae;

    padding:35px;
}


/* =====================================================
   FOOTER
===================================================== */

footer{
    text-align:center;

    color:#90a4ae;

    font-size:12px;
    line-height:18px;

    padding:20px;
}


/* =====================================================
   ADMIN
===================================================== */

.admin-body{
    min-height:100vh;
}

.admin-main{
    width:100%;

    max-width:1450px;

    margin:auto;

    padding:42px 30px;
}

.login{
    width:100%;

    max-width:520px;

    margin:30px auto;

    background:#fff;

    border-radius:18px;

    padding:38px;

    box-shadow:0 12px 40px #26323818;
}

.admin-logo{
    width:55px;
    height:55px;

    border-radius:15px;

    background:#f44336;

    color:#fff;

    display:grid;
    place-items:center;

    font-weight:800;
    font-size:20px;

    margin-bottom:20px;
}

.login h1,
.admin-head h1{
    margin:7px 0;
}

.login p,
.admin-head p{
    color:#607d8b;
}

.login label,
.form label{
    display:block;

    font-size:12px;
    line-height:18px;

    font-weight:700;

    color:#546e7a;
}

.login input,
.form input{
    display:block;

    width:100%;

    height:44px;

    margin:7px 0 18px;

    border:1px solid #d5dce1;

    border-radius:8px;

    padding:0 12px;

    font:inherit;
}

.login .primary{
    width:100%;
    height:45px;
}

.hidden{
    display:none;
}

.admin-head{
    display:flex;

    justify-content:space-between;
    align-items:flex-start;

    margin-bottom:24px;
}

.admin-head button+button{
    margin-left:8px;
}

.admin-grid{
    display:grid;

    grid-template-columns:420px 1fr;

    gap:24px;
}

.form{
    display:grid;

    grid-template-columns:1fr 1fr;

    gap:0 15px;
}

.form label.full,
.form .full{
    grid-column:1/-1;
}

.actions{
    display:flex;

    gap:10px;
}

.security-list{
    color:#607d8b;

    line-height:2;
}

.small-btn{
    border:0;

    padding:6px 9px;

    font-size:12px;

    background:#e0f7fa;

    color:#008ca3;
}

.danger{
    background:#ffebee;

    color:#d32f2f;

    margin-left:5px;
}


/* =====================================================
   LARGE LAPTOP / SMALL DESKTOP
   1200px - 1400px
===================================================== */

@media (max-width:1400px){

    .main{
        padding-left:30px;
        padding-right:30px;
    }

    .cards{
        gap:18px;
    }

    .card{
        padding-left:18px;
        padding-right:18px;

        gap:13px;
    }

    .card .ico{
        width:44px;
        height:44px;

        min-width:44px;
        max-width:44px;
    }
}


/* =====================================================
   TABLET / SMALL LAPTOP
   1100px AND BELOW

   4 cards -> 2 cards per row
===================================================== */

@media (max-width:1100px){

    .sidebar{
        width:220px;
    }

    .main{
        margin-left:220px;

        width:calc(100% - 220px);

        padding:30px 24px;
    }

    .cards{
        grid-template-columns:
            repeat(2,minmax(0,1fr));

        gap:18px;
    }

    /*
       Card dimensions stay fixed.
    */

    .card{
        height:128px;
        min-height:128px;
        max-height:128px;

        padding:20px;
    }

    .card-content strong{
        font-size:24px;
        line-height:30px;
    }

    .admin-grid{
        grid-template-columns:1fr;
    }
}


/* =====================================================
   SMALL TABLET
   900px AND BELOW
===================================================== */

@media (max-width:900px){

    .hero{
        align-items:flex-start;

        flex-direction:column;

        gap:15px;
    }

    .latest{
        width:100%;
    }

    .panel-head{
        align-items:flex-start;
    }
}


/* =====================================================
   MOBILE
   720px AND BELOW

   2 cards -> 1 card per row
===================================================== */

@media (max-width:720px){

    /* -----------------------------------------------
       TOP BAR
    ----------------------------------------------- */

    .topbar{
        height:62px;

        padding:0 16px;
    }

    .brand{
        font-size:18px;
        line-height:22px;
    }

    .top-actions{
        display:none;
    }


    /* -----------------------------------------------
       SIDEBAR
    ----------------------------------------------- */

    .sidebar{
        position:relative;

        top:auto;

        width:100%;

        height:auto;
    }

    .profile{
        height:auto;

        padding:22px;
    }

    .sidebar nav{
        display:flex;
    }

    .sidebar nav a{
        width:50%;

        justify-content:center;
    }

    .side-note{
        display:none;
    }


    /* -----------------------------------------------
       MAIN
    ----------------------------------------------- */

    .main{
        margin-left:0;

        width:100%;

        padding:20px 14px;
    }


    /* -----------------------------------------------
       HERO
    ----------------------------------------------- */

    .hero{
        display:block;
    }

    .hero h1{
        font-size:27px;
        line-height:34px;
    }

    .latest{
        margin-top:15px;

        width:100%;
    }


    /* -----------------------------------------------
       CARDS
    ----------------------------------------------- */

    .cards{
        grid-template-columns:1fr;

        gap:12px;

        width:100%;
    }

    /*
       Mobile card height is still fixed.
    */

    .card{
        width:100%;

        height:112px;
        min-height:112px;
        max-height:112px;

        padding:18px;

        gap:14px;
    }

    .card .ico{
        width:44px;
        height:44px;

        min-width:44px;
        max-width:44px;

        font-size:21px;
    }

    .card-content small{
        font-size:12px;
        line-height:18px;
    }

    .card-content strong{
        font-size:23px;
        line-height:29px;

        margin:3px 0;
    }

    .card-content span{
        font-size:12px;
        line-height:18px;
    }


    /* -----------------------------------------------
       PANELS
    ----------------------------------------------- */

    .panel{
        padding:18px;

        border-radius:14px;
    }

    .panel-head{
        align-items:flex-start;

        flex-direction:column;
    }

    .panel h2{
        font-size:18px;
        line-height:24px;
    }


    /* -----------------------------------------------
       TOOLS
    ----------------------------------------------- */

    .tools{
        width:100%;

        flex-direction:column;
    }

    .tools input{
        width:100%;

        min-width:0;
    }


    /* -----------------------------------------------
       CHART
    ----------------------------------------------- */

    .chart{
        height:300px;
    }


    /* -----------------------------------------------
       TABLE
    ----------------------------------------------- */

    .table-wrap{
        width:100%;

        overflow-x:auto;
    }


    /* -----------------------------------------------
       ADMIN
    ----------------------------------------------- */

    .admin-main{
        padding:25px 14px;
    }

    .admin-head{
        display:block;
    }

    .admin-head>div:last-child{
        margin-top:15px;
    }

    .form{
        grid-template-columns:1fr;
    }

    .form label.full,
    .form .full{
        grid-column:1;
    }

    .login{
        padding:25px;
    }

    .admin-head h1{
        font-size:25px;
        line-height:32px;
    }
}


/* =====================================================
   VERY SMALL MOBILE
   480px AND BELOW

   Keep typography stable.
   Only reduce horizontal padding.
===================================================== */

@media (max-width:480px){

    .main{
        padding-left:12px;
        padding-right:12px;
    }

    .card{
        height:108px;
        min-height:108px;
        max-height:108px;

        padding:16px;
    }

    .card .ico{
        width:42px;
        height:42px;

        min-width:42px;
        max-width:42px;

        font-size:20px;
    }

    .card-content strong{
        font-size:22px;
        line-height:28px;
    }

    .card-content small,
    .card-content span{
        font-size:11px;
        line-height:17px;
    }

    .panel{
        padding:16px;
    }

    .chart{
        height:270px;
    }
}