/* ── 날짜 선택 ─────────────────────────────────────────────────── */
.ht-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}
.ht-cal-nav-btn {
    background: none;
    border: 1.5px solid #B4C5E4;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    font-size: 18px;
    color: #3C3744;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.ht-cal-nav-btn:hover { background: #f0f4ff; }
.ht-cal-label {
    font-size: 15px;
    font-weight: 700;
    color: #3C3744;
    min-width: 110px;
    text-align: center;
}
.ht-cal-grid { width: 100%; }
.ht-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.ht-cal-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    padding: 4px 0;
}
.ht-cal-days .ht-cal-day-header:first-child { color: #e57373; }
.ht-cal-days .ht-cal-day-header:last-child  { color: #64b5f6; }
.ht-cal-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.ht-cal-date, .ht-cal-empty {
    text-align: center;
    padding: 7px 2px;
    font-size: 13px;
    border-radius: 8px;
    color: #3C3744;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.15s;
}
.ht-cal-empty { cursor: default; }
.ht-cal-date:hover { background: #f0f4ff; }
.ht-cal-date.today { font-weight: 700; color: #3C3744; background: #e8eaf0; }
.ht-cal-date.selected { background: #3C3744; color: #fff; font-weight: 700; }
.ht-cal-date.selected:hover { background: #3C3744; }
.ht-cal-date.has-record::after {
    content: '';
    display: block;
    width: 5px; height: 5px;
    background: #4CAF50;
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
}
.ht-cal-date.selected.has-record::after { background: #A5D6A7; }
.ht-selected-date {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #3C3744;
    padding: 6px 0;
    border-top: 1px solid #f0f0f0;
}

/* ── 화면 공유 상태 ─────────────────────────────────────────────── */
.ht-share-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #aaa;
}
.ht-share-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
    transition: background 0.3s;
}
.ht-share-dot.active { background: #4CAF50; box-shadow: 0 0 6px #4CAF5088; }
#htShareText { color: #aaa; font-size: 12px; }

/* ── 캔버스 래퍼 ────────────────────────────────────────────────── */
.ht-canvas-wrap {
    position: relative;
    margin-bottom: 6px;
    min-height: 120px;
    background: #f8f9fc;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}
#htPreviewCanvas {
    display: block;
    max-width: 100%;
    border-radius: 10px;
    cursor: crosshair;
}
.ht-canvas-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #aaa;
    font-size: 13px;
    line-height: 1.7;
    pointer-events: none;
}
.ht-canvas-hint p { margin: 0; }

/* ── 영역 지정 ──────────────────────────────────────────────────── */
.ht-region-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.ht-region-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fc;
    border: 1px solid #e8eaf0;
    border-radius: 10px;
    padding: 6px 10px;
    flex: 1;
    min-width: 160px;
}
.ht-region-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
.ht-badge-exp  { background: #e3f2fd; color: #1565c0; }
.ht-badge-meso { background: #fdf6dc; color: #b8860b; }
.ht-badge-frag { background: #f3e5f5; color: #6a1b9a; }
.ht-region-btn {
    font-size: 11px;
    padding: 3px 8px;
    border: 1.5px solid #B4C5E4;
    border-radius: 6px;
    background: white;
    color: #3C3744;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}
.ht-region-btn:hover { background: #f0f4ff; border-color: #3C3744; }
.ht-region-btn.active { background: #3C3744; color: #fff; border-color: #3C3744; }
.ht-region-status {
    font-size: 11px;
    color: #bbb;
    margin-left: auto;
    white-space: nowrap;
}
.ht-region-status.set { color: #4CAF50; font-weight: 700; }

/* ── 캡처 버튼 ──────────────────────────────────────────────────── */
.ht-capture-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 8px;
}
.ht-cap-btn {
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}
.ht-cap-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ht-cap-start { background: #3C3744; color: #fff; }
.ht-cap-start:hover:not(:disabled) { background: #2a2730; }
.ht-cap-end { background: #4CAF50; color: #fff; }
.ht-cap-end:hover:not(:disabled) { background: #388E3C; }
.ht-cap-arrow { font-size: 20px; color: #ccc; }
.ht-ocr-status {
    text-align: center;
    font-size: 12px;
    color: #3C3744;
    font-weight: 700;
    min-height: 18px;
}
.ht-share-hint {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    margin: 6px 0 0;
}

/* ── 수치 결과 ──────────────────────────────────────────────────── */
.ht-sub-hint {
    font-size: 11px;
    color: #aaa;
    font-weight: 400;
    margin-left: 6px;
}
.ht-result-grid { margin-bottom: 14px; }
.ht-rg-header {
    display: grid;
    grid-template-columns: 110px 1fr 1fr 90px;
    gap: 6px;
    padding: 0 4px 6px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    text-align: center;
}
.ht-rg-header span:first-child { text-align: left; }
.ht-rg-row {
    display: grid;
    grid-template-columns: 110px 1fr 1fr 90px;
    gap: 6px;
    padding: 8px 4px;
    border-bottom: 1px solid #f9f9f9;
    align-items: center;
}
.ht-rg-label {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
}
.ht-rg-input {
    width: 100%;
    padding: 6px 8px;
    border: 1.5px solid #B4C5E4;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #3C3744;
    text-align: center;
    box-sizing: border-box;
}
.ht-rg-input:focus { outline: none; border-color: #3C3744; }
.ht-rg-diff {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #aaa;
}
.ht-rg-diff.pos { color: #c62828; }
.ht-rg-diff.neg { color: #1565c0; }
.ht-memo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.ht-memo-row label {
    font-size: 12px;
    color: #888;
    min-width: 30px;
}
.ht-memo-row input {
    flex: 1;
    padding: 6px 10px;
    border: 1.5px solid #B4C5E4;
    border-radius: 8px;
    font-size: 13px;
    color: #3C3744;
}
.ht-memo-row input:focus { outline: none; border-color: #3C3744; }

/* ── 아이템 패널 ─────────────────────────────────────────────────── */
.ht-item-search-wrap {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.ht-item-search-box {
    position: relative;
    flex: 1;
}
.ht-item-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #B4C5E4;
    border-radius: 10px;
    font-size: 13px;
    color: #3C3744;
    box-sizing: border-box;
}
.ht-item-search-input:focus { outline: none; border-color: #3C3744; }
.ht-item-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: white;
    border: 1.5px solid #B4C5E4;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.ht-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.1s;
}
.ht-dropdown-item:last-child { border-bottom: none; }
.ht-dropdown-item:hover { background: #f8f9fc; }
.ht-di-name { font-weight: 600; color: #3C3744; }
.ht-di-price { font-size: 11px; color: #4CAF50; font-weight: 700; }
.ht-item-qty-input {
    width: 60px;
    padding: 8px 6px;
    border: 1.5px solid #B4C5E4;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: #3C3744;
}
.ht-item-qty-input:focus { outline: none; border-color: #3C3744; }
.ht-item-add-btn {
    padding: 8px 16px;
    background: #3C3744;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.ht-item-add-btn:hover { background: #2a2730; }
.ht-item-list { min-height: 40px; }
.ht-empty-msg { font-size: 13px; color: #bbb; }
.ht-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.ht-item-row:last-child { border-bottom: none; }
.ht-item-name { flex: 1; font-weight: 600; color: #3C3744; }
.ht-item-price { color: #888; font-size: 12px; }
.ht-item-qty { color: #888; font-size: 12px; }
.ht-item-total { font-weight: 700; color: #4CAF50; min-width: 80px; text-align: right; }
.ht-item-del {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.1s;
}
.ht-item-del:hover { color: #e53e3e; }

/* ── 요약 패널 ──────────────────────────────────────────────────── */
.ht-summary-blocks {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.ht-summary-block {
    background: #f8f9fc;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    min-width: 120px;
}
.ht-summary-block.ht-sum-highlight {
    background: #3C3744;
    border-color: #3C3744;
}
.ht-sum-label {
    font-size: 11px;
    color: #aaa;
    font-weight: 700;
    margin-bottom: 4px;
}
.ht-sum-highlight .ht-sum-label { color: #B4C5E4; }
.ht-sum-val {
    font-size: 18px;
    font-weight: 700;
    color: #3C3744;
}
.ht-sum-highlight .ht-sum-val { color: #fff; }
.ht-summary-sep {
    font-size: 20px;
    color: #ccc;
    font-weight: 300;
}
.ht-save-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.ht-save-btn {
    padding: 5px 14px;
    background: #3C3744;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.ht-save-btn:hover { background: #2a2730; }
.ht-clear-btn {
    padding: 5px 10px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.ht-clear-btn:hover { background: #ebebeb; }
.ht-delete-btn {
    padding: 5px 10px;
    background: #fff0f0;
    color: #c62828;
    border: 1px solid #f5c6c6;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.ht-delete-btn:hover { background: #ffd9d9; }
.ht-chart-toggle {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    background: transparent;
    border: 1.5px solid;
    border-radius: 20px;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.15s;
}
.ht-chart-toggle.active { opacity: 1; }

/* 인라인 편집 폼 */
.ht-inline-grid {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto;
    align-items: center;
    gap: 6px 8px;
}
.ht-il-label {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.ht-il-input {
    padding: 4px 7px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.ht-il-input:focus { outline: none; border-color: #3C3744; }
.ht-il-arrow { font-size: 12px; color: #999; }

/* ── 통계 차트 ──────────────────────────────────────────────────── */
.ht-chart-tabs {
    display: flex;
    gap: 4px;
}
.ht-chart-tab {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid #B4C5E4;
    border-radius: 20px;
    background: white;
    color: #aaa;
    cursor: pointer;
    transition: all 0.15s;
}
.ht-chart-tab.active { background: #3C3744; color: #fff; border-color: #3C3744; }
.ht-chart-tab:hover:not(.active) { background: #f0f4ff; color: #3C3744; }
.ht-chart-empty {
    text-align: center;
    font-size: 13px;
    color: #bbb;
    padding: 20px 0 0;
    display: none;
}

/* ── 반응형 ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ht-rg-header,
    .ht-rg-row { grid-template-columns: 80px 1fr 1fr 70px; }
    .ht-region-row { flex-direction: column; }
    .ht-region-item { min-width: unset; }
    .ht-summary-blocks { gap: 8px; }
    .ht-summary-block { min-width: 90px; padding: 10px 12px; }
    .ht-sum-val { font-size: 15px; }
}
