*{box-sizing:border-box}
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;margin:0;color:#111}
a{color:#0b63ce;text-decoration:none}
.header{background:#0f172a;color:#fff;padding:12px 16px;display:flex;gap:16px;align-items:center;justify-content:space-between}
.header .title{font-weight:700}
.container{max-width:1000px;margin:20px auto;padding:0 16px}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:16px}
.btn{display:inline-block;padding:8px 12px;border-radius:10px;border:1px solid #cbd5e1;background:#fff}
.btn.primary{background:#0b63ce;border-color:#0b63ce;color:#fff}
.btn.danger{background:#ef4444;border-color:#ef4444;color:#fff}
.table{width:100%;border-collapse:collapse}
.table th,.table td{border-bottom:1px solid #e5e7eb;padding:8px;text-align:left;vertical-align:top}
.table th{background:#f5f5f7;font-weight:700}

.form-row{display:flex;gap:12px;flex-wrap:wrap}
.input{flex:1;min-width:220px;display:flex;flex-direction:column;margin-bottom:10px}
.input input,.input select,.input textarea{padding:10px;border:1px solid #cbd5e1;border-radius:10px;background:#fff}

.invoice{border:1px solid #e5e7eb;border-radius:10px;overflow:hidden}

/* UPDATED: right title block to top-right */
.inv-header{
  display:grid;
  grid-template-columns: 1fr auto; /* right block auto width */
  gap:16px;
  padding:16px 16px 8px 16px;
  align-items:start;               /* align to the top */
}

.brand{display:grid;grid-template-columns:90px 1fr;gap:10px;align-items:center}
.brand .logo img{max-height:70px;max-width:100%;object-fit:contain}
.brand .admin{font-size:13px;line-height:1.4;color:#222}

/* UPDATED: make sure it sticks to the top-right */
.right-title{
  text-align:right;
  justify-self:end;   /* push to the right edge of grid */
  align-self:start;   /* stick to top */
  display:flex;
  flex-direction:column;
  align-items:flex-end;
}
.right-title h1{margin:0 0 4px 0;font-size:26px;letter-spacing:.6px}
.right-title .seri{font-size:12px;color:#666;margin-top:2px}

.customer-box{border:1px solid #d1d5db;margin:10px 16px;padding:10px;border-radius:8px;background:#fafafa}
.customer-box h3{margin:0 0 8px 0;font-size:13px}
.items{padding:0 16px 12px 16px}
.items table{width:100%;border-collapse:collapse}
.items th,.items td{border:1px solid #e5e7eb;padding:8px}
.items thead th{background:#f5f5f7}
.footer-sum{display:grid;grid-template-columns:1fr 320px;gap:16px;padding:12px 16px 16px 16px}
.footer-sum .only{border:1px solid #e5e7eb;border-radius:8px;min-height:60px;padding:10px;font-size:12px;color:#666}
.totals table{width:100%;border-collapse:collapse}
.totals td,.totals th{padding:8px;border:1px solid #e5e7eb}
.totals tr:last-child th,.totals tr:last-child td{background:#f5f5f7;font-weight:700}
.badge{display:inline-block;padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#f1f5f9}

@media print{
  .header, .print-actions, .btn, .card {display:none !important}
  .container{padding:0;margin:0}
  body{background:#fff}
  .invoice{border:none}
}
