:root {
  --ink: #191f28;
  --muted: #8b95a1;
  --paper: #eceff2;
  --card: #f7f8fa;
  --line: #dfe3e7;
  --green: #3182f6;
  --lime: #3182f6;
  --soft: #e8f3ff;
  --danger: #f04452;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard Variable", Pretendard, "Noto Sans KR", sans-serif;
  letter-spacing: -.018em;
}

.shell { grid-template-columns: 286px 1fr; }

.sidebar {
  height: 100vh;
  padding: 28px 18px;
  background: rgba(244,246,248,.97);
  color: var(--ink);
  border-right: 1px solid #eef0f2;
  backdrop-filter: blur(16px);
}

.brand { gap: 11px; margin: 0 10px 42px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #3182f6;
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  transform: rotate(-6deg);
  box-shadow: 0 6px 14px rgba(49,130,246,.22);
}
.brand b { font-size: 16px; font-weight: 750; letter-spacing: -.04em; }
.brand small { margin-top: 2px; color: #b0b8c1; font-size: 8px; letter-spacing: 1.4px; }

.sidebar nav { gap: 5px; }
.nav-item {
  padding: 13px 14px;
  border-radius: 12px;
  color: #6b7684;
  font-size: 14px;
  font-weight: 650;
  transition: background .18s, color .18s, transform .18s;
}
.nav-item span { color: #8b95a1; }
.nav-item.active, .nav-item:hover { background: #f2f4f6; color: #191f28; }
.nav-item:hover { transform: translateX(2px); }
.nav-item.active span { color: #3182f6; }

.sidebar-foot button, .import-label {
  border: 0;
  background: #f2f4f6;
  color: #6b7684;
  border-radius: 10px;
  font-weight: 650;
}
.sidebar-foot button:hover, .import-label:hover { background: #e5e8eb; color: #333d4b; }
.sidebar-foot small { color: #b0b8c1; }

.side-calendar {
  margin-top: 26px;
  padding: 16px 12px 13px;
  border: 1px solid #eef0f2;
  border-radius: 18px;
  background: #fafbfc;
}
.calendar-head { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; margin-bottom: 12px; }
.calendar-head b { text-align: center; font-size: 13px; font-weight: 750; }
.calendar-head button { width: 28px; height: 28px; border: 0; border-radius: 9px; background: transparent; color: #6b7684; font-size: 21px; line-height: 1; cursor: pointer; }
.calendar-head button:hover { background: #e8ebed; color: #191f28; }
.calendar-week, .calendar-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.calendar-week { margin-bottom: 5px; }
.calendar-week span { color: #b0b8c1; font-size: 9px; text-align: center; }
.calendar-day, .calendar-empty { aspect-ratio: 1; }
.calendar-day { position: relative; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #6b7684; font-size: 10px; cursor: pointer; }
.calendar-day:hover { background: #eef6ff; color: #3182f6; }
.calendar-day.today span { color: #3182f6; font-weight: 800; }
.calendar-day.selected { background: #3182f6; color: #fff; font-weight: 800; box-shadow: 0 4px 10px rgba(49,130,246,.2); }
.calendar-day.selected.today span { color: #fff; }
.calendar-day i { position: absolute; bottom: 4px; width: 3px; height: 3px; border-radius: 50%; background: #3182f6; }
.calendar-day.selected i { background: #fff; }
.day-summary { margin-top: 13px; padding: 13px; border-radius: 13px; background: #f4f6f8; box-shadow: 0 1px 4px rgba(0,0,0,.035); }
.day-summary>div { display: flex; justify-content: space-between; align-items: center; }
.day-summary>div span { color: #333d4b; font-size: 12px; font-weight: 750; }
.day-summary>div small { color: #b0b8c1; font-size: 9px; }
.day-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.day-summary dl div { min-width: 0; }
.day-summary dt { color: #8b95a1; font-size: 9px; }
.day-summary dd { overflow: hidden; margin: 3px 0 0; color: #191f28; font-size: 12px; font-weight: 800; text-overflow: ellipsis; }
.day-summary dl div:last-child dd { color: #3182f6; }

.sales-calendar { padding: 30px; }
.sales-calendar .calendar-head {
  grid-template-columns: 42px 1fr 42px;
  max-width: 760px;
  margin: 0 0 22px;
}
.sales-calendar .calendar-head b { font-size: 20px; letter-spacing: -.035em; }
.sales-calendar .calendar-head button { width: 40px; height: 40px; border-radius: 12px; background: #f2f4f6; font-size: 27px; }
.calendar-layout { display: grid; grid-template-columns: minmax(520px,760px) minmax(230px,1fr); gap: 28px; align-items: start; }
.sales-calendar .calendar-week { margin-bottom: 8px; }
.sales-calendar .calendar-week span { padding: 8px 0; font-size: 12px; font-weight: 650; }
.sales-calendar .calendar-days { gap: 7px; }
.sales-calendar .calendar-day, .sales-calendar .calendar-empty { aspect-ratio: 1.25; }
.sales-calendar .calendar-day { align-content: center; gap: 7px; border: 1px solid #eef0f2; border-radius: 14px; background: #fbfcfd; font-size: 14px; }
.sales-calendar .calendar-day:hover { border-color: #c9e2ff; background: #eef6ff; }
.sales-calendar .calendar-day.selected { border-color: #3182f6; background: #3182f6; color: #fff; }
.sales-calendar .calendar-day i { position: static; width: 5px; height: 5px; }
.sales-calendar .day-summary { position: sticky; top: 24px; margin-top: 0; padding: 26px; border: 1px solid #eef0f2; border-radius: 18px; background: #fafbfc; box-shadow: none; }
.sales-calendar .day-summary>div { display: block; }
.sales-calendar .day-summary>div span { display: block; font-size: 22px; letter-spacing: -.04em; }
.sales-calendar .day-summary>div small { display: block; margin-top: 6px; font-size: 11px; }
.sales-calendar .day-summary dl { grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
.sales-calendar .day-summary dl div { padding: 17px; border-radius: 14px; background: #f4f6f8; }
.sales-calendar .day-summary dt { font-size: 11px; }
.sales-calendar .day-summary dd { margin-top: 8px; font-size: 23px; letter-spacing: -.04em; }

main { max-width: 1480px; width: 100%; margin: 0 auto; padding: 44px 52px 72px; }
header { margin-bottom: 38px; }
.eyebrow, .kicker { color: #8b95a1; font-size: 10px; font-weight: 700; letter-spacing: .09em; }
h1, h2 { font-family: inherit; letter-spacing: -.045em; }
h1 { font-size: 32px; font-weight: 750; }
h2 { font-size: 23px; font-weight: 750; }

.primary, .secondary {
  padding: 12px 18px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  transition: transform .15s, background .15s;
}
.primary { background: #3182f6; box-shadow: none; }
.primary:hover { background: #1b64da; transform: translateY(-1px); }
.secondary { background: #f2f4f6; color: #4e5968; }

.metrics { gap: 14px; margin-bottom: 18px; }
.metric {
  min-height: 145px;
  padding: 24px;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.025);
}
.metric span { color: #6b7684; font-size: 13px; font-weight: 650; }
.metric strong { margin: 17px 0 7px; font-family: inherit; font-size: 29px; font-weight: 760; letter-spacing: -.045em; }
.metric small { color: #b0b8c1; font-size: 11px; }
.metric.accent { background: linear-gradient(145deg,#3182f6,#1b64da); border: 0; box-shadow: 0 10px 24px rgba(49,130,246,.18); }
.metric.accent span, .metric.accent small { color: rgba(255,255,255,.72); }

.dashboard-grid { gap: 18px; }
.dashboard-grid { grid-template-columns: 1fr; }
.panel { padding: 28px; border: 0; border-radius: 20px; box-shadow: 0 2px 12px rgba(0,0,0,.025); }
.panel-head { margin-bottom: 24px; }
.live-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 4px 7px; border-radius: 20px; background: #e8f3ff; color: #3182f6; font-family: inherit; font-size: 9px; font-weight: 800; letter-spacing: .04em; vertical-align: middle; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: #3182f6; box-shadow: 0 0 0 3px rgba(49,130,246,.13); }
.updated-at { display: block; margin-top: 7px; color: #b0b8c1; font-size: 10px; }
.text-btn { color: #3182f6; }
.inventory-item { padding: 17px 2px 4px; border-color: #f2f4f6; }
.product-icon { width: 42px; height: 42px; border-radius: 14px; background: #e8f3ff; color: #3182f6; font-family: inherit; }
.product-id b, .activity b { font-weight: 700; }
.product-id small, .inventory-item small, .activity small { color: #8b95a1; }
.stock-bar { height: 5px; background: #f2f4f6; }
.activity { padding: 15px 0; border-color: #f2f4f6; }
.activity-icon { background: #e8f3ff; color: #3182f6; }

.section-heading { margin: 12px 0 28px; }
.section-heading p { color: #8b95a1; font-size: 14px; }
.table-panel { border-radius: 20px; }
.manage-stack { display: grid; gap: 18px; }
.manage-title { display: flex; justify-content: space-between; align-items: center; padding: 22px 22px 10px; }
.manage-title h3 { margin: 0; font-size: 17px; }
.manage-title small { color: #8b95a1; font-size: 11px; }
.row-actions { display: flex; gap: 6px; }
.row-actions button { padding: 7px 11px; border: 0; border-radius: 8px; background: #e8f3ff; color: #3182f6; font-weight: 700; cursor: pointer; }
.row-actions button:hover { background: #dbeeff; }
.row-actions button.delete { background: #fff0f1; color: #e5484d; }
.row-actions button.delete:hover { background: #ffe3e5; }
table { font-size: 13px; }
th { padding-top: 17px; padding-bottom: 17px; background: #fbfcfd; color: #8b95a1; letter-spacing: .04em; }
th, td { padding-left: 21px; padding-right: 21px; border-color: #f2f4f6; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fafbfc; }
.money-positive { color: #3182f6; }
.badge { background: #e8f3ff; color: #3182f6; }

dialog { border-radius: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(25,31,40,.48); backdrop-filter: blur(3px); }
dialog form { padding: 30px; }
.close { background: #f2f4f6; color: #6b7684; }
.field label { color: #4e5968; font-size: 12px; }
.field input, .field select {
  padding: 13px;
  border-color: #e5e8eb;
  border-radius: 11px;
  background: #f9fafb;
  color: #191f28;
  transition: border .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus { outline: 0; border-color: #3182f6; background: #fff; box-shadow: 0 0 0 3px rgba(49,130,246,.12); }
.date-picker { border-color: #e5e8eb; border-radius: 11px; background: #f9fafb; }
.calendar-btn { border-left-color: #e5e8eb; background: #e8f3ff; color: #3182f6; }
.calendar-btn:hover { background: #dbeeff; }
#toast { background: #333d4b; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.16); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 76px 1fr; }
  .calendar-layout { grid-template-columns: 1fr; }
  .sales-calendar .day-summary { position: static; }
  main { padding: 32px 26px 70px; }
}

@media (max-width: 600px) {
  .sidebar { border-right: 0; border-top: 1px solid #eef0f2; }
  .sidebar nav { grid-template-columns: repeat(7,1fr); }
  main { padding: 24px 16px 88px; }
  .metric { min-height: 125px; padding: 18px; border-radius: 16px; }
  .metric strong { font-size: 23px; }
  .panel, .table-panel { border-radius: 16px; }
  .sales-calendar { padding: 16px; }
  .sales-calendar .calendar-day, .sales-calendar .calendar-empty { aspect-ratio: 1; }
  .sales-calendar .calendar-day { border-radius: 10px; font-size: 12px; }
}
