/* wage portal style — site-aware (newlabs blue, starlabs amber) */
/* Site-specific theming overrides */
body.site-starlabs .btn.b-primary { background: #f59e0b; }
body.site-starlabs .btn.b-primary:hover { background: #d97706; }
body.site-starlabs .btn.b-outline { color: #f59e0b; border-color: #f59e0b; }
body.site-starlabs .btn.b-outline:hover { background: #fffbeb; }
body.site-starlabs .portal-nav li a.active {
  background: #fffbeb; color: #b45309; border-left-color: #f59e0b;
}
body.site-starlabs .kpi-card.accent {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}
body.site-starlabs .progress .bar {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}
body.site-starlabs .badge.b-blue { background: #fef3c7; color: #92400e; }
body.site-starlabs input:focus, body.site-starlabs select:focus, body.site-starlabs textarea:focus {
  outline-color: #f59e0b40; border-color: #f59e0b;
}
body.site-starlabs .auth-card .btn-primary { background: #f59e0b; }
body.site-starlabs .auth-card .btn-primary:hover { background: #d97706; }
body.site-starlabs .auth-card .alt-link { color: #f59e0b; }
body.site-starlabs .topbar .brand { color: #b45309; }
body.site-newlabs .topbar .brand { color: #0b1a36; }

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: #1c2533;
  background: #f4f6fa;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea {
  font: inherit; color: inherit; border: 1px solid #d8dde6;
  background: #fff; padding: 10px 12px; border-radius: 6px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #2563eb40; border-color: #2563eb; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid #e5e9f0; }

/* ========== Top Bar (logo + language switcher) ========== */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e9f0;
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.01em; color: #0b1a36;
}
.topbar .brand .logo-dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 14px;
}
.lang-switch { display: flex; gap: 6px; align-items: center; }
.lang-switch .lang-btn {
  width: 30px; height: 22px; border-radius: 3px;
  border: 1px solid #e5e9f0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #4a5878;
  background: #fff;
}
.lang-switch .lang-btn.active { border-color: #2563eb; color: #2563eb; }
.lang-switch .flag {
  width: 24px; height: 16px; border-radius: 2px; display: inline-block;
  background-size: cover; background-position: center;
}
.flag-ko { background: linear-gradient(180deg, #fff 50%, #cd2e3a 50%); }
.flag-cn { background: #de2910; }
.flag-vn { background: #da251d; }
.flag-jp { background: radial-gradient(circle, #bc002d 30%, #fff 30%); }
.flag-us { background: linear-gradient(180deg, #b22234 10%, #fff 10%, #fff 20%, #b22234 20%, #b22234 30%, #fff 30%); }

/* ========== Auth (Login / Register) ========== */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: #fff; border: 1px solid #e5e9f0; border-radius: 12px;
  padding: 36px 32px; box-shadow: 0 4px 20px rgba(10,22,40,0.06);
}
.auth-card .auth-logo {
  text-align: center; margin-bottom: 22px;
  font-size: 22px; font-weight: 900; color: #0b1a36; letter-spacing: -0.02em;
}
.auth-card h1 {
  font-size: 18px; font-weight: 700; color: #1c2533;
  margin-bottom: 24px; text-align: center;
}
.auth-card .form-row { margin-bottom: 12px; }
.auth-card label { display: block; font-size: 13px; color: #4a5878; margin-bottom: 6px; }
.auth-card .checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #4a5878; margin: 12px 0 18px;
}
.auth-card .checkbox-row input { width: auto; }
.auth-card .btn-primary {
  width: 100%; padding: 12px; border-radius: 6px;
  background: #2563eb; color: #fff; font-weight: 700; font-size: 15px;
  transition: background .15s;
}
.auth-card .btn-primary:hover { background: #1d4ed8; }
.auth-card .divider {
  text-align: center; color: #94a0b8; font-size: 12px;
  margin: 18px 0; position: relative;
}
.auth-card .divider::before, .auth-card .divider::after {
  content: ''; position: absolute; top: 50%; width: calc(50% - 25px);
  height: 1px; background: #e5e9f0;
}
.auth-card .divider::before { left: 0; }
.auth-card .divider::after { right: 0; }
.auth-card .alt-link {
  display: block; text-align: center; color: #2563eb;
  font-size: 14px; font-weight: 600; padding: 10px;
}
.auth-card .alt-link:hover { text-decoration: underline; }
.error-msg {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
  padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px;
}

/* ========== Member Portal Layout ========== */
.portal {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}
.portal-side {
  background: #fff; border-right: 1px solid #e5e9f0; padding: 24px 0;
}
.portal-side .user-card {
  padding: 0 20px 20px; border-bottom: 1px solid #e5e9f0; margin-bottom: 16px;
}
.portal-side .user-card .name {
  font-weight: 700; font-size: 15px; color: #0b1a36; margin-bottom: 4px;
}
.portal-side .user-card .meta {
  font-size: 12px; color: #6b7a95;
}
.portal-side .user-card .rank-badge {
  display: inline-block; background: #eef4ff; color: #2563eb;
  padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; margin-top: 6px;
}
.portal-nav { list-style: none; }
.portal-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; font-size: 14px; color: #4a5878;
  border-left: 3px solid transparent; transition: all .12s;
}
.portal-nav li a:hover { background: #f7f9fc; color: #1c2533; }
.portal-nav li a.active {
  background: #eef4ff; color: #2563eb; border-left-color: #2563eb; font-weight: 600;
}
.portal-main {
  padding: 28px 32px;
}
.page-title {
  font-size: 22px; font-weight: 800; color: #0b1a36; margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.page-sub { font-size: 13px; color: #6b7a95; margin-bottom: 24px; }

/* ========== KPI Cards ========== */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.kpi-card {
  background: #fff; border: 1px solid #e5e9f0; border-radius: 10px;
  padding: 18px 20px;
}
.kpi-card .label { font-size: 12px; color: #6b7a95; margin-bottom: 8px; font-weight: 600; }
.kpi-card .value { font-size: 22px; font-weight: 800; color: #0b1a36; letter-spacing: -0.02em; }
.kpi-card .unit { font-size: 13px; font-weight: 600; color: #6b7a95; margin-left: 4px; }
.kpi-card .delta { font-size: 12px; color: #16a34a; font-weight: 600; margin-top: 6px; }
.kpi-card.accent {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #fff; border-color: transparent;
}
.kpi-card.accent .label, .kpi-card.accent .value, .kpi-card.accent .unit { color: #fff; }
.kpi-card.accent .label { opacity: .85; }

.progress-row { margin-top: 10px; }
.progress { background: #e5e9f0; height: 6px; border-radius: 3px; overflow: hidden; }
.progress .bar { height: 100%; background: linear-gradient(90deg, #2563eb, #06b6d4); border-radius: 3px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: #6b7a95; margin-top: 6px; }

/* ========== Tables ========== */
.panel {
  background: #fff; border: 1px solid #e5e9f0; border-radius: 10px; overflow: hidden;
  margin-bottom: 18px;
}
.panel-head {
  padding: 14px 18px; border-bottom: 1px solid #e5e9f0;
  display: flex; align-items: center; justify-content: space-between;
}
.panel-head h2 { font-size: 15px; font-weight: 700; color: #0b1a36; }
.panel-body { padding: 18px; }
.panel-body.no-pad { padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; font-size: 13px; }
thead { background: #f7f9fc; }
thead th { font-weight: 700; color: #4a5878; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr { border-top: 1px solid #eef0f5; }
tbody tr:hover { background: #fafbfd; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700;
}
.badge.b-green { background: #dcfce7; color: #166534; }
.badge.b-amber { background: #fef3c7; color: #92400e; }
.badge.b-red { background: #fee2e2; color: #991b1b; }
.badge.b-blue { background: #dbeafe; color: #1e40af; }
.badge.b-gray { background: #e5e9f0; color: #4a5878; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 600;
  transition: all .12s;
}
.btn.b-primary { background: #2563eb; color: #fff; }
.btn.b-primary:hover { background: #1d4ed8; }
.btn.b-outline { background: #fff; color: #2563eb; border: 1px solid #2563eb; }
.btn.b-outline:hover { background: #eef4ff; }
.btn.b-ghost { background: transparent; color: #4a5878; }
.btn.b-ghost:hover { background: #f7f9fc; }
.btn.b-danger { background: #ef4444; color: #fff; }
.btn.b-sm { padding: 5px 10px; font-size: 12px; }

/* ========== Tree ========== */
.tree { font-size: 13px; }
.tree-node {
  padding: 8px 12px; margin: 4px 0;
  background: #f7f9fc; border-radius: 6px;
  display: flex; align-items: center; gap: 12px;
}
.tree-node .nm { font-weight: 700; color: #0b1a36; }
.tree-node .un { color: #6b7a95; font-size: 12px; }
.tree-node .stats { margin-left: auto; font-size: 12px; color: #6b7a95; }
.tree-children { padding-left: 24px; border-left: 2px solid #e5e9f0; margin-left: 12px; }

/* ========== Toast ========== */
.toast {
  position: fixed; top: 80px; right: 24px;
  background: #0b1a36; color: #fff; padding: 12px 20px; border-radius: 8px;
  font-size: 14px; z-index: 1000;
  box-shadow: 0 8px 24px rgba(10,22,40,0.2);
  opacity: 0; transform: translateY(-10px); transition: all .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: #b91c1c; }
.toast.ok { background: #16a34a; }

/* ========== Footer ========== */
.site-footer {
  margin-top: 40px; padding: 28px 24px;
  border-top: 1px solid #e5e9f0; background: #fff;
  font-size: 12px; color: #6b7a95;
}
.site-footer .inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.site-footer .links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer .links a { color: #4a5878; text-decoration: none; }
.site-footer .links a:hover { color: var(--brand-accent-solid, #2563eb); }
.site-footer .copy { color: #94a0b8; }
@media (max-width: 640px) {
  .site-footer { padding: 20px 14px; }
  .site-footer .inner { gap: 10px; }
}

/* ========== Notification bell ========== */
.notif-bell { position: relative; }
.notif-btn {
  width: 38px; height: 38px; border-radius: 8px; border: 0; background: transparent;
  font-size: 18px; cursor: pointer; position: relative;
}
.notif-btn:hover { background: #f7f9fc; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 0 5px; min-width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.notif-panel {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 340px; max-height: 460px; overflow-y: auto;
  background: #fff; border: 1px solid #e5e9f0; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(10,22,40,0.12);
  display: none; z-index: 95;
}
.notif-panel.open { display: block; }
.notif-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid #eef0f5;
}
.notif-head strong { font-size: 14px; color: #0b1a36; }
.notif-read-all { background: transparent; border: 0; color: #6b7a95; font-size: 12px; cursor: pointer; }
.notif-read-all:hover { color: var(--brand-accent-solid, #2563eb); }
.notif-item {
  display: block; padding: 10px 14px; border-bottom: 1px solid #eef0f5;
  text-decoration: none; color: inherit; transition: background .12s;
}
.notif-item:hover { background: #f7f9fc; }
.notif-item.unread { background: #f0f7ff; border-left: 3px solid var(--brand-accent-solid, #2563eb); }
body.site-starlabs .notif-item.unread { background: #fffbeb; border-left-color: #f59e0b; }
.notif-title { font-size: 13px; font-weight: 600; color: #0b1a36; margin-bottom: 3px; }
.notif-body { font-size: 12px; color: #4a5878; line-height: 1.4; margin-bottom: 4px; }
.notif-date { font-size: 11px; color: #94a0b8; }
.notif-empty { padding: 30px; text-align: center; color: #94a0b8; font-size: 13px; }
@media (max-width: 480px) {
  .notif-panel { width: calc(100vw - 24px); right: -12px; }
}

/* ========== Hamburger button (mobile only) ========== */
.hamburger {
  display: none; cursor: pointer;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  border-radius: 6px; background: transparent; border: 0; padding: 0;
}
.hamburger:hover { background: #f7f9fc; }
.hamburger-icon, .hamburger-icon::before, .hamburger-icon::after {
  display: block; content: ''; width: 22px; height: 2px; background: #1c2533;
  border-radius: 2px; transition: transform .2s, opacity .2s;
}
.hamburger-icon { position: relative; }
.hamburger-icon::before { position: absolute; top: -7px; left: 0; }
.hamburger-icon::after  { position: absolute; top:  7px; left: 0; }

/* Drawer backdrop */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(10,22,40,0.45);
  z-index: 99;
}
.sidebar-backdrop.show { display: block; }

/* ========== Mobile (<=880px) ========== */
@media (max-width: 880px) {
  .topbar { padding: 0 12px; height: 56px; gap: 8px; }
  .topbar .brand span:not(.logo-dot) { font-size: 14px !important; }
  .hamburger { display: inline-flex; }

  .portal { grid-template-columns: 1fr; }
  .portal-side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 80%; max-width: 320px;
    background: #fff; padding: 20px 0; z-index: 100;
    transform: translateX(-100%); transition: transform .25s ease;
    border-right: 1px solid #e5e9f0; box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    overflow-y: auto;
  }
  .portal-side.open { transform: translateX(0); }
  .portal-side .user-card { padding: 0 20px 16px; border-bottom: 1px solid #e5e9f0; margin-bottom: 12px; }
  .portal-nav { display: block; padding: 0; }
  .portal-nav li a {
    padding: 12px 20px; border-left: 3px solid transparent; border-radius: 0; font-size: 14px;
  }
  .portal-nav li a.active {
    background: #eef4ff; color: #2563eb; border-left-color: #2563eb;
  }
  body.site-starlabs .portal-nav li a.active {
    background: #fffbeb; color: #b45309; border-left-color: #f59e0b;
  }
  .portal-main { padding: 16px 12px; }
  .auth-card { padding: 26px 20px; max-width: 100%; }

  /* Tables → horizontal scroll */
  .panel-body.no-pad { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel-body.no-pad table { min-width: 600px; }
  th, td { padding: 10px 12px; font-size: 12px; }

  /* KPI grid → 2 cols, then 1 col on phones */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 14px 14px; }
  .kpi-card .value { font-size: 18px; }

  /* Inline form grids — most use grid-template-columns: 1fr 1fr or repeat(3, 1fr) */
  form[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  form > div[style*="grid-column"] { grid-column: auto !important; }

  /* Panel head spacing */
  .panel-head { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .panel-head h2 { font-size: 14px; }
  .panel-body { padding: 14px; }
  .page-title { font-size: 18px; }

  /* Buttons wrap nicely */
  .btn { padding: 7px 12px; font-size: 12px; }

  /* Pager — smaller buttons */
  .pager .pbtn { min-width: 28px; height: 28px; font-size: 12px; padding: 0 6px; }
  .pager .pinfo { font-size: 11px; }

  /* Filter button rows wrap */
  .filter-btn, .sb { font-size: 11px; padding: 5px 8px; }

  /* Date range picker */
  .date-range { gap: 4px; }
  .date-range input[type="date"] { width: 130px; font-size: 12px; }
  .preset-btn { font-size: 11px; padding: 4px 8px; }

  /* Toast */
  .toast { top: 70px; right: 12px; left: 12px; font-size: 13px; }

  /* Tree wider */
  .tree-node { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .tree-node .stats { margin-left: 0; font-size: 11px; }
  .tree-children { padding-left: 12px; margin-left: 6px; }

  /* Lang switch can be hidden if cramped */
  .lang-switch { gap: 3px; }
  .lang-switch .lang-btn { width: 24px; height: 18px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar .brand span:not(.logo-dot) span:nth-child(2) { display: none; } /* hide tagline */
  .lang-switch .lang-btn:nth-child(n+4) { display: none; } /* show only first 3 flags */
}

/* Marquee bar */
.marquee-bar {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 8px 0;
  overflow: hidden;
  position: relative;
}
.marquee-bar .marquee-inner {
  white-space: nowrap;
  display: inline-block;
  padding-left: 100%;
  animation: marquee 30s linear infinite;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.marquee-bar:hover .marquee-inner { animation-play-state: paused; }
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Notification type colors */
.notif-item .notif-icon { margin-right: 6px; font-size: 13px; }
.notif-item.type-warning { border-left: 3px solid #f59e0b; padding-left: 11px; }
.notif-item.type-error   { border-left: 3px solid #ef4444; padding-left: 11px; }
.notif-item.type-success { border-left: 3px solid #16a34a; padding-left: 11px; }
.notif-item.type-info    { border-left: 3px solid #3b82f6; padding-left: 11px; }

/* Mobile drawer enhancements */
@media (max-width: 880px) {
  .sidebar-backdrop {
    backdrop-filter: blur(2px);
    transition: opacity 0.25s ease;
    opacity: 0; display: block; pointer-events: none;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .portal-side { box-shadow: 6px 0 24px rgba(0,0,0,0.18); }
  /* Hamburger animation when sidebar open */
  body:has(.portal-side.open) .hamburger-icon { background: transparent; }
  body:has(.portal-side.open) .hamburger-icon::before { transform: translateY(7px) rotate(45deg); }
  body:has(.portal-side.open) .hamburger-icon::after  { transform: translateY(-7px) rotate(-45deg); }
}

/* ========== Dark mode ========== */
html.dark {
  --bg: #0b1426;
  --panel: #131e35;
  --border: #1f2c47;
  --text: #cbd5e1;
  --text-strong: #f1f5f9;
  --muted: #64748b;
  --soft: #1a2540;
}
html.dark body { background: #0a1426; color: var(--text); }
html.dark .topbar { background: #0a1426; border-bottom-color: #1a2540; }
html.dark .portal-side { background: #131e35; border-right-color: #1f2c47; }
html.dark .portal-side .user-card { color: var(--text-strong); }
html.dark .portal-side .user-card .meta { color: var(--muted); }
html.dark .portal-nav li a { color: var(--text); }
html.dark .portal-nav li a:hover { background: #1a2540; color: var(--text-strong); }
html.dark .portal-nav li a.active { background: #1a2540 !important; color: #60a5fa !important; }
html.dark .panel { background: var(--panel); border-color: var(--border); }
html.dark .panel-head { background: #131e35; border-bottom-color: var(--border); }
html.dark .panel-head h2 { color: var(--text-strong); }
html.dark .page-title { color: var(--text-strong); }
html.dark .page-sub { color: var(--muted); }
html.dark .kpi-card { background: var(--panel); border-color: var(--border); color: var(--text); }
html.dark .kpi-card .label { color: var(--muted); }
html.dark .kpi-card .value { color: var(--text-strong); }
html.dark table thead th { background: #1a2540; color: var(--muted); border-color: var(--border); }
html.dark table td { color: var(--text); border-color: var(--border); }
html.dark table tbody tr:hover { background: #1a2540; }
html.dark input, html.dark select, html.dark textarea {
  background: #1a2540; color: var(--text-strong); border-color: #2a3a5e;
}
html.dark .btn.b-ghost { background: transparent; color: var(--text); }
html.dark .btn.b-ghost:hover { background: #1a2540; }
html.dark .btn.b-outline { background: transparent; color: #60a5fa; border-color: #2a3a5e; }
html.dark .notif-panel { background: var(--panel); border-color: var(--border); }
html.dark .notif-item { color: var(--text); border-bottom-color: var(--border); }
html.dark .notif-item:hover { background: #1a2540; }
html.dark .site-footer { background: #0a1426; color: var(--muted); border-color: var(--border); }

/* Dark mode toggle button in topbar */
.theme-toggle {
  background: transparent; border: 1px solid #e5e9f0; color: #6b7a95;
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: #f7f9fc; }
html.dark .theme-toggle { border-color: #2a3a5e; color: #cbd5e1; }
html.dark .theme-toggle:hover { background: #1a2540; }

/* ========== Unified rank badges ========== */
.rank-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  border: 1px solid transparent;
}
.rank-badge.r0 { background: #e5e9f0; color: #4a5878; border-color: #d1d8e3; }
.rank-badge.r1 { background: #fef3c7; color: #92400e; border-color: #fcd34d; }   /* 브론즈 */
.rank-badge.r2 { background: #e5e9f0; color: #1c2533; border-color: #94a3b8; }   /* 실버 */
.rank-badge.r3 { background: #fde68a; color: #78350f; border-color: #f59e0b; }   /* 골드 */
.rank-badge.r4 { background: #dbeafe; color: #1e40af; border-color: #60a5fa; }   /* 플래티넘 */
.rank-badge.r5 { background: #ede9fe; color: #5b21b6; border-color: #a78bfa; }   /* 다이아 */
.rank-badge.r6 { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #78350f;
  border-color: #f59e0b; box-shadow: 0 2px 8px rgba(245,158,11,0.25); }  /* 마스터 */
.rank-badge.center { background: #fce7f3; color: #9d174d; border-color: #f9a8d4; }
.rank-badge.admin  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

html.dark .rank-badge.r0 { background: #1a2540; color: #94a3b8; border-color: #2a3a5e; }
html.dark .rank-badge.r1 { background: rgba(252,211,77,0.15); color: #fcd34d; border-color: rgba(252,211,77,0.4); }
html.dark .rank-badge.r2 { background: #1a2540; color: #cbd5e1; border-color: #475569; }
html.dark .rank-badge.r3 { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.4); }
html.dark .rank-badge.r4 { background: rgba(96,165,250,0.15); color: #93c5fd; border-color: rgba(96,165,250,0.4); }
html.dark .rank-badge.r5 { background: rgba(167,139,250,0.15); color: #c4b5fd; border-color: rgba(167,139,250,0.4); }
html.dark .rank-badge.r6 { background: rgba(245,158,11,0.25); color: #fde68a; border-color: rgba(245,158,11,0.5); }
