* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 45%, #edf6ff 100%);
  color: #0f172a;
  scroll-behavior: smooth;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: none; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148,163,184,.12);
  position: sticky;
  top: 0;
  z-index: 10;
}
.glass-topbar {
  box-shadow: 0 12px 40px rgba(15,23,42,.05);
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #111827, #475569);
  box-shadow: 0 12px 24px rgba(15,23,42,.16);
  overflow: hidden;
}
.brand-image-mark {
  padding: 0;
  background: rgba(255,255,255,.95);
}
.brand-image-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.topbar h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.02em; }
.topbar p { margin: 0; color: #64748b; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(226,232,240,.8);
  color: #334155;
  font-weight: 700;
}
.page { max-width: 1488px; margin: 0 auto; padding: 24px; flex: 1 0 auto; width: 100%; }
.page-shell { padding-top: 24px; }
.site-footer {
  flex-shrink: 0;
  padding: 14px 20px 18px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: #94a3b8;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.55);
}
.site-footer-inner {
  margin: 0;
  max-width: 1488px;
  margin-left: auto;
  margin-right: auto;
}
.site-footer-contact {
  color: #475569;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.auth-shell { min-height: calc(100vh - 140px); display: grid; place-items: center; position: relative; }
.auth-card, .panel, .stat-card, .info-card {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(226,232,240,.88);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15,23,42,.06);
  backdrop-filter: blur(18px);
}
.auth-card { width: min(460px, 100%); padding: 32px; }
.auth-card.wide { width: min(820px, 100%); }
.auth-card h2, .panel h2 { margin-top: 0; }
.form-grid { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 8px; font-weight: 600; color: #334155; }
input, select, button, textarea {
  font: inherit;
  border-radius: 10px;
}
input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(203,213,225,.92);
  background: rgba(255,255,255,.98);
  transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}
input:hover, select:hover, textarea:hover {
  border-color: rgba(96,165,250,.68);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,.10);
}
textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.6;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37,99,235,.18);
}
.btn-light { background: #fff; color: #0f172a; border: 1px solid #dbe3ef; }
.btn-dark { background: #0f172a; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.table-action-tip { color: #94a3b8; font-weight: 600; }

.full { grid-column: 1 / -1; }
.hero-grid, .admin-grid, .info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.hero-grid:not(.admin-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.team-hero-grid:not(.admin-grid) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.admin-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.floating-grid { align-items: stretch; }
.stat-card, .info-card { padding: 16px; }
.stat-card {
  min-height: 136px;
  border-radius: 12px;
  border: 1px solid rgba(226,232,240,.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.stat-card span { display: block; color: rgba(255,255,255,.82); margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.stat-card strong { font-size: 34px; line-height: 1.1; letter-spacing: -.03em; color: #fff; }
.stat-card-link { cursor: pointer; }
.stat-card-link strong,
.stat-card-link span,
.stat-card-link small,
.period-kpi-card strong,
.period-kpi-card span,
.period-kpi-card small,
.today-detail-card strong,
.today-detail-card span,
.today-detail-card small {
  color: #fff;
}
.stat-card small { display: block; margin-top: 8px; color: rgba(255,255,255,.72); font-size: 12px; }
.gradient-card {
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 28px rgba(15,23,42,.10);
}
.dark-card { background: linear-gradient(135deg, #0f172a, #1e293b); }
.blue-card { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.soft-blue-card { background: linear-gradient(135deg, #0f766e, #22c55e); }
.soft-dark-card { background: linear-gradient(135deg, #1e293b, #334155); }
.purple-card { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.orange-card { background: linear-gradient(135deg, #ea580c, #fb923c); }
.info-card h3 { margin-top: 0; margin-bottom: 12px; }
.info-card p { margin: 6px 0; color: #475569; }
.soft-card {
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255,255,255,.6);
}
.elevated-card {
  box-shadow: 0 16px 36px rgba(15,23,42,.08);
}
.dashboard-grid { margin-bottom: 24px; }
.admin-layout-shell,
.agent-layout-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.admin-main-content,
.agent-main-content { min-width: 0; }
.admin-side-nav,
.agent-side-nav {
  position: sticky;
  top: 108px;
  width: 200px;
  padding: 16px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 12px 28px rgba(15,23,42,.06);
  backdrop-filter: blur(16px);
}
.admin-side-title {
  padding: 8px 10px 14px;
  border-bottom: 1px solid rgba(226,232,240,.88);
  margin-bottom: 12px;
}
.admin-side-title span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.admin-side-title strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 18px;
}
.admin-side-nav nav {
  display: grid;
  gap: 8px;
}
.admin-side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: 12px;
  color: #334155;
  font-weight: 700;
  transition: background-color .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.admin-side-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}
.admin-side-nav a:hover {
  text-decoration: none;
  background: rgba(241,245,249,.96);
  color: #0f172a;
}
.admin-side-nav a.active {
  text-decoration: none;
  color: #1d4ed8;
  background: linear-gradient(135deg, rgba(219,234,254,.96), rgba(239,246,255,.98));
  box-shadow: 0 10px 22px rgba(37,99,235,.10);
  font-weight: 800;
}
.admin-side-nav a.active::before {
  background: #2563eb;
}
.admin-side-nav a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(226,232,240,.9);
  color: #2563eb;
  font-size: 15px;
}
.admin-side-nav a.active span {
  background: rgba(37,99,235,.12);
}
#create-agent,
#agent-detail,
#order-manage,
#admin-password {
  scroll-margin-top: 118px;
}
.panel { padding: 16px; margin-bottom: 24px; border-radius: 16px; }
.premium-panel {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(226,232,240,.88);
  box-shadow: 0 10px 30px rgba(15,23,42,.05);
}
.panel-header { margin-bottom: 16px; }
.panel-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.panel-header.between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.panel-header p { margin: 8px 0 0; color: #94a3b8; font-size: 14px; line-height: 1.6; }
.form-desc { margin-top: -4px; margin-bottom: 18px; color: #475569; }
.chart-panel-header { align-items: flex-start; }
.filter-select-group {
  display: grid;
  gap: 6px;
  min-width: 180px;
  font-weight: 700;
  color: #475569;
}
.filter-select-group span {
  font-size: 12px;
  line-height: 1.2;
  color: #64748b;
}
.compact-filter-group {
  min-width: 180px;
}
.three-chart-grid {
  grid-template-columns: repeat(3, minmax(300px, 1fr));
}
.chart-carousel-grid.three-chart-grid {
  min-width: 940px;
}
.modern-filter-form input,
.modern-filter-form select {
  height: 44px;
  border-radius: 14px;
}
.alert {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  font-weight: 700;
}
.toast-stack {
  position: fixed;
  top: 92px;
  right: 24px;
  z-index: 120;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
}
.toast-message {
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15,23,42,.12);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.68);
  animation: toastSlideIn .24s ease;
}
.toast-message span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
  opacity: .75;
}
.toast-message strong {
  display: block;
  font-size: 14px;
  line-height: 1.5;
}
.toast-success {
  background: rgba(220,252,231,.92);
  color: #166534;
}
.toast-notice {
  display: block;
  background: rgba(219,234,254,.96);
  color: #1d4ed8;
  text-decoration: none;
}
.toast-notice:hover {
  text-decoration: none;
}
.toast-warning {
  display: block;
  background: rgba(255,247,237,.96);
  color: #c2410c;
  text-decoration: none;
}
.toast-warning:hover {
  text-decoration: none;
}
.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(239,68,68,.24);
}
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.form-helper {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.table-wrap::-webkit-scrollbar,
.multi-chart-grid::-webkit-scrollbar,
.admin-side-nav::-webkit-scrollbar {
  height: 8px;
}
.table-wrap::-webkit-scrollbar-thumb,
.multi-chart-grid::-webkit-scrollbar-thumb,
.admin-side-nav::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.72);
  border-radius: 999px;
}
.modern-table-wrap {
  border-radius: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(226,232,240,.8);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
  background: rgba(255,255,255,.92);
}
th, td {
  padding: 14px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}
th { background: #f8fafc; color: #334155; }
.table-wrap table select,
.table-wrap table input {
  min-width: 110px;
}
.inline-form-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 130px;
}
.inline-form-stack select,
.inline-form-stack input,
.inline-form-stack button {
  width: 100%;
}
.inline-form-stack .status-select {
  min-width: 132px;
}
.big-screen-panel {
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 58%, #3b82f6 100%);
  color: #fff;
  border: 1px solid rgba(191,219,254,.18);
  box-shadow: 0 16px 40px rgba(29,78,216,.18);
}
.big-screen-panel .panel-header h2,
.big-screen-panel .panel-header p {
  color: #fff;
}
.period-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.period-kpi-card,
.today-detail-card {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.10));
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(12px);
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.period-kpi-card span,
.today-detail-card span {
  color: rgba(226,232,240,.88);
  font-size: 13px;
  font-weight: 700;
}
.period-kpi-card strong,
.today-detail-card strong {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  letter-spacing: -.03em;
}
.period-kpi-card small,
.today-detail-card small {
  color: rgba(226,232,240,.72);
  font-size: 12px;
}
.today-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 0;
}
.big-screen-status-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.big-screen-status-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.93);
  letter-spacing: 0.02em;
}
.big-screen-status-chart-wrap {
  height: 220px;
  background: rgba(15, 23, 42, 0.28);
  border-radius: 14px;
  padding: 10px 12px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.big-screen-status-chart-wrap canvas {
  display: block;
  max-height: 100%;
}
.notice-panel {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.94));
}
.notice-form {
  width: min(480px, 100%);
  gap: 12px;
}
.notice-form label {
  color: #334155;
  font-weight: 700;
}
.notice-pin-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #475569;
}
.notice-pin-check input {
  width: auto;
}
.notice-list {
  display: grid;
  gap: 12px;
}
.notice-item {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(239,246,255,.94), rgba(255,255,255,.98));
  border: 1px solid rgba(219,234,254,.92);
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.notice-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.notice-item-head strong {
  color: #0f172a;
  font-size: 16px;
}
.notice-item-head span {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}
.notice-item p {
  margin: 10px 0 0;
  color: #475569;
  line-height: 1.7;
}
.clickable-kpi-card {
  appearance: none;
  width: 100%;
  text-align: left;
}
.stat-card-link,
.clickable-kpi-card {
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
  border: none;
}
.stat-card-link:hover,
.clickable-kpi-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.03);
}
.order-status-modal-card {
  max-width: 620px;
}
.summary-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.kpi-filter-tags {
  margin-bottom: 16px;
}
.kpi-filter-tags .summary-status-card strong {
  font-size: 18px;
}
.order-update-btn {
  min-width: 92px;
}
.kpi-today { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 24px rgba(59,130,246,.18); }
.kpi-week { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 24px rgba(99,102,241,.18); }
.kpi-month { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 24px rgba(249,115,22,.18); }
.ranking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.ranking-panel {
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(248,250,252,.86));
}
.ranking-list {
  display: grid;
  gap: 12px;
}
.ranking-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(238,242,255,.92), rgba(248,250,252,.96));
  border: 1px solid rgba(226,232,240,.88);
}
.ranking-item-channel {
  background: linear-gradient(135deg, rgba(255,247,237,.96), rgba(255,255,255,.98));
}
.ranking-index {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #111827, #2563eb);
  color: #fff;
  font-weight: 900;
}
.ranking-main strong {
  display: block;
  font-size: 16px;
  color: #0f172a;
}
.ranking-main span {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}
.ranking-value {
  font-size: 24px;
  font-weight: 900;
  color: #0f766e;
  white-space: nowrap;
}
.full-width-empty {
  grid-column: 1 / -1;
}
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 13px;
  font-weight: 700;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.table-action-stack { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

.settlement-showcase-panel {
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(238,242,255,.86));
}
.settlement-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.settlement-highlight-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 22px;
  color: #fff;
  box-shadow: 0 20px 40px rgba(15,23,42,.14);
}
.settlement-highlight-card h3 {
  margin: 10px 0 6px;
  font-size: 22px;
}
.settlement-highlight-card p {
  margin: 0;
  color: rgba(255,255,255,.84);
}
.settlement-highlight-meta {
  margin-top: 18px;
}
.settlement-highlight-meta strong {
  display: block;
  font-size: 28px;
}
.settlement-highlight-meta small {
  display: block;
  margin-top: 8px;
  color: rgba(255,255,255,.82);
}
.settlement-rank-tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 12px;
  font-weight: 800;
}
.settlement-rank-1 { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.settlement-rank-2 { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.settlement-rank-3 { background: linear-gradient(135deg, #ea580c, #f97316); }
.vivid-chart-panel {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(240,249,255,.92), rgba(245,243,255,.92));
}
.chart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.chart-panel-tip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(226,232,240,.9);
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(15,23,42,.06);
}
.chart-scroll-shell {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.chart-scroll-shell::-webkit-scrollbar {
  height: 8px;
}
.agent-vivid-chart-panel {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.92), rgba(245,243,255,.92));
}
.agent-chart-grid {
  min-width: 880px;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}
.four-chart-grid {
  grid-template-columns: repeat(4, minmax(280px, 1fr));
}
.chart-carousel-grid {
  min-width: 1180px;
  gap: 20px;
}
.chart-card-status {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(238,242,255,.92));
}
.chart-card-today {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(236,253,245,.94));
}
.chart-card-channel {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,247,237,.94));
}
.chart-card-agent {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,245,255,.94));
}
.chart-card {
  position: relative;
  height: 360px;
  width: 100%;
}
.multi-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.chart-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(248,250,252,.88);
  border: 1px solid rgba(226,232,240,.82);
  box-shadow: 0 18px 40px rgba(15,23,42,.08);
}
.chart-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: #0f172a;
}
.chart-box {
  height: calc(100% - 32px);
}
.bar-chart-box {
  min-height: 270px;
}
.donut-chart-box {
  min-height: 270px;
}
.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.summary-modal.show { display: flex; }
.summary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.48);
  backdrop-filter: blur(8px);
}
.summary-modal-card {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 26px;
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 30px 90px rgba(15,23,42,.24);
}
.summary-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.summary-modal-header h2 { margin: 6px 0 8px; }
.summary-modal-header p { margin: 0; color: #64748b; }
.summary-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 800;
  font-size: 12px;
}
.summary-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  background: #f1f5f9;
  color: #0f172a;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.summary-stat-grid,
.summary-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.summary-stat-card,
.summary-status-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border: 1px solid rgba(226,232,240,.9);
}
.summary-stat-card span,
.summary-status-card span {
  display: block;
  color: #64748b;
  margin-bottom: 8px;
  font-weight: 700;
}
.summary-stat-card strong,
.summary-status-card strong {
  display: block;
  font-size: 24px;
  color: #0f172a;
}
.summary-status-card small {
  display: block;
  margin-top: 8px;
  color: #2563eb;
  font-weight: 800;
}
.summary-section { margin-top: 22px; }
.summary-section h3 { margin: 0 0 12px; }
.summary-order-list { display: grid; gap: 10px; }
.summary-order-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(248,250,252,.9);
  border: 1px solid rgba(226,232,240,.86);
}
.summary-order-item span {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}
.summary-order-side { text-align: right; white-space: nowrap; }
.summary-order-side b { display: block; color: #0f766e; }
.summary-order-side em {
  display: inline-block;
  margin-top: 6px;
  font-style: normal;
  color: #3730a3;
  font-weight: 800;
}
.summary-empty {
  padding: 18px;
  border-radius: 16px;
  background: #f8fafc;
  color: #94a3b8;
  text-align: center;
  border: 1px dashed #cbd5e1;
}
.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.summary-modal.show {
  display: flex;
}
.summary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.42);
  backdrop-filter: blur(8px);
}
.summary-modal-card {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 22px;
  border-radius: 26px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 24px 80px rgba(15,23,42,.18);
}
.summary-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.summary-close {
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(148,163,184,.16);
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
}
.kpi-ios-modal-card {
  width: 750px;
  max-width: calc(100vw - 32px);
  max-height: min(88vh, 920px);
  height: auto;
  padding: 24px;
  border-radius: 16px;
  background: rgba(248,248,250,.88);
  border: 1px solid rgba(255,255,255,.68);
  box-shadow: 0 18px 48px rgba(15,23,42,.14);
  backdrop-filter: blur(24px);
}
.kpi-desktop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.kpi-title-wrap h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}
.ios-summary-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(226,232,240,.9);
  color: #475569;
}
.kpi-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}
.kpi-overview-card {
  padding: 16px;
  border-radius: 12px;
  background: #f0f0f5;
  border: 1px solid rgba(226,232,240,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.kpi-overview-card span {
  display: block;
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 10px;
}
.kpi-overview-card strong {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}
.kpi-brand-value {
  color: #2563eb !important;
}
.kpi-filter-meta {
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 8px;
}
.kpi-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-meta-item {
  color: #9ca3af;
  font-size: 14px;
}
.kpi-record-section {
  margin-top: 0;
}
.kpi-order-list {
  display: grid;
  gap: 12px;
}
.kpi-order-item {
  display: grid;
  grid-template-columns: minmax(0, 2fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(226,232,240,.8);
  box-shadow: 0 8px 24px rgba(15,23,42,.05);
  cursor: pointer;
}
.kpi-record-left strong {
  display: block;
  font-size: 14px;
  color: #111827;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-record-left span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-record-center {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}
.kpi-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.kpi-status-processed {
  background: rgba(37,99,235,.10);
  color: #2563eb;
}
.kpi-status-settled {
  background: rgba(16,185,129,.12);
  color: #059669;
}
.kpi-status-pending {
  background: rgba(148,163,184,.14);
  color: #64748b;
}
.kpi-record-right {
  text-align: right;
  display: grid;
  justify-items: end;
  gap: 8px;
}
.kpi-record-right b {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}
.kpi-record-actions {
  display: none;
}
.kpi-record-form-wrap {
  display: none;
}
.kpi-inline-form {
  margin-top: 0;
}
.kpi-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.kpi-inline-grid label span {
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
}
.kpi-inline-grid input,
.kpi-inline-grid select {
  min-height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.92);
}
.kpi-action-modal-card {
  width: min(560px, calc(100vw - 24px));
  border-radius: 16px;
}
.kpi-action-form {
  gap: 14px;
}
.kpi-pagination-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.kpi-pagination-text {
  color: #94a3b8;
  font-size: 14px;
  line-height: 40px;
}
.kpi-footer-actions {
  margin-top: 20px;
}
.kpi-footer-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.kpi-primary-btn,
.kpi-secondary-btn {
  min-height: 40px;
  border-radius: 10px;
  font-size: 14px;
}
.kpi-secondary-btn {
  background: #fff;
  border: 1px solid rgba(226,232,240,.92);
  color: #475569;
}
.empty { text-align: center; color: #94a3b8; }
.tips { margin-top: 18px; color: #475569; line-height: 1.8; }

.apple-login-shell,
.apple-register-shell {
  overflow: hidden;
  padding-top: 16px;
}
.apple-login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.apple-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: .85;
}
.orb-one {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(191,219,254,.45), rgba(147,197,253,.12));
  top: 6%;
  left: 10%;
}
.orb-two {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.9), rgba(196,181,253,.42), rgba(129,140,248,.14));
  bottom: 4%;
  right: 8%;
}
.orb-three {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.92), rgba(186,230,253,.36), rgba(34,211,238,.12));
  top: 52%;
  left: 48%;
}
.apple-login-card,
.apple-register-card {
  width: min(520px, 100%);
  padding: 40px 34px 28px;
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(255,255,255,.52);
  box-shadow: 0 24px 80px rgba(15,23,42,.12);
}
.apple-register-card { width: min(860px, 100%); }
.apple-login-head {
  text-align: center;
  margin-bottom: 26px;
}
.apple-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
  border: 1px solid rgba(226,232,240,.9);
}
.apple-login-head h2 {
  font-size: 38px;
  line-height: 1.1;
  margin-bottom: 10px;
  letter-spacing: -.03em;
}
.apple-login-head p {
  margin: 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.8;
}
.apple-form label,
.register-form label {
  font-weight: 600;
  color: #1e293b;
}
.apple-form input,
.register-form input,
.register-form select {
  min-height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,.86);
}
.apple-login-btn {
  margin-top: 6px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #111827, #000000);
}
.apple-login-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: #64748b;
  font-size: 14px;
}
.register-tips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.contact-card {
  background: linear-gradient(135deg, rgba(17,24,39,.92), rgba(37,99,235,.84));
  color: #fff;
  border: none;
}
.contact-card p { color: rgba(255,255,255,.86); }
.contact-card strong { font-size: 20px; letter-spacing: .04em; }

@media (max-width: 1180px) {
  .team-hero-grid:not(.admin-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settlement-highlight-grid { grid-template-columns: 1fr; }
  .four-chart-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .period-kpi-grid,
  .ranking-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .hero-grid, .admin-grid, .team-hero-grid, .two-col, .info-grid, .register-tips-grid { grid-template-columns: 1fr; }
  .period-kpi-grid,
  .ranking-grid,
  .admin-layout-shell, .agent-layout-shell { grid-template-columns: 1fr; gap: 16px; }
  .admin-side-nav,
  .agent-side-nav {
    position: sticky;
    top: 78px;
    z-index: 12;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
    display: block;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 24px rgba(15,23,42,.08);
    -webkit-overflow-scrolling: touch;
  }
  .admin-side-title { display: none; }
  .admin-side-nav nav,
  .agent-side-nav nav {
    display: flex;
    min-width: max-content;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .admin-side-nav a,
  .agent-side-nav a {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
    min-height: 44px;
  }
  .admin-side-nav a span,
  .agent-side-nav a span {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .admin-side-nav a:hover, .admin-side-nav a.active { transform: translateY(-1px); }
  .multi-chart-grid { grid-template-columns: repeat(3, minmax(260px, 1fr)); }
  .four-chart-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .summary-stat-grid, .summary-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-overview-grid { grid-template-columns: 1fr; }
  .kpi-inline-grid { grid-template-columns: 1fr; }
  .kpi-order-item {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
  }
  .kpi-record-center,
  .kpi-record-right,
  .kpi-footer-actions-right {
    justify-content: flex-start;
    justify-items: start;
    text-align: left;
  }
  .summary-order-item { flex-direction: column; }
  .summary-order-side { text-align: left; }
  .topbar, .topbar-actions, .panel-header.between { align-items: flex-start; flex-direction: column; }
  .topbar { gap: 12px; padding: 16px 18px; }
  .brand-wrap { gap: 12px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .topbar h1 { font-size: 22px; line-height: 1.2; }
  .topbar p { font-size: 13px; line-height: 1.5; }
  .topbar-actions { width: 100%; gap: 8px; }
  .topbar-actions .btn,
  .user-chip { width: 100%; }
  .page { padding: 16px; }
  .panel { padding: 18px; border-radius: 20px; margin-bottom: 18px; }
  .panel-header h2 { font-size: 22px; margin-bottom: 8px; }
  .panel-header p { font-size: 14px; line-height: 1.7; }
  .stat-card, .info-card { padding: 18px; border-radius: 20px; }
  .stat-card span { font-size: 15px; font-weight: 800; color: rgba(255,255,255,.9); }
  .stat-card strong { font-size: 28px; line-height: 1.15; }
  .stat-card small { font-size: 13px; color: rgba(255,255,255,.82); }
  .info-card h3,
  .chart-card h3,
  .summary-section h3 { font-size: 18px; font-weight: 900; color: #0f172a; }
  .info-card p { font-size: 15px; line-height: 1.7; }
  .filter-form,
  .filter-form input,
  .filter-form select,
  .filter-form button { width: 100%; }
  .filter-form input { min-width: 100%; }
  .modern-table-wrap {
    margin-inline: -2px;
    border-radius: 16px;
  }
  table { min-width: 860px; font-size: 14px; }
  th, td { padding: 12px 10px; white-space: nowrap; }
  td:nth-child(6),
  td:nth-child(8) {
    white-space: normal;
    min-width: 120px;
  }
  .inline-form { min-width: 180px; }
  .inline-form select { min-width: 96px; }
  .apple-login-card, .apple-register-card { padding: 30px 22px 24px; }
  .apple-login-head h2 { font-size: 30px; }
}

@media (max-width: 640px) {
  .page { padding: 12px; }
  .topbar {
    position: relative;
    padding: 14px 12px;
  }
  .page-shell { padding-top: 14px; }
  .admin-side-nav,
  .agent-side-nav {
    position: sticky;
    top: 0;
    margin-inline: 0;
    border-radius: 14px;
  }
  .admin-side-nav nav,
  .agent-side-nav nav {
    padding-bottom: 2px;
  }
  .admin-side-nav a,
  .agent-side-nav a {
    font-size: 13px;
    padding: 10px 12px;
  }
  .admin-side-nav a span,
  .agent-side-nav a span {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  .hero-grid,
  .admin-grid,
  .team-hero-grid,
  .info-grid,
  .dashboard-grid { gap: 12px; margin-bottom: 16px; }
  .stat-card strong { font-size: 26px; word-break: break-word; }
  .panel-header h2 { font-size: 21px; font-weight: 900; }
  input, select { min-height: 48px; font-size: 16px; }
  .btn { min-height: 46px; }
  .summary-modal { padding: 12px; align-items: flex-start; }
  .summary-modal-card {
    max-height: calc(100dvh - 24px);
    padding: 18px;
    border-radius: 22px;
  }
  .summary-modal-header { gap: 12px; }
  .summary-stat-grid,
  .summary-status-grid { grid-template-columns: 1fr; }
  .summary-stat-card strong,
  .summary-status-card strong { font-size: 22px; }
  .multi-chart-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .chart-card {
    flex: 0 0 82vw;
    min-width: 260px;
    scroll-snap-align: start;
  }
  .chart-panel .chart-box { height: 260px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .topbar {
    position: relative;
    padding: 10px 16px;
  }
  .brand-mark { width: 34px; height: 34px; }
  .topbar h1 { font-size: 18px; margin-bottom: 2px; }
  .topbar p { display: none; }
  .topbar-actions { flex-direction: row; width: auto; }
  .topbar-actions .btn,
  .user-chip { width: auto; padding: 8px 12px; }
  .page { padding: 12px; }
  .page-shell { padding-top: 12px; }
  .admin-side-nav,
  .agent-side-nav {
    position: relative;
    top: auto;
  }
  .panel { padding: 16px; }
  .hero-grid,
  .admin-grid,
  .team-hero-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .multi-chart-grid {
    display: flex;
    overflow-x: auto;
  }
  .chart-card { flex: 0 0 300px; }
  .chart-panel .chart-box { height: 220px; }
}
