:root{
    --ys-green:#157147;
    --ys-green-dark:#0d5c38;
    --ys-gold:#d4af37;
    --bg:#f3f6f4;
    --shadow-sm:0 6px 18px rgba(0,0,0,.05);
    --shadow-md:0 10px 25px rgba(0,0,0,.08);
    --radius-sm:10px;
    --radius-md:16px;
    --radius-lg:20px;
}

body{
    margin:0;
    background:var(--bg);
    font-family:'Segoe UI',sans-serif;
    color:#1e293b;
}

.salary-page{
    max-width:1400px;
    margin:auto;
    padding:30px;
}

.page-header{
    background:linear-gradient(
        135deg,
        var(--ys-green),
        var(--ys-green-dark)
    );

    color:white;
    padding:30px;
    border-radius:24px;
    margin-bottom:24px;

    display:flex;
    justify-content:space-between;
    align-items:center;
}

.page-header h1{
    margin:0;
    font-size:34px;
    font-weight:800;
}

.subtitle{
    color:#d4af37;
    margin-top:8px;
}

.logout-btn{
    background:white;
    color:var(--ys-green);
    padding:12px 22px;
    border-radius:12px;
    text-decoration:none;
    font-weight:700;
}

.employee-card{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:16px;
    margin-bottom:22px;
}

.employee-item{
    background:#fff;
    border-radius:14px;
    padding:16px 20px;
    box-shadow:0 6px 18px rgba(0,0,0,.05);
}

.employee-item label{
    display:block;
    color:#6b7280;
    font-size:13px;
    margin-bottom:6px;
}

.employee-item span{
    font-size:18px;
    font-weight:700;
    color:#1f2d3d;
}



.month-card select{
    width:300px;
    padding:14px;
    border-radius:12px;
    border:1px solid #ddd;
    font-size:16px;
}

.salary-summary{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:18px;
    margin-bottom:28px;
}

.salary-kpi{
    background:#fff;
    border-radius:16px;
    padding:18px 22px;
    box-shadow:0 8px 20px rgba(0,0,0,.05);
    border-top:4px solid #d9aa25;
}

.salary-kpi-main{
    background:linear-gradient(
        135deg,
        var(--ys-green),
        var(--ys-green-dark)
    );
    border:none;
}

.salary-kpi-main .salary-kpi-label{
    color:#d4af37;
}

.salary-kpi-main .salary-kpi-value{
    color:white;
}

.salary-kpi-label{
    color:#6b7280;
    font-size:13px;
    letter-spacing:1px;
    text-transform:uppercase;
}

.salary-kpi-value{
    margin-top:8px;
    font-size:26px;
    font-weight:700;
    color:#16643f;
}

.show-all-btn{
    height:44px;
    padding:0 18px;
    border:none;
    border-radius:10px;
    background:#16643f;
    color:#fff;
    font-weight:600;
    cursor:pointer;
    transition:.2s;
}

.show-all-btn:hover{

    background:#115334;
}

.salary-table{
    background:white;
    border-radius:20px;
    overflow:hidden;
    box-shadow:0 10px 25px rgba(0,0,0,.08);
}

.salary-row{
    display:grid;
    grid-template-columns:1fr 250px;
    align-items:center;
}

.salary-header{
    background:var(--ys-green);
    color:white;
    font-weight:700;
}

.salary-header .salary-name,
.salary-header .salary-value{
    color:white;
}

.salary-name,
.salary-value{
    padding:18px 22px;
}

.salary-value{
    text-align:right;
    font-weight:700;
    color:var(--ys-green);
}

.salary-row:not(.salary-header){
    border-bottom:1px solid #edf2f7;
}

.zero-row{
    display:none;
}

.show-all .zero-row{
    display:grid;
}

.error-page{
    text-align:center;
    padding:80px;
}

@media(max-width:992px){

    .employee-card{
        grid-template-columns:1fr;
    }
    .salary-summary{
        grid-template-columns:1fr;
    }
    .salary-row{
        grid-template-columns:1fr;
    }
    .salary-value{
        text-align:left;
    }
    .page-header{
        flex-direction:column;
        gap:20px;
        text-align:center;
    }
    .month-card select{
        width:100%;
    }
}

/* ==========================================================
   LOGIN PAGE
========================================================== */

.login-page{
    min-height:calc(100vh - 72px);
    display:flex;
    justify-content:center;
    align-items:center;
    padding:40px;
}

.login-card{
    width:430px;
    background:#fff;
    border-radius:18px;
    box-shadow:0 15px 35px rgba(0,0,0,.08);
    overflow:hidden;
}

.login-header{
    background:#16643f;
    color:#fff;
    padding:40px 30px;
    text-align:center;
}

.logo-circle{
    width:74px;
    height:74px;
    margin:auto;
    margin-bottom:20px;
    border-radius:50%;
    background:#fff;
    color:#16643f;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;
    font-weight:700;
}

.login-header h1{
    margin:0;
    font-size:28px;
    font-weight:700;
}

.login-header p{
    margin-top:10px;
    opacity:.9;
    font-size:15px;
}

.login-body{
    padding:35px;
}

.form-group{
    margin-bottom:20px;
}

.form-group label{
    display:block;
    margin-bottom:8px;
    color:#444;
    font-weight:600;
}

.form-control{
    width:100%;
    box-sizing:border-box;
    padding:13px 15px;
    border-radius:10px;
    border:1px solid #d7dce2;
    font-size:15px;
    transition:.25s;
}

.form-control:focus{
    outline:none;
    border-color:#16643f;
    box-shadow:0 0 0 3px rgba(22,100,63,.15);
}

.login-btn{
    width:100%;
    height:48px;
    border:none;
    border-radius:10px;
    background:#16643f;
    color:#fff;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    transition:.2s;
}

.login-btn:hover{
    background:#0f5234;
}

.validation-error{
    color:#d32f2f;
    margin-bottom:15px;
    font-size:14px;
}

.validation-summary-errors{
    color:#d32f2f;
}

.field-validation-error{
    color:#d32f2f;
    font-size:13px;
}

.input-validation-error{
    border-color:#d32f2f;
}

.login-footer{
    margin-top:24px;
    text-align:center;
    color:#777;
    font-size:14px;
    line-height:1.5;
}

.section-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    margin:35px 0 20px;
}

.section-actions{
    display:flex;
    align-items:center;
    gap:12px;
}

.section-line{
    width:80px;
    height:4px;
    background:#d4a41c;
    border-radius:10px;
    margin-top:8px;
}

.month-select{
    width:170px;
    height:44px;
    border-radius:10px;
    border:1px solid #ddd;
    padding:0 15px;
    background:#fff;
    font-size:15px;
    cursor:pointer;
}

/*=============================
    Toolbar
=============================*/

.section-toolbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:#ffffff;
    border-radius:18px;
    padding:14px 22px;
    margin:32px 0 18px;
    box-shadow:0 8px 30px rgba(0,0,0,.06);

}

.toolbar-title{
    display:flex;
    flex-direction:column;
    gap:4px;

}

.toolbar-title h2{
    margin:0;
    font-size:30px;
    color:#16643f;
    font-weight:700;
}

.toolbar-title span{
    color:#7d8895;
    font-size:14px;
}

.toolbar-actions{
    display:flex;
    align-items:center;
    gap:14px;

}

.month-select{
    width:170px;
    height:46px;
    border:1px solid #d9d9d9;
    border-radius:10px;
    padding:0 14px;
    background:#fff;
    font-size:15px;
}

.show-all-btn{
    width:140px;
    height:46px;
    border:none;
    background:#16643f;
    color:#fff;
    border-radius:10px;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition:.25s;
    display:flex;
    align-items:center;
    justify-content:center;
    white-space:nowrap;
    flex-shrink:0;
}

.show-all-btn:hover{
    background:#1e7a4d;
}

.logo-circle{
    width:80px;
    height:80px;
    margin:0 auto 28px;
    background:#fff;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 10px 25px rgba(0,0,0,.15);
}

.company-logo{
    max-width:64px;
    max-height:64px;
    width:auto;
    height:auto;
    object-fit:contain;
}
.header-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:100px;
    height:42px;
    padding:0 18px;
    background:#fff;
    color:#16643f;
    border:none;
    border-top:3px solid #d4a514;
    border-radius:12px;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
    font-size:14px;
    font-weight:700;
    text-decoration:none;
    transition:.25s;
}

.header-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 30px rgba(0,0,0,.12);
    border-top-color:#e0b323;
}

.back-link{
    color:#16643f;
    text-decoration:none;
    font-weight:600;
    transition:.25s;
}

.back-link:hover{
    color:#d4a514;
    text-decoration:none;
}

/* ==========================================================
   ADMIN
========================================================== */

.admin-page{
    max-width:1800px;
    margin:auto;
    padding:30px;
}

.admin-alert{
    padding:14px 18px;
    border-radius:12px;
    margin-bottom:18px;
    font-weight:600;
}

.admin-alert.success{
    background:#e8f6ee;
    color:#16643f;
    border:1px solid #b9e3ca;
}

.admin-alert.error{
    background:#fff0f0;
    color:#b42318;
    border:1px solid #f3c2c2;
}

.admin-toolbar{
    background:#fff;
    border-radius:18px;
    padding:20px 24px;
    margin-bottom:18px;
    box-shadow:0 8px 30px rgba(0,0,0,.06);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
}

.admin-toolbar h2{
    margin:0 0 5px;
    color:#16643f;
}

.admin-toolbar span{
    color:#7d8895;
    font-size:14px;
}

.admin-filter{
    display:flex;
    align-items:center;
    gap:12px;
}

.admin-filter label{
    font-weight:600;
    color:#555;
}

.admin-kpis{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:18px;
    margin-bottom:28px;
}

.admin-kpi{
/*    background:#fff;
    border-radius:16px;
    padding:18px 20px;
    border-top:4px solid #d9aa25;
    box-shadow:0 8px 20px rgba(0,0,0,.05);

    min-height:150px;

    display:flex;
    flex-direction:column;
    justify-content:flex-start;
*/
    background:#fff;
    border-radius:16px;
    padding:18px 22px;
    box-shadow:0 8px 20px rgba(0,0,0,.05);
    border-top:4px solid #d9aa25;
}

.admin-kpi span{
    color:#6b7280;
    font-size:13px;
    letter-spacing:.8px;
    text-transform:uppercase;
}

.admin-kpi strong{
    margin-top:10px;
    color:#16643f;
    font-size:22px;
    line-height:1.25;
    font-weight:700;
    word-break:break-word;
}

.admin-table-wrap{
    background:#fff;
    border-radius:18px;
    overflow:auto;
    box-shadow:0 10px 25px rgba(0,0,0,.07);
}

.admin-table{
    width:100%;
    min-width:1250px;
    border-collapse:collapse;
    font-size:14px;
}

.admin-table th{
    background:#16643f;
    color:#fff;
    padding:15px 14px;
    text-align:left;
    white-space:nowrap;
}

.admin-table td{
    padding:13px 14px;
    border-bottom:1px solid #edf2f7;
    vertical-align:middle;
}

.admin-table tbody tr:hover{
    background:#f8fbf9;
}

.admin-table .number{
    text-align:right;
    white-space:nowrap;
}

.salary-net{
    color:#16643f;
    font-weight:800;
}

.status-badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
}

.has-salary{
    background:#e8f6ee;
    color:#16643f;
}

.no-salary{
    background:#f2f4f7;
    color:#667085;
}

.reset-form{
    display:flex;
    gap:7px;
    min-width:230px;
}

.reset-input{
    width:150px;
    box-sizing:border-box;
    height:38px;
    border:1px solid #d9dfe5;
    border-radius:8px;
    padding:0 10px;
}

.reset-input:focus{
    outline:none;
    border-color:#16643f;
    box-shadow:0 0 0 3px rgba(22,100,63,.12);
}

.reset-btn{
    height:38px;
    border:0;
    border-radius:8px;
    padding:0 12px;
    background:#16643f;
    color:#fff;
    font-weight:700;
    cursor:pointer;
}

.reset-btn:hover{
    background:#0f5234;
}

.admin-note{
    margin-top:14px;
    color:#667085;
    font-size:13px;
}

@media(max-width:992px){
    .admin-page{
        padding:16px;
    }

    .admin-toolbar{
        flex-direction:column;
        align-items:stretch;
    }

    .admin-filter{
        justify-content:space-between;
    }

    .admin-kpis{
        grid-template-columns:1fr;
    }
}

/* ==========================================================
   ADMIN DASHBOARD + AUDIT LOG
========================================================== */

.admin-header{
    margin-bottom:20px;
}

.admin-header h1{
    margin:0;
    font-size:34px;
    font-weight:800;
}

.admin-eyebrow{
    font-size:12px;
    font-weight:800;
    letter-spacing:1.8px;
    color:#d4af37;
    margin-bottom:7px;
}

.dashboard-toolbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    background:#fff;
    border-radius:18px;
    padding:18px 22px;
    margin-bottom:18px;
    box-shadow:0 8px 30px rgba(0,0,0,.06);
}

.dashboard-toolbar > div:first-child{
    display:flex;
    align-items:baseline;
    gap:12px;
    flex-wrap:wrap;
}

.dashboard-label{
    font-size:12px;
    font-weight:800;
    letter-spacing:1px;
    color:#7d8895;
}

.dashboard-toolbar strong{
    color:#16643f;
    font-size:22px;
}

.dashboard-muted{
    color:#8a94a1;
    font-size:13px;
}

.dashboard-kpis{
    grid-template-columns:repeat(6, minmax(0,1fr));
}

.dashboard-kpis .admin-kpi{
    min-height:105px;
    box-sizing:border-box;
}

.admin-kpi small{
    display:block;
    margin-top:5px;
    color:#8a94a1;
    font-size:12px;
}

.admin-kpi.kpi-primary{
    background:linear-gradient(135deg,#16643f,#0d5c38);
    border-top:none;
}

.admin-kpi.kpi-primary span,
.admin-kpi.kpi-primary strong,
.admin-kpi.kpi-primary small{
    color:#fff;
}

.admin-kpi.kpi-primary small{
    opacity:.8;
}

.admin-kpi.kpi-warning{
    border-top-color:#d97706;
}

.admin-kpi.kpi-warning strong{
    color:#b45309;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:minmax(0, 1.85fr) minmax(350px, .8fr);
    gap:20px;
    align-items:start;
}

.dashboard-main-card,
.audit-card{
    background:#fff;
    border-radius:18px;
    box-shadow:0 10px 25px rgba(0,0,0,.07);
    overflow:hidden;
}

.dashboard-main-card .admin-table-wrap{
    border-radius:0;
    box-shadow:none;
}

.card-heading{
    padding:20px 22px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
    border-bottom:1px solid #edf2f7;
}

.card-heading h2{
    margin:0 0 5px;
    color:#16643f;
    font-size:21px;
}

.card-heading span:not(.card-counter):not(.audit-total){
    color:#7d8895;
    font-size:13px;
}

.card-counter,
.audit-total{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:32px;
    padding:0 11px;
    border-radius:999px;
    background:#edf7f1;
    color:#16643f;
    font-size:12px;
    font-weight:800;
    white-space:nowrap;
}

.audit-card{
    min-width:0;
}

.audit-heading{
    padding-bottom:15px;
}

.audit-total{
    min-width:30px;
    background:#f7f1dd;
    color:#80630d;
}

.audit-filter{
    display:grid;
    grid-template-columns:1fr 1fr auto;
    gap:8px;
    padding:14px 16px;
    border-bottom:1px solid #edf2f7;
    background:#fbfcfb;
}

.audit-filter select,
.audit-filter button{
    height:36px;
    border:1px solid #d9dfe5;
    border-radius:8px;
    background:#fff;
    padding:0 9px;
    font-size:12px;
}

.audit-filter button{
    border:0;
    padding:0 13px;
    background:#16643f;
    color:#fff;
    font-weight:700;
    cursor:pointer;
}

.audit-list{
    max-height:620px;
    overflow:auto;
}

.audit-item{
    display:flex;
    gap:11px;
    padding:14px 16px;
    border-bottom:1px solid #edf2f7;
}

.audit-item:hover{
    background:#fbfdfc;
}

.audit-icon{
    width:30px;
    height:30px;
    flex:0 0 30px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    margin-top:1px;
}

.audit-ok{
    background:#e8f6ee;
    color:#16643f;
}

.audit-fail{
    background:#fff0f0;
    color:#b42318;
}

.audit-content{
    min-width:0;
    flex:1;
}

.audit-topline{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
}

.audit-topline strong{
    font-size:13px;
    color:#243241;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.audit-result{
    padding:3px 7px;
    border-radius:999px;
    font-size:10px;
    font-weight:800;
}

.audit-result.success{
    color:#16643f;
    background:#e8f6ee;
}

.audit-result.failed{
    color:#b42318;
    background:#fff0f0;
}

.audit-meta{
    display:flex;
    justify-content:space-between;
    gap:8px;
    margin-top:5px;
    color:#667085;
    font-size:11px;
}

.audit-ip{
    margin-top:4px;
    color:#98a2b3;
    font-size:10px;
}

.audit-empty{
    padding:45px 20px;
    text-align:center;
    color:#98a2b3;
    font-size:13px;
}

@media(max-width:1250px){
    .dashboard-kpis{
        grid-template-columns:repeat(3,1fr);
    }

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

@media(max-width:992px){
    .dashboard-toolbar{
        flex-direction:column;
        align-items:stretch;
    }

    .dashboard-toolbar > div:first-child{
        align-items:flex-start;
        flex-direction:column;
        gap:4px;
    }

    .dashboard-kpis{
        grid-template-columns:repeat(2,1fr);
    }
}

@media(max-width:600px){
    .dashboard-kpis{
        grid-template-columns:1fr;
    }

    .card-heading{
        align-items:flex-start;
        flex-direction:column;
    }

    .audit-filter{
        grid-template-columns:1fr;
    }

    .audit-meta{
        flex-direction:column;
    }
}

.audit-top-card{
    margin-bottom:20px;
}

.audit-list-compact{
    max-height:none;
}

.audit-list-compact .audit-item:last-child{
    border-bottom:0;
}

.employee-card{
    overflow:hidden;
}

.employee-heading{
    align-items:center;
}

.employee-tools{
    display:flex;
    align-items:center;
    gap:10px;
    flex-shrink:0;
}

.employee-search{
    display:flex;
    align-items:center;
    gap:8px;
    width:260px;
    height:38px;
    box-sizing:border-box;
    padding:0 11px;
    border:1px solid #d9dfe5;
    border-radius:9px;
    background:#fff;
    transition:.2s;
}

.employee-search:focus-within{
    border-color:#16643f;
    box-shadow:0 0 0 3px rgba(22,100,63,.10);
}

.employee-search span{
    color:#7d8895;
    font-size:19px;
    line-height:1;
}

.employee-search input{
    width:100%;
    border:0;
    outline:0;
    background:transparent;
    font-size:13px;
    color:#243241;
}

.employee-search input::placeholder{
    color:#98a2b3;
}

.employee-row[hidden]{
    display:none;
}

.employee-no-results{
    padding:30px 20px;
    text-align:center;
    color:#98a2b3;
    font-size:13px;
    border-top:1px solid #edf2f7;
}

@media(max-width:700px){
    .employee-heading{
        align-items:stretch;
    }

    .employee-tools{
        width:100%;
        align-items:stretch;
        flex-direction:column;
    }

    .employee-search{
        width:100%;
    }
}


/* ==========================================================
   ADMIN LAYOUT FIX
   .employee-card is also used by the employee salary page,
   where it is a grid. On Admin it is a full-width card.
========================================================== */
.admin-page .employee-card{
    display:block;
    width:100%;
    min-width:0;
    box-sizing:border-box;
    margin-bottom:20px;
}

.admin-page .employee-card .admin-table-wrap{
    width:100%;
    max-width:100%;
    box-sizing:border-box;
}

.admin-page .employee-card .admin-table{
    width:100%;
}

@media(max-width:700px){
    .admin-page .employee-card{
        display:block;
    }
}


/* ==========================================================
   SALARY DETAIL TOOLBAR - MOBILE FIX
   Prevent title from being squeezed by month selector/buttons.
========================================================== */

.section-toolbar{
    width:100%;
    box-sizing:border-box;
    min-width:0;
}

.toolbar-title{
    min-width:0;
}

.toolbar-title h2{
    white-space:nowrap;
}

.toolbar-actions{
    flex-shrink:0;
}

@media (max-width: 600px){
    .section-toolbar{
        display:flex;
        flex-direction:column;
        align-items:stretch;
        gap:14px;
        padding:18px 16px;
    }

    .toolbar-title{
        width:100%;
    }

    .toolbar-title h2{
        font-size:26px;
        line-height:1.2;
        white-space:nowrap;
    }

    .toolbar-title span{
        display:block;
        max-width:220px;
        line-height:1.25;
    }

    .toolbar-actions{
        width:100%;
        display:grid;
        grid-template-columns:minmax(0,1fr) minmax(120px,140px);
        align-items:center;
        gap:10px;
    }

    .toolbar-actions form{
        min-width:0;
        width:100%;
    }

    .month-select{
        width:100%;
        min-width:0;
        box-sizing:border-box;
        height:44px;
    }

    .show-all-btn{
        width:100%;
        min-width:0;
        height:44px;
        padding:0 10px;
        font-size:14px;
    }
}

@media (max-width: 380px){
    .toolbar-actions{
        grid-template-columns:1fr;
    }

    .show-all-btn{
        width:100%;
    }
}

