* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f6f7;
  color: #17313d;
  font-family: Arial, 'Noto Sans KR', sans-serif;
  font-size: 14px;
}
header {
  height: 54px;
  background: #fff;
  border-bottom: 1px solid #dce4e7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}
h1 {
  font-size: 22px;
  margin: 0;
}
.version {
  font-size: 11px;
  color: #819098;
  margin-left: 8px;
}
button {
  cursor: pointer;
  border: 1px solid #d1dde2;
  background: #eef2f4;
  border-radius: 5px;
  padding: 6px 11px;
  color: #17313d;
}
.primary {
  background: #173f4d;
  color: #fff;
  border-color: #173f4d;
}
.wrap {
  display: grid;
  grid-template-columns: minmax(650px, 2fr) minmax(405px, 1fr);
  gap: 10px;
  padding: 10px;
}
.card {
  container-type: inline-size;
  background: #fff;
  border: 1px solid #dce4e7;
  border-radius: 9px;
  padding: 13px;
  margin-bottom: 10px;
}
h2 {
  font-size: 19px;
  margin: 0 0 10px;
}
.searchline {
  display: grid;
  grid-template-columns: 65px 170px 52px 78px 190px 52px;
  gap: 6px;
  align-items: center;
}
.searchline input {
  height: 34px;
}
.searchline label {
  font-weight: 700;
}
.profile {
  margin-top: 10px;
  border: 1px solid #e0e7ea;
  border-radius: 6px;
  padding: 11px;
  display: none;
}
.profile-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.name {
  font-size: 20px;
  font-weight: 800;
}
.meta {
  padding-left: 14px;
  border-left: 1px solid #dce4e7;
}
.meta small {
  display: block;
  color: #71818a;
  margin-bottom: 2px;
}
.source-sales {
  color: #d11;
  font-weight: 800;
}
.note-row {
  margin-top: 9px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: start;
}
.note-row label {
  font-weight: 800;
  padding-top: 7px;
}
.note-box {
  white-space: pre-wrap;
  min-height: 70px;
  border: 1px solid #d8e1e5;
  border-radius: 5px;
  padding: 8px;
  background: #fffdf9;
}
.matches {
  display: none;
  margin-top: 8px;
  border: 1px solid #dde5e8;
  border-radius: 6px;
  overflow: hidden;
}
.match {
  padding: 8px 10px;
  border-bottom: 1px solid #e6ecee;
  cursor: pointer;
}
.match:last-child {
  border: 0;
}
.match:hover {
  background: #f2f7f8;
}
.emptynew {
  display: none;
  margin-top: 8px;
  padding: 9px;
  background: #f7fafb;
  border-radius: 6px;
}
.filters {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
}
.filters select,
.filters input {
  height: 32px;
  border: 1px solid #d3dfe3;
  border-radius: 5px;
  padding: 0 6px;
}
.history {
  width: 100%;
  border-collapse: collapse;
}
.history th,
.history td {
  padding: 8px 7px;
  border-bottom: 1px solid #e5ebed;
  text-align: left;
}
.history th {
  background: #f5f8f9;
  font-size: 12px;
}
.history td.content {
  width: 36%;
}
.history tbody tr[data-id] {
  cursor: pointer;
}
.history tbody tr[data-id]:hover,
.history tbody tr.browse-row:hover {
  background: #eef6f8;
}
.history tbody tr.selected {
  background: #dceff3 !important;
  box-shadow: inset 4px 0 #1c5b69;
}
.history td.content {
  white-space: pre-wrap;
}
.chip:focus-within span,
.chip[tabindex]:focus span {
  outline: 2px solid #6e9ca6;
  outline-offset: 1px;
}
.danger {
  background: #fff2f2;
  color: #b00020;
  border-color: #e2b8b8;
}
.filter-active {
  background: #e8f3f5;
  border-color: #7ba8b2;
}
.muted {
  color: #7a8990;
}
.field {
  margin-bottom: 8px;
}
.field > label {
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  position: relative;
}
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip span {
  display: block;
  border: 1px solid #cfdade;
  border-radius: 4px;
  padding: 3px 8px;
  background: #f8fafb;
  line-height: 1.2;
  cursor: pointer;
  font-size: 12px;
}
.chip input:checked + span {
  background: #1c5b69;
  color: white;
  border-color: #1c5b69;
}
.tiny span {
  padding: 3px 6px;
  font-size: 12px;
}
.conditional {
  display: none;
  margin-top: 5px;
}
.conditional.show {
  display: block;
}
.bigtext {
  min-height: 105px;
  resize: vertical;
}
.three {
  min-height: 72px;
}
.collapse {
  width: 100%;
  text-align: left;
  margin-top: 4px;
}
.hiddenbox {
  display: none;
  padding: 8px;
  background: #f7f9fa;
  margin-top: 4px;
  border-radius: 5px;
}
.hiddenbox.show {
  display: block;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.msg {
  margin-left: 8px;
  font-weight: 700;
}
.error {
  color: #d11;
}
.success {
  color: #17823b;
}
.actions {
  display: flex;
  align-items: center;
  margin-top: 9px;
}
.newmode {
  display: none;
}
.newmode.show {
  display: block;
}
.contractbox {
  display: none;
  margin-top: 6px;
  padding: 9px;
  border: 1px solid #d8e1e5;
  background: #fbfcfc;
  border-radius: 6px;
}
.contractbox.show {
  display: block;
}
.hint {
  font-size: 12px;
  color: #8b6b00;
  background: #fff8db;
  border: 1px solid #f0e0a1;
  border-radius: 4px;
  padding: 6px 7px;
  margin-bottom: 7px;
}
.labelrow {
  font-weight: 800;
  margin: 6px 0 4px;
}
.labeled-date {
  display: grid;
  grid-template-columns: 75px 1fr;
  gap: 6px;
  align-items: center;
}
.labeled-date label {
  font-weight: 700;
}
.right {
  align-self: start;
}
input,
textarea,
select {
  border: 1px solid #ccd8dd;
  border-radius: 5px;
  padding: 7px;
  width: 100%;
  font: inherit;
}
@media (max-width: 1000px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  .searchline {
    grid-template-columns: 65px 1fr 52px;
  }
  .searchline .phone-label {
    grid-column: 1;
  }
}

.viewtabs {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}
.viewtab.active {
  background: #173f4d;
  color: #fff;
  border-color: #173f4d;
}
.browsebox {
  display: none;
}
.browsebox.show {
  display: block;
}
.browse-count {
  font-size: 18px;
  font-weight: 800;
  margin: 8px 0;
}
.browse-help {
  font-size: 12px;
  color: #71818a;
  margin-left: 8px;
}
.history tbody tr.browse-row {
  cursor: pointer;
}
.history tbody tr.browse-row:hover {
  background: #f5f9fa;
}
.task-launcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  border-radius: 18px;
  padding: 9px 14px;
  box-shadow: 0 3px 12px #0002;
}
.task-drawer {
  position: fixed;
  top: 54px;
  right: -390px;
  width: 380px;
  height: calc(100vh - 54px);
  background: white;
  border-left: 1px solid #dce4e7;
  box-shadow: -4px 0 16px #0002;
  z-index: 40;
  transition: right 0.18s;
  padding: 14px;
  overflow: auto;
}
.task-drawer.open {
  right: 0;
}
.task-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.task-item {
  border: 1px solid #dde5e8;
  border-radius: 6px;
  padding: 8px;
  margin: 6px 0;
}
.task-item.done {
  opacity: 0.55;
}
.task-meta {
  font-size: 11px;
  color: #71818a;
  margin-top: 5px;
}
.task-form {
  border-top: 1px solid #e2e8ea;
  margin-top: 10px;
  padding-top: 10px;
}
.task-form textarea {
  min-height: 72px;
}
.task-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  background: #b00020;
  color: #fff;
  border-radius: 10px;
  padding: 1px 5px;
  font-size: 11px;
  margin-left: 4px;
}

.stats-panel {
  display: none;
  padding: 10px;
}
.stats-panel.show {
  display: block;
}
.stats-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.stats-controls input,
.stats-controls select {
  width: auto;
  min-width: 125px;
  height: 34px;
}
.stats-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.stat-card {
  background: #fff;
  border: 1px solid #dce4e7;
  border-radius: 8px;
  padding: 12px;
}
.stat-card small {
  display: block;
  color: #71818a;
}
.stat-card strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}
.stat-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}
.stat-box {
  border: 1px solid #dce4e7;
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}
.stat-tables {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
}
.mini-table th,
.mini-table td {
  padding: 6px;
  border-bottom: 1px solid #e5ebed;
  text-align: left;
}
.multi-park {
  min-height: 84px;
}
.task-item.clickable {
  cursor: pointer;
}
.task-item.clickable:hover {
  background: #f2f7f8;
}
.task-item.selected-task {
  background: #dceff3;
  border-color: #7ba8b2;
}
.task-actions {
  display: flex;
  gap: 5px;
  margin-top: 7px;
}
.drawer-note {
  font-size: 12px;
  color: #71818a;
  margin: 5px 0;
}
.stats-list-wrap {
  max-height: 360px;
  overflow: auto;
}
.stats-list td.content {
  white-space: pre-wrap;
}
.scope-help {
  font-size: 11px;
  color: #71818a;
  margin-top: 3px;
}
.history-search {
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
}
.history-search input,
.history-search select {
  min-width: 105px;
  max-width: 150px;
}
.history-search #filterQ {
  min-width: 155px;
}
.history-search button {
  white-space: nowrap;
  padding: 5px 8px;
}
.report-table {
  font-size: 12px;
  min-width: 1350px;
}
.report-table th,
.report-table td {
  vertical-align: top;
}
.report-table td:nth-child(9) {
  white-space: pre-wrap;
  min-width: 250px;
}
.stats-list-wrap {
  overflow: auto;
}
.recent-label {
  font-size: 12px;
  color: #71818a;
}
.import-bad {
  color: #b00020;
  font-weight: 700;
}
.import-ok {
  color: #17823b;
}
@media (max-width: 1100px) {
  .stats-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat-tables,
  .stat-groups {
    grid-template-columns: 1fr;
  }
}

/* v4.8.2 responsive UI */
.two-panel-admin {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 10px;
}
.two-panel-admin > .task-form {
  border-top: 0;
  border-left: 1px solid #e2e8ea;
  margin: 0;
  padding: 0 0 0 10px;
}
@media (max-width: 650px) {
  .two-panel-admin {
    grid-template-columns: 1fr;
  }
  .two-panel-admin > .task-form {
    border-left: 0;
    border-top: 1px solid #e2e8ea;
    padding: 10px 0 0;
  }
}
header {
  height: auto;
  min-height: 50px;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 14px;
}
header > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
header button {
  padding: 5px 9px;
  font-size: 12px;
}
.wrap {
  grid-template-columns: minmax(560px, 1.65fr) minmax(360px, 0.85fr);
  align-items: start;
}
.card {
  padding: 10px;
}
h2 {
  font-size: 17px;
}
.right .field {
  margin-bottom: 6px;
}
.right .chip span {
  padding: 4px 7px;
  font-size: 12px;
  min-height: 26px;
  display: flex;
  align-items: center;
}
.lookup-head,
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.unified-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 6px;
}
.unified-search input {
  height: 34px;
}
.searchline {
  display: none;
}
.matches {
  max-height: 220px;
  overflow: auto;
}
.input-with-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
}
.input-with-btn button.active,
#csNoContactBtn.active {
  background: #8b2f3b;
  color: white;
  border-color: #8b2f3b;
}
.stats-panel {
  padding: 7px;
}
.stats-panel > .card:first-child {
  padding: 9px;
}
.stats-cards {
  grid-template-columns: repeat(6, minmax(80px, 1fr));
  gap: 5px;
  margin: 7px 0;
}
.stat-card {
  padding: 7px 9px;
}
.stat-card strong {
  font-size: 18px;
  margin-top: 2px;
}
.stat-groups {
  gap: 5px;
  margin: 5px 0;
}
.stat-box {
  padding: 7px;
}
.stat-tables {
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.stat-tables .mini-table {
  font-size: 11px;
}
.stats-list-wrap {
  max-height: 62vh;
  min-height: 300px;
}
.report-preview-wrap {
  max-height: 62vh;
  overflow: auto;
}
.history th {
  cursor: pointer;
  user-select: none;
}
.history th:hover {
  background: #e9f2f4;
}
.wide-drawer {
  width: min(760px, 94vw);
  right: min(-770px, -94vw);
}
.small-drawer {
  width: min(390px, 94vw);
}
.work-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.worktab.active {
  background: #173f4d;
  color: #fff;
}
.browsebox .filters {
  flex-wrap: wrap;
}
.history-search {
  overflow: visible;
}
.history-search > * {
  flex: 1 1 90px;
}
.history-search #filterQ {
  flex: 2 1 170px;
}
.history-search button {
  flex: 0 0 auto;
}
.newmode .field > label {
  display: flex;
  justify-content: space-between;
}
.report-table td.content,
.history td.content {
  white-space: pre-wrap;
}
.sms-excluded {
  opacity: 0.55;
}
.sms-overdue {
  background: #fff4e5;
}
.sms-sent {
  opacity: 0.55;
}
.no-contact-badge {
  color: #8b2f3b;
  font-weight: 800;
}
@media (max-width: 1250px) {
  .wrap {
    grid-template-columns: minmax(520px, 1.45fr) minmax(340px, 0.9fr);
  }
  .stat-tables {
    grid-template-columns: repeat(2, 1fr);
  }
  header button {
    font-size: 11px;
  }
}
@media (max-width: 980px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  .right {
    position: static;
  }
  .stats-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat-tables,
  .stat-groups {
    grid-template-columns: 1fr 1fr;
  }
  .history-search {
    flex-wrap: wrap;
  }
}
@media (max-width: 650px) {
  body {
    font-size: 13px;
  }
  header {
    align-items: flex-start;
  }
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-tables,
  .stat-groups {
    grid-template-columns: 1fr;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .viewtabs {
    overflow-x: auto;
  }
  .history-search > * {
    flex: 1 1 45%;
  }
}
@media print {
  header,
  .stats-controls,
  .task-drawer,
  #monthlyClose,
  #monthlyExcel,
  #monthlyPrint,
  .work-tabs {
    display: none !important;
  }
  #statsPanel {
    display: none !important;
  }
  #monthlyReportPanel {
    display: block !important;
    margin: 0;
    border: 0;
  }
  .report-preview-wrap {
    max-height: none;
    overflow: visible;
  }
  .report-table {
    min-width: 0;
    font-size: 10px;
  }
}

/* v4.8.2.1 button balance */
.viewtab {
  padding: 5px 9px;
  font-size: 13px;
}
.unified-search button,
.history-search button,
.actions > button,
.profile-main > button {
  padding: 5px 9px;
  font-size: 13px;
}
.work-tabs .worktab {
  padding: 5px 9px;
  font-size: 13px;
}
#workImportOpen {
  padding: 5px 10px;
  font-size: 13px;
}
.right .chip span {
  padding: 5px 9px;
  font-size: 13px;
  min-height: 29px;
}
.right .tiny span {
  padding: 5px 8px;
  font-size: 13px;
  min-height: 29px;
}
.right .collapse {
  padding: 6px 10px;
  font-size: 13px;
}
.right .actions button {
  padding: 6px 10px;
  font-size: 13px;
}
@media (max-width: 1250px) {
  .viewtab,
  .unified-search button,
  .history-search button,
  .work-tabs .worktab {
    font-size: 12px;
  }
  .right .chip span,
  .right .tiny span {
    font-size: 12px;
    min-height: 28px;
  }
}

/* v4.8.3 compact + readable + resizable */
:root {
  --ui-font: 16px;
  --left-pane: 67%;
  --right-pane: 33%;
}
body {
  font-size: var(--ui-font);
}
button {
  font-size: 14px;
  padding: 6px 10px;
  line-height: 1.15;
}
header button {
  font-size: 13px;
  padding: 5px 8px;
}
h1 {
  font-size: 23px;
}
.version {
  font-size: 12px;
}
h2 {
  font-size: 19px;
}
.wrap {
  grid-template-columns: minmax(520px, var(--left-pane)) 7px minmax(390px, var(--right-pane));
  gap: 0;
  padding: 10px;
  align-items: start;
}
.wrap > div:first-child {
  padding-right: 8px;
}
.right {
  margin-left: 8px;
}
.main-splitter {
  width: 7px;
  align-self: stretch;
  cursor: col-resize;
  background: transparent;
  border-radius: 6px;
  min-height: calc(100vh - 80px);
}
.main-splitter:hover,
.main-splitter.dragging {
  background: #c8dde2;
}
.unified-search {
  grid-template-columns: minmax(260px, 1fr) auto auto auto auto auto;
  gap: 5px;
  align-items: center;
}
.unified-search input {
  height: 36px;
}
.unified-search button {
  height: 36px;
  white-space: nowrap;
  font-size: 14px;
  padding: 6px 10px;
}
.viewtab {
  font-size: 14px;
  padding: 6px 10px;
}
.profile-main > button {
  font-size: 14px;
  padding: 6px 10px;
}
.right .chip span,
.right .tiny span {
  font-size: 14px;
  min-height: 31px;
  padding: 5px 9px;
}
.right .field > label {
  font-size: 15px;
}
.right input,
.right textarea,
.right select {
  font-size: 15px;
}
.filters {
  display: grid;
  grid-template-columns: 150px 18px 150px 145px 145px 155px 135px auto auto;
  gap: 5px;
  align-items: center;
  margin-bottom: 8px;
}
.filters input,
.filters select {
  width: 100%;
  min-width: 0;
  height: 36px;
  font-size: 14px;
}
.filters button {
  height: 36px;
  font-size: 14px;
}
.history-search {
  display: grid;
  grid-template-columns: 150px 150px 18px 150px 145px 145px 155px auto auto auto;
  overflow: visible;
}
.history-search input,
.history-search select {
  min-width: 0;
  max-width: none;
  width: 100%;
  height: 36px;
  font-size: 14px;
}
.history {
  table-layout: fixed;
}
.history th,
.history td {
  font-size: 14px;
  padding: 8px 6px;
}
.history th {
  font-size: 13px;
}
.history .col-park,
.history th:nth-child(1) {
  width: 7%;
}
.history .col-date,
.history th:nth-child(2) {
  width: 12%;
}
.history .col-staff,
.history th:nth-child(3) {
  width: 12%;
}
.history .col-content,
.history th:nth-child(4) {
  width: 43%;
}
.history .col-status,
.history th:nth-child(5) {
  width: 9%;
}
.history .col-interest,
.history th:nth-child(6) {
  width: 11%;
}
.history .col-rank,
.history th:nth-child(7) {
  width: 6%;
}
.history td.content {
  width: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.customer-task-row {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #e5ebed;
}
.customer-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.customer-task-summary {
  margin-top: 5px;
  display: grid;
  gap: 4px;
}
.customer-task-mini {
  padding: 6px 8px;
  border: 1px solid #e0e8eb;
  border-radius: 5px;
  background: #fbfcfc;
}
.customer-task-mini.overdue {
  border-color: #d9a2a8;
  background: #fff6f6;
}
.stats-controls input,
.stats-controls select {
  min-width: 0;
  width: auto;
  height: 34px;
}
.stats-controls input[type='date'] {
  width: 145px;
}
.stats-controls select {
  width: 145px;
}
.stats-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0;
}
.stat-card {
  width: 125px;
  min-height: 64px;
  padding: 7px 9px;
}
.stat-card strong {
  font-size: 20px;
}
.stat-groups {
  grid-template-columns: repeat(2, minmax(220px, 320px));
  justify-content: start;
}
.stat-tables {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 6px;
}
.stat-box {
  padding: 7px;
}
.stats-list-wrap {
  max-height: none;
  min-height: 420px;
}
.stats-panel .report-table {
  font-size: 13px;
}
.report-table {
  min-width: 1200px;
}
#monthlyReportPanel .report-preview-wrap {
  max-height: 68vh;
}
#monthlyReportPanel .report-table td:nth-child(10) {
  min-width: 300px;
}
@media (max-width: 1250px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  .main-splitter {
    display: none;
  }
  .wrap > div:first-child {
    padding-right: 0;
  }
  .right {
    margin-left: 0;
  }
  .unified-search {
    grid-template-columns: minmax(220px, 1fr) auto auto;
  }
  .unified-search #homeBtn,
  .unified-search #clearScreenBtn,
  .unified-search #listBackBtn {
    grid-row: 2;
  }
  .filters,
  .history-search {
    display: flex;
    flex-wrap: wrap;
  }
  .filters input,
  .filters select,
  .history-search input,
  .history-search select {
    width: 150px;
  }
  .stat-tables {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  body {
    font-size: 15px;
  }
  .unified-search {
    grid-template-columns: 1fr auto;
  }
  .unified-search button {
    height: auto;
  }
  .stat-tables,
  .stat-groups {
    grid-template-columns: 1fr;
  }
  .history {
    min-width: 900px;
  }
  .card {
    overflow-x: auto;
  }
}

.header-clock {
  font-weight: 700;
  color: #315563;
  font-size: 13px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #f1f6f7;
  white-space: nowrap;
}
.section-actions,
.history-actions,
.edit-panel-head {
  display: flex;
  gap: 6px;
  align-items: center;
}
.history-actions {
  margin: 2px 0 7px;
}
.unified-search {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}
.filters,
.history-search {
  display: flex !important;
  flex-wrap: wrap !important;
  overflow: visible !important;
}
.filters > *,
.history-search > * {
  flex: 0 1 auto;
}
.filters input,
.filters select,
.history-search input,
.history-search select {
  width: auto !important;
  min-width: 105px !important;
  max-width: 170px !important;
}
.history-search #filterQ {
  flex: 1 1 180px !important;
  max-width: 260px !important;
}
.history-card {
  overflow: hidden;
}
.history-card .history {
  min-width: 760px;
}
.panel-title {
  font-weight: 800;
  font-size: 16px;
  padding: 8px 10px;
  margin: -1px -1px 9px;
  border-radius: 7px 7px 0 0;
}
.input-panel {
  border: 2px solid #b8d0d6;
  background: #f9fcfd;
}
.input-panel .panel-title {
  background: #eaf4f6;
  color: #173f4d;
}
.result-panel {
  border: 1px solid #dce4e7;
  border-radius: 8px;
  padding: 9px;
  background: #fff;
}
.result-panel .panel-title {
  background: #f3f6f7;
}
.task-item {
  border: 1px solid #e1e8ea;
  border-radius: 6px;
  padding: 8px;
  margin: 5px 0;
}
.customer-task-mini {
  cursor: pointer;
}
.customer-task-mini:hover {
  background: #edf6f8;
}
.drawer-splitter,
.stats-vsplitter {
  height: 8px;
  cursor: row-resize;
  border-radius: 6px;
  margin: 3px 0;
}
.drawer-splitter:hover,
.stats-vsplitter:hover {
  background: #c8dde2;
}
.staff-table {
  display: grid;
  gap: 5px;
}
.staff-row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr 1fr 0.8fr 1.2fr;
  gap: 8px;
  padding: 9px;
  border: 1px solid #dce4e7;
  border-radius: 6px;
  align-items: center;
  cursor: pointer;
}
.staff-row.header {
  font-weight: 800;
  background: #f3f6f7;
  cursor: default;
}
.staff-row:not(.header):hover {
  background: #eef6f8;
}
.edit-panel {
  margin-top: 8px;
}
.stats-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}
.summary-pill {
  border: 1px solid #dce4e7;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
}
.summary-pill b {
  font-size: 17px;
}
.stats-detail-toggle {
  margin-bottom: 6px;
}
.stats-list-wrap .report-table {
  table-layout: fixed;
  min-width: 1050px;
}
.stats-list-wrap .report-table th:nth-child(1) {
  width: 6%;
}
.stats-list-wrap .report-table th:nth-child(2) {
  width: 10%;
}
.stats-list-wrap .report-table th:nth-child(3) {
  width: 8%;
}
.stats-list-wrap .report-table th:nth-child(4) {
  width: 8%;
}
.stats-list-wrap .report-table th:nth-child(5) {
  width: 11%;
}
.stats-list-wrap .report-table th:nth-child(6) {
  width: 8%;
}
.stats-list-wrap .report-table th:nth-child(7) {
  width: 9%;
}
.stats-list-wrap .report-table th:nth-child(8) {
  width: 6%;
}
.stats-list-wrap .report-table th:nth-child(9) {
  width: 26%;
}
.stats-list-wrap .report-table th:nth-child(10) {
  width: 10%;
}
.stats-list-wrap .report-table th:nth-child(11) {
  width: 10%;
}
.stats-list-wrap .report-table th:nth-child(12) {
  width: 7%;
}
.stats-list-wrap td.content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
}
.stats-cards {
  display: none !important;
}
@container (max-width:700px) {
  .history-search,
  .filters {
    display: flex;
    flex-wrap: wrap;
  }
  .history-search > * {
    flex: 1 1 130px !important;
  }
  .history-search button {
    flex: 0 0 auto !important;
  }
}
@media (max-width: 900px) {
  .staff-row {
    grid-template-columns: 1fr 1fr;
  }
  .staff-row.header {
    display: none;
  }
  .header-clock {
    order: 3;
    width: 100%;
    text-align: right;
  }
}
.park-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 3px 0 7px;
}
.park-tabs button.active {
  background: #173f4d;
  color: #fff;
}
.park-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  margin: 1px 2px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #0001;
  color: #24323a;
}
.park-badge.bundang {
  background: #d8c2aa;
}
.park-badge.paldang {
  background: #c7dcf2;
}
.park-badge.ilsan {
  background: #ead9c7;
}
.park-badge.pocheon {
  background: #d5ebc8;
}
.history-actions {
  margin-left: auto;
}
.version #liveClock {
  font-size: 12px;
  font-weight: 700;
  color: #51666f;
}
.report-title {
  display: none;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 10px;
}
.source-summary-print {
  margin-left: auto;
  max-width: 520px;
}
@media (min-width: 1500px) {
  body {
    font-size: 15px;
  }
  .wrap {
    max-width: 1920px;
    margin: auto;
    padding: 12px;
  }
  .card {
    padding: 12px;
  }
}
@page {
  size: A4 landscape;
  margin: 8mm;
}
@media print {
  .no-print {
    display: none !important;
  }
  .report-title {
    display: block;
  }
  .report-table {
    width: 100% !important;
    table-layout: fixed !important;
    min-width: 0 !important;
    font-size: 8.5px !important;
  }
  .report-table th,
  .report-table td {
    padding: 3px !important;
    word-break: break-word;
  }
  .report-table textarea {
    border: 0;
    resize: none;
    min-width: 0 !important;
    width: 100%;
    font-size: 8.5px;
    min-height: 32px;
  }
  .source-summary-print {
    page-break-inside: avoid;
  }
}

/* v4.8.6 customer-first workflow */
.customer-search-area {
  border: 1px dashed #c7d7dc;
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfe;
}
#profile.customer-main {
  border: 2px solid #769da8;
  border-radius: 10px;
  background: #f7fbfc;
  padding: 12px;
  box-shadow: 0 2px 8px #173f4d12;
}
#profile.customer-main .profile-main .name {
  font-size: 22px;
  font-weight: 900;
  color: #173f4d;
}
#profile.customer-main .profile-main {
  align-items: center;
}
#profile.customer-main:before {
  content: '현재 고객';
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #315f6d;
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 8px;
}
.consult-summary {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: #40545c;
  margin-top: 3px;
  white-space: pre-wrap;
}
.reservation-today {
  background: #fff8e8;
}
.audit-table td {
  vertical-align: top;
}
.audit-detail {
  max-width: 440px;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (min-width: 1200px) {
  #lookupCard {
    padding-bottom: 12px;
  }
  .customer-search-area {
    padding: 12px;
  }
  .history-card {
    margin-top: 10px;
  }
}

.stats-list-wrap .report-table th:nth-child(1) {
  width: 5%;
}
.stats-list-wrap .report-table th:nth-child(2) {
  width: 6%;
}
.stats-list-wrap .report-table th:nth-child(3) {
  width: 6%;
}
.stats-list-wrap .report-table th:nth-child(4) {
  width: 6%;
}
.stats-list-wrap .report-table th:nth-child(5) {
  width: 7%;
}
.stats-list-wrap .report-table th:nth-child(6) {
  width: 10%;
}
.stats-list-wrap .report-table th:nth-child(7) {
  width: 8%;
}
.stats-list-wrap .report-table th:nth-child(8) {
  width: 8%;
}
.stats-list-wrap .report-table th:nth-child(9) {
  width: 5%;
}
.stats-list-wrap .report-table th:nth-child(10) {
  width: 25%;
}
.stats-list-wrap .report-table th:nth-child(11) {
  width: 8%;
}
.stats-list-wrap .report-table th:nth-child(12) {
  width: 6%;
}
.stats-list-wrap .report-table th:nth-child(13) {
  width: 5%;
}

/* v4.8.9 상담이력 집중형 레이아웃 */
.history-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}
.history-scrollbox {
  height: clamp(360px, 58vh, 680px);
  overflow: auto;
  border: 1px solid #dfe7ea;
  border-radius: 7px;
  background: #fff;
}
.history-scrollbox .history {
  margin: 0;
  table-layout: fixed;
  min-width: 920px;
}
.history-scrollbox .history thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #edf3f5;
  box-shadow: 0 1px 0 #d7e1e4;
}
.history-scrollbox .history .col-park {
  width: 15%;
}
.history-scrollbox .history .col-date {
  width: 13%;
}
.history-scrollbox .history .col-staff {
  width: 9%;
}
.history-scrollbox .history .col-content {
  width: 36%;
}
.history-scrollbox .history .col-status {
  width: 9%;
}
.history-scrollbox .history .col-interest {
  width: 10%;
}
.history-scrollbox .history .col-rank {
  width: 8%;
}
.history-row td {
  vertical-align: middle;
}
.history-row .content {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-row .summary-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: #28444f;
}
.history-row.expanded {
  background: #f3f8f9;
}
.history-detail-row {
  display: none;
  background: #f8fbfc;
}
.history-detail-row.show {
  display: table-row;
}
.history-detail {
  padding: 12px 14px !important;
  white-space: pre-wrap !important;
  line-height: 1.55;
  color: #273d46;
}
.history-detail .detail-actions {
  margin-top: 8px;
  text-align: right;
}
.history-card .filters {
  margin-bottom: 7px;
}
.history-card .park-tabs {
  margin-bottom: 6px;
}
.history-card .history-actions {
  margin-bottom: 6px;
}
#lookupCard {
  margin-bottom: 8px;
}
.profile {
  margin-top: 7px;
}
.note-box {
  min-height: 48px;
}
.customer-task-row {
  margin-top: 7px;
}
@media (max-height: 850px) {
  .history-scrollbox {
    height: 50vh;
    min-height: 330px;
  }
}
@media (max-width: 1150px) {
  .history-scrollbox {
    height: 52vh;
  }
  .history-scrollbox .history {
    min-width: 860px;
  }
}

/* v4.8.9 layout/report refinements */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.header-left,
.header-right,
#mainNav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.header-left {
  min-width: 0;
  flex: 1;
}
.header-right {
  justify-content: flex-end;
}
.header-left .version {
  margin-right: 6px;
}
.header-right #loginUser {
  margin-left: 4px;
}
.park-badge {
  color: #111 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  border: 1px solid #00000018;
}
.park-badge.bundang {
  background: #d2b79a;
}
.park-badge.paldang {
  background: #c5dcf4;
}
.park-badge.ilsan {
  background: #f4eadf;
}
.park-badge.pocheon {
  background: #d5edc9;
}
.history-scrollbox {
  height: clamp(420px, 57vh, 690px);
  overflow-y: scroll !important;
  overflow-x: auto;
}
.history-scrollbox .history {
  min-width: 900px;
}
.history-detail-row .history-detail {
  background: #f8fbfc;
  border-top: 1px solid #dbe5e8;
  padding: 12px 16px !important;
}
.history-detail-row .detail-actions {
  margin-top: 8px;
  text-align: right;
}
.report-title {
  display: block !important;
  margin: 12px 0 14px;
  font-size: 21px;
}
.report-preview-wrap {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid #d9e2e5;
  border-radius: 6px;
}
.report-table {
  table-layout: fixed !important;
  width: 1500px !important;
  min-width: 1500px !important;
  font-size: 12px;
}
.report-table th,
.report-table td {
  border: 1px solid #cbd5d9 !important;
  padding: 6px !important;
  vertical-align: top;
  word-break: break-word;
}
.report-table th {
  background: #eef2f3;
  position: sticky;
  top: 0;
  z-index: 2;
}
.report-table .c-include {
  width: 54px;
}
.report-table .c-park {
  width: 70px;
}
.report-table .c-date {
  width: 68px;
}
.report-table .c-staff {
  width: 90px;
}
.report-table .c-deceased {
  width: 85px;
}
.report-table .c-customer {
  width: 90px;
}
.report-table .c-phone {
  width: 118px;
}
.report-table .c-shape {
  width: 100px;
}
.report-table .c-source {
  width: 105px;
}
.report-table .c-visit {
  width: 72px;
}
.report-table .c-content {
  width: 360px;
}
.report-table .c-result {
  width: 180px;
}
.report-table .c-contract {
  width: 72px;
}
.report-table .c-note {
  width: 95px;
}
.report-table textarea {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 72px;
  box-sizing: border-box;
  resize: vertical;
  font: inherit;
  line-height: 1.4;
}
.print-report-content {
  display: none;
}
.report-result-cell {
  white-space: pre-wrap;
}
.source-summary-print {
  margin: 12px 0 0 auto;
  max-width: 520px;
}
.stats-cards {
  display: flex !important;
}
.stats-detail-toggle {
  display: inline-block !important;
}
@media print {
  body {
    background: #fff !important;
    font-size: 8pt !important;
  }
  header,
  .stats-controls,
  .no-print,
  #monthlyClose,
  #monthlyExcel,
  #monthlyPrint {
    display: none !important;
  }
  #monthlyReportPanel {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .report-preview-wrap {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
  }
  .report-title {
    display: block !important;
    font-size: 14pt !important;
    margin: 0 0 4mm !important;
  }
  .report-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    font-size: 6.8pt !important;
    border-collapse: collapse !important;
  }
  .report-table th,
  .report-table td {
    border: 0.4pt solid #666 !important;
    padding: 1.4mm 1mm !important;
    line-height: 1.22 !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }
  .report-table thead {
    display: table-header-group;
  }
  .report-table tr {
    page-break-inside: avoid;
  }
  .report-table .c-include {
    display: none;
  }
  .report-table .c-park {
    width: 4.5%;
  }
  .report-table .c-date {
    width: 4.8%;
  }
  .report-table .c-staff {
    width: 6.3%;
  }
  .report-table .c-deceased {
    width: 6.1%;
  }
  .report-table .c-customer {
    width: 6.5%;
  }
  .report-table .c-phone {
    width: 8.7%;
  }
  .report-table .c-shape {
    width: 7.2%;
  }
  .report-table .c-source {
    width: 7.4%;
  }
  .report-table .c-visit {
    width: 5%;
  }
  .report-table .c-content {
    width: 24%;
  }
  .report-table .c-result {
    width: 10%;
  }
  .report-table .c-contract {
    width: 5.3%;
  }
  .report-table .c-note {
    width: 4.2%;
  }
  .report-table textarea {
    display: none !important;
  }
  .print-report-content {
    display: block !important;
    white-space: pre-wrap;
  }
  .source-summary-print {
    max-width: 48% !important;
    margin: 4mm 0 0 auto !important;
    page-break-inside: avoid;
  }
  .source-summary-print table {
    font-size: 7pt !important;
  }
}
@page {
  size: A4 landscape;
  margin: 6mm;
}

/* v4.8.11 layout stabilization */
.wrap {
  min-height: calc(100vh - 64px);
  align-items: stretch;
}
.wrap > div:first-child {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 74px);
}
#lookupCard {
  flex: 0 0 auto;
}
.history-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  margin-bottom: 0;
}
.history-scrollbox {
  flex: 1 1 auto;
  min-height: 360px;
  max-height: none;
  overflow: auto;
  border: 1px solid #e1e8eb;
  border-radius: 6px;
}
.history-scrollbox thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f5f8f9;
}
.right {
  align-self: stretch;
  height: calc(100vh - 74px);
  min-height: 720px;
  overflow: auto;
  margin-bottom: 0;
}
.consult-note-card {
  border: 1px solid #d8e1e5;
  background: #fffdf9;
  border-radius: 7px;
  padding: 9px;
  margin-bottom: 9px;
}
.consult-note-card textarea {
  min-height: 76px;
  resize: vertical;
  background: #fff;
}
.right .bigtext {
  min-height: 125px;
  max-height: 220px;
}
.customer-main .profile-main {
  margin-bottom: 4px;
}
.customer-main .customer-task-row {
  margin-top: 8px;
}
.note-row {
  display: none !important;
}
@media (max-width: 1250px) {
  .right {
    height: auto;
    min-height: 0;
  }
  .wrap > div:first-child {
    min-height: 0;
  }
  .history-card {
    min-height: 560px;
  }
}

/* 2026-09-14 usability patch: compact count badges + fixed desktop main viewport */
#taskBadge,
#topTaskBadge,
#smsTopBadge,
#todayReservationBadge {
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: #173f4d;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  vertical-align: middle;
}
#taskBadge:not(:empty),
#topTaskBadge:not(:empty),
#smsTopBadge:not(:empty),
#todayReservationBadge:not(:empty) {
  display: inline-flex;
}

@media (min-width: 1251px) {
  body.main-view {
    overflow: hidden;
  }
  body.main-view .wrap {
    height: calc(100vh - var(--header-h, 54px));
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
  }
  body.main-view .wrap > div:first-child {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  body.main-view .history-card {
    min-height: 0;
  }
  body.main-view .history-scrollbox {
    min-height: 0;
  }
  body.main-view .right {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.main-view .main-splitter {
    min-height: 0;
  }
}

/* v4.8.13 compact header badges */
#taskBadge,
#topTaskBadge,
#smsTopBadge,
#todayReservationBadge {
  min-width: 16px !important;
  height: 16px !important;
  padding: 0 4px !important;
  margin-left: 2px !important;
  font-size: 10px !important;
  line-height: 16px !important;
}
.header-right > button { white-space: nowrap; }
.recording-inline-audio { width: 220px; max-width: 100%; vertical-align: middle; margin-left: 6px; }
.recording-table audio { height: 30px; }

/* v4.8.13 print layout: A4 landscape, readable multi-page report */
@page { size: A4 landscape; margin: 7mm; }
@media print {
  html, body { width: auto !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  body { margin: 0 !important; font-size: 9pt !important; }
  header, main.wrap, #statsPanel, .task-drawer, #authOverlay,
  #monthlyReportPanel > .list-head, #monthlyReportPanel > .stats-controls,
  #monthlyExcel, #monthlyPrint, .no-print { display: none !important; }
  #monthlyReportPanel {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .report-title {
    display: block !important;
    width: 100% !important;
    margin: 0 0 4mm !important;
    text-align: center !important;
    font-size: 15pt !important;
    font-weight: 800 !important;
  }
  .report-preview-wrap { width: 100% !important; max-height: none !important; overflow: visible !important; border: 0 !important; }
  .report-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 8.2pt !important;
  }
  .report-table thead { display: table-header-group !important; }
  .report-table tr { break-inside: avoid !important; page-break-inside: avoid !important; }
  .report-table th, .report-table td {
    border: .5pt solid #555 !important;
    padding: 1.5mm 1.1mm !important;
    line-height: 1.25 !important;
    vertical-align: top !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
  }
  .report-table th { text-align: center !important; background: #eee !important; font-weight: 700 !important; }
  .report-table .c-park { width: 5% !important; }
  .report-table .c-date { width: 5.5% !important; }
  .report-table .c-staff { width: 6% !important; }
  .report-table .c-deceased { width: 5.5% !important; }
  .report-table .c-customer { width: 6.5% !important; }
  .report-table .c-phone { width: 9.5% !important; }
  .report-table .c-shape { width: 8% !important; }
  .report-table .c-source { width: 8% !important; }
  .report-table .c-visit { width: 5% !important; }
  .report-table .c-content { width: 24% !important; }
  .report-table .c-result { width: 8% !important; }
  .report-table .c-contract { width: 6% !important; }
  .report-table .c-note { width: 6.5% !important; }
  .report-table td:nth-child(7), .report-table th:nth-child(7) { white-space: nowrap !important; }
  .report-table textarea { display: none !important; }
  .print-report-content { display: block !important; white-space: pre-wrap !important; }
  .source-summary-print {
    width: 55% !important;
    max-width: none !important;
    margin: 5mm 0 0 auto !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .source-summary-print table { font-size: 8pt !important; }
}

/* v4.8.16 report emphasis */
#monthlyReportPanel .report-table thead th,
.stats-panel .report-table thead th {
  background: #c9dcf5 !important;
}
.report-table tr.report-contract-row > td {
  background: #fff200 !important;
}
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  #monthlyReportPanel .report-table thead th { background: #c9dcf5 !important; }
  #monthlyReportPanel .report-table tr.report-contract-row > td { background: #fff200 !important; }
}

.sms-compose-box {
  border: 1px solid #d9e3e7;
  border-radius: 7px;
  padding: 9px;
  background: #fbfdfe;
}
.sms-compose-box > label { display:block; font-weight:700; margin-bottom:5px; }
.sms-compose-box textarea { width:100%; box-sizing:border-box; min-height:82px; }
