/* CargoToVietnam v1 — clean simple styles */
* { box-sizing: border-box; }
body { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #222; margin: 0; background: #f4f6f8; }
a { color: #0b5ed7; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { background: #14365d; color: #fff; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; }
.topbar .brand { font-size: 18px; font-weight: bold; }
.topbar .tag { font-size: 11px; font-weight: normal; background: #e8a13d; color: #14365d; border-radius: 3px; padding: 2px 6px; margin-left: 8px; }
.topbar nav a { color: #cfe0f5; margin-left: 16px; font-size: 14px; }
.topbar nav a.active, .topbar nav a:hover { color: #fff; text-decoration: underline; }

.wrap { max-width: 1200px; margin: 18px auto; padding: 0 16px 40px; }
.card { background: #fff; border: 1px solid #d9dee4; border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.card h2, .card h3 { margin: 0 0 12px; color: #14365d; }
.card h3 { font-size: 15px; border-bottom: 1px solid #e5e9ee; padding-bottom: 6px; }

table.grid { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.grid th, table.grid td { border: 1px solid #d9dee4; padding: 6px 8px; text-align: left; font-size: 13px; }
table.grid th { background: #eef2f7; color: #14365d; }
table.grid tr:nth-child(even) td { background: #fafbfc; }
.num { text-align: right !important; }

label.f { display: block; font-size: 12px; color: #555; margin: 8px 0 3px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 7px 8px; border: 1px solid #c3ccd6; border-radius: 4px; font-size: 14px; background: #fff;
}
input[readonly] { background: #f0f3f6; }
textarea { min-height: 60px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.col { flex: 1 1 0; min-width: 150px; }
.col2 { flex: 2 1 0; min-width: 220px; }

.btn { display: inline-block; background: #0b5ed7; color: #fff; border: 0; border-radius: 4px; padding: 9px 18px; font-size: 14px; cursor: pointer; }
.btn:hover { background: #094cab; }
.btn.gray { background: #6c757d; }
.btn.gray:hover { background: #565e64; }
.btn.danger { background: #c0392b; }
.btn.small { padding: 4px 10px; font-size: 12px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: bold; }
.badge.UNPAID { background: #fde2e2; color: #b02a2a; border: 1px solid #f0b0b0; }
.badge.PAID { background: #dff5e1; color: #1e7e34; border: 1px solid #a9dfb2; }
.badge.PARTIAL { background: #fff3cd; color: #856404; border: 1px solid #ffe08a; }

.statgrid { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { flex: 1 1 180px; background: #fff; border: 1px solid #d9dee4; border-radius: 6px; padding: 14px; }
.stat .v { font-size: 24px; font-weight: bold; color: #14365d; }
.stat .l { font-size: 12px; color: #666; }

.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input { flex: 1; }

.feebox { max-width: 520px; margin-left: auto; }
.feebox table { width: 100%; border-collapse: collapse; }
.feebox td { padding: 5px 4px; font-size: 14px; }
.feebox td.lbl { color: #444; }
.feebox td.val { text-align: right; }
.feebox tr.grand td { font-size: 18px; font-weight: bold; color: #14365d; border-top: 2px solid #14365d; }
.feebox input { text-align: right; }

.tablewrap { overflow-x: auto; }
table.formgrid { border-collapse: collapse; width: 100%; min-width: 900px; }
table.formgrid th, table.formgrid td { border: 1px solid #d9dee4; padding: 4px; font-size: 12px; }
table.formgrid th { background: #eef2f7; font-size: 11px; white-space: nowrap; }
table.formgrid input, table.formgrid select { padding: 4px 5px; font-size: 12px; }
.w60 { width: 60px; } .w80 { width: 80px; } .w100 { width: 100px; } .w140 { width: 140px; } .w200 { width: 200px; }

.alert { background: #dff5e1; border: 1px solid #a9dfb2; color: #1e7e34; padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
.error { background: #fde2e2; border: 1px solid #f0b0b0; color: #b02a2a; padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
.hint { font-size: 12px; color: #777; }
.footerline { text-align: center; font-size: 12px; color: #888; padding: 18px 0 30px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }

/* Print (waybill view) */
@media print {
  .topbar, .toolbar, .noprint, .footerline { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; margin: 0; padding: 0; }
  .card { border: 1px solid #000; border-radius: 0; page-break-inside: avoid; }
}
