/* 零售餐饮 POS 系统全局样式 */
:root {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-light: #fff7ed;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --info: #2563eb;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text2: #64748b;
  --sidebar: #1e293b;
  --sidebar-active: #ea580c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--info); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); cursor: pointer; font-size: 14px;
  transition: all .15s; user-select: none; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 16px; border-radius: 10px; }
.btn-block { width: 100%; }

/* 输入 */
.input, .select, .textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--text); outline: none; transition: border .15s;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(234, 88, 12, .12); }
.textarea { resize: vertical; min-height: 60px; }
label.fld { display: block; margin-bottom: 12px; }
label.fld > span { display: block; font-size: 13px; color: var(--text2); margin-bottom: 5px; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }

/* 表格 */
.table-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl th { background: #f8fafc; color: var(--text2); font-weight: 600; position: sticky; top: 0; }
table.tbl tr:hover td { background: #fafafa; }

/* 徽标 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

/* Toast */
#toast-box { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 20px; border-radius: 8px; background: #1e293b; color: #fff; font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2); animation: toastIn .25s ease; max-width: 80vw;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; animation: fadeIn .15s;
}
.modal {
  background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  width: 480px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; animation: popIn .2s ease;
}
.modal.wide { width: 720px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 16px; }
.modal-close { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--text2); line-height: 1; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.95); } }

/* 表单行 */
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

/* 空状态 */
.empty { text-align: center; color: var(--text2); padding: 40px 0; font-size: 14px; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b 0%, #334155 55%, #ea580c 140%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px; width: 380px; max-width: 92vw; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-card .logo { text-align: center; margin-bottom: 24px; }
.login-card .logo .icon { width: 56px; height: 56px; border-radius: 14px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--text2); font-size: 13px; margin-bottom: 26px; }
.login-card .btn { margin-top: 6px; }
