/* Four Season Vege Admin - standalone PHP version */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Arial, sans-serif; background: #f3f4f6; color: #111; font-size: 15px; }
a { color: #15803d; }
.topbar { background: #16a34a; color: #fff; padding: 10px 16px; }
.topbar .brand { font-weight: 700; font-size: 18px; }
.topbar .sub { font-size: 13px; opacity: 0.9; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; background: #15803d; padding: 8px 12px; }
.nav a { color: #fff; text-decoration: none; padding: 7px 12px; border-radius: 6px; white-space: nowrap; }
.nav a:hover, .nav a.active { background: #166534; }
.nav a.logout { margin-left: auto; background: #b91c1c; }
.langswitch { display: inline-flex; gap: 0; margin-left: 8px; align-self: center; }
.langswitch a { padding: 5px 10px; border: 1px solid rgba(255,255,255,0.6); }
.langswitch a:first-child { border-radius: 6px 0 0 6px; }
.langswitch a:last-child { border-radius: 0 6px 6px 0; }
.langswitch a.active { background: #166534; }
.loginbox .langswitch { margin: 0 0 12px auto; display: flex; width: fit-content; }
.loginbox .langswitch a { color: #15803d; border-color: #15803d; }
.loginbox .langswitch a.active { background: #15803d; color: #fff; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 14px 0 8px; }
form.inline { display: inline; }
label { display: block; margin: 8px 0 2px; font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
    width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; background: #fff;
}
input[type=number] { text-align: left; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
button, .btn { background: #16a34a; color: #fff; border: 0; padding: 9px 16px; border-radius: 6px; cursor: pointer; font-size: 15px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #15803d; }
.btn.grey { background: #6b7280; }
.btn.red { background: #b91c1c; }
.btn.blue { background: #2563eb; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { border-bottom: 1px solid #e5e7eb; padding: 8px 10px; text-align: left; vertical-align: top; }
table.list th { background: #f9fafb; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; color: #fff; white-space: nowrap; }
.badge.green { background: #16a34a; }
.badge.blue { background: #2563eb; }
.badge.grey { background: #6b7280; }
.badge.red { background: #b91c1c; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: #dcfce7; color: #166534; }
.flash.err { background: #fee2e2; color: #991b1b; }
.hint { color: #b45309; }
.muted { color: #6b7280; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.kpi .v { font-size: 20px; font-weight: 700; }
.loginbox { max-width: 420px; margin: 60px auto; }

/* 打印单据：固定列宽、宽松内边距、数字右对齐、单号日期不换行 */
.sheet { background: #fff; padding: 24px; max-width: 800px; margin: 0 auto; color: #000; }
.sheet h1 { font-size: 24px; margin-bottom: 4px; }
.sheet .meta { margin-bottom: 4px; }
.sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 16px 0; }
.sheet th, .sheet td { border-bottom: 1px solid #999; padding: 10px 12px; text-align: left; vertical-align: top; word-wrap: break-word; }
.sheet th { background: #eee; }
.sheet td.num, .sheet th.num { text-align: right; white-space: nowrap; }
.sheet td.nowrap, .sheet th.nowrap { white-space: nowrap; }
.subtotal { border-top: 3px solid #000; margin-top: 8px; padding-top: 10px; width: 100%; }
.subtotal .row { display: flex; justify-content: space-between; padding: 4px 0; }
.subtotal .row.total { font-weight: 700; font-size: 17px; }
@media print {
    body { background: #fff; }
    .topbar, .nav, .noprint { display: none !important; }
    .wrap { max-width: none; padding: 0; }
    .sheet { box-shadow: none; padding: 0; }
}
