:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #eef6f2;
  --ink: #1d252d;
  --muted: #65717e;
  --line: #dbe3ec;
  --green: #236f5a;
  --green-2: #31926f;
  --green-soft: #dff3e9;
  --indigo: #4c61c9;
  --indigo-soft: #e8ecff;
  --amber: #b56b10;
  --amber-soft: #fff0d8;
  --coral: #c65046;
  --coral-soft: #ffe7e4;
  --cyan: #208a9a;
  --shadow: 0 14px 32px rgba(28, 36, 46, 0.08);
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(35, 111, 90, 0.08), transparent 360px),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: #202932;
  color: #f6f8fb;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  flex: 0 0 auto;
}

.brand-title {
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  color: #b9c4d0;
  font-size: 12px;
  margin-top: 3px;
}

.role-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.role-panel label {
  color: #cbd4df;
  font-size: 12px;
  font-weight: 700;
}

.role-hint {
  color: #b9c4d0;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #cbd4df;
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.nav-button.active {
  background: #f6f8fb;
  color: var(--ink);
}

.nav-symbol {
  width: 22px;
  text-align: center;
  font-weight: 800;
}

.install-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: #fff;
  background: #2f8f68;
  min-height: 40px;
  padding: 0 12px;
  font-weight: 720;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 12px;
  color: #d7dee8;
  font-size: 13px;
  line-height: 1.55;
}

.main {
  min-width: 0;
  padding: 22px;
  overflow-x: hidden;
}

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

.eyebrow {
  color: var(--green);
  font-weight: 800;
  margin: 0 0 7px;
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 29px;
  line-height: 1.16;
  margin-bottom: 7px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 5px;
}

h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.top-copy,
.panel-header p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.top-actions,
.inline-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.control {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0 11px;
  outline: none;
}

.control:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(49, 146, 111, 0.14);
}

.textarea {
  min-height: 98px;
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.45;
}

.file-control {
  padding: 8px;
  min-height: 46px;
}

.compact {
  max-width: 160px;
}

.search {
  max-width: 280px;
}

.primary-button,
.ghost-button,
.mini-button,
.icon-button {
  border-radius: var(--radius);
  min-height: 39px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 20px rgba(35, 111, 90, 0.22);
}

.ghost-button,
.mini-button,
.icon-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.mini-button {
  min-height: 31px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 22px;
}

.full {
  width: 100%;
}

.notice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.notice-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.notice-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.notice-card strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 7px;
}

.notice-card span {
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  display: inline-flex;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 720;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.mobile-grid,
.team-grid,
.head-layout {
  display: grid;
  gap: 16px;
}

.mobile-grid {
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1fr);
  align-items: start;
}

.team-grid {
  grid-template-columns: minmax(340px, 0.8fr) minmax(0, 1fr);
}

.head-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.6fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  border-bottom: 1px solid var(--line);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.clock-form {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fbfd;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  min-height: 36px;
  color: var(--muted);
  background: transparent;
  font-weight: 720;
}

.segmented button.active {
  color: #fff;
  background: var(--green);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.gps-result {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 11px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 13px;
  line-height: 1.45;
}

.photo-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 112px;
  background: #fbfcfd;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.photo-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
}

.photo-preview > div:only-child {
  grid-column: 1 / -1;
  text-align: center;
}

.ai-field {
  background: var(--panel-soft);
  border: 1px solid #cae7d7;
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ai-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activity-list,
.team-list,
.org-tree,
.insight-list {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.activity-card,
.team-card,
.org-node,
.insight-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.activity-card {
  display: grid;
  gap: 7px;
}

.activity-card strong {
  line-height: 1.3;
}

.activity-meta,
.team-meta,
.org-meta,
.insight-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.pill.green {
  color: var(--green);
  background: var(--green-soft);
}

.pill.indigo {
  color: var(--indigo);
  background: var(--indigo-soft);
}

.pill.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.pill.coral {
  color: var(--coral);
  background: var(--coral-soft);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

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

th {
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
  font-weight: 780;
}

tbody tr:hover {
  background: #f7fbf9;
}

.market-title {
  font-weight: 780;
  margin-bottom: 4px;
}

.market-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.progress {
  width: 120px;
  height: 8px;
  background: #edf1f5;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.org-node {
  position: relative;
}

.org-level {
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 5px;
}

.org-children {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.team-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.team-score {
  font-size: 20px;
  font-weight: 820;
}

.dashboard-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf1f5;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.bar-fill.indigo {
  background: var(--indigo);
}

.bar-fill.amber {
  background: var(--amber);
}

.bar-fill.coral {
  background: var(--coral);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 31, 39, 0.48);
}

.modal-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(520px, 100%);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -14px 0 30px rgba(23, 31, 39, 0.18);
}

.modal-header,
.modal-footer {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header p {
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.45;
}

.modal-body {
  padding: 16px;
  overflow: auto;
  display: grid;
  gap: 13px;
}

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  margin-top: auto;
  justify-content: flex-end;
  align-items: center;
}

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

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: min(380px, calc(100vw - 44px));
  min-width: 240px;
  background: #202932;
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 18px 30px rgba(23, 31, 39, 0.28);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  font-size: 14px;
  line-height: 1.45;
}

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

.empty {
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

@media (max-width: 1180px) {
  .notice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-grid,
  .team-grid,
  .head-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-button {
    justify-content: center;
    padding: 0 7px;
    min-height: 40px;
  }

  .nav-text {
    display: none;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    display: grid;
  }

  .top-actions,
  .inline-tools {
    justify-content: stretch;
  }

  .top-actions > *,
  .inline-tools > * {
    flex: 1 1 160px;
  }

  h1 {
    font-size: 24px;
  }

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

@media (max-width: 520px) {
  body {
    overflow-x: hidden;
  }

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

  .side-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .role-panel {
    grid-template-columns: 1fr;
  }

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

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

  .modal-panel {
    width: 100%;
  }

  .bar-row {
    grid-template-columns: 80px minmax(0, 1fr) 38px;
  }
}
