:root {
  --bg: #f4f5f9;
  --bg-side: #f4f5f9;
  --ink: #1f2329;
  --muted: #8a9199;
  --muted-2: #646a73;
  --line: #e5e6eb;
  --line-soft: #f0f1f5;
  --card: #ffffff;
  --tile: #f5f6f8;
  --accent: #1677ff;
  --accent-soft: rgba(22, 119, 255, 0.08);
  --accent-hover: #4096ff;
  --ok: #00a870;
  --ok-soft: rgba(0, 168, 112, 0.1);
  --warn: #d48806;
  --warn-soft: rgba(212, 136, 6, 0.12);
  --danger: #f53f3f;
  --danger-soft: rgba(245, 63, 63, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(15, 23, 42, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 220px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  width: var(--side-w);
  max-width: var(--side-w);
  min-width: 0;
  background: var(--bg-side);
  padding: 20px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  box-sizing: border-box;
}

.brand-block {
  padding: 8px 12px 20px;
  flex: none;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.2;
}
.brand-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.3;
  transition: background .15s, color .15s;
}
.nav-link .nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  text-decoration: none;
}
.nav-link.active {
  background: var(--card);
  color: var(--accent);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.nav-ico {
  width: 1.25em;
  min-width: 1.25em;
  text-align: center;
  font-size: 12px;
  line-height: 1;
  opacity: 0.85;
  flex: none;
  overflow: hidden;
}
.nav-link .nav-badge { margin-left: auto; flex: none; }

.nav-group { margin-top: 4px; border: 0; flex: none; }
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  font-weight: 500;
  user-select: none;
}
.nav-group-title:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
}
.nav-chev {
  margin-left: auto;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform .15s;
  flex: none;
}
.nav-group[open] > .nav-group-title .nav-chev { transform: rotate(180deg); }
.nav-group-body {
  padding: 2px 0 4px 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-group-body .nav-link {
  padding-left: 34px;
  font-weight: 400;
  font-size: 13px;
}

.side-foot {
  margin-top: 8px;
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12px;
  flex: none;
  position: relative;
  z-index: 2;
  background: var(--bg-side);
}
.side-user {
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-role {
  color: var(--muted);
  margin: 2px 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-logout { color: var(--muted-2); font-size: 12px; display: inline-block; }
.side-logout:hover { color: var(--accent); }

.main {
  padding: 16px 16px 28px 0;
  min-width: 0;
}
.main-inner {
  background: var(--card);
  border-radius: var(--radius) 0 0 var(--radius);
  min-height: calc(100vh - 32px);
  padding: 24px 28px 40px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.topbar h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}
.card > .muted:first-child { margin-top: 0; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-hd h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-height: 88px;
}
.stat .label {
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
}
.stat .num {
  font-size: 28px;
  font-weight: 650;
  margin-top: 8px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: #fff;
}
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--tile);
  color: var(--ink);
  border-color: #d0d3d9;
}
.btn-warn { background: var(--warn); }
.btn-warn:hover { filter: brightness(1.05); color: #fff; }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

table.dense {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.dense th, table.dense td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.dense th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  background: transparent;
}
table.dense tbody tr:hover td {
  background: rgba(22, 119, 255, 0.02);
}
table.dense tbody tr:last-child td { border-bottom: 0; }
table.dense td.actions { white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: rgba(0, 0, 0, 0.05); color: var(--muted-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
}
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid > div { min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
label {
  display: block;
  font-size: 13px;
  color: var(--muted-2);
  margin-bottom: 6px;
  font-weight: 500;
}
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]):not([type=image]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background-color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  min-height: 38px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background-color .15s, padding .15s;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a9199' d='M1.4 1.5 6 6.1l4.6-4.6 1.4 1.4L6 9 0 2.9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 32px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 110px; resize: vertical; }
input[type=file] {
  width: auto;
  max-width: 100%;
  min-height: 0;
  padding: 6px 0;
  border: 0;
  background: transparent;
}
/* 浏览器自动填充也保持统一外观 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 99999s ease-out;
}
/* 已填写：浅绿底 + 右侧打勾 */
input.is-filled:not(:focus):not(:disabled):not([readonly]),
select.is-filled:not(:focus):not(:disabled),
textarea.is-filled:not(:focus):not(:disabled):not([readonly]) {
  border-color: #86efac;
  background-color: var(--ok-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2300a870'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 32px;
}
select.is-filled:not(:focus):not(:disabled) {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2300a870'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z' clip-rule='evenodd'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a9199' d='M1.4 1.5 6 6.1l4.6-4.6 1.4 1.4L6 9 0 2.9z'/%3E%3C/svg%3E");
  background-position: right 28px center, right 12px center;
  background-size: 16px 16px, 12px 8px;
  padding-right: 48px;
}
textarea.is-filled:not(:focus):not(:disabled):not([readonly]) {
  background-position: right 10px top 10px;
}
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }

.kw-picker {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--tile);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}
.kw-picker label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  border: 1px solid transparent;
}
.kw-picker label:hover { border-color: var(--line); }
.kw-picker .meta { font-size: 11px; color: var(--muted); }

.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
}
.login-card .muted { margin-bottom: 20px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    width: 100%;
    max-width: none;
    position: relative;
    height: auto;
    border-bottom: 1px solid var(--line);
  }
  .brand-block { padding-bottom: 12px; }
  .nav {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    overflow: visible;
    max-height: none;
  }
  .nav-group { width: 100%; }
  .side-foot {
    display: block;
    margin-top: 12px;
  }
  .side-role { margin: 2px 0 8px; }
  .main { padding: 0; }
  .main-inner {
    border-radius: 0;
    min-height: auto;
    padding: 18px 16px 36px;
  }
  .form-grid { grid-template-columns: 1fr; }
}

.btn-link {
  background: none; border: 0; padding: 0; color: var(--accent);
  cursor: pointer; font: inherit; text-decoration: none;
}
.btn-link:hover { color: var(--accent-hover); }
.hint { font-size: 12px; color: var(--muted); }
.check { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.check input[type=checkbox],
.check input[type=radio] {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  appearance: auto;
  -webkit-appearance: auto;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.pager-meta { font-size: 12px; }
.pager-nav { gap: 6px; }
.pager-nav .btn { min-width: 36px; }

/* transfer / offboard */
.flash.warn, .flash-warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.nav-badge {
  display: inline-block; min-width: 16px; height: 16px; margin-left: 6px;
  padding: 0 4px; border-radius: 999px; background: #e65100; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}
.colleague-search { position: relative; }
.colleague-search input.form-control,
.colleague-search input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
}
.colleague-search-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18,32,46,.12); z-index: 40;
  max-height: 280px; overflow-y: auto;
}
.colleague-search-item {
  display: block; width: 100%; text-align: left; border: 0; background: #fff;
  padding: 10px 12px; cursor: pointer; font-family: inherit; border-bottom: 1px solid #f0f3f7;
}
.colleague-search-item:hover { background: var(--tile, #eef6ff); }
.colleague-search-item .n { font-size: 13px; color: var(--ink); font-weight: 600; }
.colleague-search-item .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.colleague-search-empty { padding: 12px; font-size: 13px; color: var(--muted); }
.colleague-search-picked { margin-top: 8px; font-size: 13px; }
.transfer-modal[hidden] { display: none !important; }
.transfer-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.transfer-modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.transfer-modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 440px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.transfer-modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.transfer-modal-bd { padding: 12px; }
.auth-wrap { min-height: 100vh; display:grid; place-items:center; padding:24px; background: var(--bg,#f5f7fa); }
.auth-card { width:100%; max-width:720px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:20px; }

/* user search picker */
.user-picker { position: relative; }
.user-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}
.user-chip-x {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.user-chip-x:hover { color: var(--danger); }
.user-picker-input-wrap { position: relative; }
.user-picker-q { width: 100%; }
.user-picker-dropdown {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 30;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow: auto;
  padding: 4px;
}
.user-picker-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.user-picker-item:hover { background: var(--tile); }
.user-picker-item.is-picked { opacity: 0.45; cursor: default; }
.user-picker-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

/* searchable select (task assignee etc.) */
.user-combo { position: relative; max-width: 420px; }
.user-combo-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.user-combo-toggle:hover { border-color: #c9cdd4; }
.user-combo-caret {
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  flex: none;
}
.user-combo-panel {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 40;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 8px;
}
.user-combo-q { width: 100%; margin-bottom: 6px; }
.user-combo-list { max-height: 220px; overflow: auto; }
.user-combo-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.user-combo-item:hover { background: var(--tile); }
.user-combo-empty { padding: 8px 10px; color: var(--muted); font-size: 13px; }

/* schedule perpetual calendar */
.cal-wrap { padding: 16px; }
.cal-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-ym { display: flex; gap: 6px; }
.cal-ym select {
  min-width: 88px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; font: inherit;
}
.cal-hint { font-size: 12px; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px; margin-bottom: 4px; text-align: center;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.cal-weekdays .is-weekend { color: #d4380d; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px; min-height: 520px;
}
.cal-day {
  min-height: 96px; border: 1px solid var(--line-soft); border-radius: 10px;
  background: #fff; padding: 6px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-day:hover { border-color: #91caff; box-shadow: 0 0 0 2px rgba(22,119,255,.08); }
.cal-day.is-out { background: #fafafa; opacity: .72; }
.cal-day.is-today { border-color: var(--accent); background: var(--accent-soft); }
.cal-day.is-weekend .cal-day-num { color: #d4380d; }
.cal-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.cal-day-num { font-weight: 700; font-size: 14px; }
.cal-lunar { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day-events { display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.cal-event {
  border: 0; border-radius: 4px; background: #e6f4ff; color: #0958d9;
  font: inherit; font-size: 12px; line-height: 1.3; text-align: left;
  padding: 2px 4px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.cal-event:hover { background: #bae0ff; }
.cal-event-time { color: #1677ff; font-variant-numeric: tabular-nums; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 2px; }

.cal-dialog {
  border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 24px));
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}
.cal-dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
.cal-dialog-body { padding: 18px 18px 16px; }
.cal-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px;
}
.cal-dialog-head h2 { margin: 0; font-size: 18px; }
.cal-dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }

@media (max-width: 860px) {
  .cal-grid { min-height: 0; }
  .cal-day { min-height: 78px; }
  .cal-event-time { display: none; }
}
