/* Company Detail View */
.detail-header {
    margin-bottom: 24px;
}

.company-info-accordion {
    overflow: hidden;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(145, 170, 210, 0.18);
    background:
        linear-gradient(145deg, rgba(14, 31, 59, 0.68), rgba(7, 20, 40, 0.54)),
        rgba(8, 22, 43, 0.54);
    box-shadow:
        0 22px 58px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.company-info-toggle {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border: 0;
    color: rgba(226, 236, 249, 0.9);
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.company-info-toggle:hover {
    background: rgba(59, 130, 246, 0.07);
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.18), 0 0 18px rgba(59, 130, 246, 0.07);
}

.company-info-toggle-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #edf4ff;
    font-size: 0.82rem;
    font-weight: 680;
}

.company-info-toggle-text i {
    color: rgba(147, 197, 253, 0.86);
}

.company-info-toggle-meta {
    min-width: 0;
    color: rgba(186, 201, 222, 0.72);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-info-chevron {
    margin-left: auto;
    color: rgba(202, 216, 235, 0.72);
    font-size: 0.78rem;
    transition: transform 0.24s ease;
}

.company-info-accordion.is-open .company-info-chevron {
    transform: rotate(180deg);
}

.company-info-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: max-height 0.26s ease, opacity 0.22s ease, transform 0.24s ease;
}

.company-info-accordion.is-open .company-info-panel {
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
}

.company-info-panel-inner {
    position: relative;
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(145, 170, 210, 0.12);
}

.company-info-actions {
    position: absolute;
    top: 14px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-info-action,
.company-manager-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(145, 170, 210, 0.16);
    border-radius: 8px;
    color: rgba(224, 234, 248, 0.86);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 620;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.company-info-action {
    padding: 6px 9px;
}

.company-info-action:hover,
.company-manager-change:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(180, 205, 239, 0.26);
}

.company-info-action.danger {
    color: rgba(252, 165, 165, 0.92);
    border-color: rgba(248, 113, 113, 0.18);
    background: rgba(127, 29, 29, 0.12);
}

.company-info-action.danger:hover {
    color: #fecaca;
    background: rgba(127, 29, 29, 0.22);
}

.company-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-right: 178px;
}

.company-info-card {
    min-height: 73px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 13px 12px;
    border-radius: 10px;
    background: rgba(22, 38, 62, 0.52);
    border: 1px solid rgba(145, 170, 210, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.16s ease, background 0.16s ease;
}

.company-info-card:hover {
    background: rgba(30, 48, 76, 0.62);
    border-color: rgba(147, 197, 253, 0.14);
}

.company-info-card span {
    color: rgba(174, 190, 213, 0.78);
    font-size: 0.72rem;
    font-weight: 650;
}

.company-info-card strong {
    min-width: 0;
    color: rgba(246, 249, 255, 0.94);
    font-size: 0.86rem;
    font-weight: 620;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-info-manager {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
    white-space: normal;
}

.company-info-manager > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-info-sub {
    display: block;
    color: rgba(174, 190, 213, 0.65);
    font-size: 0.76rem;
    font-weight: 500;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-info-tags {
    display: flex;
    align-items: center;
    gap: 6px;
}

.company-info-tags em {
    padding: 3px 7px;
    border-radius: 999px;
    color: rgba(211, 245, 229, 0.94);
    background: rgba(16, 185, 129, 0.12);
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 560;
}

.company-manager-change {
    padding: 3px 8px;
}

.company-send-section .company-send-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.company-send-section .company-send-header h4 {
    margin: 0;
}

.company-send-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-send-grid {
    gap: 16px;
}

.company-send-card {
    min-height: 172px;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    cursor: pointer;
    position: relative;
    border-radius: 12px;
    background: rgba(31, 47, 72, 0.58);
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.company-send-card:hover {
    transform: translateY(-2px);
    background: rgba(38, 56, 82, 0.72);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.16);
}

.company-send-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(145, 170, 210, 0.12);
}

.company-send-title {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(239, 246, 255, 0.94);
    font-size: 0.86rem;
    font-weight: 680;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-send-title i {
    color: rgba(96, 165, 250, 0.88);
}

.company-send-state {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(178, 191, 211, 0.72);
    font-size: 0.72rem;
    font-weight: 560;
}

.company-send-state.has-files {
    color: rgba(121, 230, 167, 0.92);
}

.company-send-state i {
    font-size: 0.5rem;
}

.company-send-file-list {
    flex: 1;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.company-send-file {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(226, 236, 249, 0.88);
    font-size: 0.78rem;
    line-height: 1.3;
}

.company-send-file i {
    flex: 0 0 auto;
    color: rgba(96, 165, 250, 0.84);
    font-size: 0.72rem;
}

.company-send-file span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-send-file.sent {
    color: rgba(253, 224, 71, 0.55);
}

.company-send-file.sent i {
    color: rgba(253, 200, 50, 0.45);
}

.company-send-empty {
    color: rgba(174, 190, 213, 0.62);
    font-size: 0.78rem;
    font-style: italic;
}

.company-send-more {
    margin-top: 4px;
    color: rgba(96, 165, 250, 0.78);
    font-size: 0.72rem;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: color 0.14s ease;
}

.company-send-more:hover {
    color: rgba(147, 197, 253, 0.96);
    text-decoration: underline;
}

.company-send-card-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.company-send-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 8px;
    padding: 6px 12px;
    color: rgba(226, 239, 255, 0.94);
    background: rgba(37, 99, 235, 0.52);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 640;
    transition: background 0.16s ease, transform 0.16s ease;
}

.company-send-upload:hover {
    transform: translateY(-1px);
    background: rgba(37, 99, 235, 0.66);
}

/* ── 업체 메모 위젯 ── */
.archive-item.receive-box {
    position: relative;
    overflow: hidden;
    /* 135deg 대각선 그라데이션 제거: 박스에 빗금/마름모꼴 음영 띠로 보이던 원인.
       따뜻한 톤은 단색으로 유지 */
    background: rgba(255, 168, 100, 0.10);
    border-color: rgba(255, 166, 92, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.company-bg .archive-item.receive-box {
    background: rgba(255, 168, 100, 0.11);
    border-color: rgba(255, 166, 92, 0.22);
}

.archive-item.receive-box:hover,
.company-bg .archive-item.receive-box:hover {
    background: rgba(255, 176, 110, 0.15);
    border-color: rgba(255, 177, 104, 0.3);
}

.archive-item.receive-box > * {
    position: relative;
    z-index: 1;
}

/* 우편물 그림 — 우하단 데코레이션 */
.archive-item.receive-box::before {
    content: '';
    position: absolute;
    right: -18px;
    bottom: -12px;
    width: 116px;
    height: 74px;
    border-radius: 5px;
    background:
        linear-gradient(33deg, transparent 49%, rgba(245, 124, 78, 0.2) 50%, transparent 51%),
        linear-gradient(147deg, transparent 49%, rgba(245, 124, 78, 0.2) 50%, transparent 51%),
        repeating-linear-gradient(
            135deg,
            rgba(239, 68, 68, 0.34) 0 6px,
            rgba(255, 255, 255, 0.22) 6px 12px,
            rgba(59, 130, 246, 0.3) 12px 18px,
            rgba(255, 255, 255, 0.22) 18px 24px
        );
    border: 1px solid rgba(255, 196, 150, 0.34);
    box-shadow: 2px 5px 14px rgba(0, 0, 0, 0.2);
    opacity: 0.78;
    transform: rotate(-8deg);
    pointer-events: none;
}

.archive-item.receive-box::after {
    content: '';
    position: absolute;
    right: 2px;
    bottom: 14px;
    width: 94px;
    height: 53px;
    background-image: url("data:image/svg+xml,%3Csvg width='134' height='76' viewBox='0 0 134 76' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23161616' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' opacity='.64'%3E%3Ccircle cx='31' cy='38' r='27'/%3E%3Ccircle cx='31' cy='38' r='21' stroke-width='1.25'/%3E%3Cpath d='M12 23c8-8 31-9 40 0' stroke-dasharray='4 3'/%3E%3Cpath d='M11 53c9 7 31 8 41 0' stroke-dasharray='4 3'/%3E%3Cpath d='M62 21c20-8 38 8 63 0'/%3E%3Cpath d='M61 34c22-7 41 8 65 0'/%3E%3Cpath d='M61 47c22-8 40 8 65 0'/%3E%3Cpath d='M61 60c20-7 39 7 62 0'/%3E%3C/g%3E%3Cg fill='%23161616' opacity='.62' font-family='Georgia,serif' text-anchor='middle'%3E%3Ctext x='31' y='21' font-size='8' font-weight='700' letter-spacing='1'%3EPOST%3C/text%3E%3Ctext x='31' y='59' font-size='7' font-weight='700' letter-spacing='.8'%3EOFFICE%3C/text%3E%3Ctext x='31' y='37' font-size='9' font-weight='700'%3EMAIL%3C/text%3E%3Ctext x='31' y='48' font-size='10' font-weight='700'%3E18%3C/text%3E%3C/g%3E%3Cpath d='M78 18c6 2 12 2 19 0M88 32c6 2 12 2 20 0M81 45c7 2 15 2 23 0M94 58c6 2 12 1 18-1' stroke='%23fff4df' stroke-width='1.6' stroke-linecap='round' opacity='.28'/%3E%3C/svg%3E");
    background-size: 94px 53px;
    background-repeat: no-repeat;
    opacity: 0.92;
    transform: rotate(-9deg);
    pointer-events: none;
}

.memo-widget-mini {
    position: relative;
    overflow: hidden;
    background: rgba(254, 240, 138, 0.13);
    border: 1px solid rgba(253, 224, 71, 0.2);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 메모지 그림 — 우하단 데코레이션 */
.memo-widget-mini::before {
    content: '';
    position: absolute;
    right: -12px;
    bottom: -14px;
    width: 72px;
    height: 88px;
    border-radius: 3px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 11px,
            rgba(200, 160, 0, 0.18) 11px,
            rgba(200, 160, 0, 0.18) 12px
        ),
        rgba(254, 245, 160, 0.18);
    border: 1px solid rgba(253, 224, 71, 0.28);
    border-top: 3px solid rgba(253, 200, 50, 0.35);
    transform: rotate(8deg);
    pointer-events: none;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.18);
}

/* 메모지 위에 두 번째 겹쳐진 종이 */
.memo-widget-mini::after {
    content: '';
    position: absolute;
    right: -4px;
    bottom: -8px;
    width: 64px;
    height: 78px;
    border-radius: 3px;
    background: rgba(254, 249, 195, 0.12);
    border: 1px solid rgba(253, 224, 71, 0.2);
    transform: rotate(3deg);
    pointer-events: none;
}

.memo-widget-title {
    margin: 0 0 6px 0;
    color: rgba(253, 224, 71, 0.88);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.memo-widget-textarea {
    width: 100%;
    flex: 1;
    min-height: 80px;
    background: transparent;
    border: none;
    resize: none;
    font-family: inherit;
    color: rgba(254, 249, 195, 0.92);
    font-size: 0.85rem;
    padding: 4px;
    outline: none;
    position: relative;
    z-index: 1;
}

.memo-widget-textarea::placeholder {
    color: rgba(253, 224, 71, 0.4);
}

.memo-widget-save {
    color: rgba(253, 224, 71, 0.85);
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(253, 224, 71, 0.2);
    position: relative;
    z-index: 1;
}

.memo-widget-save:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(253, 240, 100, 1);
}

.saesol-signature-art {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.saesol-signature-art img {
    width: min(158px, 55%);
    height: auto;
    opacity: 0.34;
    filter: saturate(0.92) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.14));
    transform: translateY(6px) rotate(-3deg);
}

.saesol-signature-art span {
    max-width: 54%;
    color: rgba(255, 244, 226, 0.54);
    font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
    font-size: clamp(1rem, 1.35vw, 1.42rem);
    font-weight: 600;
    line-height: 1.02;
    text-align: left;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transform: rotate(-5deg);
}

.company-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.9rem;
}

.company-info-table th,
.company-info-table td {
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    vertical-align: middle;
}

.company-info-table th {
    width: 100px;
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-align: left;
    white-space: nowrap;
}

.company-info-table td {
    font-weight: 500;
    color: var(--text-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.todo-section {
    min-height: 250px;
    max-height: 280px;
    display: flex;
    flex-direction: column;
}

.todo-section .section-header {
    flex-shrink: 0;
}

.todo-section .todo-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.empty-msg {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-size: 0.9rem;
    opacity: 0.5;
}

/* Todo Items */
.todo-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
    gap: 12px;
}

.todo-item:last-child {
    border-bottom: none;
}

/* 할일 체크박스 원형 UI */
.todo-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: transparent;
    font-size: 0.7rem;
    background: #f8fafc;
}

.todo-checkbox:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.todo-checkbox.checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.todo-main {
    flex: 1;
}

.todo-title {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.todo-text {
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* 완료된 할일: 취소선 적용 (.completed 클래스) */
.todo-item.completed .todo-title,
.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: rgba(148, 163, 184, 0.65);
    opacity: 1;
}

/* 구 호환성: .done 클래스도 지원 */
.todo-item.done .todo-title,
.todo-item.done .todo-text {
    text-decoration: line-through;
    color: rgba(148, 163, 184, 0.65);
    opacity: 1;
}

.todo-delete-btn {
    display: none;
}

.todo-item.done .todo-delete-btn,
.todo-item.completed .todo-delete-btn {
    display: block;
}

/* Fix Input sizes for todos */
.todo-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.todo-input-group input[type="text"] {
    width: 100%;
    padding: 16px;
    font-size: 15px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #000000;
}

.todo-attach {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    width: 750px;
    max-width: 92%;
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
}

.modal-header {
    margin-bottom: 24px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 19px 16px;
    font-size: 15px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #000000;
}

.modal-body input[type="text"].w-100,
.modal-body input[type="email"].w-100,
.modal-body select.w-100 {
    padding: 19px 16px;
    font-size: 15px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #000000;
    width: 100%;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    color: var(--accent-blue);
}

.todo-section .section-header .btn-icon {
    background: transparent;
    border: none;
    color: rgba(96, 165, 250, 0.75);
    font-size: 1rem;
    position: relative;
    z-index: 10;
}
.todo-section .section-header .btn-icon:hover {
    color: rgba(147, 197, 253, 1);
}

.mt-24 {
    margin-top: 24px;
}

/* Todo Actions Row */
.todo-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.todo-attach-label {
    font-size: 0.75rem;
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
}

/* Premium Table */
.premium-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-table th {
    text-align: left;
    padding: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.premium-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    /* Ensure visibility */
}

/* Modal Styling Specific */
.modal-content h3,
.modal-content h2 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Checkbox specific styles for modals */
.checkbox-group {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* History Timeline */
.history-timeline {
    margin-top: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.history-timeline::-webkit-scrollbar {
    display: none;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.timeline-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.timeline-delete-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(156, 163, 175, 0.82);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.timeline-item:hover .timeline-delete-btn {
    opacity: 1;
}

.timeline-delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 4px;
}

.history-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
    min-width: 100px;
}

.manager-badge-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-text.sm {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.badge.green {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Archive Header & Tabs */
.archive-tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 10px;
}

.tab-btn {
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.archive-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    margin-bottom: -8px;
}

.archive-header-actions h3 {
    font-size: 1rem;
    color: var(--text-primary);
}

.archive-header-actions h3 i {
    margin-right: 10px;
    color: var(--accent-blue);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 24px;
}

.archive-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: rgba(59, 130, 246, 0.05);
    /* Light blue tint for boxes */
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.archive-item:hover {
    background: rgba(59, 130, 246, 0.1);
    /* transform 제거 — 아이콘 hover 시 움직임 방지 */
    border-color: var(--accent-blue);
}

.archive-icon {
    font-size: 2rem;
    color: var(--accent-blue);
    margin-bottom: 12px;
}

.archive-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.archive-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}


/* Custom Toggle Switch */
.toggle-container {
    position: relative;
    display: inline-block;
    width: 240px;
    height: 42px;
    background-color: #f1f5f9;
    border-radius: 21px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.toggle-container input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-bg {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    position: relative;
    z-index: 1;
}

.toggle-bg::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: 34px;
    background-color: #ffffff;
    border-radius: 18px;
    transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: -1;
}

.toggle-container input:checked+.toggle-bg::before {
    transform: translateX(100%);
}

.toggle-option {
    width: 50%;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    transition: 0.3s;
}

.toggle-container input:not(:checked)+.toggle-bg .personal {
    color: var(--accent-blue);
}

.toggle-container input:checked+.toggle-bg .corp {
    color: var(--accent-purple);
}

/* View Content */
.content-panel {
    flex: 1;
    min-height: 0;
    padding: 32px;
    overflow-y: auto;
    user-select: none;
}

/* 텍스트 복사가 필요한 영역은 선택 허용 */
.content-panel input,
.content-panel textarea,
.content-panel [contenteditable],
.content-panel .selectable,
.content-panel td,
.content-panel .company-name,
.content-panel .company-ceo,
.content-panel p {
    user-select: text;
}

