:root {
  --bg: #e8edf5;
  --panel: #f7f9fd;
  --line: #d4deee;
  --text: #253044;
  --muted: #627089;
  --brand: #2d6edf;
  --brand-2: #2257b7;
  --danger: #d54848;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard Variable", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef3fb, #dbe5f3);
}

.mega-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.mega-login-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 42px rgba(33, 52, 91, 0.14);
  padding: 26px;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
}

h1 {
  margin: 6px 0 10px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.desc {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #586781;
  font-weight: 600;
}

input,
select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid rgba(45, 110, 223, 0.2);
  border-color: var(--brand);
}

.btn {
  height: 36px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn.primary {
  color: #fff;
  border-color: var(--brand-2);
  background: linear-gradient(180deg, #3b81f3, #2d6edf);
}

.btn.ghost,
.btn.light {
  color: #2f4f8d;
  border-color: #bdd0f4;
  background: #f3f7ff;
}

.btn.dark {
  color: #fff;
  border-color: #2e4d87;
  background: #2d5fb6;
}

.btn.danger {
  color: #fff;
  border-color: #b73d3d;
  background: #d54848;
}

.mega-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.mega-side {
  border-right: 1px solid #ced9ed;
  background: linear-gradient(180deg, #f8fbff, #eef3fc);
  padding: 16px 12px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
}

.mega-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mega-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.mega-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.mega-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.mega-nav {
  display: grid;
  gap: 8px;
}

.mega-nav-btn {
  width: 100%;
  height: 40px;
  border: 1px solid #ccd8ee;
  border-radius: 8px;
  background: #fff;
  color: #435f95;
  font-weight: 700;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.mega-nav-btn.active {
  color: #fff;
  border-color: #2a63c8;
  background: linear-gradient(180deg, #357bf0, #2a63c8);
}

.go-merchant {
  align-self: end;
  text-decoration: none;
  font-size: 13px;
  color: #345ca8;
  font-weight: 700;
}

.mega-main {
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.mega-top {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mega-top h1 {
  margin: 0;
  font-size: 28px;
}

.token-box {
  display: flex;
  gap: 8px;
}

.token-box input {
  width: 220px;
}

.mega-view {
  display: none;
  gap: 12px;
}

.mega-view.active {
  display: grid;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.panel-head {
  height: 46px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
}

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

.actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid #dce3f0;
  border-right: 1px solid #e7ecf6;
  padding: 9px 10px;
  font-size: 13px;
  white-space: nowrap;
  text-align: left;
}

th {
  background: #eef3fb;
  color: #456292;
  font-size: 12px;
  font-weight: 700;
}

th:last-child,
td:last-child {
  border-right: 0;
}

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

.permission-toolbar .actions {
  align-items: center;
}

.mini-btn {
  height: 28px;
  border: 1px solid #c1d0ea;
  background: #fff;
  color: #3a5b90;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  padding: 0 8px;
}

.notice {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(440px, calc(100vw - 24px));
  background: rgba(29, 44, 74, 0.95);
  color: #fff;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.notice.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1200px) {
  .grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .mega-shell {
    grid-template-columns: 1fr;
  }
  .mega-side {
    grid-template-rows: auto;
  }
  .token-box input {
    width: 130px;
  }
  .grid-form {
    grid-template-columns: 1fr;
  }
  .permission-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
