:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: rgba(15,23,42,.68);
  --border: rgba(15,23,42,.12);
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --shadow2: 0 1px 2px rgba(15,23,42,.06);
  --primary: #2563eb;
  --primary2: rgba(37,99,235,.10);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Layout */
.wrap{ max-width:1200px; margin:28px auto; padding:0 14px; }
h1{ margin:0; font-size:34px; letter-spacing:-.02em; }
.muted{ color:var(--muted); font-size:12px; }

/* Topbar */
.topbar{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:center;
  justify-content:space-between;
}
.navlinks{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.navlinks a{
  text-decoration:none;
  padding:10px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.72);
  color:var(--text);
  box-shadow: var(--shadow2);
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.navlinks a:hover{
  background:#fff;
  border-color:rgba(37,99,235,.35);
}
.navlinks a:active{
  transform: translateY(1px);
}

/* Cards */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow: var(--shadow);
  padding:14px;
  margin:14px 0;
}

/* Hero */
.hero-card{
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color:#fff;
  border-radius:20px;
  box-shadow: var(--shadow);
  padding:18px;
  margin:14px 0;
}
.hero-brand{
  display:flex;
  gap:16px;
  align-items:center;
  flex-wrap:wrap;
}
.hero-logo-wrap{
  width:78px;
  height:78px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.18);
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  flex:0 0 auto;
}
.hero-logo-wrap img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:10px;
}
.hero-title{
  font-size:24px;
  font-weight:800;
  line-height:1.1;
}
.hero-sub{
  margin-top:6px;
  color:rgba(255,255,255,.88);
  font-size:13px;
}
.hero-actions{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:10px;
  margin-top:16px;
}
.hero-shortcut{
  text-decoration:none;
  color:#fff;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  text-align:center;
  font-weight:700;
}
.hero-shortcut:hover{
  background:rgba(255,255,255,.14);
}

/* Filters */
.filters{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:end;
}
.filters label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:0 0 6px 2px;
}
.filters select,
.filters input{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  outline:none;
  box-shadow: var(--shadow2);
}
.filters select:focus,
.filters input:focus{
  border-color:rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px var(--primary2);
}
.filters button{
  padding:10px 14px;
  border:1px solid rgba(37,99,235,.35);
  background:var(--primary);
  color:#fff;
  border-radius:12px;
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(37,99,235,.18);
  transition: transform .06s ease, filter .15s ease;
}
.filters button:hover{
  filter: brightness(1.02);
}
.filters button:active{
  transform: translateY(1px);
}

/* KPI */
.grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
}
.grid-kpi-main{
  grid-template-columns:repeat(5, minmax(0, 1fr));
}
.kpi{
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  background: linear-gradient(180deg, rgba(37,99,235,.06), rgba(255,255,255,0) 52%);
}
.kpi .label{
  font-size:12px;
  color:var(--muted);
}
.kpi .value{
  font-size:24px;
  font-weight:800;
  margin-top:6px;
  letter-spacing:-.01em;
}
.kpi .sub{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

/* Shortcut grid */
.shortcut-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
}
.nav-shortcut{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:64px;
  padding:12px 14px;
  text-decoration:none;
  color:var(--text);
  font-weight:700;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  box-shadow: var(--shadow2);
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
  text-align:center;
}
.nav-shortcut:hover{
  background:#f8fbff;
  border-color:rgba(37,99,235,.35);
}
.nav-shortcut:active{
  transform:translateY(1px);
}

/* Two columns */
.two-col{
  display:grid;
  grid-template-columns:1.3fr 1fr;
  gap:12px;
}

/* Tables */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
}
th,td{
  padding:12px 10px;
  border-bottom:1px solid rgba(15,23,42,.08);
  text-align:left;
}
th{
  font-size:12px;
  color:var(--muted);
  background:rgba(15,23,42,.02);
}
tr:hover td{
  background:rgba(37,99,235,.03);
}
.right{
  text-align:right;
}
.status-pill{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  background:#fff;
}
.status-UNPAID{
  background:#fff1f2;
  border-color:#fecdd3;
}
.status-PAID{
  background:#ecfdf5;
  border-color:#bbf7d0;
}
.status-paid,
.status-unpaid{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
}
.status-paid{
  background:#ecfdf5;
  border-color:#bbf7d0;
}
.status-unpaid{
  background:#fff1f2;
  border-color:#fecdd3;
}

/* Buttons */
.btn-sm{
  padding:8px 10px;
  border:1px solid var(--border);
  background:#fff;
  border-radius:12px;
  cursor:pointer;
  box-shadow: var(--shadow2);
}
.btn-sm:hover{
  border-color:rgba(37,99,235,.35);
}

/* Chart canvas */
canvas{
  width:100%;
  height:260px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
}

/* User bar */
.userbar{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
}
.userchip{
  padding:6px 10px;
  border:1px solid rgba(15,23,42,.15);
  border-radius:999px;
  background:rgba(255,255,255,.7);
  box-shadow: var(--shadow2);
}
.userchip .muted{
  opacity:.7;
  font-weight:600;
}

/* Aksi invoice */
.act-link{
  margin-right:10px;
}
.act-btn{
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #e8e8e8;
  background:#fff;
  cursor:pointer;
  font-weight:700;
}
.act-btn:disabled{
  opacity:.6;
  cursor:not-allowed;
}

/* Responsive */
@media(max-width:1100px){
  .grid-kpi-main{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
  .shortcut-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .hero-actions{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}
@media(max-width:980px){
  .grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .two-col{
    grid-template-columns:1fr;
  }
}
@media(max-width:640px){
  .grid-kpi-main{
    grid-template-columns:1fr;
  }
  .shortcut-grid{
    grid-template-columns:1fr;
  }
  .hero-actions{
    grid-template-columns:1fr;
  }
}
@media(max-width:520px){
  .grid{
    grid-template-columns:1fr;
  }
}

.navlinks{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.shortcut-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
}

.nav-shortcut{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:64px;
  padding:12px 14px;
  text-decoration:none;
  color:var(--text);
  font-weight:700;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  box-shadow: var(--shadow2);
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
  text-align:center;
}

.nav-shortcut:hover{
  background:#f8fbff;
  border-color:rgba(37,99,235,.35);
}

.hero-actions{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:10px;
  margin-top:16px;
}

@media(max-width:1100px){
  .shortcut-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .hero-actions{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

@media(max-width:640px){
  .shortcut-grid{ grid-template-columns:1fr; }
  .hero-actions{ grid-template-columns:1fr; }
}