* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
  margin: 0;
  background: #f4f6f8;
  color: #222;
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}
h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: #16283b; }
h2 { font-weight: 700; }

.topbar {
  background: linear-gradient(135deg, #1F3B57, #16283f);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-group { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.2px; }
.today-date { font-size: 13px; color: #cfd9e3; }
.topbar nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }
.content { padding: 24px 20px 60px; max-width: 1400px; margin: 0 auto; }
.hint { color: #5a6470; font-size: 13.5px; margin: 0 0 20px; }
.hint a { color: #1F3B57; font-weight: 600; }

.login-body {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; background: radial-gradient(circle at top, #274a6e, #14202e);
}
.login-box {
  background: #fff; padding: 36px 32px; border-radius: 14px;
  display: flex; flex-direction: column; gap: 12px; width: 300px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
.login-box h1 { font-size: 18px; margin: 0 0 8px; text-align: center; }
.login-box input { padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; }
.login-box input:focus { outline: none; border-color: #1F3B57; box-shadow: 0 0 0 3px rgba(31,59,87,0.15); }
.login-box button {
  background: #1F3B57; color: #fff; border: none; padding: 11px;
  border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600;
  transition: background 0.15s;
}
.login-box button:hover { background: #16283f; }
.error { color: #c0392b; font-size: 13px; }

.group h2 {
  background: #1F3B57; color: #fff; padding: 9px 16px;
  border-radius: 8px; font-size: 15px; margin-top: 30px; margin-bottom: 12px;
  letter-spacing: 0.2px;
}
.item-card {
  background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(20,30,40,0.07);
  border: 1px solid #edf0f2;
  overflow-x: auto;
  transition: box-shadow 0.15s;
}
.item-card:hover { box-shadow: 0 3px 10px rgba(20,30,40,0.1); }
.item-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.item-name { font-weight: 700; font-size: 16px; color: #16283b; }
.seo-input {
  flex: 1; min-width: 220px; padding: 7px 11px; border: 1px solid #dfe3e7; border-radius: 7px; font-size: 13px;
  transition: border-color 0.15s;
}
.seo-input:focus { outline: none; border-color: #1F3B57; }

.add-item-form { display: flex; gap: 8px; margin-bottom: 22px; }
.add-item-form input {
  padding: 9px 12px; border: 1px solid #ccd2d8; border-radius: 7px; font-size: 13px; width: 240px;
}
.add-item-form input:focus { outline: none; border-color: #1F3B57; }
.add-item-form button {
  background: #1F3B57; color: #fff; border: none; padding: 9px 18px;
  border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: background 0.15s;
}
.add-item-form button:hover { background: #16283f; }

.delete-item-btn, .delete-option-btn, .purge-item-btn, .purge-option-btn {
  background: #fff; color: #c0392b; border: 1px solid #e8bdb6; border-radius: 7px;
  padding: 5px 11px; font-size: 12px; cursor: pointer; font-weight: 500;
  transition: background 0.15s;
}
.delete-item-btn:hover, .delete-option-btn:hover,
.purge-item-btn:hover, .purge-option-btn:hover { background: #FFE6E6; }

.restore-item-btn, .restore-option-btn {
  background: #fff; color: #1F3B57; border: 1px solid #c3ccd4; border-radius: 7px;
  padding: 5px 11px; font-size: 12px; cursor: pointer; font-weight: 500; margin-right: 6px;
  transition: background 0.15s;
}
.restore-item-btn:hover, .restore-option-btn:hover { background: #E8EEF3; }

.price-input {
  width: 96px; box-sizing: border-box; text-align: right;
  padding: 6px 8px; border: 1px solid #dfe3e7; border-radius: 6px; font-size: 13px;
  font-family: inherit; background: #fff; color: #222;
  transition: border-color 0.15s;
}
.price-input:focus { outline: none; border-color: #1F3B57; box-shadow: 0 0 0 2px rgba(31,59,87,0.12); }
.price-input::placeholder { color: #b7bec5; }
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.price-input[type=number] { -moz-appearance: textfield; }

.add-option-row td { border-bottom: none; padding-top: 12px; }
.add-option-row input {
  padding: 6px 9px; border: 1px dashed #c3ccd4; border-radius: 6px; font-size: 13px;
  box-sizing: border-box;
}
.add-option-row .new-option-name { width: 150px; }
.add-option-row .new-option-price { width: 100px; text-align: right; }
.add-option-btn {
  background: #fff; color: #1F3B57; border: 1px solid #1F3B57; border-radius: 7px;
  padding: 6px 14px; font-size: 12px; cursor: pointer; font-weight: 600;
  transition: background 0.15s;
}
.add-option-btn:hover { background: #E8EEF3; }

.option-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
.option-table th, .option-table td {
  padding: 8px; border-bottom: 1px solid #f0f2f4; text-align: left; white-space: nowrap;
  vertical-align: middle;
}
.option-table th { color: #7a828a; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.option-table tbody tr:hover td { background: #fafbfc; }
.option-table td.num { text-align: right; }
.option-table td.price { background: #FFF3CC; font-weight: 700; }
.option-table td.margin { background: #E1F3E4; font-weight: 700; color: #0a5c1f; }
.option-table td.note { white-space: normal; color: #666; }

.status-badge {
  border: none; border-radius: 14px; padding: 4px 12px; font-size: 12px;
  cursor: pointer; font-weight: 600; transition: background 0.15s, transform 0.1s;
  background: #FCE5CD; /* 기본값: 미정 */
}
.status-badge:active { transform: scale(0.96); }
.status-badge[data-status="판매중"] { background: #D9EAD3; color: #0a5c1f; }
.status-badge[data-status="품절"] { background: #E2E3E5; color: #555; }

.supply-alert td { background: #FFF1E6; }
.supply-alert:hover td { background: #FFE9D6 !important; }
.alert-badge { color: #C0530B; font-weight: 700; }

.note-tag {
  display: inline-block; font-weight: 700; padding: 2px 8px; border-radius: 5px;
  font-size: 11.5px; white-space: nowrap;
}
.note-date { font-size: 11px; color: #9aa2a9; margin-left: 4px; }
.note-상승 { color: #b02a2a; background: #FFE2E2; }
.note-하락 { color: #1f5fbf; background: #E2ECFF; }
.note-변동없음 { color: #7d858c; background: #eef0f2; }
.note-매입불가전환 { color: #b25b06; background: #FFE9D6; }
.note-신규, .note-재입고, .note-최초기록 { color: #0a7a34; background: #DFF4E5; }
.note-수동수정, .note-수동추가 { color: #555; background: #ececec; }

.upload-form { display: flex; gap: 10px; margin-bottom: 22px; }
.upload-form input[type="file"] {
  padding: 8px; border: 1px solid #dfe3e7; border-radius: 7px; font-size: 13px; background: #fff;
}
.upload-form button, .item-head button {
  background: #1F3B57; color: #fff; border: none; padding: 9px 18px;
  border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: background 0.15s;
}
.upload-form button:hover { background: #16283f; }

.summary-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 24px; }
.stat-chip {
  background: #fff; border: 1px solid #e7eaed; border-radius: 10px;
  padding: 10px 16px; min-width: 96px; text-align: center;
  box-shadow: 0 1px 3px rgba(20,30,40,0.06);
}
.stat-chip .stat-num { display: block; font-size: 20px; font-weight: 700; color: #16283b; }
.stat-chip .stat-label { display: block; font-size: 12px; color: #7a828a; margin-top: 2px; }
.stat-chip.stat-상승 .stat-num { color: #b02a2a; }
.stat-chip.stat-하락 .stat-num { color: #1f5fbf; }
.stat-chip.stat-신규 .stat-num { color: #0a7a34; }
.stat-chip.stat-매입불가전환 .stat-num { color: #b25b06; }

.warning-box, .info-box {
  background: #FFF3CC; border-radius: 10px; padding: 14px 18px; margin: 14px 0;
  border: 1px solid #f4e2a3;
}
.info-box { background: #DDEBF7; border-color: #bcd6ea; }
.kind-상승 { background: #FFE6E6; }
.kind-하락 { background: #E6F0FF; }
.kind-신규 { background: #E1F3E4; }
.kind-매입불가전환 { background: #FFE9D6; }

.trash-table { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(20,30,40,0.07); }
.trash-actions { white-space: nowrap; }

.settings-form { background: #fff; border-radius: 12px; padding: 20px 24px; max-width: 480px;
  box-shadow: 0 1px 4px rgba(20,30,40,0.07); border: 1px solid #edf0f2; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f2f4; }
.settings-row label { font-size: 14px; color: #333; font-weight: 500; }
.settings-input-wrap { display: flex; align-items: center; gap: 6px; }
.settings-input-wrap input {
  width: 100px; text-align: right; padding: 7px 9px; border: 1px solid #dfe3e7; border-radius: 6px; font-size: 13px;
}
.settings-input-wrap input:focus { outline: none; border-color: #1F3B57; }
.settings-unit { font-size: 13px; color: #7a828a; width: 20px; }
.settings-save-btn {
  margin-top: 18px; background: #1F3B57; color: #fff; border: none; padding: 10px 22px;
  border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.settings-save-btn:hover { background: #16283f; }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.chart-card { background: #fff; border-radius: 10px; padding: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.chart-card img { width: 100%; border-radius: 6px; }
.change-text { font-size: 13px; color: #555; text-align: center; margin: 6px 0 0; }
