:root{
    --primary:#166b69;
    --primary-dark:#105453;
    --primary-soft:#e9f5f4;
    --background:#f5f7f8;
    --card:#ffffff;
    --text:#172126;
    --muted:#718087;
    --border:#e4e9eb;
    --danger:#c94b4b;
    --warning:#b98018;
    --success:#21845a;
    --shadow:0 8px 30px rgba(20,40,50,.08);
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color:var(--text);
    background:var(--background);
}

button,
input,
select,
textarea{
    font:inherit;
}

button{
    cursor:pointer;
}

/* LOGIN */

.login-page{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:24px;
    background:
        radial-gradient(circle at top right,#dff3f1,transparent 35%),
        radial-gradient(circle at bottom left,#e8f1f6,transparent 35%),
        #f5f8f8;
}

.login-card{
    width:min(430px,100%);
    background:white;
    border:1px solid var(--border);
    border-radius:26px;
    padding:38px;
    box-shadow:var(--shadow);
}

.brand-mark{
    width:66px;
    height:66px;
    display:grid;
    place-items:center;
    border-radius:20px;
    background:var(--primary);
    color:white;
    font-weight:800;
    letter-spacing:1px;
    margin-bottom:22px;
}

.brand-mark.small{
    width:44px;
    height:44px;
    border-radius:13px;
    margin:0;
    flex:none;
}

.login-card h1{
    margin:0 0 5px;
}

.muted{
    color:var(--muted);
}

label{
    display:block;
    margin:19px 0 7px;
    font-size:13px;
    font-weight:700;
}

input,
select,
textarea{
    width:100%;
    border:1px solid var(--border);
    background:#fff;
    border-radius:11px;
    padding:12px 13px;
    outline:none;
}

input:focus,
select:focus,
textarea:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 3px var(--primary-soft);
}

textarea{
    resize:vertical;
    min-height:90px;
}

.password-box{
    position:relative;
}

.password-box input{
    padding-right:50px;
}

.eye{
    position:absolute;
    right:5px;
    top:5px;
    width:40px;
    height:36px;
    border:0;
    background:transparent;
}

.primary{
    border:0;
    background:var(--primary);
    color:white;
    border-radius:11px;
    padding:12px 17px;
    font-weight:700;
}

.primary:hover{
    background:var(--primary-dark);
}

.login-button{
    width:100%;
    margin-top:24px;
}

.message{
    min-height:22px;
    margin-top:12px;
    color:var(--danger);
    font-size:13px;
}

.demo-box{
    background:var(--primary-soft);
    border-radius:13px;
    padding:14px;
    display:grid;
    gap:3px;
    font-size:13px;
    margin-top:18px;
}

.signature{
    text-align:center;
    color:#9aa4a9;
    font-size:11px;
    margin-top:24px;
}

/* APP */

.app-page{
    min-height:100vh;
}

.sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:250px;
    background:#fff;
    border-right:1px solid var(--border);
    padding:20px 14px;
    z-index:20;
    display:flex;
    flex-direction:column;
}

.sidebar-brand{
    display:flex;
    align-items:center;
    gap:12px;
    padding:4px 7px 22px;
}

.sidebar-brand strong,
.sidebar-brand small{
    display:block;
}

.sidebar-brand small{
    color:var(--muted);
    margin-top:2px;
    max-width:150px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.sidebar nav{
    overflow:auto;
    flex:1;
}

.nav{
    width:100%;
    border:0;
    background:transparent;
    display:flex;
    align-items:center;
    gap:11px;
    padding:11px 13px;
    border-radius:10px;
    margin:2px 0;
    color:#48565c;
    text-align:left;
}

.nav:hover{
    background:#f4f7f7;
}

.nav.active{
    background:var(--primary-soft);
    color:var(--primary-dark);
    font-weight:700;
}

.disabled-nav{
    opacity:.45;
    cursor:default;
}

.nav-group{
    font-size:10px;
    color:#9aa5aa;
    font-weight:800;
    letter-spacing:1px;
    padding:19px 13px 7px;
}

.logout{
    border:1px solid var(--border);
    background:#fff;
    border-radius:10px;
    padding:11px;
}

.main{
    margin-left:250px;
    min-height:100vh;
}

.topbar{
    height:84px;
    background:#fff;
    border-bottom:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 30px;
    position:sticky;
    top:0;
    z-index:10;
}

.topbar h2{
    margin:0;
    font-size:21px;
}

.user-box{
    display:flex;
    align-items:center;
    gap:10px;
}

.user-box small,
.user-box strong{
    display:block;
}

.user-box small{
    color:var(--muted);
}

.avatar{
    width:40px;
    height:40px;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:var(--primary);
    color:white;
    font-weight:800;
}

.mobile-menu{
    display:none;
}

#content{
    padding:28px 30px 50px;
}

.cards{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
}

.stat{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:16px;
    padding:20px;
}

.stat .value{
    font-size:30px;
    font-weight:800;
    margin-top:10px;
}

.stat .label{
    color:var(--muted);
    font-size:13px;
}

.panel{
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    margin-top:18px;
    overflow:hidden;
}

.panel-head{
    padding:17px 19px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    border-bottom:1px solid var(--border);
}

.panel-head h3{
    margin:0;
}

.toolbar{
    display:flex;
    gap:9px;
    flex-wrap:wrap;
}

.secondary{
    border:1px solid var(--border);
    background:#fff;
    padding:10px 14px;
    border-radius:10px;
}

table{
    width:100%;
    border-collapse:collapse;
}

th,
td{
    text-align:left;
    padding:13px 17px;
    border-bottom:1px solid var(--border);
    font-size:13px;
}

th{
    color:var(--muted);
    background:#fafbfb;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.4px;
}

.empty{
    padding:45px 20px;
    text-align:center;
    color:var(--muted);
}

.badge{
    display:inline-block;
    padding:5px 9px;
    border-radius:20px;
    font-size:11px;
    font-weight:700;
    background:#edf1f2;
}

.badge.agendado{
    background:#edf3ff;
    color:#3e64a3;
}

.badge.confirmado{
    background:#e7f6ef;
    color:#277654;
}

.badge.concluido{
    background:#e5f5ed;
    color:#18754b;
}

.badge.cancelado{
    background:#faeaea;
    color:#a33f3f;
}

.badge.faltou{
    background:#fff0db;
    color:#966318;
}

.actions{
    display:flex;
    gap:5px;
    flex-wrap:wrap;
}

.action{
    border:1px solid var(--border);
    background:#fff;
    padding:6px 8px;
    border-radius:7px;
    font-size:11px;
}

.filters{
    display:flex;
    gap:10px;
    align-items:center;
}

.filters input,
.filters select{
    width:auto;
}

.modal-overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(12,25,30,.45);
    z-index:100;
    padding:20px;
    place-items:center;
}

.modal-overlay.show{
    display:grid;
}

.modal-card{
    width:min(650px,100%);
    max-height:90vh;
    overflow:auto;
    background:#fff;
    border-radius:18px;
    padding:24px;
    position:relative;
    box-shadow:0 30px 70px #0003;
}

.modal-close{
    position:absolute;
    right:15px;
    top:13px;
    width:35px;
    height:35px;
    border:0;
    background:#f2f4f5;
    border-radius:50%;
    font-size:20px;
}

.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 14px;
}

.form-grid .full{
    grid-column:1/-1;
}

.form-actions{
    display:flex;
    justify-content:flex-end;
    gap:9px;
    margin-top:22px;
}

.toast{
    position:fixed;
    right:25px;
    bottom:25px;
    background:#172126;
    color:#fff;
    padding:13px 18px;
    border-radius:10px;
    opacity:0;
    pointer-events:none;
    transform:translateY(15px);
    transition:.2s;
    z-index:200;
}

.toast.show{
    opacity:1;
    transform:none;
}

.agenda-day{
    display:grid;
    grid-template-columns:90px 1fr;
    border-bottom:1px solid var(--border);
}

.agenda-time{
    padding:15px;
    color:var(--muted);
    font-size:13px;
    border-right:1px solid var(--border);
}

.agenda-item{
    padding:12px 16px;
}

.agenda-item strong{
    display:block;
}

.agenda-item small{
    color:var(--muted);
}

@media(max-width:1050px){
    .cards{
        grid-template-columns:repeat(2,1fr);
    }
}

@media(max-width:760px){

    .sidebar{
        transform:translateX(-100%);
        transition:.2s;
        width:270px;
    }

    .sidebar.open{
        transform:none;
    }

    .main{
        margin-left:0;
    }

    .mobile-menu{
        display:block;
        border:0;
        background:#f3f5f5;
        border-radius:9px;
        width:40px;
        height:40px;
        margin-right:12px;
    }

    .topbar{
        padding:0 16px;
        justify-content:flex-start;
    }

    .user-box{
        margin-left:auto;
    }

    #content{
        padding:18px 14px 40px;
    }

    .cards{
        grid-template-columns:1fr;
    }

    .form-grid{
        grid-template-columns:1fr;
    }

    .form-grid .full{
        grid-column:auto;
    }

    .panel{
        overflow:auto;
    }

    table{
        min-width:700px;
    }
}
