/* ===== 편집 바 스타일 ===== */
.format-bar {
    display: none;
    align-items: center;
    padding: 8px 12px;
    background: var(--ui-panel);
    border-bottom: 1px solid var(--ui-border);
    gap: 4px;
    flex-wrap: wrap;
}

.format-bar.active { display: flex; }

.format-btn { 
    padding: 6px 10px;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--ui-text);
    font-size: 14px;
    position: relative;
}

.format-btn:hover { background: var(--ui-hover); }
.format-btn.active { background: rgba(0, 200, 83, 0.3); color: var(--ui-accent); }

.format-select { 
    padding: 5px 8px;
    border: 1px solid var(--ui-border);
    border-radius: 4px;
    background: var(--ui-bg);
    color: var(--ui-text);
    font-size: 12px;
}

.format-divider { 
    width: 1px; 
    height: 24px; 
    background: var(--ui-border); 
    margin: 0 6px; 
}

/* 툴팁 */
.format-btn .tooltip {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.format-btn:hover .tooltip { opacity: 1; }

/* 색상 선택기 */
.color-picker-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-picker-btn input[type="color"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 편집 모드 활성 블록 */
.active-block {
    outline: 2px dashed var(--ui-accent) !important;
    outline-offset: 2px;
}

/* 표 삽입 모달 */
.table-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.table-modal.active { display: flex; }

.table-modal-content {
    background: var(--ui-panel);
    border-radius: 12px;
    padding: 24px;
    width: 320px;
    border: 1px solid var(--ui-border);
}

.table-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-text);
    margin-bottom: 20px;
}

.table-modal-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.table-modal-row label {
    flex: 1;
    font-size: 13px;
    color: var(--ui-dim);
}

.table-modal-row input[type="number"] {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--ui-border);
    border-radius: 4px;
    background: var(--ui-bg);
    color: var(--ui-text);
    text-align: center;
}

.table-modal-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.table-modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.table-modal-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    cursor: pointer;
}

.table-modal-btn.primary {
    background: var(--ui-accent);
    color: #003300;
    font-weight: 600;
}

.table-modal-btn.secondary {
    background: var(--ui-border);
    color: var(--ui-text);
}

/* 토스트 메시지 */
.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
}

.toast {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 인쇄 시 숨김 */
@media print {
    .format-bar,
    .table-modal,
    .toast-container {
        display: none !important;
    }
}