/* Hoa Vinh ERP — giao diện gọn kiểu bảng Excel. Không cần build. */
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", Roboto, Arial, sans-serif; color: #1f2937; background: #f3f4f6; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 48px; background: #1e3a5f; color: #fff; }
.topbar a { color: #e5edf7; }
.topbar a.active { color: #fff; font-weight: 600; border-bottom: 2px solid #fbbf24; padding-bottom: 2px; }
.topbar .brand { font-weight: 700; color: #fff; margin-right: 12px; }
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
.topbar .who { font-size: 13px; color: #cbd5e1; }

.banner { padding: 6px 20px; font-size: 13px; }
.banner.sandbox { background: #fef3c7; color: #92400e; }

main { max-width: 1280px; margin: 20px auto; padding: 0 20px; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 10px; }

.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; padding: 16px 18px; margin-bottom: 16px; }

.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
.flash.ok { background: #dcfce7; color: #166534; }
.flash.err { background: #fee2e2; color: #991b1b; }
.flash ul { margin: 0; padding-left: 18px; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.grid th, table.grid td { border: 1px solid #d1d5db; padding: 5px 8px; vertical-align: top; text-align: left; }
table.grid th { background: #e8eef6; font-weight: 600; white-space: nowrap; }
table.grid tr:nth-child(even) td { background: #fafafa; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }

.form-row { display: grid; grid-template-columns: 200px 1fr; gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.form-row label { font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%; max-width: 520px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 4px; font: inherit;
}
textarea { min-height: 70px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-width: 110px; }

.btn { display: inline-block; padding: 6px 14px; border: 1px solid #1e3a5f; background: #1e3a5f; color: #fff; border-radius: 4px; cursor: pointer; font: inherit; }
.btn:hover { background: #274b77; text-decoration: none; }
.btn.secondary { background: #fff; color: #1e3a5f; }
.btn.danger { background: #b91c1c; border-color: #b91c1c; }
.btn.small { padding: 2px 8px; font-size: 12px; }
.link-btn { background: none; border: 0; color: #cbd5e1; cursor: pointer; font: inherit; padding: 0; }

.muted { color: #6b7280; font-size: 12px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; background: #e5e7eb; }
.badge.on { background: #dcfce7; color: #166534; }
.badge.off { background: #fee2e2; color: #991b1b; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
details.edit summary { cursor: pointer; color: #1d4ed8; font-size: 12px; }

.login-box { max-width: 380px; margin: 80px auto; }
.login-box .form-row { grid-template-columns: 1fr; }
.login-box input { max-width: none; }
pre.values { margin: 0; white-space: pre-wrap; font-size: 12px; }

/* Trạng thái PR */
.st { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 12px; white-space: nowrap; }
.st-net { background: #fef3c7; color: #92400e; }
.st-approval { background: #e0e7ff; color: #3730a3; }
.st-customer { background: #dbeafe; color: #1e40af; }
.st-done { background: #dcfce7; color: #166534; }
.st-cancel { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.urgent { color: #b91c1c; font-weight: 700; }
table.grid th a { color: inherit; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.filters input, .filters select { width: auto; min-width: 120px; padding: 4px 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
