:root{
    --primary:#1455d9;
    --primary-dark:#0d3f9f;
    --bg:#eef4fb;
    --text:#1f2937;
    --muted:#6b7280;
    --border:#d7e2ee;
    --danger:#dc2626;
    --danger-bg:#fff1f2;
    --success:#15803d;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Arial,'Segoe UI',sans-serif;color:var(--text);background:var(--bg)}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
.page-bg{
    min-height:100vh;
    background:
      radial-gradient(circle at 8% 8%, rgba(20,85,217,.22), transparent 32%),
      radial-gradient(circle at 90% 20%, rgba(14,165,233,.20), transparent 28%),
      linear-gradient(135deg,#eef5ff 0%,#dbe9f8 100%);
}
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:22px}
.login-card{
    width:100%;max-width:440px;background:rgba(255,255,255,.94);
    border:1px solid rgba(255,255,255,.76);border-radius:26px;
    box-shadow:0 24px 70px rgba(15,63,159,.18);padding:34px;
}
.logo-box{text-align:center;margin-bottom:24px}
.logo-badge{
    width:86px;height:86px;margin:0 auto;display:flex;align-items:center;justify-content:center;
    border-radius:24px;background:linear-gradient(135deg,#ffffff,#eff6ff);
    box-shadow:0 12px 28px rgba(20,85,217,.14);border:1px solid var(--border)
}
.logo-box img{max-width:72px;max-height:72px;object-fit:contain}
.logo-title{font-size:22px;font-weight:900;color:#0f172a;margin-top:14px;line-height:1.25}
.logo-sub{font-size:13px;color:var(--muted);margin-top:5px}
.form-label{display:block;font-weight:800;font-size:13px;margin-bottom:8px;color:#374151;text-align:left}
.input,select{
    width:100%;height:46px;padding:10px 13px;border:1px solid var(--border);border-radius:13px;background:#fff;
    outline:none;font-size:14px;transition:.2s
}
.input:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(20,85,217,.12)}
.form-row{margin-bottom:16px}
.btn{
    display:inline-block;border:0;border-radius:12px;padding:12px 18px;font-weight:900;cursor:pointer;
    background:var(--primary);color:#fff!important;transition:.2s;text-align:center
}
.btn:hover{background:var(--primary-dark);text-decoration:none;transform:translateY(-1px)}
.btn-block{width:100%}
.btn-secondary{background:#475569}
.btn-danger{background:#dc2626}
.alert{display:block;border-radius:14px;padding:12px 14px;margin-bottom:16px;font-weight:800;font-size:13px;line-height:1.45}
.alert-danger{background:var(--danger-bg);color:#991b1b;border:1px solid #fecdd3}
.alert-info{background:#dbeafe;color:#1e3a8a;border:1px solid #bfdbfe}
.login-error{
    display:flex;gap:10px;align-items:flex-start;background:var(--danger-bg);border:1px solid #fecdd3;
    color:#991b1b;border-radius:16px;padding:13px 14px;margin-bottom:16px;
    box-shadow:0 8px 20px rgba(220,38,38,.08)
}
.login-error .icon{
    width:28px;height:28px;border-radius:999px;background:#dc2626;color:#fff;
    display:flex;align-items:center;justify-content:center;font-weight:900;flex:0 0 28px
}
.login-error .title{font-weight:900;margin-bottom:2px}
.login-error .msg{font-size:13px;line-height:1.4}
.captcha{
    display:inline-block;background:#0f172a;color:#fff;border-radius:12px;padding:10px 20px;
    font-size:22px;letter-spacing:6px;font-weight:900;margin-bottom:10px
}
.app-shell{min-height:100vh;display:flex}
.sidebar{width:280px;background:#0f172a;color:#fff;padding:22px;position:fixed;left:0;top:0;bottom:0;overflow:auto}
.sidebar .brand{text-align:center;border-bottom:1px solid rgba(255,255,255,.12);padding-bottom:18px;margin-bottom:18px}
.sidebar .brand img{max-width:70px;max-height:70px}
.sidebar .brand h2{font-size:18px;margin:10px 0 2px}
.sidebar .brand p{font-size:12px;color:#cbd5e1;margin:0}
.nav-link{display:block;color:#e2e8f0!important;padding:12px 14px;border-radius:12px;margin-bottom:8px;font-weight:800}
.nav-link:hover,.nav-link.active{background:rgba(255,255,255,.11);text-decoration:none}
.main{margin-left:280px;width:calc(100% - 280px);padding:28px}
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;gap:12px}
.page-title h1{font-size:26px;margin:0;color:#0f172a}
.page-title p{margin:6px 0 0;color:var(--muted)}
.card{
    background:#fff;border:1px solid var(--border);border-radius:22px;box-shadow:0 14px 35px rgba(15,23,42,.08);padding:24px;margin-bottom:22px
}
.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:16px}
.col-6{grid-column:span 6}
.col-4{grid-column:span 4}
.col-12{grid-column:span 12}
.stat{background:linear-gradient(135deg,#fff,#eef5ff);border:1px solid var(--border);border-radius:18px;padding:18px}
.stat .label{font-size:12px;color:var(--muted);font-weight:900;text-transform:uppercase}
.stat .value{font-size:22px;font-weight:900;margin-top:6px;word-break:break-word}
.table-wrap{overflow:auto}
table.modern{width:100%;border-collapse:collapse;font-size:14px}
table.modern th{background:#eff6ff;color:#1e3a8a;text-align:left;padding:12px;border:1px solid var(--border)}
table.modern td{padding:12px;border:1px solid var(--border)}
table.modern .amount{text-align:right;font-weight:800;white-space:nowrap}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.note{font-size:13px;color:var(--muted);line-height:1.55}
.mobile-menu{display:none;background:#0f172a;color:#fff;padding:14px 16px;align-items:center;justify-content:space-between}
.mobile-menu .title{font-weight:900}
.mobile-menu a{color:#fff}

.print-page{background:#fff;padding:10px}
.print-paper{max-width:980px;margin:0 auto;background:#fff;border:1px solid #d1d5db;padding:16px}
.print-head{display:flex;gap:12px;align-items:center;justify-content:center;text-align:center;border-bottom:2px solid #111827;padding-bottom:10px;margin-bottom:10px}
.print-head img{max-width:62px;max-height:62px}
.print-head h2{margin:0;font-size:17px;line-height:1.25}
.print-head p{margin:3px 0 0;font-size:11px}
.print-title{text-align:center;font-weight:900;margin:10px 0;font-size:15px}
.print-actions{max-width:980px;margin:12px auto;display:flex;gap:10px}
.print-paper table.modern{font-size:11px}
.print-paper table.modern th,.print-paper table.modern td{padding:5px 6px}
.print-paper h3{font-size:13px;margin:6px 0}
.print-paper .note{font-size:10px;margin-top:8px}
.print-summary{margin-top:8px}

@media(max-width:860px){
    .mobile-menu{display:flex}
    .sidebar{position:relative;width:100%;bottom:auto;border-radius:0;padding:16px}
    .app-shell{display:block}
    .main{margin-left:0;width:100%;padding:16px}
    .topbar{display:block}
    .topbar .actions{margin-top:14px}
    .grid{display:block}
    .col-6,.col-4,.col-12{margin-bottom:14px}
    .login-card{padding:22px;border-radius:22px}
    .logo-title{font-size:20px}
    .stat .value{font-size:19px}
    table.modern{font-size:13px}
    table.modern th,table.modern td{padding:10px}
}
@media(max-width:520px){
    .login-wrap{padding:14px;align-items:flex-start;padding-top:32px}
    .login-card{padding:18px}
    .captcha{font-size:18px;letter-spacing:4px}
    .btn{width:100%;margin-bottom:8px}
    .actions .btn{width:auto}
}

/* =========================================================
   CETAK A4 - STYLE KERAJAAN / HRMIS / JKR
   ========================================================= */

.print-gov {
    width: 100%;
    background: #fff;
    color: #000;
    font-family: Arial, "Segoe UI", sans-serif;
}

.gov-paper {
    width: 190mm;
    min-height: 277mm;
    margin: 0 auto;
    background: #fff;
    padding: 0;
}

.gov-header {
    display: table;
    width: 100%;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    margin-bottom: 7px;
}

.gov-logo {
    display: table-cell;
    width: 22mm;
    vertical-align: middle;
    text-align: left;
}

.gov-logo img {
    max-width: 18mm;
    max-height: 18mm;
}

.gov-head-text {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    padding-right: 22mm;
}

.gov-head-text h1 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.25;
}

.gov-head-text div {
    font-size: 9px;
    line-height: 1.25;
}

.gov-title {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    border: 1px solid #000;
    padding: 4px;
    margin: 6px 0;
    background: #f3f3f3;
}

.gov-section-title {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    border: 1px solid #000;
    border-bottom: 0;
    padding: 3px 5px;
    background: #f3f3f3;
    margin-top: 5px;
}

.gov-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 8.6px;
    line-height: 1.18;
}

.gov-table th,
.gov-table td {
    border: 1px solid #000;
    padding: 2.5px 4px;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.gov-table th {
    background: #f3f3f3;
    font-weight: 800;
}

.gov-info th {
    width: 20%;
    text-align: left;
}

.gov-info td {
    width: 30%;
}

.gov-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 5px;
}

.gov-amount {
    text-align: right;
    white-space: nowrap;
}

.gov-center {
    text-align: center;
}

.gov-total-row td,
.gov-total-row th {
    font-weight: 800;
    background: #f3f3f3;
}

.gov-summary {
    margin-top: 5px;
}

.gov-summary th,
.gov-summary td {
    font-size: 9px;
    padding: 3px 4px;
}

.gov-footer {
    margin-top: 7px;
    font-size: 8px;
    line-height: 1.25;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.gov-footer-box {
    border: 1px solid #000;
    padding: 4px 5px;
    flex: 1;
    min-height: 28px;
}

.gov-print-actions {
    max-width: 190mm;
    margin: 12px auto;
    display: flex;
    gap: 8px;
}



/* =========================================================
   OVERRIDE CETAK - FONT LEBIH JELAS
   ========================================================= */

/* =========================================================
   PRINT A4 FINAL (FIX 2 PAGE + FONT JELAS)
   ========================================================= */
@media print {

    @page {
        size: A4 portrait;
        margin: 7mm;
    }

    html,
    body {
        width: 210mm;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        overflow: visible !important;
    }

    form {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .no-print,
    .sidebar,
    .topbar,
    .mobile-menu,
    .print-actions,
    .gov-print-actions {
        display: none !important;
    }

    .main,
    .content,
    .content-wrapper,
    .app-shell {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
    }

    .card,
    .print-paper {
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .gov-paper {
        width: 196mm;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        padding: 0 !important;
        transform: scale(1);
        transform-origin: top center;

        page-break-after: avoid !important;
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
        break-after: avoid !important;
        break-before: avoid !important;
        break-inside: avoid !important;
    }

    .gov-header {
        padding-bottom: 4px;
        margin-bottom: 5px;
    }

    .gov-logo {
        width: 18mm;
    }

    .gov-logo img {
        max-width: 15mm;
        max-height: 15mm;
    }

    .gov-head-text {
        padding-right: 18mm;
    }

    .gov-head-text h1 {
        font-size: 11.5px;
        line-height: 1.2;
    }

    .gov-head-text div {
        font-size: 8.5px;
        line-height: 1.2;
    }

    .gov-title {
        font-size: 10.5px;
        padding: 3px;
        margin: 4px 0;
    }

    .gov-section-title {
        font-size: 9px;
        padding: 2px 4px;
        margin-top: 4px;
    }

    .gov-table {
        width: 100%;
        font-size: 8.8px;
        line-height: 1.14;
        table-layout: fixed;
        border-collapse: collapse;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .gov-table th,
    .gov-table td {
        padding: 2px 3px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .gov-amount {
        text-align: right;
        white-space: nowrap;
    }

    .gov-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        margin-top: 4px;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .gov-summary {
        margin-top: 4px;
    }

    .gov-summary th,
    .gov-summary td {
        font-size: 9px;
        padding: 2px 3px;
    }

    .gov-footer {
        font-size: 7.8px;
        margin-top: 5px;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .gov-footer-box {
        padding: 3px 4px;
        min-height: 20px;
    }
}
