/* 모바일 우선 스타일 - 생산일정 v2 */

:root {
    --v2-bg: #f7f8fa;
    --v2-surface: #ffffff;
    --v2-text: #202124;
    --v2-muted: #5f6368;
    --v2-border: #e0e3e7;
    --v2-primary: #2563eb;
    --v2-success: #16a34a;
    --v2-danger: #dc2626;
    --v2-radius: 12px;
    --v2-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--v2-bg);
    color: var(--v2-text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Apple SD Gothic Neo, Noto Sans KR, "Malgun Gothic", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.v2-container {
    padding: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.v2-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.v2-toolbar {
    position: sticky;
    top: 0;
    background: var(--v2-bg);
    padding: 8px 12px;
    z-index: 100;
}

.v2-toolbar .bar {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
}

.v2-btn {
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    color: var(--v2-text);
    font-weight: 600;
}

.v2-btn.primary { border-color: var(--v2-primary); color: var(--v2-primary); }
.v2-btn.ghost { background: transparent; }

.v2-card {
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    box-shadow: var(--v2-shadow);
}

.house-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 4px 4px;
}

.chip {
    flex: 0 0 auto;
    min-width: 56px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    font-weight: 600;
}

.chip.active { border-color: var(--v2-primary); color: var(--v2-primary); }

.calendar {
    margin-top: 10px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 10px;
}

.weekday {
    text-align: center;
    font-size: 0.8rem;
    color: var(--v2-muted);
    font-weight: 600;
}

.calendar-day {
    position: relative;
    min-height: 72px;
    padding: 8px;
    border: 1px solid var(--v2-border);
    border-radius: 10px;
    background: var(--v2-surface);
    overflow: hidden;
}

.calendar-day.is-today { outline: 2px solid var(--v2-primary); }
.calendar-day.is-other-month { opacity: 0.45; }

.day-number {
    position: relative;
    z-index: 2;
    font-weight: 700;
}

.status-container {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 0;
    z-index: 0;
    pointer-events: none;
}

.status-segment {
    flex: 1 1 0;
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 10px 12px;
}

.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* 바텀시트 */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
    z-index: 900;
}

.bottom-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--v2-surface);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.12);
    transform: translateY(100%);
    transition: transform .25s ease;
    z-index: 1000;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.bottom-sheet.open { transform: translateY(0); }
.sheet-overlay.open { opacity: 1; visibility: visible; }

.sheet-handle {
    width: 40px; height: 4px; border-radius: 4px;
    background: #ccd1d5; margin: 8px auto;
}

.sheet-header { padding: 6px 16px 4px; font-weight: 700; }
.sheet-body { padding: 8px 16px 16px; overflow: auto; }
.sheet-actions { padding: 10px 16px 14px; display: flex; gap: 8px; border-top: 1px solid var(--v2-border); }

.status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.status-chip {
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.status-chip.active { outline: 2px solid var(--v2-primary); }

/* 전체 하우스 개요 그리드 */
.overview {
    margin-top: 12px;
}

.overview-scroller {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

.overview-table { display: grid; grid-template-columns: 80px 1fr; gap: 6px; padding: 10px; }
.overview-left { display: grid; grid-auto-rows: minmax(36px, auto); gap: 6px; }
.overview-grid {
    display: grid;
    grid-template-columns: repeat(var(--overview-days, 10), minmax(var(--ov-col-w, 44px), 1fr));
    gap: 6px;
}

.overview-cell {
    min-height: 36px;
    border: 1px solid var(--v2-border);
    border-radius: 8px;
    background: var(--v2-surface);
    position: relative;
    overflow: hidden;
}

.overview-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--ov-label-size, 12px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 #fff;
}

.overview-status {
    position: absolute;
    inset: 0;
    display: flex;
    pointer-events: none;
}

.overview-seg { flex: 1 1 0; }

/* 30일 모드에서 셀 높이/간격 축소로 1줄 유지 */
.overview.compact .overview-left { gap: 4px; }
.overview.compact .overview-grid { gap: 4px; }
.overview.compact .overview-cell { min-height: 28px; }
.overview.compact .overview-label { font-size: 10px; }

/* 월 경계 강조 */
.month-boundary { border-left: 2px solid #c7cdd4 !important; }

/* 주말 음영 */
.weekend-cell { background-image: linear-gradient(0deg, rgba(0,0,0,0.035), rgba(0,0,0,0.035)); }

/* 스티키 헤더/좌측 라벨 */
.overview .sticky-top { position: sticky; top: 0; z-index: 3; background: var(--v2-surface); }
.overview .sticky-left { position: sticky; left: 0; z-index: 2; background: var(--v2-surface); }
.overview .sticky-left { touch-action: pan-y; }
.overview .sticky-top-left { touch-action: pan-y; }
.overview .sticky-top-left { position: sticky; top: 0; left: 0; z-index: 4; background: var(--v2-surface); }

/* 개요 컨트롤 */
.overview-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.overview-controls .group { display: inline-flex; gap: 6px; }
.chip-group { display: inline-flex; gap: 6px; }

/* 반응형 */
@media (min-width: 768px) {
    .calendar-day { min-height: 88px; }
    .v2-title { font-size: 1.35rem; }
}


