:root {
  --accent: #2f6fed;
  --accent-dark: #2a63d4;
  --ink: #1e2633;
  --muted: #7b8794;
  --line: #e6eaf0;
  --bg: #eef1f6;
  --green: #12a150;
  --red: #e5484d;
  --orange: #e08600;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Malgun Gothic", "맑은 고딕", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}

/* ---------- 로그인 ---------- */
body.center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  width: 360px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px 30px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(30, 38, 51, .08);
}
.login-card .logo {
  width: 46px; height: 46px; margin: 0 auto 12px;
  background: var(--accent); color: #fff;
  border-radius: 12px; font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { margin: 0; font-size: 24px; font-weight: 800; }
.login-card .sub { margin: 4px 0 18px; color: var(--muted); font-size: 13px; }
.login-card input {
  width: 100%; margin-bottom: 10px;
  padding: 11px 13px; font-size: 14px;
  border: 1px solid #dbe1ea; border-radius: 10px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.error {
  color: var(--red); font-size: 12.5px; margin: 4px 0 10px;
  text-align: center; line-height: 1.4;
}

/* ---------- 버튼 ---------- */
button, .dl, .dl-excel { font-family: inherit; cursor: pointer; }
.primary {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 800; padding: 11px 26px;
}
.primary:hover { background: var(--accent-dark); }
.primary:disabled { background: #a9c1f5; cursor: default; }
.login-card .primary { width: 100%; margin-top: 6px; }
.ghost {
  background: #fff; color: var(--muted); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 14px; font-size: 12.5px;
}
.ghost:hover { color: var(--ink); border-color: #cdd6e2; }

/* ---------- 상단바 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 26px; background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar .title { font-size: 19px; font-weight: 800; }
.topbar .store { color: var(--ink); }
.topbar .accent { color: var(--accent); }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.topbar .who { color: #5b6572; font-size: 13px; }
.chip {
  background: #eef3ff; color: var(--accent); border-radius: 20px;
  padding: 4px 13px; font-size: 12px; font-weight: 800;
}
.inline { display: inline; }
select {
  font-family: inherit; font-size: 12.5px; font-weight: 800;
  color: var(--accent); background: #eef3ff;
  border: 1px solid #d5e1ff; border-radius: 9px; padding: 6px 10px;
}

/* ---------- 툴바 ---------- */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 26px; background: #fff;
  border-bottom: 1px solid var(--line);
}
.tool-label { color: #5b6572; font-weight: 700; margin-right: 4px; }
.tilde { color: #98a2b3; }
.spacer { flex: 1; }
input[type=date] {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid #dbe1ea; border-radius: 9px; padding: 8px 12px;
  background: #fff; outline: none;
}
input[type=date]:focus { border-color: var(--accent); }

/* ---------- 요약 카드 ---------- */
.summary {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; padding: 22px 26px 8px;
}
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
}
.card.stat { padding: 16px 18px; }
.card.stat .k { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.card.stat .v { font-size: 30px; font-weight: 800; margin-top: 2px; }

/* ---------- 상태바 ---------- */
.statusbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 26px; background: #fff;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
#status { color: var(--muted); font-size: 12.5px; }
.dl-excel {
  display: inline-flex; align-items: center; gap: 8px;
  background: #217346; color: #fff; font-size: 13px; font-weight: 800;
  text-decoration: none; border: none; border-radius: 9px;
  padding: 9px 16px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(33, 115, 70, .35);
}
.dl-excel:hover { background: #1a5b38; }
.dl-excel .xls-ico { display: block; flex: none; }

/* ---------- 표 ---------- */
.table-wrap { padding: 14px 26px 30px; position: relative; }
table { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th {
  background: #f6f8fb; color: #66707d; font-size: 12.5px; font-weight: 800;
  text-align: left; padding: 11px 12px; border-bottom: 1px solid #e9edf3;
  white-space: nowrap;
}
td {
  padding: 11px 12px; border-bottom: 1px solid #e6ebf2; font-size: 13.5px;
  vertical-align: middle; white-space: nowrap;
}
tr:hover td { background: #fafcff; }
tr.group-end td { border-bottom: 2px solid #c8d3e0; }
td.c { text-align: center; }
.grade { font-weight: 800; }
td.reason { color: #5b6572; white-space: normal; word-break: break-word; }
.empty-row td {
  text-align: center; color: #a3adba; font-size: 13.5px;
  padding: 46px 12px; background: #fff;
}
.empty-row:hover td { background: #fff; }

/* ---------- 매장 선택 ---------- */
.center-wrap {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px;
}
.card.wide { width: 420px; padding: 26px 24px; }
.card.wide h2 { margin: 0 0 4px; font-size: 18px; }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.store-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.store-row:hover { background: #f7faff; border-color: #d5e1ff; }
.store-row input { accent-color: var(--accent); }
.row-end { display: flex; justify-content: flex-end; margin-top: 14px; }
