* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    background: #f4f5f7;
    color: #222;
}

/* ── 로그인 화면 ───────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: #fff;
    padding: 40px 36px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 320px;
}
.login-box h1 { font-size: 20px; margin: 0 0 24px; text-align: center; }
.login-box input {
    width: 100%; padding: 12px; margin-bottom: 12px;
    border: 1px solid #ddd; border-radius: 8px; font-size: 15px;
}
.login-box button {
    width: 100%; padding: 12px; border: none; border-radius: 8px;
    background: #2563eb; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.login-box button:hover { background: #1d4ed8; }
.error-msg { color: #d33; font-size: 13px; margin-bottom: 12px; text-align: center; }

/* ── 공통 레이아웃 ─────────────────────────── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; padding: 14px 24px; border-bottom: 1px solid #e5e7eb;
}
.topbar .brand { font-weight: 700; font-size: 18px; }
.topbar nav a {
    margin-right: 18px; text-decoration: none; color: #444; font-size: 14px; font-weight: 500;
}
.topbar nav a.active { color: #2563eb; }
.topbar .user-info { font-size: 13px; color: #666; }
.topbar .user-info a { margin-left: 12px; color: #d33; text-decoration: none; }

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

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; margin-bottom: 24px; }
.card {
    background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card .label { font-size: 13px; color: #777; margin-bottom: 6px; }
.card .value { font-size: 24px; font-weight: 700; }
.card.deposit .value { color: #059669; }
.card.withdrawal .value { color: #d33; }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select { padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.filters button, .btn {
    padding: 8px 16px; border: none; border-radius: 6px; background: #2563eb; color: #fff;
    font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn.secondary { background: #6b7280; }
.btn.excel { background: #059669; }
.btn.danger { background: #d33; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid #eee; }
th { background: #fafafa; color: #555; font-weight: 600; }
tr.deposit td.type { color: #059669; font-weight: 600; }
tr.withdrawal td.type { color: #d33; font-weight: 600; }
/* 위험 입금(예금주 숫자 포함 또는 100원 미만): 셀 하나하나에 직접 배경을 칠해서
   브라우저마다 tr 배경이 씹히는 문제 없이 항상 확실하게 보이도록 함. !important로
   다른 규칙(줄무늬, hover 등)과 충돌해도 절대 가려지지 않게 고정. */
tr.risky td { background: #fecaca !important; font-weight: 600; }
tr.risky td.type { color: #b91c1c; }
tr.risky:hover td { background: #fca5a5 !important; }
/* 새로 들어온 행 반짝임 효과: 위험 행은 애니메이션이 빨간 배경을 1.6초간 가려버리므로
   제외하고, 일반 입출금 행에만 적용 */
tr.new-row:not(.risky) { animation: flashRow 1.6s ease-out; }
@keyframes flashRow { from { background: #fef9c3; } to { background: transparent; } }

.toggle { display: inline-flex; align-items: center; gap: 8px; margin-right: 20px; font-size: 14px; }
.switch { position: relative; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: .2s;
}
.slider:before {
    content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: white; border-radius: 50%; transition: .2s;
}
input:checked + .slider { background: #2563eb; }
input:checked + .slider:before { transform: translateX(18px); }

.empty-state { text-align: center; padding: 60px 0; color: #999; }

.raw-msg { font-size: 12px; color: #666; background: #f7f7f7; padding: 8px; border-radius: 6px; white-space: pre-wrap; }
.highlightable { cursor: text; user-select: text; }
.token-box { font-family: monospace; background: #f0f0f0; padding: 10px; border-radius: 6px; word-break: break-all; }
