/* 收银系统公共样式（后台 + 收银台共用） */
:root {
  --primary: #D9382C;
  --primary-dark: #B92A20;
  --primary-light: #FDECEA;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --green: #16A34A;
  --blue: #2563EB;
  --orange: #D97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 8px; font-size: 14px; transition: .15s; border: 1px solid transparent; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; border-color: #FCA5A5; color: #DC2626; }
.btn-danger:hover { background: #FEF2F2; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th { text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #F3F4F6; color: var(--muted); }
.tag-red { background: var(--primary-light); color: var(--primary); }
.tag-green { background: #DCFCE7; color: var(--green); }
.tag-gray { background: #F3F4F6; color: var(--muted); }
.tag-blue { background: #DBEAFE; color: var(--blue); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-head .close { font-size: 20px; color: var(--muted); line-height: 1; padding: 4px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* 提示 */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.2); animation: toastIn .2s; }
.toast.error { background: #DC2626; }
.toast.success { background: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 36px; width: 100%; max-width: 380px; }
.login-card .logo { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-card .logo em { color: var(--primary); font-style: normal; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 13px; }
.login-card .btn { width: 100%; height: 42px; margin-top: 6px; }
.login-tip { margin-top: 16px; padding: 10px 12px; background: #F9FAFB; border-radius: 8px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.money { font-variant-numeric: tabular-nums; }
