/* Lofi Media — Lịch làm việc (thiết kế theo ảnh tham chiếu) */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f7f5f2;
  --ink: #1b1b1d;
  --ink-2: #4b4b4f;
  --muted: #8c8c91;
  --muted-2: #aaa8a5;
  --line: #ece9e5;
  --line-2: #e4e0db;
  --pink: #e63b6f;
  --pink-dark: #cf2d5f;
  --pink-soft: #fde9ef;
  --pink-border: #f4c9d6;
  --beige: #fbf6ea;
  --beige-border: #f0e5cf;
  --beige-strong: #f4e9d2;
  --green: #2c8a61;
  --green-soft: #e8f5ef;
  --red: #c63b3b;
  --red-soft: #fdecec;
  --shadow: 0 1px 2px rgba(24, 20, 17, 0.03), 0 10px 26px -22px rgba(24, 20, 17, 0.22);
  --shadow-lg: 0 40px 100px -36px rgba(24, 20, 17, 0.4);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -180px, #fdf1f4 0, rgba(253, 241, 244, 0) 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: fixed;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  transition: top 0.18s ease;
}
.skip:focus { top: 12px; text-decoration: none; }

.sprite { position: absolute; overflow: hidden; }
.ic {
  width: 15px; height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px 42px;
}

/* ------------------------------------------------------------ header */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.head-copy h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.accent-dot { color: var(--pink); }
.head-copy p { margin-top: 5px; font-size: 11.5px; color: var(--muted); }

.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.btn:hover { background: #fcfbfa; border-color: #d9d4cf; text-decoration: none; }
.btn:active { transform: scale(0.985); }
.btn .ic { width: 14px; height: 14px; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 11.5px; }
.btn-primary {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
  box-shadow: 0 7px 16px -10px rgba(230, 59, 111, 0.8);
}
.btn-primary:hover { background: var(--pink-dark); border-color: var(--pink-dark); }
.btn-danger { border-color: transparent; background: transparent; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: transparent; }
.btn:disabled { opacity: 0.55; cursor: default; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .ic { width: 15px; height: 15px; }

.menu-wrap { position: relative; }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 214px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 44px -20px rgba(24, 20, 17, 0.3);
}
.menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 11.5px;
  text-align: left;
}
.menu button:hover { background: var(--surface-2); }
.menu button .ic { width: 14px; height: 14px; color: var(--muted); }
.menu .danger { color: var(--red); }

/* ------------------------------------------------------------ summary */

.summary {
  display: grid;
  grid-template-columns: 1.18fr 0.95fr 0.95fr 1.18fr;
  margin-bottom: 14px;
  padding: 17px 2px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.summary.no-money { grid-template-columns: 1.3fr 1fr 1fr; }

.sum-item {
  display: flex;
  min-width: 0;
  padding: 0 19px;
  align-items: center;
}
.sum-item + .sum-item { border-left: 1px solid var(--line); }
.sum-month { gap: 11px; }
.sum-icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: none;
  border-radius: 10px;
  background: var(--pink-soft);
  color: var(--pink);
}
.sum-icon .ic { width: 18px; height: 18px; }
.sum-month b { font-size: 12.5px; font-weight: 650; letter-spacing: -0.01em; }

.sum-item:not(.sum-month) {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
}
.sum-item > b {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.sum-item > b.pink { color: var(--pink); }
.sum-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.sum-sub b { font-weight: 650; color: var(--ink-2); }
.sum-money > b { font-size: 20px; }

/* ------------------------------------------------------------ panel */

.panel {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.toolbar-left { display: flex; align-items: center; gap: 3px; }

.month-wrap { position: relative; }
.month-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.month-button:hover { background: var(--surface-2); }
.month-button .chev { width: 12px; height: 12px; color: var(--muted); }

.month-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 60;
  width: 238px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 44px -20px rgba(24, 20, 17, 0.3);
}
.month-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 2px 7px;
}
.month-pop-head b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.month-grid button {
  height: 31px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
}
.month-grid button:hover { background: var(--surface-2); }
.month-grid button.active { background: var(--pink-soft); color: var(--pink); font-weight: 700; }

.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.seg button .ic { width: 13px; height: 13px; }
.seg button:hover { color: var(--ink-2); }
.seg button.active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(24, 20, 17, 0.06);
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.chip .ic { width: 13px; height: 13px; }
.chip span { color: var(--muted); font-weight: 500; }
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--pink-soft); color: var(--pink); }
.chip.active span { color: var(--pink); }

.filter-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.search { position: relative; display: flex; align-items: center; }
.search input {
  width: 218px;
  height: 32px;
  padding: 0 27px 0 29px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  color: var(--ink);
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus { border-color: var(--pink); outline: none; box-shadow: 0 0 0 3px var(--pink-soft); }
.search .ic {
  position: absolute;
  left: 9px;
  color: var(--muted);
  width: 13px; height: 13px;
  pointer-events: none;
}
.search kbd {
  position: absolute;
  right: 7px;
  display: grid;
  place-items: center;
  width: 16px; height: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font);
  font-size: 9px;
  pointer-events: none;
}

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 25px 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
}
.select > .ic:first-child { width: 13px; height: 13px; color: var(--muted); margin-right: 5px; }
.select.no-icon { padding-left: 10px; }
.select select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 128px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  outline: none;
}
.select .chev {
  position: absolute;
  right: 7px;
  width: 11px; height: 11px;
  color: var(--muted);
  pointer-events: none;
}

/* ------------------------------------------------------------ table */

.view { min-height: 180px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.jobs {
  width: 100%;
  min-width: 1030px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.jobs th {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  background: #faf9f7;
  color: #9c9893;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
}
.jobs th.center, .jobs td.center { text-align: center; }
.jobs td {
  padding: 18px 10px;
  border-bottom: 1px solid rgba(28, 26, 24, 0.055);
  background: var(--row, #fff);
  font-size: 12.5px;
  line-height: 1.48;
  vertical-align: middle;
}
.jobs tbody tr { cursor: pointer; outline: none; }
.jobs tbody tr:hover td { box-shadow: inset 0 0 0 9999px rgba(20, 18, 16, 0.018); }
.jobs tbody tr:focus-visible td { box-shadow: inset 0 0 0 9999px rgba(230, 59, 111, 0.05); }
.jobs tbody tr:last-child td { border-bottom: 0; }

.d-main { display: block; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.d-lunar { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.type-cell { display: flex; align-items: flex-start; gap: 5px; }
.type-icons { display: flex; gap: 3px; padding-top: 1px; color: var(--muted); }
.type-icons .ic { width: 13px; height: 13px; }
.type-icons .video { color: #b44a76; }
.type-icons .photo { color: #4a7d6b; }
.type-label { display: block; font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.linked { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.cust { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-name { display: block; font-size: 11.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); font-weight: 400; }

.checkbtn {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  padding: 0;
  border: 1px solid #dcd7d2;
  border-radius: 50%;
  background: #fff;
  color: #cfcac5;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.checkbtn .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.checkbtn:hover { border-color: var(--pink-border); color: var(--pink); }
.checkbtn.done { border-color: var(--pink); background: var(--pink); color: #fff; }
.checkstatic {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border: 1px solid #dcd7d2;
  border-radius: 50%;
  color: #cfcac5;
  background: #fff;
}
.checkstatic.done { border-color: var(--pink); background: var(--pink); color: #fff; }
.checkstatic .ic, .checkbtn .ic { width: 11px; height: 11px; stroke-width: 2.4; }

.crew { display: flex; align-items: center; gap: 5px; min-width: 0; }
.avatars { display: flex; align-items: center; flex: none; }
.avatar {
  display: grid;
  place-items: center;
  width: 19px; height: 19px;
  margin-left: -4px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}
.avatar:first-child { margin-left: 0; }
.crew-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 10.5px; }
.conflict {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  color: var(--pink);
  font-size: 9px;
  line-height: 1.25;
  white-space: nowrap;
}
.conflict .ic { width: 9px; height: 9px; }

.loc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.money { text-align: right; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.note {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.note-warn { color: var(--pink); }

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}
.panel-foot b { color: var(--ink-2); font-weight: 650; }
.panel-foot .sep { margin: 0 2px; color: var(--muted-2); }
.foot-right { display: flex; align-items: center; gap: 9px; }
.foot-right span { display: inline-flex; align-items: center; gap: 4px; }
.foot-right .ic { width: 11px; height: 11px; }

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 44px 2px 0;
  color: var(--muted-2);
  font-size: 9.5px;
}
.page-footer .footer-brand { color: inherit; text-decoration: none; }
.page-footer .footer-brand:hover { color: var(--pink); text-decoration: none; }
.page-footer a, .page-footer button.linklike {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-footer a:hover, .page-footer button.linklike:hover { color: var(--pink); }
.foot-dot { margin: 0 2px; }

/* ------------------------------------------------------------ skeletons & states */

.skeleton { display: grid; gap: 1px; background: var(--line); }
.sk-row {
  height: 66px;
  background: linear-gradient(100deg, #fbfaf8 30%, #ffffff 50%, #fbfaf8 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }

.empty-state, .error-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 54px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state .ic, .error-state .ic { width: 26px; height: 26px; color: var(--muted-2); }
.empty-state b, .error-state b { color: var(--ink); font-size: 13px; font-weight: 650; }
.empty-state p, .error-state p { font-size: 11.5px; }
.error-state .btn { margin-top: 8px; }

/* ------------------------------------------------------------ calendar */

.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal { min-width: 880px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  background: #faf9f7;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  text-align: right;
}
.cal-head div:first-child { text-align: left; }
.cal-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 106px;
  min-width: 0;
  padding: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: #fcfbf9; color: var(--muted-2); }
.cal-cell.today { background: #fdf2f6; }
.cal-date { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; }
.cal-date b { font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-date b {
  display: inline-grid; place-items: center;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 10.5px;
}
.cal-lunar { color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.cal-pills { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 3px 5px;
  border: 0;
  border-radius: 6px;
  background: var(--row, var(--surface-2));
  color: var(--ink);
  font-size: 9px;
  text-align: left;
}
.cal-pill:hover { filter: brightness(0.97); }
.cal-pill b { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-pill .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-hint { display: none; padding: 8px 10px 0; color: var(--muted); font-size: 10px; }

/* ------------------------------------------------------------ mobile cards */

.m-list { display: grid; gap: 7px; padding: 9px; }
.m-card {
  display: grid;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid rgba(28, 26, 24, 0.07);
  border-radius: 10px;
  background: var(--row, #fff);
  cursor: pointer;
}
.m-card:active { filter: brightness(0.985); }
.m-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}
.m-top .type-icons .ic { width: 11px; height: 11px; }
.m-title { font-size: 12.5px; font-weight: 700; }
.m-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 9px;
  color: var(--ink-2);
  font-size: 9.5px;
}
.m-meta span { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.m-meta .ic { width: 10px; height: 10px; color: var(--muted); }
.m-meta .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.m-note { color: var(--muted); font-size: 9px; }
.m-note.warn { color: var(--pink); }

/* ------------------------------------------------------------ sheet (detail/form) */

dialog.sheet {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  flex-direction: column;
}
dialog.sheet[open] { display: flex; animation: sheet-in 0.24s cubic-bezier(0.16, 1, 0.3, 1); }
dialog.sheet::backdrop {
  background: rgba(48, 34, 38, 0.32);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } }

.sheet-scroll {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--pink-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.sheet-close:hover { background: var(--pink-soft); }
.sheet-close .ic { width: 15px; height: 15px; }

.sheet-head { flex: none; padding: 38px 34px 24px; }
.eyebrow {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-right: 46px;
}
.job-title {
  margin-top: 5px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  padding-right: 46px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tag .ic { width: 11px; height: 11px; }
.tag.service.video { border-color: var(--pink-border); color: var(--pink); background: #fff8fa; }
.tag.service.photo { border-color: #cfe7dd; color: #2e6f58; background: #f6fbf8; }
.tag.neutral { color: var(--muted); }
.tag.done { border-color: #cfe7dd; color: var(--green); background: var(--green-soft); }
.tag .dot, .status-dot {
  width: 4px; height: 4px; border-radius: 50%; background: currentColor;
}

.sheet-body { display: flex; flex: 0 0 auto; flex-direction: column; padding: 0 34px 14px; }
.section { margin-top: 28px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}
.section-head .ic { width: 14px; height: 14px; color: var(--ink-2); }
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--pink-soft);
  color: var(--pink);
  font-size: 8.5px;
  font-weight: 700;
}
.divider { margin: 17px 0 0; border: 0; border-top: 1px solid var(--line); }

.session-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.session-card {
  display: flex;
  gap: 13px;
  min-width: 0;
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--beige-border);
  border-radius: 12px;
  background: var(--beige);
}
.day-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  flex: none;
  border-radius: 9px;
  background: var(--beige-strong);
}
.day-num { font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.day-month { margin-top: 2px; color: #88785c; font-size: 7px; font-weight: 700; letter-spacing: 0.04em; }
.session-info { min-width: 0; }
.s-label { color: var(--pink); font-size: 9.5px; font-weight: 600; }
.s-date { margin-top: 2px; font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-lunar { margin-top: 2px; color: var(--muted); font-size: 10px; }
.s-time { display: flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.s-time .ic { width: 10px; height: 10px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; min-height: 210px; }
.info-title {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 650;
}
.info-title .ic { width: 13px; height: 13px; color: var(--ink-2); }
.info-label { margin-top: 12px; color: var(--muted); font-size: 10px; }
.info-value { margin-top: 2px; font-size: 13px; color: var(--ink); }
.info-value.dim { color: var(--muted); }
.phone-actions { display: flex; gap: 5px; margin-top: 8px; }
.phone-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phone-line .info-value { margin-top: 0; }
.phone-line .phone-actions { margin-top: 0; }
.phone-actions a, .phone-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
}
.phone-actions a:hover, .phone-actions button:hover { border-color: var(--pink-border); color: var(--pink); text-decoration: none; }
.phone-actions .ic { width: 10px; height: 10px; }

.owner-card { display: flex; align-items: center; gap: 8px; }
.owner-avatar {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--pink);
  font-size: 9px;
  font-weight: 700;
}
.owner-name { font-size: 13px; font-weight: 650; }
.owner-sub { margin-top: 2px; color: var(--ink-2); font-size: 10.5px; }

.crew-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  font-size: 10.5px;
  color: var(--ink-2);
}
.crew-chip .avatar { width: 18px; height: 18px; margin: 0; font-size: 7.5px; border: 0; }
.crew-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.location-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.location-text { font-size: 12.5px; color: var(--ink-2); }

.cost-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #f7e6ec;
  border-radius: 10px;
  background: #fdf7f9;
}
.cost-item { padding: 16px; }
.cost-item + .cost-item { border-left: 1px solid #f3dde5; }
.cost-label { color: var(--muted); font-size: 10px; }
.cost-value { margin-top: 3px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cost-value.remaining { color: var(--pink); }
.dim { color: var(--muted); font-weight: 400; }
.muted-block { color: var(--muted); font-size: 12.5px; }
.lock-note {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9.5px;
}
.lock-note .ic { width: 12px; height: 12px; margin-top: 1px; }
.updated { margin-top: 26px; text-align: right; color: var(--muted-2); font-size: 8.5px; font-variant-numeric: tabular-nums; }

.sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -12px 28px -24px rgba(24, 20, 17, 0.35);
}
.sheet-footer .right { display: flex; align-items: center; gap: 8px; }
.view-only { color: var(--muted); font-size: 9.5px; }

/* ------------------------------------------------------------ iPhone calendar */

.iphone-sheet { width: min(640px, calc(100% - 28px)); }
.iphone-card .job-title { font-size: 26px; }
.iphone-body { padding: 0 34px 24px; gap: 14px; }
.iphone-steps { display: grid; gap: 10px; }
.iphone-step { display: flex; align-items: flex-start; gap: 10px; }
.iphone-step > span {
  display: grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--pink-soft); color: var(--pink);
  font-size: 10px; font-weight: 700;
}
.iphone-step b { display: block; font-size: 11.5px; font-weight: 650; }
.iphone-step p { margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.cred-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 4px 12px; }
.cred-title { padding: 8px 0 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cred-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 11.5px; }
.cred-row > span { flex: none; width: 86px; color: var(--muted); font-size: 10px; }
.cred-row code { flex: 1; min-width: 0; color: var(--ink-2); font-size: 10.5px; overflow-wrap: anywhere; }
.cred-row code.cal-password { color: var(--ink); font-weight: 600; }
.copy-btn {
  flex: none; height: 24px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: #fff; color: var(--ink-2); font-size: 9px; font-weight: 600;
}
.copy-btn:hover { border-color: var(--pink-border); color: var(--pink); }
.iphone-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.iphone-actions .btn { text-decoration: none; }
.iphone-manual { border: 1px dashed var(--line-2); border-radius: 9px; padding: 9px 11px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.iphone-manual summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
.iphone-manual p { margin: 7px 0 0; }
.iphone-hint { display: flex; gap: 7px; margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.iphone-hint .ic { flex: none; width: 12px; height: 12px; margin-top: 1px; }
.push-card { border: 1px solid var(--pink-border); border-radius: 12px; background: var(--pink-soft); padding: 13px 14px; }
.push-title { color: var(--ink); font-size: 11.5px; font-weight: 700; }
.push-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.push-actions .btn { height: 32px; font-size: 10px; }
.push-status { margin-top: 8px; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
@media (max-width: 760px) { .push-card { padding: 11px 12px; } }

@media (max-width: 760px) {
  .iphone-body { padding: 0 18px 18px; }
  .iphone-card .job-title { font-size: 23px; }
  .cred-row > span { width: 72px; }
  .cred-row code { font-size: 10px; }
  .iphone-actions .btn { flex: 1 1 auto; justify-content: center; }
}

.confirm-dialog {
  width: min(380px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.confirm-dialog::backdrop {
  background: rgba(48, 34, 38, 0.36);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.confirm-card {
  border-radius: 16px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.confirm-card p { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ------------------------------------------------------------ form */

.form-sheet { width: min(740px, calc(100% - 28px)); }
.form-body { padding: 24px 28px 26px; }
.form-title { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; padding-right: 46px; }
.form-sub { margin-top: 3px; color: var(--muted); font-size: 10.5px; }

.form-section { margin-top: 18px; }
.form-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.form-section-title .ic { width: 13px; height: 13px; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { color: var(--ink-2); font-size: 9.5px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 11.5px;
  outline: none;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-soft);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field .hint { color: var(--muted); font-size: 8.5px; }

.svc-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.svc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}
.svc-toggle .ic { width: 13px; height: 13px; }
.svc-toggle.on { border-color: var(--pink-border); background: var(--pink-soft); color: var(--pink); }
.svc-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.sess-card {
  margin-top: 7px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fcfbfa;
}
.sess-card.on { border-color: var(--beige-border); background: var(--beige); }
.sess-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sess-check { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 650; }
.sess-check input { accent-color: var(--pink); width: 14px; height: 14px; margin: 0; }
.sess-tag { color: var(--pink); font-size: 8.5px; font-weight: 600; }
.sess-body { display: grid; gap: 8px; margin-top: 8px; }
.sess-body[hidden] { display: none; }
.sess-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sess-grid.one { grid-template-columns: 1fr; }
.sess-grid .field input { min-height: 32px; }

.crew-row { display: grid; grid-template-columns: 1fr 1fr 30px; gap: 6px; margin-top: 6px; }
.crew-row input { min-height: 32px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 11px; background: #fff; }
.crew-row input:focus { border-color: var(--pink); outline: none; box-shadow: 0 0 0 2px var(--pink-soft); }
.crew-remove {
  display: grid;
  place-items: center;
  width: 30px; height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
}
.crew-remove:hover { color: var(--red); border-color: #f1c9c9; background: var(--red-soft); }
.add-crew {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pink);
  font-size: 9.5px;
  font-weight: 600;
}
.add-crew .ic { width: 11px; height: 11px; }

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #f3caca;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
}
.form-error .ic { width: 12px; height: 12px; margin-top: 1px; }
.form-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex: none;
}

/* ------------------------------------------------------------ toast */

body.sheet-open { overflow: hidden; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 120;
  max-width: calc(100% - 32px);
  padding: 9px 16px;
  border-radius: 100px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 980px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .summary.no-money { grid-template-columns: 1fr 1fr; }
  .sum-item:nth-child(3), .sum-item:nth-child(4) { padding-top: 11px; margin-top: 11px; border-top: 1px solid var(--line); }
  .sum-item:nth-child(3) { border-left: 0; }
  .summary.no-money .sum-item:nth-child(3) { grid-column: 1 / -1; }
  .search input { width: 180px; }
}

@media (max-width: 760px) {
  body { font-size: 12.5px; }
  .page { padding: 18px 14px 26px; }
  .page-head { align-items: flex-start; gap: 12px; }
  .head-copy h1 { font-size: 23px; }
  .head-copy p { font-size: 10.5px; max-width: 46ch; }
  .head-actions .btn span { display: none; }
  .head-actions .btn { width: 36px; padding: 0; }
  .summary { padding: 12px 0; }
  .sum-item { padding: 0 12px; }
  .sum-item > b { font-size: 19px; }
  .sum-money > b { font-size: 17px; }
  .sum-sub { font-size: 9.5px; white-space: normal; }
  .sum-icon { width: 33px; height: 33px; }
  .sum-month b { font-size: 11.5px; }
  .toolbar { padding: 9px 10px; gap: 8px; }
  .toolbar-left { gap: 1px; flex: 1 1 auto; }
  .month-button { font-size: 11.5px; }
  .seg button { padding: 0 8px; }
  .seg button span { display: none; }
  .filters { padding: 8px 10px; gap: 8px; }
  .filter-tools { width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .select { flex: 1 1 auto; }
  .select select { max-width: none; width: 100%; }
  .table-wrap { display: none; }
  .panel-foot { padding: 8px 10px; }
  .foot-right { display: none; }
  .page-footer { flex-direction: column; align-items: flex-start; gap: 5px; font-size: 9px; }
  .m-list { padding: 7px; }

  dialog.sheet {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .sheet-head { padding: 22px 18px 12px; }
  .job-title { font-size: 25px; }
  .sheet-body { padding: 0 18px 8px; }
  .session-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 16px; }
  .cost-card { grid-template-columns: 1fr; }
  .cost-item + .cost-item { border-left: 0; border-top: 1px solid #f3dde5; }
  .sheet-footer { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .sheet-footer .btn { height: 34px; font-size: 11px; }
  .sheet-close { top: 12px; right: 12px; width: 34px; height: 34px; }
  .form-body { padding: 20px 16px 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .sess-grid { grid-template-columns: 1fr; }
  .form-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .menu { right: 0; min-width: 200px; }
}

/* ------------------------------------------------------------ print */

@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .head-actions, .toolbar, .filters, .panel-foot, .page-footer, .menu, .month-pop, .sheet, .toast, .skip, .search kbd { display: none !important; }
  .summary { box-shadow: none; border-color: #ddd; }
  .panel { box-shadow: none; border-color: #ddd; }
  .jobs th { background: #f4f4f4; }
  .jobs td { box-shadow: none !important; }
  .table-wrap { overflow: visible; }
  table.jobs { min-width: 0; width: 100%; }
  .m-list { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

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