* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  margin: 0; background: #f4f6f8; color: #1f2937;
}
header {
  background: #2f7d4f; color: #fff; padding: 12px 20px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; }
nav a {
  color: #e8f5ee; text-decoration: none; margin-right: 14px; font-size: 15px;
}
nav a:hover { color: #fff; text-decoration: underline; }
main { max-width: 1000px; margin: 24px auto; padding: 0 16px; }
footer { text-align: center; color: #9ca3af; font-size: 12px; padding: 30px 0; }

h1 { font-size: 22px; margin: 8px 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; color: #374151; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: #e7f6ec; color: #1a7f3c; border: 1px solid #b8e6c6; }
.flash.err { background: #fdeaea; color: #b42323; border: 1px solid #f4c2c2; }

.summary-bar { display: flex; gap: 20px; margin-bottom: 16px; }
.summary-bar span { background: #fff; padding: 8px 14px; border-radius: 8px; border: 1px solid #e5e7eb; font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 18px; }
.card-title { font-size: 14px; color: #6b7280; }
.card-stock { font-size: 34px; font-weight: 700; color: #2f7d4f; }
.card-stock small { font-size: 14px; font-weight: 400; color: #9ca3af; margin-left: 4px; }
.card-sub { font-size: 13px; color: #6b7280; margin-top: 2px; }
.card-meta { margin-top: 12px; font-size: 13px; color: #374151; line-height: 1.7; border-top: 1px solid #f0f0f0; padding-top: 10px; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eef0f2; }
th { background: #f3f5f7; color: #4b5563; font-weight: 600; }
tr.danger { background: #fdeaea; }
tr.warn { background: #fff6e5; }
.muted { color: #9ca3af; }
td.num, th.num { text-align: right; }

.form { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; max-width: 460px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #4b5563; }
.form input, .form select { padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px; }
.form button, .form-inline button { background: #2f7d4f; color: #fff; border: 0; padding: 11px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.form button:hover, .form-inline button:hover { background: #276841; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.form-inline label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.form-inline input { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; }

.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }

/* 헤더 우측 (사용자/백업/로그아웃) */
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.whoami { color: #e8f5ee; font-size: 13px; }
.backup-btn { color: #fff; background: rgba(255,255,255,0.18); padding: 5px 10px; border-radius: 6px; text-decoration: none; font-size: 13px; }
.backup-btn:hover { background: rgba(255,255,255,0.32); }
.logout { color: #cfe9d8; text-decoration: none; font-size: 13px; }
.logout:hover { color: #fff; }

/* 로그인 화면 */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box { background: #fff; padding: 32px; border-radius: 14px; border: 1px solid #e5e7eb; width: 320px; }
.login-brand { font-size: 20px; font-weight: 700; color: #2f7d4f; text-align: center; margin-bottom: 18px; }

/* 네이버 버튼 */
.naver-box { background: #eef6f0; border: 1px solid #cfe6d6; border-radius: 10px; padding: 14px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.naver-box button { background: #03c75a; color: #fff; border: 0; padding: 10px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.naver-box button:hover { background: #02a94d; }
.naver-box button:disabled { background: #9bd9b3; cursor: default; }

/* 외부 모니터링 카드 */
.card.monitor { background: #f8fafb; border-style: dashed; }
.card.monitor .card-stock { color: #4b5563; font-size: 28px; }

/* 삭제 버튼 */
.del-btn { margin-top: 12px; background: #d64545; color: #fff; border: 0; padding: 9px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.del-btn:hover { background: #b83a3a; }
