@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --primary: #0369a1;
  --primary-deep: #075985;
  --primary-2: #0284c7;
  --brand: #0f172a;
  --brand-2: #1e293b;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --amber: #b45309;
  --overdue: #dc2626;
  --success: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
  --ok: #15803d;
  --accent: #0369a1;
  --paper: #f1f5f9;
  --surface: #ffffff;
  --card: #ffffff;
  --line: #e2e8f0;
  --outline: #cbd5e1;
  --sider: #0f172a;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --font-display: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-num: "Noto Sans SC", ui-monospace, tabular-nums, sans-serif;
  --radius: 6px;
  --shell-header-h: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: var(--shell-header-h) 1fr;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.side {
  grid-column: 1;
  grid-row: 2;
  background: var(--sider);
  color: #e2e8f0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.brand {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--shell-header-h);
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  flex-shrink: 0;
  z-index: 2;
}
.brand:hover {
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}
.brand-logo {
  display: block;
  width: 100%;
  max-width: 196px;
  height: auto;
  max-height: calc(var(--shell-header-h) - 10px);
  object-fit: contain;
  object-position: center;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}
.brand-copy { min-width: 0; overflow: hidden; }
.brand-text {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 16px;
}
.nav {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 10px 10px 12px;
}
.nav a {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 2px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--primary-2);
}
.nav a.nav-l1, .nav-group-title.nav-l1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
}
.nav a.nav-home {
  margin-bottom: 8px;
  font-weight: 700;
}
.nav a.nav-l2 {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  padding: 7px 12px 7px 22px;
  margin: 0 0 2px 6px;
  height: auto;
}
.nav a.nav-l2.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 3px 0 0 var(--primary-2);
}
.nav-group { margin: 6px 0 10px; }
.nav-group-title {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: auto;
  opacity: 1;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  transition: background .15s ease;
}
.nav-group-title:hover { background: rgba(255, 255, 255, 0.08); }
.nav-group-title::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex-shrink: 0;
  margin-top: -2px;
}
.nav-group.open > .nav-group-title::after {
  transform: rotate(45deg);
  margin-top: 2px;
}
.nav-group-body { display: none; }
.nav-group.open > .nav-group-body { display: block; }
.side-user {
  margin-top: auto;
  flex-shrink: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
}
.side-user strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; color: #fff; }
.side-user-meta { color: rgba(255, 255, 255, 0.42); font-size: 11px; margin-bottom: 8px; letter-spacing: 0.02em; }
.side-logout {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  padding: 4px 0;
}
.side-logout:hover { color: #fff; }

.main-wrap {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
}
.app-header {
  grid-column: 2;
  grid-row: 1;
  height: var(--shell-header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.app-header-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  color: var(--ink);
}
.app-header .actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}
.app-header-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.app-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: transparent;
}
.app-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.app-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 24px;
}

/* ---------- page chrome ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}
.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  line-height: 26px;
}
.topbar p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.card h2, .card h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
}

/* ---------- KPI / stats ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.card.stat,
a.card.stat {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 2px 8px;
  padding: 14px 16px 12px;
  border-radius: var(--radius);
  border-left: 3px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card.stat .label,
a.card.stat .label {
  grid-column: 1;
  font-size: 13px;
  color: var(--muted);
}
.card.stat .value,
a.card.stat .value {
  grid-column: 1;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 700;
  line-height: 32px;
  margin-top: 2px;
  color: var(--ink);
}
.card.stat .hint,
a.card.stat .hint {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
a.card.stat:hover {
  border-color: var(--line);
  border-left-color: var(--primary);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  text-decoration: none;
}
a.card.stat.active,
.card.stat.active {
  border-color: var(--line);
  border-left-color: var(--primary);
  background: #fff;
}
a.card.stat.active .value { color: var(--primary-deep); }
.card.stat.warn,
a.card.stat.warn {
  border-left-color: var(--warn);
}
.card.stat.warn .value { color: var(--warn); }

.grid-4 > .card.stat .value { color: var(--ink); font-family: var(--font-num); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  background: #fafbfc;
}
tr:hover td { background: #f8fafc; }
table.data-table { table-layout: fixed; }
.notices-table .col-title { width: 24%; }
.notices-table .col-source { width: 9%; }
.notices-table .col-tag { width: 8%; }
.notices-table .col-contact { width: 15%; }
.notices-table .col-time { width: 13%; }
.notices-table .col-act { width: 12%; }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.row-actions form { display: inline; margin: 0; }

.projects-table { table-layout: fixed; width: 100%; }
.projects-table th, .projects-table td { padding: 10px 12px; vertical-align: middle; }
.projects-table .nowrap { white-space: nowrap; }
.projects-table .project-name {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.projects-table .mono { font-size: 13px; }
td.col-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
  font-weight: 500;
}
td.col-title a:hover { color: var(--primary); }
.cell-sub { margin-top: 4px; font-size: 12px; }
.datetime {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--ink);
}
.col-source, .col-tag, .col-act { white-space: nowrap; }

/* ---------- badges / buttons ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #e0f2fe;
  color: var(--primary-deep);
  white-space: nowrap;
  font-weight: 500;
  border: 1px solid transparent;
}
.badge.warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge.danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.badge.muted { background: #f1f5f9; color: var(--muted); border-color: var(--line); }
.badge.accent { background: #e0f2fe; color: var(--primary-deep); border-color: #bae6fd; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--primary-deep); text-decoration: none; color: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--outline);
}
.btn.secondary:hover { background: #f8fafc; color: var(--ink); border-color: var(--primary-2); box-shadow: none; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #d92d20; }
.btn.accent { background: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--outline);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.12);
}
textarea { min-height: 96px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.muted { color: var(--muted); }

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  border: 1px solid transparent;
}
.alert.error, .alert.danger { background: #fff1f0; color: var(--danger); border-color: #ffccc7; }
.alert.ok { background: #f6ffed; color: #389e0d; border-color: #b7eb8f; }
.alert.warn { background: #fffbe6; color: #d48806; border-color: #ffe58f; }
.alert.info { background: #e0f2fe; color: var(--primary-deep); border-color: #bae6fd; }
.badge.ok { background: #f6ffed; color: #389e0d; }

.filter-bar { padding: 14px 16px; }
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: end;
}
.filter-item { min-width: 140px; }
.filter-item.filter-grow { flex: 1 1 220px; min-width: 200px; }
.filter-item.filter-submit { min-width: auto; }
.filter-item select { min-width: 150px; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 4px 4px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.pager .actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: #eef2f6;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.active { background: #e0f2fe; color: var(--primary-deep); font-weight: 600; border: 1px solid #bae6fd; }

.steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.step {
  padding: 6px 12px;
  border-radius: 8px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
}
.step.on { background: var(--primary); color: #fff; }
.step.done { background: #e0f2fe; color: var(--primary-deep); }

.panel { margin-top: 12px; }
.meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; font-size: 14px; }
.meta .k { color: var(--muted); font-size: 12px; }
.meta .v { margin-top: 2px; }
.vote-list, .check-list, .attach-list { list-style: none; padding: 0; margin: 0; }
.vote-list li, .check-list li, .attach-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.contact-mini { font-size: 12px; line-height: 1.5; color: var(--ink); word-break: break-word; }
.contact-mini .who { font-weight: 600; margin-bottom: 2px; }
.contact-block { font-size: 14px; line-height: 1.8; }
.contact-block .k { color: var(--muted); display: inline-block; min-width: 4.5em; }
.party-card { background: #f8fafc; border-radius: 8px; padding: 14px 16px; margin-top: 10px; border: 1px solid var(--line); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }

/* ---------- login (ERP split) ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
  position: relative;
  overflow: hidden;
  background: #e2e8f0;
}
.login-split {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  position: relative;
  z-index: 1;
}
.login-hero {
  min-height: 520px;
  position: relative;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 28px 24px;
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 40%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 28px,
      rgba(255, 255, 255, 0.025) 28px,
      rgba(255, 255, 255, 0.025) 29px
    );
  pointer-events: none;
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-hero-brand img {
  width: auto;
  height: 44px;
  max-width: 220px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
}
.login-hero-brand strong {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  display: block;
}
.login-hero-brand span {
  display: block;
  font-size: 12px;
  opacity: 0.65;
  font-weight: 400;
}
.login-hero-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}
.login-hero-art svg { width: min(100%, 340px); height: auto; }
.login-hero-copy h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
}
.login-hero-copy p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
  max-width: 36em;
}
.login-hero-copy small { color: rgba(255, 255, 255, 0.45); font-size: 12px; }
.login-form-col {
  padding: 40px 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.login-form-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}
.login-form-head p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}
.login-form-col #login-form > .btn[type="submit"] {
  width: 100%;
  height: 42px;
  font-size: 15px;
  margin-top: 4px;
}
.login-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.accounts {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- right drawer forms (ERP fw-drawer style) ---------- */
.main-wrap.has-drawer .main { overflow: hidden; }
body.drawer-open { overflow: hidden; }

.drawer-root {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: none;
  pointer-events: none;
}
.drawer-root.is-open {
  display: flex;
  pointer-events: auto;
  animation: drawer-fade-in 0.28s ease;
}
.drawer-mask {
  flex: 1;
  min-width: 0;
  background: rgba(15, 23, 42, 0.38);
  cursor: pointer;
}
.drawer-panel {
  width: min(1120px, 78%);
  max-width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.fw-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #fff; }
.fw-main { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.fw-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: #f8fafc;
}
.fw-kicker { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 2px; }
.fw-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); font-family: var(--font-display); }
.fw-intro { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.fw-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 24px 32px;
  overscroll-behavior: contain;
}
.fw-section-title {
  margin: 16px 0 12px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 22px;
}
.fw-section-title:first-child { margin-top: 4px; }
.fw-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.fw-foot-note { font-size: 12px; color: var(--muted); line-height: 1.5; max-width: 55%; }
.fw-foot-actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }
.fw-body .form-grid label { font-weight: 500; }
.fw-body label.req::after { content: ' *'; color: var(--danger); }

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

/* ---------- personal office ---------- */
.office-todo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.office-todo-group {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.office-todo-group:hover {
  border-color: var(--outline);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  text-decoration: none;
}
.office-todo-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.office-todo-preview { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.module-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.module-link {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
  text-decoration: none;
  color: inherit;
}
.module-link:hover { border-color: var(--outline); background: #f8fafc; text-decoration: none; }
.module-link span { display: block; font-weight: 600; margin-bottom: 4px; }
.module-link small { color: var(--muted); font-size: 12px; }
.activity-feed { list-style: none; margin: 0; padding: 0; }
.activity-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.activity-item:last-child { border-bottom: 0; }
.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.activity-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.activity-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.activity-who {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-who.is-mine { color: var(--primary); }
.activity-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}
.activity-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  word-break: break-word;
}
.activity-foot {
  margin-top: 6px;
  font-size: 12px;
}
.activity-feed-full .activity-item { padding: 14px 0; }
.activity-feed-full .activity-body { padding-right: 0; }
.notification-list { list-style: none; margin: 0; padding: 0; }
.notification-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.notification-list li.unread { background: #f8fafc; margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-left: 3px solid var(--primary); }
.nav-badge, .header-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.app-header-bell {
  position: relative;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  text-decoration: none;
}
.app-header-bell:hover { color: var(--primary); border-color: var(--primary-2); text-decoration: none; }
.header-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; font-size: 10px; }
.app-user-chip { text-decoration: none; color: inherit; }
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
}
.online-dot.off { background: #d0d5dd; }
.calendar-legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.calendar-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.calendar-legend .dot.deadline { background: var(--warn); }
.calendar-legend .dot.crawl { background: var(--primary); }

/* legacy login class aliases */
.login-wrap { min-height: 100vh; }
.login-card { display: none; }

.login-sms-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}
.login-sms-row input[name="sms_code"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 42px;
  box-sizing: border-box;
}
.login-sms-row .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 118px;
  height: 42px;
  margin-top: 0;
  padding: 0 14px;
  white-space: nowrap;
}
.login-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted, #64748b);
  grid-column: 1 / -1;
  margin: 2px 0 0;
  cursor: pointer;
  font-weight: 400;
}
.login-agree input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 2px 0 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--primary, #0369a1);
  cursor: pointer;
}
.login-agree span {
  flex: 1;
  min-width: 0;
}
.onboard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--muted, #64748b);
}
.onboard-steps .active { color: var(--primary, #0369a1); font-weight: 600; }
.onboard-steps .done { color: var(--ok, #15803d); }

.legal-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #f1f5f9 45%);
  padding: 40px 16px 64px;
}
.legal-card {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  padding: 28px 32px 40px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
.legal-nav {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
  font-size: 13px;
}
.legal-nav a { color: var(--primary, #0369a1); }
.legal-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-family: var(--font-display);
}
.legal-meta {
  margin: 0 0 24px;
  color: var(--muted, #64748b);
  font-size: 13px;
}
.legal-section { margin-bottom: 18px; }
.legal-section h2 {
  margin: 0 0 8px;
  font-size: 16px;
}
.legal-section p {
  margin: 0;
  line-height: 1.75;
  color: #334155;
  font-size: 14px;
}
.login-agree a {
  color: var(--primary, #0369a1);
  text-decoration: none;
}
.login-agree a:hover { text-decoration: underline; }
.media-thumb-wrap { display: inline-block; position: relative; }
.media-thumb-wrap img {
  max-width: 160px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line, #e2e8f0);
}
.media-thumb-wrap .view-orig {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--shell-header-h) var(--shell-header-h) auto 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .app-header { grid-column: 1; grid-row: 2; }
  .side { grid-column: 1; grid-row: 3; position: relative; height: auto; max-height: none; }
  .main-wrap { grid-column: 1; grid-row: 4; height: auto; }
  .main { overflow: visible; }
  .drawer-root { position: fixed; inset: 0; z-index: 500; }
  .drawer-panel { width: 100%; max-width: 100%; }
  .fw-foot { flex-direction: column; align-items: stretch; }
  .fw-foot-note { max-width: none; }
  .grid-4, .grid-2, .form-grid.two, .meta { grid-template-columns: 1fr; }
  .login-split { grid-template-columns: 1fr; }
  .login-hero { min-height: 220px; }
  .login-hero-art { display: none; }
}
