/* =========================================================
   BASE & GLOBAL
========================================================= */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
    margin:0;
    background:
        radial-gradient(circle at top right,rgba(14,165,233,.08),transparent 28%),
        #f4f7fb;
    color:#1e293b;
    font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}
a{text-decoration:none;color:#0e7490}
button,input,select,textarea{font:inherit}
input,select,textarea{max-width:100%}

/* =========================================================
   PAGE HEADER
========================================================= */
.page-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    margin-bottom:18px;
}
.page-header h1{margin:0 0 5px;font-size:27px}
.page-header p,.muted{margin:0;color:#64748b}

/* =========================================================
   CARDS / PANELS
========================================================= */
.cards{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
    margin-bottom:18px;
}
.cards.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.card-stat,.panel,.wallet-card{
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:14px;
    box-shadow:0 3px 12px rgba(15,23,42,.04);
}
.card-stat{padding:18px}
.card-stat span{display:block;color:#64748b;font-size:13px;margin-bottom:8px}
.card-stat strong{font-size:22px}
.card-stat.good{border-left:4px solid #16a34a}
.card-stat.bad{border-left:4px solid #dc2626}
.card-stat.warn{border-left:4px solid #f59e0b}
.card-stat.balance{border-left:4px solid #0891b2}
.small-value{font-size:16px!important}
.panel{padding:18px;margin-bottom:18px}
.panel h2{margin:0 0 14px;font-size:18px}
.panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px}

/* =========================================================
   FORMS
========================================================= */
.form-group{
    display:flex;
    flex-direction:column;
    gap:7px;
    margin-bottom:14px;
}
.form-group label{font-size:13px;font-weight:700}
.form-group input,
.form-group select,
.form-group textarea,
.filter-row input,
.filter-row select{
    width:100%;
    border:1px solid #cbd5e1;
    border-radius:9px;
    padding:10px 11px;
    background:#fff;
    outline:none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.filter-row input:focus,
.filter-row select:focus{
    border-color:#0891b2;
    box-shadow:0 0 0 3px rgba(6,182,212,.11);
}
.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 14px;
}
.full-col{grid-column:1/-1}
.form-actions,.actions,.filter-row{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}
.form-actions{justify-content:flex-end;margin-top:8px}
.filter-row{margin-bottom:16px}
.filter-row input,.filter-row select{width:auto;min-width:150px}

/* =========================================================
   BUTTONS
========================================================= */
.btn{
    border:0;
    border-radius:9px;
    padding:9px 13px;
    cursor:pointer;
    color:#fff;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
}
.btn.primary{background:#0e7490}
.btn.secondary{background:#64748b}
.btn.success{background:#16a34a}
.btn.warning{background:#d97706}
.btn.danger{background:#dc2626}
.btn.small{padding:6px 9px;font-size:12px}
.btn.full{width:100%;margin-top:6px}
.btn:hover{filter:brightness(.97)}

/* =========================================================
   TABLES
========================================================= */
.table-wrap,.table-responsive{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}
.data-table{
    width:100%;
    border-collapse:collapse;
    font-size:13px;
}
.data-table th,.data-table td{
    padding:11px 9px;
    border-bottom:1px solid #e2e8f0;
    text-align:left;
    white-space:nowrap;
}
.data-table th{
    background:#f8fafc;
    color:#475569;
    font-weight:800;
}
.data-table tbody tr:hover{background:#f8fbff}
.right{text-align:right!important}
.center{text-align:center!important}

/* =========================================================
   BADGES / ALERTS
========================================================= */
.badge{
    display:inline-block;
    padding:4px 8px;
    border-radius:999px;
    font-size:11px;
    font-weight:700;
}
.badge.aktif,.status-aktif{background:#dcfce7;color:#166534}
.badge.nonaktif,.status-ditolak{background:#fee2e2;color:#991b1b}
.status-menunggu{background:#fef3c7;color:#92400e}
.status-nonaktif{background:#e2e8f0;color:#475569}
.alert{
    padding:11px 13px;
    border-radius:9px;
    margin-bottom:15px;
}
.alert.success{background:#dcfce7;color:#166534}
.alert.danger{background:#fee2e2;color:#991b1b}
.block{display:block;margin-top:4px}

/* =========================================================
   WALLET
========================================================= */
.wallet-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}
.wallet-card{padding:18px}
.wallet-card span,.wallet-card small{display:block;color:#64748b}
.wallet-card strong{display:block;font-size:22px;margin:8px 0}
.wallet-card .actions{margin-top:14px}

/* =========================================================
   MODAL
========================================================= */
.modal{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.53);
    z-index:1200;
    display:none;
    align-items:center;
    justify-content:center;
    padding:16px;
}
.modal.show{display:flex}
.modal-card{
    width:min(470px,100%);
    max-height:92vh;
    overflow:auto;
    background:#fff;
    border-radius:16px;
    padding:20px;
    position:relative;
    box-shadow:0 24px 80px rgba(0,0,0,.32);
}
.modal-card.wide{width:min(700px,100%)}
.modal-close{
    position:absolute;
    right:12px;
    top:9px;
    border:0;
    background:transparent;
    font-size:28px;
    cursor:pointer;
    color:#64748b;
}
.modal-card h2{margin:0 0 18px}

/* =========================================================
   VOICE INPUT
========================================================= */
.input-voice{
    display:flex;
    gap:6px;
    align-items:stretch;
    position:relative;
}
.input-voice input,.input-voice textarea{flex:1}
.voice-btn{
    width:43px;
    min-width:43px;
    border:1px solid #a5f3fc;
    background:#ecfeff;
    color:#075985;
    border-radius:9px;
    cursor:pointer;
}
.voice-btn.listening{animation:pulse .8s infinite}
.voice-note{
    font-size:12px;
    color:#64748b;
    background:#f8fafc;
    padding:10px;
    border-radius:8px;
}
.check{
    display:flex;
    gap:9px;
    align-items:flex-start;
    font-size:13px;
    margin-bottom:13px;
}
.check input{margin-top:2px}
@keyframes pulse{50%{transform:scale(1.08);background:#cffafe}}

/* =========================================================
   LOGIN / REGISTER
========================================================= */
.login-body{
    min-height:100vh;
    background:linear-gradient(135deg,#ecfeff,#f8fafc);
    display:grid;
    place-items:center;
    padding:20px;
}
.auth-shell{
    display:grid;
    grid-template-columns:1fr 430px;
    width:min(900px,100%);
    background:#fff;
    border-radius:22px;
    overflow:hidden;
    box-shadow:0 25px 70px rgba(15,23,42,.12);
}
.auth-brand{
    padding:55px;
    background:linear-gradient(145deg,#155e75,#0e7490);
    color:#fff;
}
.auth-brand h1{font-size:32px;margin:20px 0 10px}
.auth-brand p{line-height:1.6;color:#cffafe}
.login-box{width:min(430px,100%);background:#fff;padding:38px}
.login-box h2{margin:0 0 5px}
.register-box{border-radius:18px;box-shadow:0 20px 50px rgba(15,23,42,.13)}
.auth-link{text-align:center;margin-top:18px;font-size:13px}

/* =========================================================
   MODERN HEADER / SIDEBAR LAYOUT
========================================================= */
.app-layout{min-height:100vh}
.sidebar{
    position:fixed;
    z-index:1000;
    left:0;
    top:0;
    bottom:0;
    width:270px;
    padding:0;
    display:flex;
    flex-direction:column;
    background:linear-gradient(180deg,#075985 0%,#0e7490 45%,#155e75 100%);
    color:#fff;
    box-shadow:8px 0 35px rgba(15,23,42,.10);
    transition:transform .28s ease,width .28s ease;
    overflow:hidden;
}
.sidebar-header{
    min-height:78px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:15px 18px;
    border-bottom:1px solid rgba(255,255,255,.10);
}
.brand-logo{
    width:45px;
    height:45px;
    flex:0 0 45px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:14px;
    background:linear-gradient(135deg,#fff,#cffafe);
    color:#0e7490;
    font-size:17px;
    font-weight:900;
    box-shadow:0 8px 20px rgba(0,0,0,.12);
}
.brand-text{display:flex;flex-direction:column;min-width:0}
.brand-text strong{font-size:17px;text-transform:uppercase;letter-spacing:.6px;line-height:1.2}
.brand-text small{margin-top:4px;color:rgba(255,255,255,.75);font-size:11.5px}

.profile-card{
    margin:14px 14px 8px;
    padding:12px;
    display:flex;
    align-items:center;
    gap:11px;
    background:rgba(255,255,255,.10);
    border:1px solid rgba(255,255,255,.12);
    border-radius:16px;
    backdrop-filter:blur(8px);
}
.profile-avatar,.topbar-avatar{
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    font-weight:800;
}
.profile-avatar{
    width:41px;
    height:41px;
    flex:0 0 41px;
    background:#fff;
    color:#075985;
    font-size:16px;
}
.profile-info{min-width:0;display:flex;flex-direction:column}
.profile-info strong{font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-info span{margin-top:3px;color:#bae6fd;font-size:11px}

.sidebar-menu{
    flex:1;
    padding:5px 12px 18px;
    overflow-y:auto;
    scrollbar-width:thin;
}
.menu-title{
    padding:14px 11px 8px;
    color:rgba(255,255,255,.52);
    font-size:10px;
    font-weight:700;
    letter-spacing:1.1px;
    text-transform:uppercase;
}
.menu-title-second{margin-top:12px}
.menu-item{
    position:relative;
    width:100%;
    min-height:47px;
    margin:4px 0;
    padding:9px 11px;
    display:flex;
    align-items:center;
    gap:11px;
    border-radius:13px;
    color:rgba(255,255,255,.85);
    font-size:13.5px;
    font-weight:500;
    transition:all .18s ease;
}
.menu-item:hover{color:#fff;background:rgba(255,255,255,.11);transform:translateX(2px)}
.menu-item.active{background:#fff;color:#075985;box-shadow:0 7px 20px rgba(0,0,0,.11);font-weight:700}
.menu-item.active::before{
    content:"";
    position:absolute;
    left:-12px;
    width:4px;
    height:27px;
    background:#67e8f9;
    border-radius:0 5px 5px 0;
}
.menu-icon{
    width:25px;
    height:25px;
    flex:0 0 25px;
    display:flex;
    align-items:center;
    justify-content:center;
}
.menu-icon svg{width:20px;height:20px;fill:currentColor}
.menu-text{flex:1}
.menu-badge{
    min-width:23px;
    height:23px;
    padding:0 6px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#ef4444;
    color:#fff;
    border-radius:999px;
    font-size:10px;
    font-weight:800;
    box-shadow:0 3px 8px rgba(239,68,68,.30);
}

.sidebar-footer{
    padding:11px 13px 16px;
    border-top:1px solid rgba(255,255,255,.10);
}
.logout-btn{
    min-height:45px;
    padding:9px 11px;
    display:flex;
    align-items:center;
    gap:10px;
    border-radius:13px;
    color:#fee2e2;
    font-size:13px;
    font-weight:600;
    transition:.18s ease;
}
.logout-btn:hover{background:rgba(239,68,68,.18);color:#fff}

.main-content{
    min-height:100vh;
    margin-left:270px;
    transition:margin .28s ease;
}
.topbar{
    position:sticky;
    z-index:500;
    top:0;
    min-height:70px;
    padding:10px 25px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    background:rgba(255,255,255,.88);
    backdrop-filter:blur(15px);
    border-bottom:1px solid #e8edf3;
}
.topbar-left{display:flex;align-items:center;gap:12px}
.topbar-title{display:flex;flex-direction:column}
.topbar-title strong{color:#0f172a;font-size:16px}
.topbar-title small{margin-top:3px;color:#94a3b8;font-size:11.5px}
.topbar-user{display:flex;align-items:center;gap:10px}
.topbar-user-text{display:flex;flex-direction:column;text-align:right}
.topbar-user-text strong{
    max-width:180px;
    color:#334155;
    font-size:12.5px;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}
.topbar-user-text span{margin-top:2px;color:#94a3b8;font-size:10.5px}
.topbar-avatar{
    width:39px;
    height:39px;
    background:linear-gradient(135deg,#0891b2,#075985);
    color:#fff;
    box-shadow:0 5px 14px rgba(8,145,178,.25);
}
.page-content{
    width:100%;
    max-width:1550px;
    margin:0 auto;
    padding:22px;
}
.mobile-menu-btn{
    display:none;
    width:42px;
    height:42px;
    flex:0 0 42px;
    padding:0;
    align-items:center;
    justify-content:center;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#fff;
    color:#075985;
    cursor:pointer;
}
.mobile-menu-btn svg{width:22px;height:22px;fill:currentColor}
.sidebar-close{
    display:none;
    margin-left:auto;
    width:35px;
    height:35px;
    border:0;
    border-radius:10px;
    background:rgba(255,255,255,.10);
    color:#fff;
    font-size:25px;
    line-height:1;
    cursor:pointer;
}
.sidebar-overlay{
    position:fixed;
    z-index:990;
    inset:0;
    background:rgba(15,23,42,.52);
    backdrop-filter:blur(2px);
    opacity:0;
    visibility:hidden;
    transition:.25s ease;
}
.sidebar-overlay.show{opacity:1;visibility:visible}
.sidebar-menu::-webkit-scrollbar{width:4px}
.sidebar-menu::-webkit-scrollbar-track{background:transparent}
.sidebar-menu::-webkit-scrollbar-thumb{background:rgba(255,255,255,.20);border-radius:10px}

/* =========================================================
   RESPONSIVE
========================================================= */
@media(max-width:1024px){
    body.sidebar-open{overflow:hidden}
    .sidebar{
        width:290px;
        max-width:85vw;
        transform:translateX(-105%);
        box-shadow:15px 0 45px rgba(15,23,42,.20);
    }
    .sidebar.open{transform:translateX(0)}
    .sidebar-close{display:flex;align-items:center;justify-content:center}
    .main-content{margin-left:0}
    .mobile-menu-btn{display:flex}
    .page-content{padding:18px}
    .topbar{padding:10px 18px}
    .cards{grid-template-columns:1fr 1fr}
    .wallet-grid{grid-template-columns:1fr 1fr}
}

@media(max-width:700px){
    .page-header{align-items:flex-start;flex-direction:column}
    .page-header h1{font-size:23px}
    .cards,.cards.three,.wallet-grid,.form-grid{grid-template-columns:1fr}
    .filter-row>*{width:100%!important}
    .data-table th,.data-table td{padding:9px 7px}
    .modal{align-items:flex-end;padding:0}
    .modal-card,.modal-card.wide{width:100%;border-radius:18px 18px 0 0;max-height:90vh}
    .auth-shell{display:block}
    .auth-brand{display:none}
    .login-box{padding:26px}
    .card-stat strong{font-size:20px}
}

@media(max-width:640px){
    .sidebar{width:285px;max-width:88vw}
    .sidebar-header{min-height:70px;padding:12px 15px}
    .brand-logo{width:41px;height:41px;flex-basis:41px;border-radius:13px}
    .brand-text strong{font-size:15px}
    .profile-card{margin:10px 11px 7px;border-radius:14px}
    .sidebar-menu{padding:4px 10px 14px}
    .menu-item{min-height:46px;font-size:13px}
    .topbar{min-height:62px;padding:8px 12px}
    .mobile-menu-btn{width:39px;height:39px;flex-basis:39px}
    .topbar-title strong{font-size:14px}
    .topbar-title small{display:none}
    .topbar-user-text{display:none}
    .topbar-avatar{width:37px;height:37px}
    .page-content{padding:13px 11px 24px}
    input,select,textarea{font-size:16px!important}
}

@media(max-width:380px){
    .sidebar{width:270px}
    .page-content{padding:11px 9px 22px}
    .topbar-title strong{font-size:13px}
}

@media print{
    .sidebar,.topbar,.sidebar-overlay,.mobile-menu-btn{display:none!important}
    .main-content{margin:0!important}
    .page-content{padding:0!important;max-width:none!important}
    .panel,.card-stat{box-shadow:none}
}