/* ===== Pretendard 전역 적용 ===== */
html, body,
.mud-typography, .mud-input, .mud-input-slot, .mud-select, .mud-button-root,
.mud-nav-link, .mud-table, .mud-dialog, .mud-tooltip,
h1, h2, h3, h4, h5, h6, input, button, textarea, select {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI',
        Roboto, 'Helvetica Neue', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif !important;
}

h1:focus {
    outline: none;
}

/* ===== 빠른 작업 카드 호버 (은은한 리프트) ===== */
.quick-action {
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
    border-color: #3182F6;
}

/* ===== 로그인 화면 ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #17181C;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: #1E1F24;
    border: 1px solid #2A2C33;
    border-radius: 14px;
    padding: 2.25rem 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: #E5E8EB;
}

.login-sub {
    font-size: 0.9rem;
    color: #8B95A1;
    margin: 0 0 1.5rem;
}

.login-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #C9CDD2;
    margin: 0.9rem 0 0.35rem;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.8rem;
    background: #17181C;
    color: #E5E8EB;
    border: 1px solid #2A2C33;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}

.login-input:focus {
    border-color: #3182F6;
    box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.15);
}

.login-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.7rem;
    background: #3182F6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.login-btn:hover {
    background: #1B64DA;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* ===== 모바일 다이얼로그 = 하단 바텀시트(전체폭) ===== */
@media (max-width: 640px) {
    .mud-dialog-container {
        align-items: flex-end !important;
    }
    .mud-dialog {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-top-left-radius: 18px !important;
        border-top-right-radius: 18px !important;
        max-height: 94vh;
    }
}

/* ===== 대시보드 위젯 ===== */
.dash-widget { transition: border-color .12s ease; }
.editing .dash-widget { border-style: dashed !important; }

/* 커스텀 대시보드 드롭존 = 반응형 타일 그리드 */
.dash-zone { display: flex; flex-wrap: wrap; gap: 16px; min-height: 80px; }
.dash-zone > * { flex: 1 1 300px; max-width: 520px; }
.dash-tile { height: 100%; }
.dash-zone.editing .dash-tile { border-style: dashed !important; cursor: grab; }
.mud-drop-item-preview { opacity: .5; }

/* 섹션 헤더 (라인 + 타이틀) */
.dash-section {
    display: flex; align-items: center; gap: 10px;
    margin: 28px 0 14px;
}
.dash-section .t { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.dash-section .sub { font-size: .8rem; color: var(--mud-palette-text-secondary); white-space: nowrap; }
.dash-section .rule { flex: 1; height: 1px; background: var(--mud-palette-lines-default); }
.w-tag {
    font-size: 0.62rem; font-weight: 700; letter-spacing: .04em;
    padding: 2px 7px; border-radius: 6px;
}
.w-tag.inv { background: var(--mud-palette-primary-hover); color: var(--mud-palette-primary); }
.w-tag.hr { background: rgba(245,165,36,.16); color: var(--mud-palette-warning); }

/* ===== 근무 하루 편집 행 (그리드 정렬) ===== */
.shift-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 92px 14px 92px minmax(80px, 1fr) 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.shift-row .tilde { text-align: center; color: var(--mud-palette-text-secondary); }
.shift-row .mud-input-control { margin: 0; }
@media (max-width: 560px) {
    .shift-row { display: flex; flex-wrap: wrap; }
    .shift-row > * { flex: 1 1 40%; }
    .shift-row .tilde { display: none; }
}

/* ===== 공용 캘린더 (CalendarView) ===== */
.calv-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calv-dow { text-align: center; font-size: .72rem; font-weight: 700; padding: 4px 0; color: var(--mud-palette-text-secondary); }
.calv-dow.sun { color: var(--mud-palette-error); }
.calv-dow.sat { color: #4593FC; }
.calv-cell { min-height: 94px; border: 1px solid var(--mud-palette-lines-default); border-radius: 8px;
    padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; background: var(--mud-palette-surface);
    cursor: pointer; overflow: hidden; }
.calv-cell:hover { border-color: var(--mud-palette-primary); }
.calv-cell.pad { visibility: hidden; }
.calv-cell.today { box-shadow: inset 0 0 0 2px var(--mud-palette-primary); }
.calv-daynum { font-size: .8rem; font-weight: 600; }
.calv-daynum.sun, .calv-hol { color: var(--mud-palette-error); }
.calv-daynum.sat { color: #4593FC; }
.calv-hol { font-size: .6rem; margin-left: 3px; font-weight: 600; }
.calv-item { font-size: .66rem; line-height: 1.3; border-radius: 4px; padding: 1px 4px; display: flex;
    align-items: center; gap: 3px; background: var(--mud-palette-background-grey);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calv-item .cdot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.calv-item.dim { opacity: .5; }
.calv-more { font-size: .6rem; color: var(--mud-palette-text-secondary); padding-left: 2px; }
@media (max-width: 640px) {
    .calv-cell { min-height: 62px; padding: 2px 3px; }
    .calv-item { font-size: .58rem; }
    .calv-hol { display: none; }
}

/* ===== 사이드바 서브헤드 (라인 + 타이틀 + 간격) ===== */
.nav-subhead {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--mud-palette-text-secondary);
    padding: 8px 16px 4px;
    margin-top: 10px;
    border-top: 1px solid var(--mud-palette-lines-default);
}
.nav-subhead.first {
    border-top: none;
    margin-top: 2px;
}

/* ===== 실사 달력 ===== */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-dow {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
    padding: 4px 0;
}
.cal-cell {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
}
.cal-cell.has {
    background: var(--mud-palette-background-grey);
    border-color: var(--mud-palette-lines-default);
    cursor: pointer;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}
.cal-cell.has:hover {
    border-color: var(--mud-palette-primary);
}
.cal-cell .cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* ===== Blazor 오류 표시 ===== */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "오류가 발생했습니다."
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
