/* ============================================================
   LUMORA Admin — 管理后台样式
   ============================================================ */
:root {
  --brand: #1c2b24;
  --brand-2: #26392f;
  --gold: #c9a227;
  --accent: #e9c199;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #24302a;
  --muted: #7b8880;
  --border: #e5eae7;
  --shadow: 0 1px 3px rgba(20,40,30,.06), 0 6px 20px rgba(20,40,30,.04);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
svg { width: 20px; height: 20px; }

/* ===== 登录 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16241d 0%, #26392f 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 14px;
  padding: 44px 38px 30px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.login-brand { font-size: 22px; font-weight: 800; letter-spacing: .04em; color: var(--brand); }
.login-brand span { color: var(--gold); }
.login-card h1 { font-size: 26px; margin: 26px 0 6px; color: var(--brand); }
.login-sub { color: var(--muted); margin: 0 0 28px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #55635b; }
.pw-field { position: relative; }
.pw-field input {
  width: 100%; padding: 13px 44px 13px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; transition: .2s;
}
.pw-field input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(38,57,47,.1); }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; }
.pw-eye svg { width: 18px; height: 18px; }
.login-msg { min-height: 20px; margin: 10px 0 4px; color: #c0392b; font-size: 13px; }
.btn-login {
  width: 100%; padding: 13px; margin-top: 6px;
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: .2s;
}
.btn-login:hover { background: var(--brand-2); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }
.back-site { display: block; text-align: center; margin-top: 22px; color: var(--muted); text-decoration: none; font-size: 13px; }
.back-site:hover { color: var(--brand); }

/* ===== 布局 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--brand); color: #cfd8d2;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { padding: 26px 24px 24px; font-size: 20px; font-weight: 800; color: #fff; letter-spacing: .03em; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand span { color: var(--gold); }
.side-brand small { display: block; font-size: 10px; letter-spacing: .25em; color: rgba(255,255,255,.4); margin-top: 4px; font-weight: 600; }
.side-nav { padding: 16px 12px; flex: 1; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 4px;
  background: transparent; color: #b9c6bd; border: 0; border-radius: 8px;
  font-size: 14px; cursor: pointer; text-align: left; transition: .15s;
}
.nav-item svg { width: 19px; height: 19px; opacity: .8; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav-item em { margin-left: auto; font-style: normal; font-size: 11px; background: var(--gold); color: #1c2b24; border-radius: 10px; padding: 1px 7px; font-weight: 700; min-width: 20px; text-align: center; }
.nav-item em:empty { display: none; }
.side-bottom { padding: 16px 12px 24px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-link { display: block; width: 100%; padding: 10px 14px; color: #b9c6bd; text-decoration: none; font-size: 13px; border: 0; background: none; text-align: left; border-radius: 8px; cursor: pointer; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.logout { color: #e8a89f; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 32px; background: #fff; border-bottom: 1px solid var(--border);
}
.topbar h2 { font-size: 20px; margin: 0; color: var(--brand); }
.page-sub { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; color: var(--brand); padding: 6px; }
.refresh-btn {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; color: var(--text); font-size: 13px; transition: .15s;
}
.refresh-btn:hover { border-color: var(--brand-2); color: var(--brand); }
.refresh-btn svg { width: 16px; height: 16px; }

.content { padding: 28px 32px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border-radius: 12px; padding: 20px;
  display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow);
}
.stat-icon { width: 46px; height: 46px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.green { background: #e8f3ed; color: #2e8b57; }
.stat-icon.blue { background: #e7eefb; color: #3b6fd4; }
.stat-icon.amber { background: #fbf1e2; color: #c98a1e; }
.stat-icon.purple { background: #f0eafb; color: #7d52c7; }
.stat-label { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--brand); line-height: 1.1; }

.table-card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-box input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--border); border-radius: 8px; outline: none; font-size: 13px; }
.search-box input:focus { border-color: var(--brand-2); }
.record-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 13px 20px; background: #fafbfa; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfb; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.cell-clamp { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.status.pending { background: #fbf1e2; color: #b07d12; }
.status.paid { background: #e8f3ed; color: #2e8b57; }
.status.other { background: #eef0ef; color: #6b776f; }
.detail-btn { background: none; border: 0; color: #3b6fd4; cursor: pointer; font-size: 12px; padding: 0; }
.detail-btn:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; opacity: .4; }
.empty-state p { margin-top: 12px; }

/* ===== 弹窗 ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,32,26,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; max-height: 80vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; color: var(--brand); }
.modal-head button { background: none; border: 0; font-size: 26px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 24px; }
.detail-row { margin-bottom: 16px; }
.detail-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.detail-row .val { font-size: 14px; color: var(--text); word-break: break-word; line-height: 1.6; }
.items-list { background: #fafbfa; border-radius: 8px; padding: 12px 16px; }
.items-list div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--brand); color: #fff; padding: 12px 22px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 960px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: block; }
  .topbar { padding: 16px 18px; }
  .content { padding: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 14px; gap: 12px; }
  .stat-value { font-size: 20px; }
}
