:root{
    --navy:#05142f;
    --navy2:#09245a;
    --blue:#0078ff;
    --cyan:#11b8ff;
    --orange:#ff7a00;
    --gold:#ffb000;
    --bg:#f4f8fd;
    --text:#0f172a;
    --muted:#64748b;
    --line:#d8e4f2;
    --white:#ffffff;
}

*{box-sizing:border-box}

body{
    margin:0;
    font-family:"Segoe UI",Arial,sans-serif;
    background:
        radial-gradient(circle at top right,rgba(17,184,255,.12),transparent 30%),
        radial-gradient(circle at bottom left,rgba(255,122,0,.09),transparent 28%),
        var(--bg);
    color:var(--text);
}

.app{display:flex;min-height:100vh}

/* SIDEBAR */
.sidebar{
    width:292px;
    position:fixed;
    top:0;left:0;bottom:0;
    padding:24px 18px;
    background:
        linear-gradient(180deg,rgba(5,20,47,.98),rgba(5,18,43,.98)),
        radial-gradient(circle at top right,rgba(255,122,0,.28),transparent 35%);
    color:white;
    z-index:1000;
    box-shadow:22px 0 65px rgba(5,20,47,.28);
    transition:.25s ease;
}

.brand{
    display:flex;
    align-items:center;
    gap:13px;
    padding:8px 8px 22px;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.brand img{
    width:58px;
    height:58px;
    object-fit:contain;
    background:white;
    border-radius:18px;
    padding:8px;
}

.brand h2{
    margin:0;
    font-size:31px;
    line-height:1;
    font-weight:900;
    background:linear-gradient(135deg,var(--cyan),var(--blue));
    -webkit-background-clip:text;
    color:transparent;
}

.brand span{
    font-size:12px;
    font-weight:900;
    color:var(--gold);
}

.menu-title{
    margin:24px 12px 12px;
    color:#8ea6c9;
    font-size:12px;
    letter-spacing:1.5px;
    font-weight:900;
}

.sidebar a{
    display:flex;
    align-items:center;
    gap:13px;
    color:#eaf4ff;
    text-decoration:none;
    padding:15px 16px;
    margin-bottom:9px;
    border-radius:18px;
    font-weight:850;
    border:1px solid transparent;
    transition:.2s ease;
}

.sidebar a:hover{
    background:rgba(255,255,255,.09);
    transform:translateX(4px);
}

.sidebar a.active{
    background:linear-gradient(135deg,rgba(0,120,255,.42),rgba(17,184,255,.20));
    border-color:rgba(17,184,255,.32);
    box-shadow:0 14px 30px rgba(0,120,255,.22);
}

.sidebar .logout{
    margin-top:25px;
    background:linear-gradient(135deg,rgba(255,122,0,.20),rgba(255,176,0,.08));
}

.icon{
    width:24px;
    text-align:center;
}

/* MAIN */
.main{
    margin-left:292px;
    width:calc(100% - 292px);
    min-height:100vh;
    transition:.25s ease;
}

.topbar{
    height:78px;
    position:sticky;
    top:0;
    z-index:800;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 36px;
    background:rgba(255,255,255,.86);
    backdrop-filter:blur(18px);
    border-bottom:1px solid var(--line);
}

.toggle{
    border:0;
    width:48px;
    height:48px;
    border-radius:16px;
    background:linear-gradient(135deg,var(--blue),var(--cyan));
    color:white;
    font-size:20px;
    cursor:pointer;
    box-shadow:0 12px 28px rgba(0,120,255,.25);
}

.userbox{text-align:right}
.userbox b{display:block;color:var(--navy)}
.userbox span{font-size:13px;color:var(--muted)}

.content{padding:40px}

.page-head{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:20px;
    margin-bottom:28px;
}

.page-head h1{
    margin:0;
    font-size:38px;
    letter-spacing:-1.2px;
    color:var(--navy);
}

.page-head p{
    margin:9px 0 0;
    color:var(--muted);
}

.badge-company{
    padding:11px 18px;
    border-radius:999px;
    background:#fff2e5;
    color:#b45309;
    font-weight:900;
}

/* CARD & PANEL */
.cards{
    display:grid;
    grid-template-columns:repeat(4,minmax(180px,1fr));
    gap:22px;
}

.card,.panel{
    background:rgba(255,255,255,.95);
    border:1px solid var(--line);
    border-radius:30px;
    box-shadow:0 24px 65px rgba(5,20,47,.09);
}

.card{
    padding:26px;
    position:relative;
    overflow:hidden;
}

.card:before{
    content:"";
    position:absolute;
    right:-44px;
    top:-44px;
    width:132px;height:132px;
    border-radius:50%;
    background:linear-gradient(135deg,rgba(17,184,255,.19),rgba(255,122,0,.18));
}

.card-icon{
    width:48px;height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:17px;
    color:white;
    font-size:22px;
    background:linear-gradient(135deg,var(--blue),var(--cyan));
    box-shadow:0 12px 28px rgba(0,120,255,.22);
    margin-bottom:16px;
}

.card h3{
    margin:0;
    font-size:15px;
    color:#334155;
}

.card strong{
    display:block;
    margin-top:10px;
    color:var(--blue);
    font-size:34px;
    font-weight:900;
}

.panel{
    padding:27px;
    margin-top:28px;
}

.panel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:20px;
}

.panel-head h2{
    margin:0;
    font-size:23px;
    color:var(--navy);
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:15px;
}

input,select{
    width:100%;
    padding:15px 17px;
    border:1px solid #ccd9ea;
    border-radius:17px;
    outline:none;
    background:white;
    font-size:14px;
}

input:focus,select:focus{
    border-color:var(--cyan);
    box-shadow:0 0 0 5px rgba(17,184,255,.14);
}

button,.btn,.btn-small,.btn-success,.btn-danger{
    border:0;
    border-radius:17px;
    padding:14px 18px;
    font-weight:900;
    cursor:pointer;
    text-decoration:none;
    display:inline-block;
    white-space:nowrap;
}

button,.btn,.btn-small{
    background:linear-gradient(135deg,var(--blue),var(--cyan));
    color:white;
    box-shadow:0 12px 28px rgba(0,120,255,.20);
}

.btn-success{
    background:linear-gradient(135deg,#16a34a,#22c55e);
    color:white;
}

.btn-danger{
    background:linear-gradient(135deg,#ef4444,#dc2626);
    color:white;
}

button:hover,.btn:hover,.btn-small:hover{
    transform:translateY(-1px);
}

.table-wrap{overflow-x:auto}

table{
    width:100%;
    min-width:900px;
    border-collapse:separate;
    border-spacing:0 10px;
}

thead th{
    background:var(--navy);
    color:white;
    padding:16px;
    text-align:left;
    font-size:14px;
}

thead th:first-child{border-radius:18px 0 0 18px}
thead th:last-child{border-radius:0 18px 18px 0}

tbody td{
    background:white;
    padding:16px;
    border-top:1px solid #e7eef8;
    border-bottom:1px solid #e7eef8;
}

tbody td:first-child{
    border-left:1px solid #e7eef8;
    border-radius:16px 0 0 16px;
}

tbody td:last-child{
    border-right:1px solid #e7eef8;
    border-radius:0 16px 16px 0;
}

tbody tr:hover td{
    background:#f8fbff;
}

.empty{
    text-align:center;
    color:var(--muted);
    padding:30px!important;
}

.aksi{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.status-ok,.status-warn,.status-mail{
    padding:8px 13px;
    border-radius:999px;
    font-size:12px;
    font-weight:900;
}

.status-ok{background:#dcfce7;color:#166534}
.status-warn{background:#fff3d6;color:#b45309}
.status-mail{background:#e0f2fe;color:#075985}

/* LOGIN */
.login-body{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:
        radial-gradient(circle at 20% 20%,rgba(17,184,255,.20),transparent 30%),
        radial-gradient(circle at 80% 10%,rgba(255,122,0,.17),transparent 30%),
        linear-gradient(135deg,#f8fbff,#edf4fb);
}

.login-card{
    width:430px;
    background:white;
    padding:44px;
    border-radius:32px;
    box-shadow:0 30px 90px rgba(5,20,47,.16);
    text-align:center;
}

.login-card img{
    width:210px;
    max-width:100%;
    margin-bottom:14px;
}

.login-card h1{
    margin:0;
    font-size:28px;
    color:var(--navy);
}

.login-card p{
    color:var(--orange);
    font-weight:900;
}

label{
    display:block;
    text-align:left;
    margin-top:16px;
    font-weight:800;
}

.alert{
    background:#fee2e2;
    color:#991b1b;
    padding:12px;
    border-radius:14px;
}

/* INVOICE DETAIL PRINT */
.invoice-page{
    padding:36px;
    background:#eef4fb;
    min-height:100vh;
}

.invoice-box{
    max-width:1050px;
    margin:auto;
    background:white;
    border-radius:28px;
    padding:40px;
    box-shadow:0 25px 80px rgba(5,20,47,.14);
}

.invoice-header,.invoice-info{
    display:flex;
    justify-content:space-between;
    gap:30px;
}

.invoice-header img{
    width:250px;
    max-width:100%;
}

.invoice-title{
    text-align:right;
}

.invoice-title span{
    font-size:34px;
    font-weight:900;
    color:var(--navy);
}

.invoice-table th{background:var(--blue)}
.total-row td{
    background:var(--navy);
    color:white;
    font-weight:900;
}

.payment-box{
    margin-top:24px;
    padding:18px;
    border-left:6px solid var(--orange);
    border-radius:18px;
    background:linear-gradient(135deg,rgba(17,184,255,.10),rgba(255,122,0,.08));
}

.invoice-footer{
    text-align:right;
    margin-top:38px;
}

.print-area{
    display:flex;
    gap:12px;
    margin-top:28px;
}

.print-area a{
    background:var(--navy);
    color:white;
    border-radius:16px;
    padding:14px 18px;
    text-decoration:none;
    font-weight:900;
}

/* COLLAPSE */
body.collapsed .sidebar{width:96px}
body.collapsed .brand h2,
body.collapsed .brand span,
body.collapsed .menu-title,
body.collapsed .sidebar a span{display:none}
body.collapsed .brand{justify-content:center;padding-left:0;padding-right:0}
body.collapsed .brand img{width:52px;height:52px}
body.collapsed .sidebar a{justify-content:center}
body.collapsed .main{margin-left:96px;width:calc(100% - 96px)}

/* RESPONSIVE HP */
@media(max-width:1100px){
    .cards{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:768px){
    .sidebar{
        transform:translateX(-105%);
        width:292px;
    }

    body.mobile-open .sidebar{
        transform:translateX(0);
    }

    .main,body.collapsed .main{
        margin-left:0;
        width:100%;
    }

    .topbar{
        height:70px;
        padding:0 16px;
    }

    .content{
        padding:24px 16px;
    }

    .page-head{
        display:block;
    }

    .page-head h1{
        font-size:29px;
    }

    .badge-company{
        display:inline-block;
        margin-top:14px;
    }

    .cards,.form-grid{
        grid-template-columns:1fr;
    }

    .panel,.card{
        padding:20px;
        border-radius:23px;
    }

    .userbox{display:none}

    table{min-width:820px}

    .login-card{
        width:92%;
        padding:30px;
    }

    .invoice-page{
        padding:12px;
    }

    .invoice-box{
        padding:22px;
    }

    .invoice-header,.invoice-info{
        display:block;
    }

    .invoice-title{
        text-align:left;
        margin-top:20px;
    }
}

@media print{
    .print-area{display:none}
    .invoice-page{padding:0;background:white}
    .invoice-box{box-shadow:none;border-radius:0}
}