* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  color: #14161A;
  background: #F4F6F8;
}

input,
select,
button,
textarea {
  font-family: inherit;
  letter-spacing: -0.01em;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #3182F6;
  outline-offset: -1px;
}

button {
  cursor: pointer;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-thumb {
  background: #D7DCE2;
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #C2C9D1;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: #F4F6F8;
  overflow: hidden;
}

.sidebar {
  width: 236px;
  flex: none;
  background: #111827;
  border-right: 1px solid #1F2937;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.brand {
  padding: 22px 22px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #3182F6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -1px;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: #fff;
}

.brand-sub {
  font-size: 11px;
  color: #8B95A1;
  font-weight: 500;
  margin-top: 1px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 13px 20px;
}

.nav-header {
  font-size: 10.5px;
  font-weight: 700;
  color: #667085;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 15px 11px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  margin: 2px 0;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #A4ACB5;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  transition: background .12s, color .12s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
}

.nav-item.active {
  color: #3182F6;
  background: #EAF2FF;
  font-weight: 700;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 800;
  background: #EEF1F4;
  color: #5A626C;
}

.side-foot {
  padding: 14px 20px;
  border-top: 1px solid #1F2937;
  font-size: 11px;
  color: #A4ACB5;
}

.main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.topbar {
  height: 60px;
  flex: none;
  background: #fff;
  border-bottom: 1px solid #ECEFF3;
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 14px;
}

.page-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.top-spacer {
  flex: 1;
}

.top-label {
  font-size: 12px;
  color: #8B95A1;
  font-weight: 600;
}

.mode-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #3E4654;
  background: #F1F3F5;
  white-space: nowrap;
}

.mode-pill.attack {
  color: #F04452;
  background: #FCEBEC;
}

.mode-pill.item {
  color: #3182F6;
  background: #EAF2FF;
}

.divider {
  width: 1px;
  height: 20px;
  background: #ECEFF3;
}

.top-time {
  font-size: 12.5px;
  color: #8B95A1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #8B95A1;
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ED9A4;
}

.gm-chip {
  display: flex;
  align-items: center;
  gap: 9px;
}

.gm-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #F1F3F5;
  color: #5A626C;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.gm-name {
  font-size: 13px;
  font-weight: 700;
}

.content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}

.page {
  padding: 26px 30px;
}

@keyframes rpIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rpToast {
  from {
    opacity: 0;
    transform: translate(-50%,12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%,0);
  }
}

@keyframes rpResult {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.page-desc {
  margin: 5px 0 0;
  font-size: 13px;
  color: #8B95A1;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.field,
.select,
.textarea {
  height: 38px;
  border: 1px solid #DCE0E5;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  background: #fff;
  color: #14161A;
}

.textarea {
  height: 96px;
  padding: 12px 14px;
  line-height: 1.6;
  resize: vertical;
}

.search-wrap {
  position: relative;
  flex: none;
}

.search-wrap .field {
  padding-left: 34px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 15px;
  height: 15px;
  color: #A4ACB5;
}

.hint {
  font-size: 12px;
  color: #A4ACB5;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hint-box {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: #F7F8FA;
  border: 1px solid #E3E7EC;
}

.btn {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #DCE0E5;
  background: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #4E5562;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.btn.primary {
  border: none;
  background: #3182F6;
  color: #fff;
}

.btn.soft {
  border: none;
  background: #EAF2FF;
  color: #3182F6;
}

.btn.danger {
  border: none;
  background: #F04452;
  color: #fff;
}

.btn.dark {
  border: none;
  background: #14161A;
  color: #fff;
}

.btn.ghost-blue {
  color: #3182F6;
}

.table-shell {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid #ECEFF3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20,30,50,0.03);
}

.rp {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  table-layout: fixed;
}

.rp th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #F7F8FA;
  border-bottom: 1px solid #E3E7EC;
  padding: 10px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: #6B7684;
  white-space: nowrap;
}

.rp td {
  border-bottom: 1px solid #F1F3F5;
  padding: 11px 12px;
  color: #14161A;
  vertical-align: middle;
}

.rp tbody tr:hover {
  background: #FBFCFE;
}

.rp tbody tr:last-child td {
  border-bottom: none;
}

.rp-cell {
  border: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  font-size: 13px;
  color: #14161A;
}

.rp-cell:focus {
  outline: 2px solid #3182F6;
  outline-offset: -2px;
  background: #fff;
  border-radius: 5px;
}

.locked,
.auto {
  background: #FAFBFD;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.auto {
  background: #F2F6FF;
}

.locked-head {
  background: #F2F6FF !important;
  color: #3182F6 !important;
}

.muted {
  color: #8B95A1;
}

.num {
  font-variant-numeric: tabular-nums;
}

.progress-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.progress-number {
  width: 30px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: #EDF0F3;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 6px;
  background: #3182F6;
}

.progress-bar.hp-low {
  background: #F04452;
}

.progress-bar.gauge {
  background: #9B72F2;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  background: #F1F3F5;
  color: #5A626C;
  white-space: nowrap;
}

.status-good {
  color: #12986A;
  background: #E9F8F2;
}

.status-warn {
  color: #B56A00;
  background: #FFF4DF;
}

.status-bad {
  color: #D63440;
  background: #FCEBEC;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: #fff;
  border: 1px solid #ECEFF3;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(20,30,50,0.03);
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.metric {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.metric-label {
  font-size: 12px;
  color: #8B95A1;
  font-weight: 600;
}

.metric-value {
  margin-top: 6px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #8B95A1;
  margin-bottom: 6px;
}

.form-field .field,
.form-field .select,
.form-field .textarea {
  width: 100%;
}

.segment {
  display: flex;
  padding: 4px;
  background: #F2F4F6;
  border-radius: 13px;
  gap: 4px;
}

.segment button {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  color: #8B95A1;
}

.segment button.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.segment button.attack.active {
  color: #F04452;
}

.segment button.item.active {
  color: #3182F6;
}

.attack-card {
  border-color: #F7D6DA;
  background: #FFF9FA;
}

.attack-result {
  position: sticky;
  bottom: 0;
  margin: 0 30px 26px;
  background: #fff;
  border: 1px solid #F4C7CC;
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(20,30,50,0.16);
  overflow: hidden;
  animation: rpResult .25s ease;
  z-index: 5;
}

.attack-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #F1F3F5;
  flex-wrap: wrap;
}

.attack-result-body {
  max-height: 220px;
  overflow: auto;
}

.attack-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #F1F3F5;
  font-size: 13px;
}

.attack-row:last-child {
  border-bottom: none;
}

.attack-ment {
  color: #8B95A1;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-page {
  min-height: 100vh;
  background: #F4F6F8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 360px;
  background: #fff;
  border: 1px solid #ECEFF3;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 18px 48px rgba(20,30,50,0.08);
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #14161A;
  color: #fff;
  padding: 14px 22px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 12px 34px rgba(0,0,0,0.32);
  animation: rpToast .22s ease;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 180;
  padding: 24px;
}

.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 22px 60px rgba(20,30,50,0.22);
}

.modal h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.modal-desc {
  margin: 8px 0 18px;
  font-size: 13px;
  color: #8B95A1;
  line-height: 1.55;
}

.modal-box {
  background: #F7F8FA;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #4E5562;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.empty {
  padding: 34px;
  text-align: center;
  color: #A4ACB5;
  font-size: 13px;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
  }

  .brand,
  .side-foot {
    display: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    padding: 9px;
  }

  .nav-header {
    display: none;
  }

  .nav-item {
    width: auto;
    flex: none;
  }

  .topbar {
    padding: 0 14px;
    overflow-x: auto;
  }

  .page {
    padding: 18px 14px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .attack-result {
    margin: 0 14px 18px;
  }
}
