* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 속성이 항상 우선하도록 (display:flex/grid 요소가 hidden을 무시하는 문제 방지) */
[hidden] { display: none !important; }

:root {
  --line: #e5e5e5;
  --line-strong: #d0d0d0;
  --text: #1a1a1a;
  --muted: #767676;
  --bg-soft: #fafafa;
  --accent: #1a1a1a;
}

html, body {
  background: #ffffff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", "맑은 고딕", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

/* 로그인 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-title { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 6px; }
.login-box input {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.login-box input:focus { border-color: #999; }
.login-box button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
}
.login-error { color: #c0392b; font-size: 12.5px; min-height: 16px; text-align: center; }

/* 상단바 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 15px; font-weight: 600; }
.btn-plain {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
}
.btn-plain:hover { background: var(--bg-soft); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

.list-head, .detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.list-head span { font-size: 14px; color: var(--muted); }

/* 그리드 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  text-align: left;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.card-phone { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.card-meta { margin-top: 10px; color: var(--muted); font-size: 12.5px; display: flex; gap: 14px; }
.card-seen { margin-top: 8px; color: #9a9a9a; font-size: 12px; }

.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* 상세 */
.detail-phone { font-size: 17px; font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tab {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

/* 테이블 */
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}
tbody tr:hover { background: var(--bg-soft); }
.col-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-body { word-break: break-word; }

.tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.tag-in { background: #eef4ff; color: #2456c4; }
.tag-out { background: #eefaf0; color: #1f8a4c; }
.tag-miss { background: #fdeeee; color: #c0392b; }
.tag-etc { background: #f2f2f2; color: #666; }

.panel-empty { color: var(--muted); padding: 36px 0; text-align: center; }
