:root{
    --app-primary:#2563eb;
    --app-primary-dark:#1e40af;
    --app-accent:#06b6d4;
    --app-success:#16a34a;
    --app-warning:#f59e0b;
    --app-danger:#ef4444;
    --app-dark:#0f172a;
    --app-muted:#64748b;
    --app-bg:#f6f8fc;
    --app-card:#ffffff;
    --app-border:#e5e7eb;
    --app-shadow:0 18px 45px rgba(15,23,42,.08);
    --app-radius:22px;
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    min-height:100vh;
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.12), transparent 30%),
        linear-gradient(180deg,#f8fbff 0%,var(--app-bg) 100%) !important;
    color:#162033;
    font-family:'Inter','Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}

a{
    transition:.2s ease;
}

.navbar-app,
.navbar-custom,
.navbar.bg-primary,
.navbar.bg-success{
    background:rgba(15,23,42,.92) !important;
    backdrop-filter:blur(16px);
    border-bottom:1px solid rgba(255,255,255,.08);
}

.navbar-brand{
    display:flex;
    align-items:center;
    gap:.55rem;
    font-weight:800 !important;
    letter-spacing:-.02em;
}

.navbar-brand::before{
    content:'✓';
    width:34px;
    height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    background:linear-gradient(135deg,var(--app-primary),var(--app-accent));
    color:white;
    font-weight:900;
    box-shadow:0 10px 24px rgba(37,99,235,.28);
}

.navbar .nav-link{
    border-radius:12px;
    padding:.55rem .8rem !important;
    color:rgba(255,255,255,.82) !important;
    font-weight:600;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus{
    background:rgba(255,255,255,.10);
    color:#fff !important;
}

.app-user-pill{
    display:flex;
    align-items:center;
    gap:.55rem;
    padding:.45rem .75rem;
    border-radius:999px;
    background:rgba(255,255,255,.10);
    color:white;
    font-size:.92rem;
}

.app-page,
.container,
.container-fluid{
    position:relative;
}

.app-page{
    width:min(1180px,100%);
    margin:0 auto;
    padding:1.35rem;
}

.page-hero{
    position:relative;
    overflow:hidden;
    border-radius:28px;
    padding:1.55rem;
    background:
        linear-gradient(135deg,rgba(37,99,235,.98),rgba(6,182,212,.90)),
        var(--app-primary);
    color:white;
    box-shadow:var(--app-shadow);
    margin-bottom:1.25rem;
}

.page-hero::after{
    content:'';
    position:absolute;
    right:-48px;
    top:-70px;
    width:190px;
    height:190px;
    border-radius:50%;
    background:rgba(255,255,255,.14);
}

.page-hero h1,
.page-hero h2,
.page-hero h3{
    margin:0;
    font-weight:850;
    letter-spacing:-.035em;
}

.page-hero p{
    max-width:760px;
    margin:.55rem 0 0;
    opacity:.92;
}

.card{
    border:1px solid rgba(226,232,240,.86) !important;
    border-radius:var(--app-radius) !important;
    box-shadow:var(--app-shadow) !important;
    overflow:hidden;
}

.card-header{
    border-bottom:1px solid rgba(226,232,240,.86) !important;
    background:rgba(255,255,255,.78) !important;
    color:#0f172a !important;
    font-weight:800;
    padding:1rem 1.15rem;
}

.card-header.bg-primary,
.card-header.bg-info,
.card-header.bg-success,
.card-header.bg-warning,
.card-header.bg-danger,
.card-header.bg-dark{
    background:linear-gradient(135deg,#0f172a,#1e293b) !important;
    color:white !important;
}

.card-body{
    padding:1.15rem;
}

.stat-card{
    position:relative;
    min-height:138px;
    border:0 !important;
    color:white;
    background:linear-gradient(135deg,var(--app-primary),var(--app-accent)) !important;
}

.stat-card.bg-success{
    background:linear-gradient(135deg,#16a34a,#22c55e) !important;
}

.stat-card.bg-warning{
    background:linear-gradient(135deg,#f59e0b,#facc15) !important;
    color:#1f2937 !important;
}

.stat-card.bg-dark,
.stat-card.bg-danger{
    background:linear-gradient(135deg,#0f172a,#334155) !important;
}

.stat-card .card-body{
    position:relative;
    z-index:2;
}

.stat-card h1,
.stat-card h2{
    font-size:2.55rem;
    font-weight:900;
    line-height:1;
    margin-bottom:.45rem;
    letter-spacing:-.04em;
}

.stat-card p{
    margin:0;
    opacity:.92;
    font-weight:650;
}

.stat-card i,
.stat-icon{
    position:absolute;
    right:1rem;
    bottom:.85rem;
    font-size:2.5rem;
    opacity:.26;
}

.table-responsive{
    border-radius:18px;
    overflow:auto;
    border:1px solid var(--app-border);
    background:white;
}

.table{
    margin-bottom:0;
    vertical-align:middle;
}

.table th{
    background:#f8fafc;
    color:#334155;
    white-space:nowrap;
    font-size:.86rem;
    font-weight:800;
}

.table td{
    color:#334155;
}

.table-bordered > :not(caption) > *{
    border-width:0;
}

.table-bordered > :not(caption) > * > *{
    border-color:#edf2f7;
}

.btn{
    border-radius:13px;
    font-weight:700;
    box-shadow:none !important;
    transition:.2s ease;
}

.btn:hover{
    transform:translateY(-1px);
}

.btn-primary,
.bg-primary{
    background:linear-gradient(135deg,var(--app-primary),var(--app-accent)) !important;
    border-color:transparent !important;
}

.btn-success,
.bg-success{
    background:linear-gradient(135deg,#16a34a,#22c55e) !important;
    border-color:transparent !important;
}

.btn-warning,
.bg-warning{
    background:linear-gradient(135deg,#f59e0b,#facc15) !important;
    border-color:transparent !important;
}

.btn-danger,
.bg-danger{
    background:linear-gradient(135deg,#dc2626,#f97316) !important;
    border-color:transparent !important;
}

.btn-info,
.bg-info{
    background:linear-gradient(135deg,#0284c7,#06b6d4) !important;
    border-color:transparent !important;
}

.form-control,
.form-select,
select.form-control,
textarea.form-control{
    border-radius:14px;
    border:1px solid #dbe3ef;
    padding:.72rem .85rem;
}

.form-control:focus,
.form-select:focus{
    border-color:var(--app-primary);
    box-shadow:0 0 0 .2rem rgba(37,99,235,.12);
}

.badge{
    border-radius:999px;
    padding:.45rem .65rem;
    font-weight:750;
}

.quick-menu{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
    gap:.8rem;
}

.quick-menu .btn{
    width:100%;
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:.45rem;
}

.action-toolbar{
    display:flex;
    flex-wrap:wrap;
    gap:.55rem;
    align-items:center;
    justify-content:space-between;
}

.dataTables_wrapper .row{
    row-gap:.75rem;
}

.dataTables_filter input,
.dataTables_length select{
    border-radius:12px !important;
    border:1px solid #dbe3ef !important;
    padding:.45rem .65rem !important;
}

.alert{
    border:0;
    border-radius:18px;
    box-shadow:0 12px 32px rgba(15,23,42,.06);
}

.foto-absen,
img.foto-absen{
    width:72px;
    height:72px;
    object-fit:cover;
    border-radius:16px;
    border:3px solid white;
    box-shadow:0 10px 24px rgba(15,23,42,.15);
}

.mobile-bottom-nav{
    display:none;
}

@media(max-width:991.98px){
    .navbar .container-fluid{
        align-items:center;
    }
    .navbar-collapse{
        margin-top:.75rem;
        padding:.75rem;
        border-radius:18px;
        background:rgba(255,255,255,.08);
    }
    .app-user-pill{
        width:100%;
        justify-content:space-between;
        margin-top:.55rem;
    }
}

@media(max-width:768px){
    body{
        background:#f7f9fd !important;
    }
    .app-page,
    .container,
    .container-fluid{
        padding-left:.9rem !important;
        padding-right:.9rem !important;
    }
    .app-page{
        padding-top:1rem;
        padding-bottom:5.8rem;
    }
    .page-hero{
        border-radius:23px;
        padding:1.25rem;
    }
    .page-hero h1,
    .page-hero h2,
    .page-hero h3{
        font-size:1.55rem;
    }
    .card{
        border-radius:19px !important;
    }
    .card-body{
        padding:1rem;
    }
    .stat-card{
        min-height:122px;
    }
    .stat-card h1,
    .stat-card h2{
        font-size:2rem;
    }
    .table{
        font-size:.88rem;
    }
    .table th,
    .table td{
        white-space:nowrap;
    }
    .btn{
        padding:.62rem .85rem;
    }
    .quick-menu{
        grid-template-columns:1fr 1fr;
    }
}

@media(max-width:575.98px){
    .navbar-brand{
        font-size:1rem;
    }
    .page-hero{
        margin-top:.25rem;
    }
    .row.g-3 > [class*='col-6']{
        padding-left:.35rem;
        padding-right:.35rem;
    }
    .quick-menu{
        grid-template-columns:1fr;
    }
    .btn-group,
    .action-toolbar{
        width:100%;
    }
    .action-toolbar .btn,
    form .btn{
        width:100%;
        margin-bottom:.35rem;
    }
    .dataTables_filter,
    .dataTables_length{
        text-align:left !important;
    }
    .dataTables_filter input{
        width:100% !important;
        margin-left:0 !important;
        margin-top:.35rem;
    }
}
