/* Clean Light: final presentation layer for the operations and admin apps. */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before, body::after { content: none; }
button, input, select, textarea { font-family: inherit; }
input, select, textarea { color-scheme: light; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: var(--fg-30); opacity: 1; }
.container { width: 100%; max-width: none; }
.header {
  min-height: 76px;
  padding: 18px max(24px, calc((100% - 1392px) / 2));
  gap: 20px;
  background: var(--surface);
  backdrop-filter: none;
  border-bottom: 1px solid var(--hairline);
}
.logo { font-size: 22px; font-weight: 750; letter-spacing: -.04em; }
.logo-dot { width: 10px; height: 10px; box-shadow: none; }
.user-info { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.user-points { background: var(--bs-08); border: 0; color: var(--brand-soft); padding: 8px 14px; }
.logout-btn { border-radius: 9px; background: var(--surface-muted); padding: 9px 14px; }
.nav-menu {
  padding: 0 max(24px, calc((100% - 1392px) / 2));
  gap: 28px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  scrollbar-width: thin;
}
.nav-item { padding: 17px 0; font-size: 14px; color: var(--fg-60); }
.nav-item.active { color: var(--brand); text-shadow: none; }
.nav-item-new, .nav-badge-new, .btn-flow, .pill.run::before,
.anim-enter, .anim-stagger > *, .admin-login-wrap .login-box { animation: none; }
.nav-badge-new { top: 3px; left: auto; right: -10px; }
.main-content { width: 100%; max-width: 1440px; padding: 0 24px 64px; margin: 0 auto; }
.description-section, .admin-title-section, .page-title-section, .point-title-section { margin-top: 32px; }
.section-title, .admin-main-title, .page-main-title, .point-main-title {
  font-family: var(--font-body); font-size: 28px; font-weight: 750; letter-spacing: -.035em; line-height: 1.35;
}
.section-desc, .admin-subtitle, .page-subtitle, .point-subtitle { font-size: 14px; color: var(--fg-60); }
.stats-container { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.stat-card { display: block; padding: 24px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 18px; }
.stat-card::before, .stat-card::after, table.grid tbody tr::after, .admin-subnav::after { content: none; }
.stat-card:hover, .admin-stat-card:hover { transform: none; background: var(--surface); }
.stat-card.is-highlight { background: var(--bs-08); border-color: var(--bs-20); }
.stat-card.stat-complete { background: var(--st-done-bg); border-color: var(--st-done-bd); }
.stat-label { color: var(--fg-60); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.stat-value { margin-top: 12px; font-size: 36px; font-weight: 750; color: var(--fg); font-variant-numeric: tabular-nums; }
.stat-card.is-highlight .stat-value, .stat-card.is-highlight .stat-value:hover { color: var(--brand-soft); }
.stat-card.is-highlight .stat-label::before { background: var(--brand); }
.stat-foot { margin-top: 8px; font-size: 13px; color: var(--fg-60); }
.filter-section { padding: 16px; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; margin-top: 24px; }
.filter-left { gap: 8px; flex-wrap: wrap; }
.filter-right { gap: 8px; flex-wrap: wrap; min-width: 0; }
.dropdown-btn, .date-filter-input, .search-box, .items-btn { background: var(--surface); border-color: var(--hairline); min-height: 42px; border-radius: 10px; }
.search-input { font-size: 14px; min-width: 0; }
.search-btn { background: var(--surface-muted); color: var(--fg-70); font-size: 13px; }
.register-btn { height: 42px; background: var(--brand); box-shadow: none; border-radius: 10px; }
.register-btn:hover { background: var(--brand-bright-hover); transform: none; }
.table-wrap, .table-container, .admin-table, .point-table { background: var(--surface); border-color: var(--hairline); border-radius: 16px; box-shadow: var(--shadow-1); }
table.grid thead th { padding: 14px 16px; background: #F8F9FC; font-size: 12px; font-family: var(--font-body); color: var(--fg-60); letter-spacing: 0; text-transform: none; }
table.grid tbody td { padding: 16px; font-size: 14px; border-bottom-color: var(--hairline); }
table.grid tbody td.cell-campaign { font-weight: 600; color: var(--fg); }
.cell-campaign .cid { display: block; margin: 3px 0 0; font-size: 12px; font-weight: 400; }
.chip, .pill { border-radius: 8px; font-size: 12px; }
.page-num { background: var(--surface); min-width: 36px; height: 36px; }
.page-num.active { background: var(--brand); color: var(--white); border-color: var(--brand); }
.admin-subnav { flex-wrap: wrap; gap: 8px; }
.subnav-item { background: var(--surface); border-color: var(--hairline); border-radius: 10px; }
.subnav-item.active { background: var(--bs-08); color: var(--brand-soft); box-shadow: none; }
.admin-stat-card, .chart-section, .recent-section, .point-card, .summary-card,
.campaign-info-card, .trend-card, .tt-card { background: var(--surface); border-color: var(--hairline); box-shadow: var(--shadow-1); }
.admin-stat-card { align-items: flex-start; padding: 24px; gap: 12px; }
.admin-stat-label { color: var(--fg-60); font-size: 14px; }
.admin-stat-value { font-size: 34px; font-variant-numeric: tabular-nums; }
.admin-table-header, .table-header, .point-table-header { background: #F8F9FC; }
.at-col, .th { color: var(--fg-60); }
.form-input, .form-textarea, .form-select, .link-input, .login-input { background-color: var(--surface); border-color: #D4DAE5; }
.form-container { border-radius: 18px; }
.btn-flow { background: var(--brand); background-size: auto; }
.btn-flow:hover { background: var(--brand-bright-hover); }

/* Welcome screen: a calm product overview paired with a focused sign-in form. */
.login-hero-wrap { grid-template-columns: 1.05fr .95fr; }
.login-hero { display: flex; flex-direction: column; justify-content: center; gap: 48px; padding: clamp(32px, 5vw, 80px); background: #EEF2FF; }
.login-hero-copy { position: relative; padding: 0; max-width: 540px; }
.login-hero-eyebrow { color: var(--brand-soft); font-family: var(--font-body); font-size: 13px; letter-spacing: .04em; }
.login-hero-title { color: var(--fg); font-size: clamp(30px, 3vw, 44px); line-height: 1.35; letter-spacing: -.045em; text-shadow: none; }
.login-hero-title em { font-style: normal; color: var(--brand); }
.login-hero-text { color: var(--fg-60); text-shadow: none; line-height: 1.8; font-size: 16px; }
.login-preview { max-width: 460px; padding: 24px; border: 1px solid #DDE3F4; border-radius: 20px; background: var(--surface); box-shadow: 0 12px 32px rgba(67, 56, 202, .06); }
.login-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 18px; margin-bottom: 6px; border-bottom: 1px solid var(--hairline); font-weight: 700; }
.login-preview-head span { font-size: 12px; color: var(--fg-50); font-weight: 400; }
.login-step { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.login-step-number { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--bs-08); color: var(--brand); font-weight: 700; }
.login-step:last-child .login-step-number { background: var(--st-done-bg); color: var(--st-done); }
.login-step strong { display: block; font-size: 14px; font-weight: 650; }
.login-step p { margin: 3px 0 0; font-size: 12px; color: var(--fg-60); }
.login-page { background: var(--bg); padding: 48px 32px; }
.login-box { max-width: 400px; }
.login-logo { font-size: 28px; font-weight: 750; letter-spacing: -.04em; }
.login-subtitle { font-size: 14px; margin-top: 10px; }
.login-card { background: var(--surface); padding: 32px; border-radius: 20px; box-shadow: var(--shadow-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.login-card::before { content: none; }
.login-label { font-size: 14px; color: var(--fg-70); }
.login-input { min-height: 48px; border-radius: 10px; font-size: 15px; }
.login-input:focus { background: var(--surface); border-color: var(--brand); }
.login-btn { min-height: 48px; font-size: 15px; border-radius: 10px; }
.admin-login-wrap .login-box { padding: 36px; border: 1px solid var(--hairline); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-2); }
.admin-login-wrap .login-brand { flex-direction: column; gap: 0; margin-bottom: 28px; }
.admin-login-wrap .login-logo, .admin-login-wrap .login-subtitle { margin: 0; }
.admin-login-wrap .login-subtitle { margin-top: 8px; }
.admin-login-wrap .login-form { width: 100%; }

@media (max-width: 1024px) {
  .filter-section { align-items: stretch; }
  .filter-right { width: 100%; }
  .filter-right .search-box { flex: 1; min-width: 180px; }
  .stat-card { padding: 20px; }
  .admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .header { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  .header-right { margin-left: auto; min-width: 0; }
  .logo { font-size: 20px; }
  .nav-menu { padding: 0 20px; gap: 22px; }
  .nav-item { font-size: 13px; padding: 15px 0; }
  .main-content { padding: 0 20px 40px; }
  .section-title, .admin-main-title, .page-main-title, .point-main-title { font-size: 24px; }
  .stats-container { gap: 10px; }
  .stat-card { padding: 16px; border-radius: 14px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 28px; }
  .stat-foot { font-size: 12px; }
  .chart-grid { grid-template-columns: 1fr; }
  .login-hero-wrap { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .login-hero { padding: 32px 24px; gap: 0; }
  .login-hero-title { font-size: 28px; }
  .login-hero-text { display: block; font-size: 14px; margin-top: 12px; }
  .login-preview { display: none; }
  .login-page { min-height: 0; padding: 32px 20px 48px; }
}
@media (max-width: 480px) {
  .header { padding: 14px 16px; }
  .header-right { width: 100%; }
  .user-info { width: 100%; gap: 10px; justify-content: space-between; }
  .user-name, .logout-btn, .user-points { font-size: 12px; }
  .nav-menu { padding: 0 16px; gap: 20px; }
  .main-content { padding: 0 16px 32px; }
  .stats-container { gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .stat-label { font-size: 11px; gap: 4px; }
  .stat-card .stat-label::before { display: none; }
  .stat-value { font-size: 26px; }
  .stat-value .unit { font-size: 11px; }
  .stat-foot { display: none; }
  .filter-section { padding: 12px; gap: 10px; }
  .filter-left .dropdown { flex: 1; min-width: 0; }
  .dropdown-btn { width: 100%; min-width: 0; font-size: 13px; }
  .filter-right .date-filter-box { width: 100%; }
  .date-filter-input { width: 100%; }
  .filter-right .search-box { width: 100%; min-width: 0; flex: 1 1 180px; }
  .register-btn { min-height: 42px; font-size: 13px; padding: 0 16px; }
  .admin-stat-card { padding: 18px 14px; }
  .admin-stat-label { font-size: 12px; }
  .admin-stat-value { font-size: 28px; }
  .subnav-item { padding: 9px 12px; font-size: 13px; }
  .login-card { padding: 24px; }
}

/* Keep the campaign, product and status visible together on narrow screens.
   The row still opens the full campaign details through its existing handler. */
@media (max-width: 640px) {
  table.grid { min-width: 0; table-layout: fixed; }
  table.grid :is(th, td):nth-child(1),
  table.grid :is(th, td):nth-child(n+4):nth-child(-n+10) { display: none; }
  table.grid :is(th, td):nth-child(2) { width: 47%; }
  table.grid :is(th, td):nth-child(3) { width: 30%; }
  table.grid :is(th, td):nth-child(11) { width: 23%; }
  table.grid thead th { padding: 12px 10px; font-size: 11px; }
  table.grid tbody td { padding: 14px 10px; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
  table.grid .cell-campaign .cid { font-size: 11px; }
  table.grid .chip { padding: 4px 6px; font-size: 11px; }
  table.grid .pill { padding: 4px 6px; font-size: 11px; gap: 4px; white-space: nowrap; }
  table.grid td.empty-cell { display: table-cell; padding: 32px 12px; }
}
