:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --ink: #000000;
  --ink-2: #222222;
  --ink-soft: #86868b;
  --line: #ebebeb;
  --line-strong: #dddddd;
  --primary: #e60012;
  --primary-dark: #c90010;
  --primary-soft: #fff0f1;
  --success: #2ca66f;
  --success-soft: #ecf9f2;
  --warning: #e68a00;
  --warning-soft: #fff7e8;
  --info: #1677ff;
  --info-soft: #edf5ff;
  --danger: #e60012;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.045);
  --radius: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --keyboard-height: 0px;
  --visual-viewport-height: 100dvh;
  font-family:
    "MiSans", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #eeeeee;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
select,
input[type="date"],
input[type="month"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(230, 0, 18, 0.22);
  outline-offset: 1px;
}

svg {
  display: block;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(123px + var(--safe-bottom));
  background: var(--bg);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
}

.topbar-main {
  position: relative;
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.topbar-back {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: #000;
  text-decoration: none;
}

.topbar-logout {
  display: inline-flex;
  min-width: 58px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.topbar-save {
  min-width: 58px;
  min-height: 40px;
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.topbar-spacer {
  width: 58px;
  flex: 0 0 auto;
}

.brand-block {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42%;
  min-width: 0;
  text-align: center;
  transform: translate(-50%, -50%);
}

.brand-block h1,
.brand-block p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-block h1 {
  color: #333333;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.brand-block p {
  margin-top: 1px;
  color: #666666;
  font-size: 10px;
  font-weight: 400;
}

.role-trigger {
  display: inline-flex;
  min-width: 0;
  max-width: 148px;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #000;
  background: #fff;
  text-decoration: none;
  cursor: pointer;
}

.role-avatar,
.person-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #111;
  font-weight: 600;
}

.admin-shell .role-avatar {
  background: var(--primary);
}

.role-avatar {
  width: 27px;
  height: 27px;
  font-size: 11px;
}

.role-copy {
  min-width: 0;
  text-align: left;
}

.role-copy strong,
.role-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-copy strong {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.role-copy span {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 9px;
}

.chevron {
  flex: 0 0 auto;
  color: var(--ink-soft);
}

.page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 12px 12px 28px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 2px 12px;
}

.page-heading h2,
.section-title h2 {
  margin: 0;
  color: #111;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
}

.page-heading p,
.section-title p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.date-switcher {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.date-switcher input,
.month-picker {
  width: 132px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #222;
  background: #fff;
  font-size: 12px;
}

.admin-heading-controls {
  display: grid;
  min-width: 0;
  max-width: 270px;
  flex: 1 1 auto;
  grid-template-columns: minmax(82px, 1fr) 132px;
  gap: 6px;
}

.organization-picker {
  display: inline-flex;
  min-width: 0;
  height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #222;
  background: #fff;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.organization-picker svg {
  flex: 0 0 auto;
}

.organization-picker svg:first-child {
  color: var(--primary);
}

.organization-picker span {
  overflow: hidden;
  flex: 1 1 auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #333;
  background: #fff;
  cursor: pointer;
}

.summary-band {
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 10px;
  color: #000;
  background: #fff;
  box-shadow: var(--shadow);
}

.sales-shell .summary-band {
  border-top: 3px solid #111;
}

.admin-shell .summary-band {
  border-top: 3px solid var(--primary);
}

.summary-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px 13px;
}

.summary-copy {
  min-width: 0;
}

.summary-copy .eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 11px;
}

.summary-number {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.summary-number strong {
  color: #000;
  font-size: 32px;
  font-weight: 650;
  line-height: 1;
}

.summary-number span {
  color: #555;
  font-size: 13px;
}

.summary-copy p {
  margin: 8px 0 0;
  color: #666;
  font-size: 11px;
}

.progress-ring {
  --progress: 0;
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary) calc(var(--progress) * 1%),
    #eeeeee 0
  );
}

.sales-shell .progress-ring {
  background: conic-gradient(
    #111111 calc(var(--progress) * 1%),
    #eeeeee 0
  );
}

.progress-ring::before {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.progress-ring strong {
  position: relative;
  color: #111;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.summary-stat {
  min-width: 0;
  padding: 11px 6px;
  background: #f7f7f7;
  text-align: center;
}

.summary-stat strong,
.summary-stat span {
  display: block;
}

.summary-stat strong {
  color: #111;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.summary-stat span {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.notice-strip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #ffe0b2;
  border-radius: 8px;
  color: #8a4f00;
  background: var(--warning-soft);
  font-size: 12px;
}

.notice-strip svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--warning);
}

.section {
  margin-top: 18px;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 9px;
}

.text-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
}

.action-panel,
.metric-panel,
.feedback-item,
.report-card,
.member-list,
.ranking-list,
.profile-section,
.form-section,
.filter-panel,
.submitted-feedback-section {
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.action-panel,
.metric-panel {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px;
}

.action-panel .status-mark {
  display: inline-flex;
  width: max-content;
  min-height: 24px;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 500;
}

.action-panel .status-mark.complete {
  color: var(--success);
  background: var(--success-soft);
}

.action-panel h3 {
  margin: 10px 0 4px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
}

.action-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--primary);
  color: #fff;
  background: var(--primary);
}

.primary-button:active {
  background: var(--primary-dark);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.topbar-save:disabled {
  cursor: wait;
  opacity: 0.55;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: #333;
  background: #f5f5f5;
}

.danger-button {
  border: 1px solid #ffc8cd;
  color: var(--danger);
  background: #fff5f6;
}

.action-panel .primary-button {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  font-size: 13px;
}

.metric-panel .metric-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-soft);
}

.metric-panel strong {
  display: block;
  margin-top: 14px;
  color: #111;
  font-size: 23px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.metric-panel span {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
}

.feedback-list,
.report-list {
  display: grid;
  gap: 9px;
}

.feedback-item {
  padding: 12px;
  cursor: pointer;
}

.feedback-head,
.report-head,
.member-row,
.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-author,
.person-block {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.person-avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.person-avatar.orange {
  background: #ef755a;
}

.person-avatar.blue,
.person-avatar.gold {
  background: var(--primary);
}

.person-copy {
  min-width: 0;
}

.person-copy strong,
.person-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-copy strong {
  color: #222;
  font-size: 12px;
  font-weight: 600;
}

.person-copy span {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.time-label {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 10px;
}

.feedback-item > p {
  margin: 9px 0 0 43px;
  color: #333;
  font-size: 12px;
  line-height: 1.7;
}

.filter-panel {
  margin-bottom: 12px;
  padding: 12px;
}

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

.field-compact {
  min-width: 0;
}

.field-compact label {
  display: block;
  margin-bottom: 5px;
  color: #666;
  font-size: 11px;
}

.field-compact select,
.field-compact input {
  width: 100%;
  height: 40px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #222;
  background: #fff;
  font-size: 12px;
}

.field-compact .organization-picker {
  width: 100%;
  height: 40px;
}

.segment-control {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  margin-top: 10px;
  padding: 3px;
  border-radius: 7px;
  background: #f2f2f2;
}

.segment-control button {
  min-height: 34px;
  padding: 5px 6px;
  border: 0;
  border-radius: 5px;
  color: #666;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.segment-control button.active {
  color: #fff;
  background: var(--primary);
}

.member-list {
  overflow: hidden;
}

.member-row {
  min-height: 64px;
  padding: 10px 12px;
}

.member-row + .member-row {
  border-top: 1px solid var(--line);
}

.member-row.clickable {
  cursor: pointer;
}

.member-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bbbbbd;
}

.status-dot.submitted {
  background: var(--success);
}

.status-dot.late {
  background: var(--warning);
}

.member-status .comment-count {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 6px;
  border-radius: 12px;
  color: var(--info);
  background: var(--info-soft);
  font-size: 10px;
}

.report-card {
  padding: 12px;
  cursor: pointer;
}

.report-card:active {
  background: #fafafa;
}

.report-title {
  min-width: 0;
}

.report-title strong,
.report-title span {
  display: block;
}

.report-title strong {
  overflow: hidden;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-title span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 23px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 500;
}

.status-badge.submitted {
  color: var(--success);
  background: var(--success-soft);
}

.status-badge.pending {
  color: var(--primary);
  background: var(--primary-soft);
}

.status-badge.commented {
  color: var(--info);
  background: var(--info-soft);
}

.status-badge.late {
  color: var(--warning);
  background: var(--warning-soft);
}

.report-badges {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.report-summary {
  min-width: 0;
  margin-top: 10px;
}

.report-summary-label {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  color: #666;
  background: #f2f2f2;
  font-size: 9px;
  font-weight: 600;
}

.report-summary-label.smart {
  color: var(--primary);
  background: var(--primary-soft);
}

.report-excerpt {
  margin: 5px 0 0;
  color: #333;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.report-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}

.report-meta span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.report-meta .location {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-feedback-preview {
  margin-top: 10px;
  padding: 8px 9px;
  border-left: 2px solid var(--primary);
  background: #fafafa;
}

.report-feedback-preview > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.report-feedback-preview span {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
}

.report-feedback-preview strong {
  overflow: hidden;
  color: #666;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-feedback-preview p {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  color: #333;
  font-size: 11px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.sales-card-info {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.sales-card-info > .location {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: #666;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-summary {
  margin-top: 10px;
  padding: 13px 0 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.viewer-summary.compact {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.viewer-summary.compact svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.viewer-summary.compact span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.viewer-summary.compact strong {
  color: #666;
  font-weight: 500;
}

.viewer-summary-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #222;
}

.viewer-summary-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.viewer-summary-heading svg {
  flex: 0 0 auto;
  color: var(--primary);
}

.viewer-summary-heading strong {
  font-size: 12px;
  font-weight: 600;
}

.viewer-summary-title > span {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 10px;
}

.viewer-list {
  display: grid;
  margin-top: 8px;
}

.viewer-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
}

.viewer-row + .viewer-row {
  border-top: 1px solid #f1f1f1;
}

.viewer-avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 600;
}

.viewer-person {
  min-width: 0;
}

.viewer-person strong,
.viewer-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-person strong {
  color: #333;
  font-size: 11px;
  font-weight: 600;
}

.viewer-person small,
.viewer-empty,
.viewer-time {
  color: var(--ink-soft);
  font-size: 9px;
}

.viewer-person small {
  margin-top: 1px;
}

.viewer-time {
  white-space: nowrap;
}

.viewer-empty {
  display: block;
  padding: 12px 0 8px;
  text-align: center;
}

.empty-state {
  padding: 34px 18px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.empty-state svg {
  margin: 0 auto 9px;
  color: #a0a0a0;
}

.empty-state strong {
  display: block;
  color: #333;
  font-size: 13px;
  font-weight: 550;
}

.empty-state p {
  margin: 4px 0 0;
  font-size: 11px;
}

.form-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 11px 12px;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.compact-date-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.compact-date-row label {
  min-width: 0;
  text-align: center;
}

.compact-date-row label > span {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
}

.compact-date-row input {
  width: 132px;
  max-width: 100%;
  height: 28px;
  padding: 0;
  border: 0;
  color: #222;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.form-intro strong {
  display: block;
  color: #222;
  font-size: 13px;
  font-weight: 550;
}

.form-intro span {
  display: block;
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.form-section {
  overflow: hidden;
  margin-bottom: 8px;
  padding: 0 12px 12px;
}

.form-section-title {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  margin: 0 -12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.section-index {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 600;
}

.form-section-title h3 {
  margin: 0;
  color: #111;
  font-size: 14px;
  font-weight: 600;
}

.form-section-heading {
  min-width: 0;
}

.form-section-heading strong,
.form-section-heading small {
  display: block;
}

.form-section-heading strong {
  color: #111;
  font-size: 14px;
  font-weight: 600;
}

.form-section-heading small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 400;
}

.form-disclosure {
  padding-bottom: 0;
}

.form-disclosure summary {
  list-style: none;
  cursor: pointer;
}

.form-disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure-icon {
  margin-left: auto;
  color: var(--ink-soft);
  transition: transform 160ms ease;
}

.form-disclosure[open] .disclosure-icon {
  transform: rotate(180deg);
}

.disclosure-body {
  padding-bottom: 8px;
}

.field {
  margin-top: 12px;
}

.field:first-child {
  margin-top: 0;
}

.field label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: #222;
  font-size: 12px;
  font-weight: 500;
}

.field-hint {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 400;
}

.required {
  color: var(--primary);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #222;
  background: #f7f7f7;
}

.field input,
.field select {
  height: 42px;
  padding: 0 10px;
}

.field textarea {
  min-height: 88px;
  padding: 9px 10px;
  line-height: 1.65;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #ffadb4;
  background: #fff;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #999;
}

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-grid > .field {
  min-width: 0;
  margin-top: 0;
}

.input-history {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.input-history summary {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  color: #555;
  font-size: 10px;
  list-style: none;
  cursor: pointer;
}

.input-history summary::-webkit-details-marker {
  display: none;
}

.input-history summary > span:first-child {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.input-history summary svg {
  flex: 0 0 auto;
  color: var(--ink-soft);
}

.input-history-count {
  flex: 0 0 auto;
  color: var(--ink-soft);
}

.input-history[open] summary {
  border-bottom: 1px solid var(--line);
}

.input-history-list {
  display: grid;
  padding: 3px 8px;
}

.input-history-list button {
  width: 100%;
  min-height: 36px;
  padding: 8px 1px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: #333;
  background: transparent;
  font-size: 11px;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.input-history-list button:last-child {
  border-bottom: 0;
}

.input-history-list button:active {
  color: var(--primary);
}

.target-list {
  overflow: hidden;
}

.target-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.target-row:last-child {
  border-bottom: 0;
}

.target-row label {
  color: #222;
  font-size: 12px;
  font-weight: 400;
}

.percent-input {
  display: flex;
  height: 36px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f7f7f7;
}

.percent-input:focus-within {
  border-color: #ffadb4;
  background: #fff;
}

.percent-input input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 4px 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: right;
}

.percent-input span {
  flex: 0 0 auto;
  padding-right: 8px;
  color: var(--ink-soft);
  font-size: 11px;
}

.check-row {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 9px;
  margin: 0 -1px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.check-row input {
  width: 19px;
  height: 19px;
  accent-color: var(--primary);
}

.check-row span {
  color: #222;
  font-size: 12px;
}

.toggle-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.toggle-row + .toggle-row {
  border-top: 1px solid var(--line);
}

.toggle-copy strong,
.toggle-copy span {
  display: block;
}

.toggle-copy strong {
  color: #222;
  font-size: 12px;
  font-weight: 500;
}

.toggle-copy span {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.switch {
  position: relative;
  width: 42px;
  height: 25px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: #c7c7c7;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(17px);
}

.support-field[hidden] {
  display: none;
}

.vehicle-fields[hidden] {
  display: none;
}

.form-actions {
  position: sticky;
  z-index: 20;
  bottom: calc(59px + var(--safe-bottom));
  display: grid;
  grid-template-columns: 0.85fr 1.4fr;
  gap: 10px;
  margin: 12px -12px -28px;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.form-mode {
  padding-bottom: 0;
}

.form-mode .report-form-page {
  padding-bottom: 148px;
}

.form-mode .form-actions {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, 760px);
  margin: 0;
  transform: translateX(-50%);
  grid-template-columns: 1fr;
}

body.keyboard-open .form-actions {
  display: none;
}

body.keyboard-open .system-credit {
  display: none;
}

body.keyboard-open .form-mode .report-form-page {
  padding-bottom: calc(var(--keyboard-height) + 32px);
}

body.keyboard-open input,
body.keyboard-open textarea,
body.keyboard-open select {
  scroll-margin-top: calc(72px + var(--safe-top));
  scroll-margin-bottom: 24px;
}

.compact-button {
  min-height: 36px;
  padding: 5px 11px;
  font-size: 12px;
}

.ranking-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.ranking-stat {
  min-width: 0;
  padding: 12px 6px;
  background: #fff;
  text-align: center;
}

.ranking-stat strong,
.ranking-stat span {
  display: block;
}

.ranking-stat strong {
  color: #111;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ranking-stat span {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.ranking-list {
  overflow: hidden;
}

.ranking-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 56px;
  min-height: 74px;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
}

.ranking-row + .ranking-row {
  border-top: 1px solid var(--line);
}

.rank-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: #777;
  background: #f0f0f0;
  font-size: 11px;
  font-weight: 600;
}

.ranking-row:nth-child(1) .rank-number {
  color: #8a5d00;
  background: #ffe8a3;
}

.ranking-row:nth-child(2) .rank-number {
  color: #555;
  background: #e5e5e5;
}

.ranking-row:nth-child(3) .rank-number {
  color: #8a4c32;
  background: #f2d0bf;
}

.ranking-info {
  min-width: 0;
}

.ranking-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ranking-name strong {
  overflow: hidden;
  color: #222;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 500;
}

.trend.up {
  color: var(--success);
}

.trend.down {
  color: var(--primary);
}

.trend.flat {
  color: var(--ink-soft);
}

.rank-bar {
  display: block;
  width: 100%;
  overflow: hidden;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #eeeeee;
  appearance: none;
}

.rank-bar::-webkit-progress-bar {
  border-radius: inherit;
  background: #eeeeee;
}

.rank-bar::-webkit-progress-value {
  border-radius: inherit;
  background: var(--primary);
}

.rank-bar::-moz-progress-bar {
  border-radius: inherit;
  background: var(--primary);
}

.ranking-detail {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.ranking-value {
  text-align: right;
}

.ranking-value strong,
.ranking-value span {
  display: block;
}

.ranking-value strong {
  color: #111;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ranking-value span {
  color: var(--ink-soft);
  font-size: 9px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 10px;
  padding: 18px 15px;
  border-radius: var(--radius);
  color: #111;
  background: #fff;
  box-shadow: var(--shadow);
}

.profile-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 17px;
  font-weight: 600;
}

.sales-shell .profile-avatar {
  background: #111;
}

.profile-header h2 {
  margin: 0;
  color: #111;
  font-size: 18px;
  font-weight: 600;
}

.profile-header p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.profile-section {
  overflow: hidden;
  margin-bottom: 9px;
}

.profile-section-title {
  padding: 11px 12px 6px;
  color: var(--ink-soft);
  font-size: 10px;
}

.profile-row {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
}

.profile-row + .profile-row {
  border-top: 1px solid var(--line);
}

.profile-row > span:first-child {
  color: #222;
  font-size: 12px;
}

.profile-value {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: calc(59px + var(--safe-bottom));
  padding: 3px max(8px, env(safe-area-inset-right, 0px)) var(--safe-bottom)
    max(8px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
}

.sales-shell .bottom-nav {
  grid-template-columns: repeat(3, 1fr);
}

.admin-shell .bottom-nav.with-report-action {
  grid-template-columns: repeat(5, 1fr);
}

.nav-item {
  display: flex;
  min-width: 0;
  min-height: 55px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px;
  border: 0;
  color: #8f8f8f;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.admin-shell .nav-report-action {
  color: var(--primary);
}

.sales-shell .nav-item.active {
  color: #111;
}

.overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: var(--safe-top);
  background: rgba(0, 0, 0, 0.5);
  animation: fade-in 140ms ease-out;
}

.sheet {
  display: flex;
  width: min(100%, 760px);
  max-height: calc(94dvh - var(--safe-top));
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: #fff;
  animation: rise-in 180ms ease-out;
}

.sheet-header {
  display: flex;
  min-height: 58px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-header h2 {
  overflow: hidden;
  margin: 0;
  color: #111;
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-body {
  overflow-y: auto;
  padding: 12px;
  overscroll-behavior: contain;
}

.sheet-body.flush {
  padding: 0;
}

.sheet-close {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 18px;
  color: #666;
  background: #f5f5f5;
  cursor: pointer;
}

.active-check {
  flex: 0 0 auto;
  color: var(--primary);
}

.organization-tree-sheet {
  width: min(100%, 560px);
}

.organization-tree-body {
  padding: 0;
}

.organization-current-path {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
}

.organization-current-path span {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 10px;
}

.organization-current-path strong {
  overflow: hidden;
  color: #222;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-tree {
  padding-bottom: 8px;
}

.organization-tree-row {
  display: flex;
  min-height: 52px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.organization-tree-row.active {
  background: var(--primary-soft);
}

.organization-tree-row.org-level-1 {
  padding-left: 14px;
}

.organization-tree-row.org-level-2 {
  padding-left: 28px;
}

.organization-tree-row.org-level-3 {
  padding-left: 42px;
}

.organization-node-select {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 9px;
  padding: 7px 4px 7px 12px;
  border: 0;
  color: #222;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.organization-node-marker {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #888;
  font-size: 10px;
  font-weight: 600;
}

.organization-node-marker.root {
  background: var(--primary);
}

.organization-node-marker.military {
  background: #333;
}

.organization-node-marker.theater {
  color: #333;
  background: #e8e8e8;
}

.organization-node-marker.area {
  border: 1px solid #cfcfcf;
  color: #666;
  background: #fff;
}

.organization-node-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.organization-node-copy strong,
.organization-node-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-node-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.organization-node-copy span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.organization-node-toggle {
  display: inline-grid;
  width: 42px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  color: #888;
  background: transparent;
  cursor: pointer;
}

.organization-node-toggle svg {
  transition: transform 160ms ease;
}

.organization-node-toggle.expanded svg {
  transform: rotate(90deg);
}

.organization-tree-children-shell {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 180ms ease;
}

.organization-tree-item.expanded > .organization-tree-children-shell {
  grid-template-rows: 1fr;
}

.organization-tree-children {
  min-height: 0;
  overflow: hidden;
}

.report-detail {
  display: grid;
  gap: 0;
}

.detail-hero {
  padding: 13px 12px;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  color: #111;
  background: #f7f7f7;
}

.detail-hero h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.detail-hero p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.detail-block {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.detail-block:last-child {
  border-bottom: 0;
}

.detail-block h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 7px;
  color: #111;
  font-size: 12px;
  font-weight: 600;
}

.detail-block h4 svg {
  color: var(--primary);
}

.detail-block p {
  margin: 0;
  color: #333;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.metric-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-chip {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #f5f5f5;
  font-size: 10px;
}

.metric-chip strong {
  color: var(--primary);
}

.comments-section {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: #f7f7f7;
}

.comments-section h4 {
  margin: 0 0 10px;
  color: #111;
  font-size: 13px;
  font-weight: 600;
}

.comment {
  padding: 10px 0;
}

.comment:first-of-type {
  padding-top: 0;
}

.comment + .comment {
  border-top: 1px solid var(--line);
}

.comment p {
  margin: 7px 0 0 43px;
  color: #333;
  font-size: 12px;
  line-height: 1.65;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.comment-form textarea {
  min-height: 42px;
  max-height: 110px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  resize: vertical;
}

.comment-form button {
  min-height: 42px;
  align-self: end;
}

.submitted-feedback-section {
  margin-bottom: 8px;
  padding: 12px;
}

.submitted-feedback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.submitted-feedback-header h3 {
  margin: 0;
  color: #111;
  font-size: 14px;
  font-weight: 600;
}

.submitted-feedback-header span {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.submitted-feedback-header .feedback-total {
  flex: 0 0 auto;
  margin-top: 1px;
}

.submitted-feedback-section .viewer-summary {
  margin-top: 10px;
}

.submitted-comments {
  margin-top: 2px;
}

.submitted-comments .comment {
  padding: 11px 0;
}

.submitted-feedback-empty {
  padding: 17px 0 7px;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: center;
}

.compact-feedback-action {
  min-height: 36px;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 200;
  top: calc(72px + var(--safe-top));
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 9px 13px;
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, 0.84);
  font-size: 12px;
  transform: translateX(-50%);
  animation: toast-in 180ms ease-out;
}

.boot-state {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--ink-soft);
  font-size: 12px;
}

.access-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  place-items: center;
  background: var(--bg);
}

body.keyboard-open .access-shell {
  place-items: start center;
  padding-top: calc(16px + var(--safe-top));
}

.access-panel {
  width: min(100%, 380px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.access-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 50%;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
}

.access-heading {
  margin-bottom: 20px;
}

.access-heading h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
}

.access-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.access-panel form {
  display: grid;
  gap: 14px;
}

.identity-fields {
  display: grid;
  gap: 12px;
}

.access-panel .field {
  padding: 0;
}

.access-panel .field label {
  display: block;
  margin-bottom: 6px;
  color: #333;
  font-size: 12px;
  font-weight: 600;
}

.access-panel .field input,
.access-panel .field select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #222;
  background: #fff;
  font: inherit;
}

.access-panel .field input:focus,
.access-panel .field select:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary-soft);
}

.access-error {
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.access-error[hidden] {
  display: none;
}

.password-rule,
.password-reset-note {
  margin: -3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.password-reset-note {
  padding: 9px 10px;
  border-radius: 6px;
  color: #7b4a00;
  background: var(--warning-soft);
}

.compact-sheet {
  width: min(100%, 440px);
}

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

.password-form .field {
  min-width: 0;
}

.password-form .field label {
  display: block;
  margin-bottom: 6px;
  color: #333;
  font-size: 12px;
  font-weight: 600;
}

.password-form .field input,
.password-form .field select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #222;
  background: #fff;
  font: inherit;
}

.password-form .field input:focus,
.password-form .field select:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary-soft);
}

.password-input {
  position: relative;
  width: 100%;
}

.access-panel .field .password-input input,
.password-form .field .password-input input {
  padding-right: 48px;
}

.password-visibility {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 3px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  place-items: center;
  color: #666;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
  touch-action: manipulation;
}

.password-visibility:active {
  background: var(--surface-soft);
}

.password-visibility:focus-visible {
  outline: 2px solid rgba(230, 0, 18, 0.22);
  outline-offset: -2px;
}

.sheet-loading {
  display: grid;
  min-height: 140px;
  place-items: center;
  color: var(--ink-soft);
  font-size: 12px;
}

.service-error-panel .access-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.full-width {
  width: 100%;
}

.link-button {
  text-decoration: none;
}

.profile-button {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.profile-button .profile-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.system-credit {
  position: fixed;
  z-index: 35;
  bottom: calc(59px + var(--safe-bottom));
  left: 50%;
  display: grid;
  width: min(100%, 760px);
  min-height: 64px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  margin: 0;
  padding: 7px 12px 6px;
  color: #9a9a9a;
  background: rgba(247, 247, 247, 0.98);
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.form-mode.has-bottom-action .system-credit {
  bottom: calc(59px + var(--safe-bottom));
}

.form-mode:not(.has-bottom-action) .system-credit {
  bottom: 0;
}

.system-credit::before {
  width: 28px;
  height: 2px;
  margin-bottom: 4px;
  border-radius: 2px;
  background: var(--primary);
  content: "";
}

.system-credit-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 10px;
  line-height: 1.35;
}

.system-credit-brand strong {
  color: #555;
  font-size: 11px;
  font-weight: 650;
}

.system-credit p {
  max-width: 100%;
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.sheet-subtitle {
  display: block;
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.detail-content {
  margin-top: 10px;
}

.detail-hero-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-hero-title h3 {
  min-width: 0;
}

.detail-permission {
  margin: 10px 2px 0;
  color: var(--ink-soft);
  font-size: 9px;
  text-align: center;
}

.comment-empty {
  padding: 13px 0;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: center;
}

.ranking-tabs {
  margin: 0 0 10px;
}

.simple-home {
  padding-top: 12px;
}

.simple-home .page-heading {
  margin-bottom: 10px;
}

.today-task-card {
  padding: 15px;
  border-top: 3px solid #111;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.today-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 10px;
}

.today-task-head span:first-child {
  color: #333;
  font-weight: 600;
}

.today-task-card > h2 {
  margin: 16px 0 3px;
  color: #111;
  font-size: 20px;
  font-weight: 650;
}

.today-task-card > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.today-task-stats {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin: 15px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.today-task-stats > div {
  min-width: 0;
  padding: 10px 4px;
  background: #fafafa;
  text-align: center;
}

.today-task-stats strong,
.today-task-stats span {
  display: block;
}

.today-task-stats strong {
  color: #111;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.today-task-stats strong small {
  color: #555;
  font-size: 10px;
  font-weight: 500;
}

.today-status-stat.complete strong {
  color: var(--success);
}

.today-status-stat.pending strong {
  color: var(--primary);
}

.today-task-stats span {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.today-task-action {
  min-height: 44px;
}

.simple-link-row {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  color: #222;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}

.simple-link-row strong,
.simple-link-row small {
  display: block;
}

.simple-link-row strong {
  font-size: 13px;
  font-weight: 600;
}

.simple-link-row small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.simple-link-row svg {
  flex: 0 0 auto;
  color: var(--ink-soft);
}

.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 2px 10px;
}

.dashboard-heading > div:first-child,
.page-heading > div:first-child {
  min-width: 0;
}

.dashboard-heading h2 {
  margin: 0;
  color: #111;
  font-size: 18px;
  font-weight: 650;
}

.dashboard-heading p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.dashboard-heading input {
  width: 132px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #222;
  background: #fff;
  font-size: 12px;
}

.admin-summary-card {
  overflow: hidden;
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-summary-head {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.admin-summary-head strong {
  color: #222;
  font-size: 13px;
  font-weight: 600;
}

.admin-summary-head span {
  color: var(--success);
  font-size: 11px;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.admin-kpi-grid > * {
  min-width: 0;
  padding: 14px 6px;
  text-align: center;
}

.admin-kpi-grid > * + * {
  border-left: 1px solid var(--line);
}

.admin-kpi-item {
  appearance: none;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: background 160ms ease;
}

.admin-kpi-item:hover {
  background: #fafafa;
}

.admin-kpi-item:active {
  background: #f3f3f3;
}

.admin-kpi-item:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.admin-kpi-grid strong,
.admin-kpi-grid span {
  display: block;
}

.admin-kpi-grid strong {
  color: #111;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.admin-kpi-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.admin-kpi-grid span svg {
  flex: 0 0 auto;
}

.admin-kpi-grid .pending strong,
.admin-kpi-grid .pending span {
  color: var(--primary);
}

.modal-open {
  overflow: hidden;
}

.portal-body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #f7f7f7;
}

.portal-shell {
  display: flex;
  width: min(100%, 760px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  flex-direction: column;
  justify-content: center;
  padding: calc(34px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
}

.portal-brand {
  margin-bottom: 24px;
  text-align: center;
}

.portal-logo {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  font-size: 21px;
  font-weight: 650;
}

.portal-brand > p {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.portal-brand h1 {
  margin: 0;
  color: #111;
  font-size: 25px;
  font-weight: 650;
}

.portal-brand > span {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.portal-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.portal-card {
  display: flex;
  min-height: 188px;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #111;
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.portal-card.sales {
  border-top: 3px solid #111;
}

.portal-card.admin {
  border-top: 3px solid var(--primary);
}

.portal-card-tag {
  display: inline-flex;
  width: max-content;
  min-height: 23px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 5px;
  color: #333;
  background: #f2f2f2;
  font-size: 10px;
  font-weight: 500;
}

.portal-card.admin .portal-card-tag {
  color: var(--primary);
  background: var(--primary-soft);
}

.portal-card > strong {
  display: block;
  margin-top: 15px;
  font-size: 19px;
  font-weight: 650;
}

.portal-card > p {
  margin: 6px 0 16px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.portal-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #111;
  font-size: 12px;
  font-weight: 600;
}

.portal-card.admin .portal-link {
  color: var(--primary);
}

.portal-link b {
  font-size: 17px;
  font-weight: 400;
}

.portal-note {
  margin: 16px 0 0;
  color: #999;
  font-size: 10px;
  text-align: center;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes rise-in {
  from {
    transform: translateY(20px);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -7px);
  }
}

@media (min-width: 761px) {
  body:not(.portal-body) {
    padding: 18px 0;
  }

  .app-shell {
    overflow: hidden;
    width: 760px;
    min-height: calc(100dvh - 36px);
    border: 1px solid #dddddd;
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.08);
  }

  .topbar {
    top: 18px;
  }

  .bottom-nav {
    right: auto;
    left: 50%;
    width: 760px;
    transform: translateX(-50%);
  }

  .form-actions {
    bottom: calc(77px + var(--safe-bottom));
  }

  .overlay {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    max-height: 88dvh;
    border-radius: 10px;
  }
}

@media (max-width: 560px) {
  .portal-shell {
    justify-content: flex-start;
    padding-top: calc(42px + var(--safe-top));
  }

  .portal-options {
    grid-template-columns: 1fr;
  }

  .portal-card {
    min-height: 166px;
    padding: 15px;
  }

  .portal-card > strong {
    margin-top: 11px;
    font-size: 18px;
  }

  .portal-card > p {
    margin-top: 4px;
    margin-bottom: 10px;
  }
}

@media (max-width: 390px) {
  .brand-block {
    width: 38%;
  }

  .role-trigger {
    max-width: 126px;
  }

  .role-copy span {
    display: none;
  }

  .summary-main {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 350px) {
  .brand-block {
    width: 43%;
  }

  .role-trigger {
    max-width: 96px;
  }

  .role-avatar {
    display: none;
  }

  .page-heading,
  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-heading-controls {
    width: 100%;
    max-width: none;
  }

  .date-switcher {
    width: 100%;
  }

  .date-switcher input {
    flex: 1 1 auto;
    width: auto;
  }

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

  .metric-panel {
    min-height: 112px;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .ranking-row {
    grid-template-columns: 27px minmax(0, 1fr) 52px;
    gap: 7px;
    padding-right: 9px;
    padding-left: 9px;
  }
}

@media (max-width: 760px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  textarea,
  select {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
