/* ===== Base ===== */
*{ box-sizing:border-box; }
body{
  font-family: Arial, sans-serif;
  background:#f5f6fa;
  margin:0;
  color:#111;
}
a{ text-decoration:none; color:#0f1f6b; }
a:hover{ text-decoration:underline; }

/* ===== Layout ===== */
.app{ display:flex; min-height:100vh; }

/* Sidebar */
.sidebar{
  width:240px;
  background:#0f1f6b;
  color:#fff;
  padding:14px 12px;
}
.brand{ font-weight:bold; font-size:16px; margin-bottom:14px; }

.userbox{
  background:rgba(255,255,255,0.10);
  padding:10px;
  border-radius:8px;
  margin-bottom:14px;
}
.user-name{ font-size:13px; margin-bottom:6px; }
.logout{ color:#fff; font-size:12px; opacity:.9; }

.menu a{
  display:block;
  color:#fff;
  padding:10px 12px;
  border-radius:8px;
  margin-bottom:8px;
  background:rgba(255,255,255,0.08);
  font-size:14px;
}
.menu a:hover{ background:rgba(255,255,255,0.16); text-decoration:none; }
.menu a.active{
  background:#fff;
  color:#0f1f6b;
  font-weight:bold;
}

/* Content */
.main{ flex:1; min-width:0; }
.topbar{
  background:#fff;
  padding:14px 18px;
  border-bottom:1px solid #e8e8e8;
}
.page-title{ font-weight:bold; font-size:16px; }
.content{ padding:18px; }

/* ===== Card ===== */
.card{
  background:#fff;
  border:1px solid #e8e8e8;
  border-radius:12px;
  padding:18px;
}

/* ===== Headings ===== */
h1,h2,h3{ margin:0 0 12px 0; }
h2{ font-size:22px; }
small{ color:#777; }

/* ===== Forms ===== */
.form{
  max-width:560px;
}
.form-group{
  margin-bottom:14px;
}
label{
  display:block;
  font-size:13px;
  margin-bottom:6px;
  color:#222;
  font-weight:bold;
}
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid #d9d9d9;
  border-radius:8px;
  background:#fff;
  font-size:14px;
  outline:none;
}
textarea{ min-height:90px; resize:vertical; }
input:focus, select:focus, textarea:focus{
  border-color:#0f1f6b;
  box-shadow:0 0 0 3px rgba(15,31,107,0.12);
}

/* ===== Buttons ===== */
.btn{
  display:inline-block;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid transparent;
  font-size:14px;
  cursor:pointer;
}
.btn-primary{
  background:#0f1f6b;
  color:#fff;
}
.btn-primary:hover{ background:#0c1856; }
.btn-light{
  background:#f2f4ff;
  border-color:#d7dcff;
  color:#0f1f6b;
}
.btn-light:hover{ background:#e9ecff; }
.btn-link{
  padding:10px 0;
  border:none;
  background:transparent;
  color:#0f1f6b;
}

/* ===== Alerts ===== */
.alert{
  padding:10px 12px;
  border-radius:10px;
  margin:10px 0;
  font-size:14px;
}
.alert-success{ background:#e8fff1; border:1px solid #b8f5cf; color:#0b6b2a; }
.alert-error{ background:#ffecec; border:1px solid #ffbcbc; color:#a30000; }

/* ===== Tables ===== */
.table{
  width:100%;
  border-collapse:collapse;
  margin-top:12px;
}
.table th, .table td{
  padding:10px 12px;
  border-bottom:1px solid #eee;
  font-size:14px;
}
.table th{
  text-align:left;
  background:#f5f6fa;
  font-weight:bold;
  color:#222;
}
.table tr:hover td{ background:#fafbff; }

/* Utility */
.flex{ display:flex; gap:10px; align-items:center; }
.flex-between{ display:flex; justify-content:space-between; align-items:center; }

.badge{
  display:inline-block;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:bold;
  border:1px solid transparent;
}

.badge-paid{
  background:#e8fff1;
  color:#0b6b2a;
  border-color:#b8f5cf;
}

.badge-dp{
  background:#fff6e5;
  color:#8a5a00;
  border-color:#ffd79a;
}

.badge-unpaid{
  background:#ffecec;
  color:#a30000;
  border-color:#ffbcbc;
}

.row-paid td{ background:#fbfffd; }
.row-dp td{ background:#fffdf7; }
.row-unpaid td{ background:#fffafa; }

.sidebar .brand {
  text-align: center;
  padding: 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar .brand .logo-sidebar {
  max-width: 160px;
  height: auto;
}

.sidebar .userbox {
  padding: 12px 10px;
}


/* Statistik card dashboard */
.stat-card{
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}

.stat-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(0,0,0,.12);
}

.stat-card .label{
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #6c757d;
  margin-bottom: 6px;
}

.stat-card .value{
  font-size: 22px;
  font-weight: 800;
  color: #0b1f3a; /* navy */
}

.grid-4{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:14px;
}

.stat{
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  padding: 16px 18px;
  background:#fff;

  /* efek mengembang + shadow */
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.stat:hover{
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,.12);
  border-color: rgba(0,0,0,.08);
}

.stat-title{
  font-size: 12px;
  color:#6b7280;
  letter-spacing: .5px;
}

.stat-value{
  font-size: 22px;
  font-weight: 800;
  margin-top: 8px;
  color:#0b1f3a; /* navy */
}

@media(max-width:1100px){ .grid-4{ grid-template-columns:repeat(2,1fr);} }
@media(max-width:600px){ .grid-4{ grid-template-columns:1fr;} }


.grid-4 .stat{
  box-shadow: 0 10px 25px rgba(0,0,0,.12) !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  border-radius: 16px !important;
}

.modal-overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center;
  z-index:9999;
}
.modal-box{
  width:520px; max-width:92vw;
  background:#fff;
  border-radius:14px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  padding:16px;
}
.modal-header{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:10px;
}
.modal-close{
  border:none; background:transparent;
  font-size:28px; line-height:1; cursor:pointer;
}
.form-group{ margin-bottom:10px; }
.form-group input{
  width:100%; padding:10px; border:1px solid #ddd; border-radius:10px;
}


.order-customer-row{
  display:flex;
  gap:12px;
  align-items:flex-end;
}

.order-customer-row .customer-select{
  flex: 1;
}

.order-customer-row .btn-add-customer{
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
}

.order-customer-row{
  display:flex;
  gap:12px;
  align-items:flex-end;
}

.order-customer-row .customer-select{
  flex:1;
  height:42px;
}

.order-customer-row .btn-add-customer{
  height:42px;
  padding:0 14px;
  border-radius:10px;
  border:1px solid #d7d7d7;
  background:#f3f3f3;
  cursor:pointer;
  white-space:nowrap;
}

.info { border: 2px solid #111; }
.info .c { border-left: 1px solid #111; }
.info .c:first-child { border-left: 0; }
.lines-placeholder { display:none !important; }


/* ===== PDF (DOMPDF) OVERRIDES ===== */
body.pdf .row{ display: table !important; width:100% !important; }
body.pdf .logo{ display: table-cell !important; width:70% !important; vertical-align: top !important; }
body.pdf .title-box{ display: table-cell !important; width:30% !important; text-align:right !important; vertical-align: top !important; }

body.pdf .info-wrap{ display:block !important; margin-top:10px !important; }
body.pdf .info{ width:100% !important; }

body.pdf .info .r{ display: table !important; width:100% !important; table-layout: fixed !important; }
body.pdf .info .c{ display: table-cell !important; float:none !important; }

/* Items table lebih stabil */
body.pdf table.items{ table-layout: fixed !important; }
body.pdf table.items th,
body.pdf table.items td{ word-wrap: break-word !important; }

/* HILANGKAN garis abu-abu saat PDF biar gak jadi 2 halaman */
body.pdf .grayline{ display:none !important; }

/* BOTTOM (bank + note) jangan flex */
body.pdf .bottom{ display: table !important; width:100% !important; }
body.pdf .bank, body.pdf .note{ display: table-cell !important; width:50% !important; vertical-align: top !important; }

/* cegah box pecah halaman */
body.pdf .box{ page-break-inside: avoid !important; }
body.pdf table.items tr{ page-break-inside: avoid !important; }

body.pdf .box{ min-height: 80px !important; padding:8px !important; }
body.pdf table.items td{ padding:5px 6px !important; }
body.pdf table.items th{ padding:6px 6px !important; }


/* PDF only */
.grayline{ display:none !important; } /* hilangkan baris kosong */
.bottom{ display: table; width:100%; }
.bank{ display: table-cell; width:55%; vertical-align: top; }
.summary{ display: table-cell; width:45%; vertical-align: top; margin-left:0; }
.row{ display: table; width:100%; }
.logo{ display: table-cell; width:70%; vertical-align: top; }
.title-box{ display: table-cell; width:30%; text-align:right; vertical-align: top; }

/* baris To + info box sejajar */
.top-row{ display: table; width:100%; margin-top:10px; }
.top-row .to{ display: table-cell; width:60%; vertical-align: top; }
.top-row .info-wrap{ display: table-cell; width:40%; vertical-align: top; text-align:right; }

/* kotak info kecil */
.info-box{ display:inline-block; width:320px; } /* sesuaikan 300-340 */
table.info{ width:100%; }
table.info th, table.info td{ padding:6px 6px; font-size:11px; }
