/* ===== 克丽缇娜 · 门店经营系统 ===== */
:root {
  --primary: #b8624a;
  --primary-2: #d98a6a;
  --primary-soft: #f7ece7;
  --ink: #2f2926;
  --ink-2: #6b625c;
  --ink-3: #9b918a;
  --line: #ece5df;
  --bg: #f7f4f1;
  --card: #fffdfb;
  --green: #4f8a6d;
  --green-soft: #e8f2ec;
  --amber: #c8923c;
  --amber-soft: #f9f0df;
  --red: #c0554e;
  --red-soft: #f9eae8;
  --blue: #557a9c;
  --blue-soft: #eaf0f5;
  --shadow: 0 2px 14px rgba(80, 60, 45, .06);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button, input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }
button { cursor: pointer; }

/* ===== 品牌 ===== */
.brand-mark {
  width: 54px; height: 54px; border-radius: 16px; flex: none;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(184, 98, 74, .28);
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 19px; }

/* ===== 登录 ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 10%, #f3ded2 0%, transparent 45%),
              radial-gradient(circle at 85% 90%, #e9d9d0 0%, transparent 40%), var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card); border-radius: 22px;
  padding: 38px 34px; box-shadow: 0 20px 60px rgba(90, 60, 45, .14);
}
.login-brand { text-align: center; margin-bottom: 30px; }
.login-brand .brand-mark { margin: 0 auto 18px; }
.login-brand h1 { font-size: 20px; letter-spacing: .5px; }
.login-brand p { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.field-label { display: block; color: var(--ink-2); font-size: 12px; margin: 16px 0 6px; font-weight: 600; }
.field-input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); transition: border .15s;
}
.field-input:focus { border-color: var(--primary-2); }
.login-err { color: var(--red); font-size: 12px; min-height: 20px; margin-top: 8px; }
.login-hint { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 16px; line-height: 1.7; }

/* ===== 按钮 ===== */
.btn {
  padding: 9px 16px; border: none; border-radius: 9px; font-weight: 600;
  transition: transform .12s, opacity .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-block { width: 100%; padding: 12px; margin-top: 6px; }
.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary-2); color: var(--primary); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-danger { background: var(--red-soft); color: var(--red); }

/* ===== 布局 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background: #3a302c; color: #efe7e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px; padding: 20px 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-title { font-size: 15px; font-weight: 700; }
.brand-sub { font-size: 11px; color: #a99c95; }
.nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-group-label {
  font-size: 10px; letter-spacing: 1.5px; color: #8a7e77;
  padding: 14px 10px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 9px; color: #cfc4bd; cursor: pointer; font-size: 13px;
  transition: background .15s, color .15s; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-ico { width: 18px; text-align: center; font-size: 15px; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { font-size: 12px; color: #cfc4bd; margin-bottom: 10px; }
.side-user b { color: #fff; font-size: 13px; }
.btn-logout {
  width: 100%; padding: 8px; background: rgba(255,255,255,.08); color: #cfc4bd;
  border: none; border-radius: 8px; font-size: 12px;
}
.btn-logout:hover { background: rgba(255,255,255,.15); color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.view-title { font-size: 17px; font-weight: 700; }
.view-subtitle { font-size: 11px; color: var(--ink-3); }
.store-filter {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font-size: 12px;
}
.date-chip { font-size: 12px; color: var(--ink-3); }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--ink); }
.content { padding: 24px 28px 60px; max-width: 1400px; }

/* ===== 通用卡片/网格 ===== */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 700; }
.card-sub { font-size: 11px; color: var(--ink-3); }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.mb16 { margin-bottom: 16px; }

/* ===== 统计卡 ===== */
.stat {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); border-left: 3px solid var(--primary);
}
.stat .label { font-size: 12px; color: var(--ink-2); }
.stat .value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.5px; }
.stat .foot { font-size: 11px; color: var(--ink-3); }
.stat.green { border-left-color: var(--green); }
.stat.amber { border-left-color: var(--amber); }
.stat.blue { border-left-color: var(--blue); }
.up { color: var(--green); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; color: var(--ink-3); font-weight: 600;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid #f4efeb; font-size: 13px; }
.tbl tbody tr:hover { background: #fdf9f6; }
.tbl .right { text-align: right; }
.tbl .center { text-align: center; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; margin: 1px 3px 1px 0; }
.tag.primary { background: var(--primary-soft); color: var(--primary); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.gray { background: #f1edea; color: var(--ink-2); }

/* ===== 进度条 ===== */
.bar { height: 8px; background: #f0eae5; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--primary)); border-radius: 6px; }
.bar.green > i { background: var(--green); }
.bar.amber > i { background: var(--amber); }

/* ===== 搜索/工具条 ===== */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search {
  flex: 1; min-width: 200px; padding: 9px 13px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff;
}
.filter-select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .emoji { font-size: 36px; display: block; margin-bottom: 10px; opacity: .6; }

/* ===== 弹窗 ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(40,30,26,.45); }
.modal-box {
  position: relative; background: var(--card); border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.2);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-x { background: none; border: none; font-size: 24px; color: var(--ink-3); line-height: 1; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.form-row textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ===== 画像卡 ===== */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.profile-name { font-size: 16px; font-weight: 700; }
.profile-meta { font-size: 11px; color: var(--ink-3); }
.section-label { font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 16px 0 8px; }
.suggest-item {
  padding: 9px 12px; background: var(--amber-soft); border-radius: 9px;
  font-size: 12px; color: #7a5c22; margin-bottom: 7px; display: flex; gap: 8px;
}

/* ===== 待办/提醒条 ===== */
.notice {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px;
  font-size: 12px; margin-bottom: 8px;
}
.notice.warn { background: var(--amber-soft); color: #7a5c22; }
.notice.info { background: var(--blue-soft); color: #3d5c78; }
.notice .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #3a302c; color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .date-chip { display: none; }
}
