:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e5e7eb;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f59e0b;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 11px 18px;
  font-weight: 700;
}

button.ghost,
.text-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.top {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

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

.top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px;
}

.entry-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.entry-card {
  max-width: 720px;
  margin: 90px auto 0;
}

.entry-card h2,
.panel h3,
.page-head h2 {
  margin: 0;
}

.entry-card p {
  color: var(--muted);
  margin: 8px 0 18px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.form-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

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

.role-text {
  color: var(--blue);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 6px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card .value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 900;
}

.card .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}

.mt {
  margin-top: 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.simple-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.simple-form.compact {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.simple-form.compact:first-of-type {
  border-top: none;
  padding-top: 0;
}

.simple-form h4 {
  grid-column: 1 / -1;
  margin: 0;
}

.simple-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.full {
  grid-column: 1 / -1;
}

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

.customer-form textarea {
  min-height: 72px;
}

.customer-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.customer-columns h4 {
  margin: 0 0 10px;
}

.customer-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.customer-card.a {
  border-left: 4px solid var(--red);
}

.customer-card.b {
  border-left: 4px solid var(--blue);
}

.customer-name {
  font-weight: 900;
  margin-bottom: 4px;
}

.customer-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  background: #dcfce7;
  color: #166534;
}

.badge.red {
  background: #fee2e2;
  color: #991b1b;
}

.badge.orange {
  background: #fef3c7;
  color: #92400e;
}

.badge.blue {
  background: #dbeafe;
  color: #1e40af;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 920px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f9fafb;
  color: var(--muted);
  font-weight: 800;
}

.empty {
  border: 1px dashed var(--line);
  color: var(--muted);
  padding: 18px;
  border-radius: 14px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: #fff;
  padding: 12px 15px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s;
}

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

@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid,
  .customer-columns {
    grid-template-columns: 1fr;
  }

  .customer-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .top {
    padding: 0 16px;
  }

  .wrap {
    padding: 16px;
  }

  .entry-card {
    margin-top: 32px;
  }

  .entry-row,
  .form-2,
  .simple-form,
  .customer-form {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .actions,
  .page-head,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

/* homepage simple patch */
.top {
  height: 72px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: none;
}

.top h1 {
  font-size: 20px;
  letter-spacing: 0;
}

.top p {
  font-size: 13px;
  color: #667085;
}

.entry-card {
  max-width: 560px;
  margin: 96px auto 0;
  padding: 28px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .05);
}

.entry-card h2 {
  font-size: 24px;
  font-weight: 800;
}

.entry-card p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.entry-row {
  grid-template-columns: 1fr 96px;
}

.entry-row input {
  height: 46px;
}

.entry-row button {
  height: 46px;
}

.hint {
  font-size: 13px;
  color: #667085;
}

body {
  background: #f6f8fb;
}

/* ===== landing ui upgrade ===== */
body {
  background:
    radial-gradient(circle at 8% 12%, rgba(37,99,235,.10), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(14,165,233,.11), transparent 30%),
    linear-gradient(180deg, #f7f9ff 0%, #eef3f9 100%);
}

.landing-top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226,232,240,.85);
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 12px 24px rgba(37,99,235,.24);
}

.landing-card {
  max-width: 1080px;
  min-height: 520px;
  margin: 72px auto 0;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  border: 1px solid rgba(226,232,240,.9);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 28px 80px rgba(15,23,42,.10);
}

.landing-left {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mini-label {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  margin-bottom: 16px;
}

.landing-left h2 {
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: -1.4px;
  margin: 0;
}

.landing-sub {
  margin: 14px 0 28px !important;
  color: #64748b;
  font-size: 17px !important;
}

.landing-entry {
  grid-template-columns: 1fr 108px;
  background: #fff;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15,23,42,.06);
}

.landing-entry input {
  border: none;
  height: 48px;
  font-size: 16px;
  background: transparent;
}

.landing-entry input:focus {
  box-shadow: none;
}

.landing-entry button {
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 12px 28px rgba(37,99,235,.24);
}

.landing-note {
  margin-top: 16px;
  color: #64748b;
  font-size: 14px;
}

.landing-right {
  position: relative;
  padding: 46px;
  background:
    linear-gradient(135deg, rgba(15,23,42,.96), rgba(30,64,175,.92)),
    radial-gradient(circle at 30% 20%, rgba(59,130,246,.45), transparent 34%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.landing-right::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .45;
}

.preview-card {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(16px);
}

.main-preview {
  margin-bottom: 18px;
  padding: 24px;
}

.preview-title {
  color: rgba(255,255,255,.72);
  font-weight: 800;
}

.preview-number {
  margin-top: 10px;
  font-size: 56px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -1.8px;
}

.preview-desc {
  margin-top: 8px;
  color: rgba(255,255,255,.72);
}

.preview-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preview-card span {
  display: block;
  color: rgba(255,255,255,.62);
  font-size: 13px;
  margin-bottom: 8px;
}

.preview-card strong {
  display: block;
  font-size: 17px;
}

.auth-card {
  max-width: 620px;
  margin: 88px auto 0;
  padding: 32px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(15,23,42,.10);
}

.auth-head h2 {
  font-size: 30px;
}

.auth-head p {
  margin: 8px 0 20px;
}

.auth-form input {
  height: 48px;
}

.auth-actions button {
  height: 44px;
}

.auth-hint {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

@media (max-width: 900px) {
  .landing-card {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .landing-left {
    padding: 34px;
  }

  .landing-right {
    padding: 30px;
  }

  .landing-left h2 {
    font-size: 36px;
  }
}

@media (max-width: 560px) {
  .landing-entry {
    grid-template-columns: 1fr;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .landing-left,
  .landing-right {
    padding: 24px;
  }
}

.home-grid {
  max-width: 1080px;
  margin: 72px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.home-card {
  margin: 0;
  max-width: none;
  min-height: 320px;
}

.staff-entry-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(239,246,255,.94));
}

.admin-entry-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.96));
}

.admin-login-grid,
.admin-register-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

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

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

.claim-item button {
  padding: 8px 12px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .claim-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .admin-login-grid,
  .admin-register-row {
    grid-template-columns: 1fr;
  }

  .claim-list {
    grid-template-columns: 1fr;
  }
}

/* hide admin entry patch */
.home-grid {
  max-width: 620px;
  margin: 92px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.main-entry-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.main-entry-card h2 {
  font-size: 34px;
  margin-bottom: 22px;
}

.staff-entry-card {
  background:
    radial-gradient(circle at 90% 10%, rgba(37,99,235,.09), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fbff);
}

.admin-mini-link {
  position: absolute;
  right: 22px;
  bottom: 18px;
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.admin-mini-link:hover {
  color: #2563eb;
  background: transparent;
}

.admin-hidden-card {
  min-height: auto;
  padding: 20px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, .06);
  background: rgba(255,255,255,.92);
}

.admin-hidden-card h2 {
  font-size: 20px;
  margin: 0;
}

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

.small-text-btn {
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 9px;
}

.admin-hidden-card .mini-label {
  margin-bottom: 8px;
  font-size: 11px;
}

.admin-hidden-card .actions {
  margin-top: 10px;
}

@media (max-width: 760px) {
  .home-grid {
    margin-top: 36px;
  }

  .main-entry-card {
    min-height: 280px;
  }

  .main-entry-card h2 {
    font-size: 28px;
  }

  .admin-mini-link {
    right: 16px;
    bottom: 14px;
  }
}

/* customer drawer patch */
.customer-card {
  cursor: pointer;
  transition: .18s ease;
}

.customer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
  border-color: #cbd5e1;
}

.customer-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.level-dot {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
}

.level-dot.hot {
  background: #fee2e2;
  color: #991b1b;
}

.level-dot.blue {
  background: #dbeafe;
  color: #1e40af;
}

.customer-follow {
  margin-top: 10px;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .36);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  z-index: 80;
}

.drawer-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.customer-drawer {
  position: fixed;
  right: 0;
  top: 0;
  width: min(560px, 94vw);
  height: 100vh;
  background: #fff;
  z-index: 90;
  transform: translateX(105%);
  transition: .25s ease;
  box-shadow: -18px 0 60px rgba(15, 23, 42, .18);
  display: flex;
  flex-direction: column;
}

.customer-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  height: 82px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.drawer-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.drawer-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  padding: 0;
}

.drawer-form {
  padding: 18px 22px 28px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
}

.drawer-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.drawer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.drawer-section-title {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

#saveCustomerBtn {
  margin-top: 6px;
  width: 100%;
}

.drawer-form input:disabled,
.drawer-form select:disabled,
.drawer-form textarea:disabled {
  background: #f8fafc;
  color: #64748b;
}

@media (max-width: 640px) {
  .drawer-row {
    grid-template-columns: 1fr;
  }

  .customer-drawer {
    width: 100vw;
  }
}

/* staff workspace upgrade */
.staff-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 18px;
}

.daily-panel {
  min-height: 100%;
}

.soft-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.daily-card-form {
  display: grid;
  gap: 14px;
}

.daily-main-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.daily-main-row + .daily-main-row {
  grid-template-columns: repeat(2, 1fr);
}

.daily-card-form label,
.target-form label {
  display: grid;
  gap: 7px;
  color: #667085;
  font-size: 14px;
  font-weight: 700;
}

.daily-card-form input,
.daily-card-form textarea,
.target-form input {
  background: #f9fafb;
}

.side-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.focus-list {
  display: grid;
  gap: 10px;
}

.focus-item {
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.focus-item.red {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.focus-item.orange {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.focus-item.green {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.focus-item.blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.target-form {
  display: grid;
  gap: 11px;
}

.target-form h4 {
  margin: 0;
}

.month-target-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.customer-workbench {
  overflow: visible;
}

.customer-title-row {
  align-items: center;
}

.customer-toolbar {
  display: grid;
  grid-template-columns: 1.4fr .8fr .9fr .9fr .9fr;
  gap: 10px;
  margin-bottom: 18px;
}

.customer-toolbar input,
.customer-toolbar select {
  background: #f9fafb;
}

.customer-columns > div {
  min-width: 0;
}

.customer-card {
  position: relative;
}

.customer-name {
  font-size: 15px;
}

.customer-follow strong {
  color: #334155;
}

.customer-card .badges {
  margin-top: 10px;
}

@media (max-width: 1180px) {
  .staff-workspace {
    grid-template-columns: 1fr;
  }

  .customer-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .daily-main-row,
  .daily-main-row + .daily-main-row,
  .customer-toolbar {
    grid-template-columns: 1fr;
  }
}

/* delete and export patch */
.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  margin-top: 6px;
}

.danger-btn {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.danger-btn:hover {
  background: #fecaca;
}

@media (max-width: 640px) {
  .drawer-actions,
  .page-actions {
    grid-template-columns: 1fr;
    display: grid;
    width: 100%;
  }
}

/* unclaim button */
.mini-danger-btn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
}

.mini-danger-btn:hover {
  background: #ffedd5;
}

/* delete staff from unclaimed pool */
.claim-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.delete-staff-btn {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
}

.delete-staff-btn:hover {
  background: #fecaca;
}

/* admin visual + staff daily drawer */
.visual-board {
  display: grid;
  gap: 12px;
}

.visual-row {
  display: grid;
  grid-template-columns: 120px 1fr 100px;
  gap: 12px;
  align-items: center;
}

.visual-name,
.link-staff-btn {
  border: none;
  background: transparent;
  color: #1d4ed8;
  padding: 0;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.visual-name:hover,
.link-staff-btn:hover {
  text-decoration: underline;
}

.visual-bar {
  height: 12px;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
}

.visual-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
}

.staff-drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .36);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  z-index: 95;
}

.staff-drawer-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.staff-drawer {
  position: fixed;
  right: 0;
  top: 0;
  width: min(680px, 96vw);
  height: 100vh;
  background: #fff;
  z-index: 100;
  transform: translateX(105%);
  transition: .25s ease;
  box-shadow: -18px 0 60px rgba(15, 23, 42, .18);
  display: flex;
  flex-direction: column;
}

.staff-drawer.open {
  transform: translateX(0);
}

.staff-drawer-body {
  overflow-y: auto;
  padding: 18px 22px 28px;
  display: grid;
  gap: 18px;
}

.staff-edit-card,
.staff-history-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.staff-daily-edit-form {
  display: grid;
  gap: 12px;
}

.staff-daily-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.month-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.month-tag {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 13px;
}

.month-tag.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.staff-history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
}

.history-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.history-date {
  font-weight: 900;
  margin-bottom: 8px;
}

.history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #475569;
  font-size: 13px;
  margin-bottom: 8px;
}

.history-metrics span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.history-desc {
  color: #334155;
  font-size: 14px;
}

#adminSortMetric,
#superSortMetric {
  max-width: 180px;
}

@media (max-width: 720px) {
  .visual-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .staff-drawer {
    width: 100vw;
  }
}

/* admin visual with list */
.visual-board {
  display: grid;
  gap: 12px;
}

.visual-row {
  display: grid;
  grid-template-columns: 120px 1fr 110px;
  gap: 12px;
  align-items: center;
}

.visual-name,
.link-staff-btn {
  border: none;
  background: transparent;
  color: #1d4ed8;
  padding: 0;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.visual-name:hover,
.link-staff-btn:hover {
  text-decoration: underline;
}

.visual-bar {
  height: 12px;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
}

.visual-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
}

#adminSortMetric {
  max-width: 190px;
}

@media (max-width: 720px) {
  .visual-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* final close styles */
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#exportExcelBtn {
  background: #ffffff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

#exportExcelBtn:hover {
  background: #eff6ff;
}

.visual-board {
  display: grid;
  gap: 12px;
}

.visual-row {
  display: grid;
  grid-template-columns: 150px 1fr 120px;
  gap: 12px;
  align-items: center;
}

.visual-sub {
  color: #64748b;
  font-size: 12px;
  margin-top: 3px;
}

.visual-name,
.link-staff-btn {
  border: none;
  background: transparent;
  color: #1d4ed8;
  padding: 0;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.visual-name:hover,
.link-staff-btn:hover {
  text-decoration: underline;
}

.visual-bar {
  height: 12px;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
}

.visual-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
}

.super-panel {
  display: grid;
  gap: 18px;
}

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

.super-group-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.super-group-title {
  font-size: 18px;
  font-weight: 900;
}

.super-group-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.super-metric-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  margin-top: 6px;
}

.danger-btn {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.danger-btn:hover {
  background: #fecaca;
}

@media (max-width: 800px) {
  .super-group-grid {
    grid-template-columns: 1fr;
  }

  .visual-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page-actions,
  .drawer-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* =========================================================
   Final UI Polish: clean product style
   ========================================================= */

:root {
  --bg: #f7f7f4;
  --card: #ffffff;
  --text: #111111;
  --muted: #6f6f68;
  --line: #e5e5df;
  --line-strong: #d8d8d0;
  --blue: #111111;
  --green: #10a37f;
  --red: #d92d20;
  --orange: #b54708;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.04);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(16, 163, 127, .07), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(0, 0, 0, .035), transparent 24%),
    var(--bg) !important;
  color: var(--text);
  letter-spacing: -.01em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  border: 1px solid #111111;
  font-weight: 650;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

button.ghost,
.text-btn,
#exportExcelBtn {
  background: #ffffff;
  color: #111111;
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

button.ghost:hover,
.text-btn:hover,
#exportExcelBtn:hover {
  background: #f2f2ee;
  border-color: #cfcfc8;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17,17,17,.06);
  background: #ffffff;
}

/* top */
.top,
.landing-top {
  height: 76px;
  background: rgba(247,247,244,.82) !important;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(229,229,223,.86);
  box-shadow: none !important;
}

.top h1 {
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -.03em;
}

.top p {
  color: var(--muted);
  font-size: 13px;
}

.brand-mark {
  background: #111111 !important;
  color: #ffffff;
  border-radius: 12px;
  box-shadow: none !important;
}

/* layout */
.wrap {
  max-width: 1280px;
}

.entry-card,
.panel,
.card,
.customer-card,
.super-group-card,
.staff-edit-card,
.staff-history-card {
  background: rgba(255,255,255,.82) !important;
  border: 1px solid rgba(229,229,223,.94) !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(16px);
}

.entry-card,
.panel {
  border-radius: 22px;
}

.card {
  border-radius: 18px;
}

.page-head {
  margin-bottom: 22px;
}

.page-head h2 {
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -.04em;
}

.role-text,
.mini-label,
.drawer-kicker {
  color: var(--green) !important;
  background: rgba(16,163,127,.08) !important;
  border: 1px solid rgba(16,163,127,.16);
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .04em;
}

/* home */
.home-grid {
  max-width: 600px;
}

.main-entry-card {
  min-height: 340px;
  background:
    radial-gradient(circle at 90% 8%, rgba(16,163,127,.10), transparent 30%),
    rgba(255,255,255,.86) !important;
}

.main-entry-card h2,
.landing-left h2 {
  font-size: 38px;
  font-weight: 780;
  letter-spacing: -.06em;
}

.entry-row {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.entry-row input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 999px;
  padding-left: 16px;
}

.entry-row button {
  border-radius: 999px;
  min-width: 92px;
}

.admin-mini-link {
  color: #9a9a92 !important;
  font-weight: 600;
}

.admin-mini-link:hover {
  color: #111111 !important;
}

/* cards */
.cards {
  gap: 12px;
}

.card {
  padding: 18px;
}

.card .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.card .value {
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -.05em;
}

.card .sub {
  color: var(--muted);
}

/* panels */
.panel-title h3 {
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -.03em;
}

.panel-title span {
  color: var(--muted);
}

.daily-card-form input,
.daily-card-form textarea,
.target-form input,
.customer-toolbar input,
.customer-toolbar select {
  background: #fbfbf9;
}

/* badges */
.badge {
  border-radius: 999px;
  font-weight: 680;
}

.badge.green {
  background: rgba(16,163,127,.10);
  color: #08785f;
}

.badge.blue {
  background: rgba(17,17,17,.06);
  color: #111111;
}

.badge.orange {
  background: #fff4e5;
  color: #8a4b00;
}

.badge.red {
  background: #fff1f0;
  color: #b42318;
}

/* customer cards */
.customer-card {
  border-radius: 18px;
  padding: 16px;
}

.customer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(0,0,0,.07) !important;
}

.customer-card.a {
  border-left: 4px solid var(--green) !important;
}

.customer-card.b {
  border-left: 4px solid #111111 !important;
}

.customer-name {
  font-weight: 760;
  letter-spacing: -.02em;
}

.customer-meta,
.customer-follow {
  color: var(--muted);
}

.level-dot.hot,
.level-dot.blue {
  background: #111111;
  color: #ffffff;
  border-radius: 999px;
}

/* tables */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
}

table {
  background: #ffffff;
}

th {
  background: #f7f7f4;
  color: #5f5f58;
  font-weight: 720;
}

td {
  color: #222222;
}

tr:hover td {
  background: #fbfbf8;
}

.link-staff-btn,
.visual-name {
  color: #111111 !important;
  font-weight: 720;
}

.link-staff-btn:hover,
.visual-name:hover {
  color: var(--green) !important;
  text-decoration: none;
}

/* visual bars */
.visual-board {
  gap: 14px;
}

.visual-row {
  background: #fbfbf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.visual-bar {
  height: 10px;
  background: #ecece6;
}

.visual-bar span {
  background: linear-gradient(90deg, #111111, var(--green));
}

/* drawers */
.customer-drawer,
.staff-drawer {
  background: #fbfbf8 !important;
  border-left: 1px solid var(--line);
}

.drawer-head {
  background: rgba(251,251,248,.92);
  backdrop-filter: blur(16px);
}

.drawer-head h3 {
  font-weight: 760;
  letter-spacing: -.04em;
}

.drawer-form,
.staff-drawer-body {
  background: #fbfbf8;
}

.drawer-close {
  background: #ffffff;
  color: #111111;
  border: 1px solid var(--line);
}

.drawer-section-title {
  color: #111111;
  font-weight: 760;
}

/* history */
.month-tag {
  background: #ffffff;
  border: 1px solid var(--line);
  color: #4b4b45;
}

.month-tag.active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.history-item {
  background: #ffffff;
  border: 1px solid var(--line);
}

.history-item:hover {
  background: #f5f5f1;
  border-color: #d2d2ca;
}

/* danger */
.danger-btn,
.mini-danger-btn,
.delete-staff-btn {
  background: #fff1f0 !important;
  color: #b42318 !important;
  border: 1px solid #ffd0cc !important;
}

.danger-btn:hover,
.mini-danger-btn:hover,
.delete-staff-btn:hover {
  background: #ffe4e1 !important;
}

/* focus hints */
.focus-item {
  border-radius: 16px;
}

.focus-item.green {
  background: rgba(16,163,127,.08);
  color: #08785f;
  border-color: rgba(16,163,127,.18);
}

.focus-item.blue {
  background: rgba(17,17,17,.045);
  color: #111111;
  border-color: rgba(17,17,17,.08);
}

.focus-item.orange {
  background: #fff8ee;
  color: #8a4b00;
}

.focus-item.red {
  background: #fff1f0;
  color: #b42318;
}

/* mobile */
@media (max-width: 760px) {
  .top {
    height: auto;
    min-height: 72px;
    padding: 14px 16px;
  }

  .page-head h2 {
    font-size: 24px;
  }

  .main-entry-card h2 {
    font-size: 32px;
  }

  .entry-row {
    border-radius: 20px;
  }

  .entry-row button {
    width: 100%;
  }

  .panel,
  .entry-card {
    border-radius: 18px;
  }
}
