:root{
  --navy:#1B2A4A; --navy-dark:#101c33; --navy-soft:#2c3f68;
  --gold:#AD8A3D; --gold-soft:#e7dcc0; --paper:#FDFCF8; --bg:#EFEDE6;
  --ink:#23262B; --muted:#6b6f76; --border:#DAD4C4; --danger:#B4432F; --ok:#3f6c51;
}
*{box-sizing:border-box;}
html,body{height:100%; margin:0;}
body{font-family:'Segoe UI',Inter,Arial,sans-serif; background:var(--bg); color:var(--ink);}
a{color:inherit;}

/* Landing */
.landing{width:100%; min-height:100vh; background:radial-gradient(circle at 15% 0%, #24365c 0%, var(--navy-dark) 55%), var(--navy-dark); color:#fff; display:flex; flex-direction:column;}
.land-nav{display:flex; justify-content:space-between; align-items:center; padding:22px 6vw;}
.land-brand{display:flex; align-items:center; gap:10px; font-weight:800; font-size:17px;}
.land-brand .mark{width:34px; height:34px; border-radius:8px; background:var(--gold); color:#2a2210; display:flex; align-items:center; justify-content:center; font-weight:800; font-family:Georgia,serif;}
.land-nav-btns{display:flex; gap:10px;}
.land-hero{flex:1; display:flex; align-items:center; gap:40px; padding:20px 6vw 60px 6vw; flex-wrap:wrap;}
.land-hero-text{flex:1; min-width:300px;}
.eyebrow{color:var(--gold); font-size:12.5px; letter-spacing:2px; font-weight:700; text-transform:uppercase; margin-bottom:14px;}
.land-hero-text h1{font-size:clamp(28px,4vw,44px); line-height:1.15; margin:0 0 16px 0; font-family:Georgia,serif; font-weight:700;}
.land-hero-text h1 span{color:var(--gold);}
.land-hero-text p{color:#c7cde0; font-size:15px; line-height:1.6; max-width:480px; margin-bottom:26px;}
.land-feat-list{flex:1; min-width:300px; display:grid; gap:12px;}
.land-feat{background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); border-radius:10px; padding:15px 18px; display:flex; gap:12px;}
.land-feat b{display:block; font-size:13.5px; margin-bottom:2px;}
.land-feat span{font-size:12px; color:#b9c0d6;}
.land-strip{background:#16213d; padding:14px 6vw; font-size:12px; color:#9aa3bd; border-top:1px solid rgba(255,255,255,.08);}
.demo-box{background:rgba(173,138,61,.12); border:1px solid var(--gold); border-radius:8px; padding:10px 14px; font-size:12px; color:#f0e5cc; margin-top:14px;}

/* Auth */
.auth-wrap{width:100%; min-height:100vh; background:var(--bg); display:flex; align-items:center; justify-content:center; padding:30px 16px;}
.auth-card{background:var(--paper); border:1px solid var(--border); border-radius:14px; width:100%; max-width:420px; padding:30px;}
.auth-back{font-size:12.5px; color:var(--muted); margin-bottom:14px; display:inline-block; text-decoration:none;}
.auth-card h2{margin:0 0 4px 0; color:var(--navy); font-size:19px;}
.auth-card p.sub{margin:0 0 20px 0; color:var(--muted); font-size:12.8px;}
.auth-toggle{display:flex; background:#eee9dc; border-radius:9px; padding:3px; margin-bottom:20px;}
.auth-toggle a{flex:1; text-align:center; padding:8px; border-radius:7px; font-size:12.8px; font-weight:700; color:var(--muted); text-decoration:none;}
.auth-toggle a.active{background:var(--navy); color:#fff;}
.acct-type-row{display:flex; gap:10px; margin-bottom:16px;}
.acct-type-opt{flex:1; border:1.5px solid var(--border); border-radius:9px; padding:12px 10px; text-align:center; cursor:pointer; font-size:12.3px; font-weight:600; color:var(--muted);}
.acct-type-opt input{display:none;}
.acct-type-opt.active{border-color:var(--gold); background:var(--gold-soft); color:var(--navy);}
.field{margin-bottom:13px;}
.field label{display:block; font-size:12px; font-weight:600; color:var(--navy); margin-bottom:4px;}
.field input, .field select, .field textarea{width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:7px; font-size:13px; font-family:inherit; background:#fff; color:var(--ink);}
.field textarea{resize:vertical; min-height:70px;}
.field small.note{display:block; color:#a79f8c; font-size:10.6px; margin-top:4px; line-height:1.4;}
.field-row{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.alert-err{background:#fbeae6; color:var(--danger); font-size:12px; padding:9px 11px; border-radius:7px; margin-bottom:14px;}
.alert-ok{background:#e7f2ea; color:var(--ok); font-size:12px; padding:9px 11px; border-radius:7px; margin-bottom:14px;}

.btn{display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:10px 16px; border-radius:8px; border:none; font-size:13px; font-weight:700; cursor:pointer; text-decoration:none;}
.btn-block{width:100%;}
.btn-primary{background:var(--navy); color:#fff;}
.btn-gold{background:var(--gold); color:#2a2210;}
.btn-outline{background:#fff; border:1.5px solid var(--border); color:var(--navy);}
.btn-ghost{background:transparent; border:1.5px solid rgba(255,255,255,.5); color:#fff;}

/* Dashboard app shell */
.app{display:flex; width:100%; min-height:100vh;}
.sidebar{width:230px; flex-shrink:0; background:linear-gradient(180deg,var(--navy) 0%, var(--navy-dark) 100%); color:#fff; display:flex; flex-direction:column; padding:22px 0;}
.brand{display:flex; align-items:center; gap:10px; padding:0 20px 20px 20px; border-bottom:1px solid rgba(255,255,255,0.12); margin-bottom:14px;}
.brand-mark{width:36px;height:36px;border-radius:8px; background:var(--gold); color:var(--navy-dark); display:flex;align-items:center;justify-content:center; font-weight:800;font-size:18px; font-family:Georgia,serif; overflow:hidden;}
.brand-mark img{width:100%; height:100%; object-fit:cover;}
.brand-text b{display:block;font-size:15px;}
.brand-text span{display:block;font-size:10.5px;color:#c8cede;}
.nav-item{display:flex;align-items:center;gap:10px; padding:11px 20px; font-size:13.5px; color:#cfd5e4; text-decoration:none; border-left:3px solid transparent;}
.nav-item:hover{background:rgba(255,255,255,0.06); color:#fff;}
.nav-item.active{background:rgba(255,255,255,0.09); color:#fff; border-left:3px solid var(--gold); font-weight:600;}
.sidebar-foot{margin-top:auto; padding:14px 20px 0 20px;}
.acct-chip{display:flex; align-items:center; gap:8px; font-size:11.5px; color:#c8cede; border-top:1px solid rgba(255,255,255,.1); padding-top:12px;}
.acct-chip .dot{width:7px; height:7px; border-radius:50%; background:#6fbf8b; flex-shrink:0;}
.logout-link{margin-top:8px; font-size:11.5px; color:#e3a68a; text-decoration:none; display:inline-block;}

.main{flex:1; min-width:0; padding:26px 32px;}
.topbar{display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:22px; flex-wrap:wrap; gap:12px;}
.topbar h1{font-size:21px; margin:0 0 4px 0; color:var(--navy);}
.topbar p{margin:0; color:var(--muted); font-size:13px;}

.stat-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:22px;}
.stat-card{background:var(--paper); border:1px solid var(--border); border-radius:10px; padding:14px 16px; position:relative; overflow:hidden;}
.stat-card::before{content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--gold);}
.stat-card .n{font-size:23px; font-weight:800; color:var(--navy);}
.stat-card .l{font-size:11px; color:var(--muted); margin-top:2px;}

.panel{background:var(--paper); border:1px solid var(--border); border-radius:10px; padding:18px 20px; margin-bottom:18px;}
.panel h3{margin:0 0 12px 0; font-size:14.5px; color:var(--navy);}

.quick-types{display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:12px;}
.type-btn{border:1.5px solid var(--border); background:#fff; border-radius:10px; padding:15px; text-decoration:none; display:block; color:inherit;}
.type-btn:hover{border-color:var(--gold);}
.type-btn .ic{font-size:19px;}
.type-btn b{display:block; margin-top:6px; font-size:13px; color:var(--navy);}
.type-btn span{font-size:11px; color:var(--muted);}

table.hist{width:100%; border-collapse:collapse; font-size:12.6px;}
table.hist th{text-align:left; padding:9px 10px; background:#f3f0e8; color:var(--navy); font-size:11px; text-transform:uppercase; border-bottom:2px solid var(--border);}
table.hist td{padding:9px 10px; border-bottom:1px solid var(--border); vertical-align:top;}
table.hist tr:hover td{background:#faf9f5;}
.badge{display:inline-block; padding:2px 8px; border-radius:20px; font-size:10.3px; font-weight:700; color:#fff; white-space:nowrap;}
.link-btn{background:none; border:none; color:var(--navy); font-size:12px; cursor:pointer; text-decoration:underline; padding:0; margin-right:10px; font-family:inherit;}
.link-btn.danger{color:var(--danger);}
.empty{color:var(--muted); font-size:13px; padding:16px 4px;}

.type-tabs{display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap;}
.type-tab{padding:7px 13px; border-radius:20px; border:1.5px solid var(--border); background:#fff; font-size:11.8px; color:var(--muted); font-weight:600; text-decoration:none;}
.type-tab.active{background:var(--navy); border-color:var(--navy); color:#fff;}
.btn-row{display:flex; gap:10px; margin-top:16px; flex-wrap:wrap;}

.split{display:grid; grid-template-columns:380px 1fr; gap:20px; align-items:start;}
@media (max-width:980px){.split{grid-template-columns:1fr;}}
.preview-wrap{background:#DFDAC9; border-radius:10px; padding:22px; display:flex; justify-content:center;}
.paper{background:var(--paper); width:100%; max-width:640px; min-height:800px; box-shadow:0 8px 26px rgba(0,0,0,.18); padding:32px 36px; font-family:'Georgia','Times New Roman',serif; font-size:11px; line-height:1.5; color:#1c1c1c;}
.kop{display:flex; align-items:center; gap:12px; border-bottom:3px double #1c1c1c; padding-bottom:8px; margin-bottom:14px;}
.kop-logo{width:46px; height:46px; border-radius:6px; background:var(--navy); color:var(--gold); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:19px; flex-shrink:0; overflow:hidden;}
.kop-logo img{width:100%; height:100%; object-fit:cover;}
.kop-text{flex:1;}
.kop-text .cname{font-size:14.5px; font-weight:800; text-transform:uppercase;}
.kop-text .caddr{font-size:9.4px; color:#444;}
.doc-title{text-align:center; margin:14px 0 12px 0;}
.doc-title .t1{font-weight:800; font-size:12.6px; text-decoration:underline; text-transform:uppercase;}
.doc-title .t2{font-size:10.4px; margin-top:2px;}
.p-table{width:100%; margin:4px 0 8px 0;}
.p-table td{padding:1.5px 0; vertical-align:top; font-size:11px;}
.p-table td.k{width:115px;}
.p-table td.c{width:12px;}
.quote{border-left:3px solid var(--gold); padding:6px 10px; margin:8px 0; background:#f7f4ea; font-style:italic; font-size:10.8px;}
.sig-1col{margin-top:22px; text-align:right; font-size:11px;}
.sig-1col .box{display:inline-block; text-align:center; min-width:200px;}
.sig-2col{display:flex; justify-content:space-between; margin-top:22px; gap:20px;}
.sig-block{width:46%; text-align:center; font-size:11px;}
.sig-space{height:52px; position:relative;}
.seal{position:absolute; inset:0; margin:auto; width:60px; height:60px; border-radius:50%; border:1.4px dashed var(--gold); color:var(--gold); opacity:.65; display:flex; align-items:center; justify-content:center; font-size:7.6px; font-weight:700; text-align:center; transform:rotate(-8deg);}
.sig-name{font-weight:700; text-decoration:underline;}
.placeholder-note{color:#b9b2a0; font-size:10.3px;}
.tembusan{margin-top:14px; font-size:10.4px;}

.logo-uploader{display:flex; align-items:center; gap:16px; margin-bottom:18px;}
.logo-preview{width:74px; height:74px; border-radius:10px; background:var(--navy); display:flex; align-items:center; justify-content:center; overflow:hidden; border:1px solid var(--border); flex-shrink:0;}
.logo-preview img{width:100%; height:100%; object-fit:cover;}
.logo-preview .ph{color:var(--gold); font-size:24px; font-weight:800; font-family:Georgia,serif;}

@media print{
  body *{visibility:hidden;}
  #printArea, #printArea *{visibility:visible;}
  #printArea{position:absolute; top:0; left:0; width:210mm; padding:14mm 16mm;}
  .paper{box-shadow:none; width:100%; max-width:none; min-height:0; padding:0;}
}
