/* ===== Digital Employee ===== */
.page-employee { animation: fadeIn 0.3s ease; }

.employee-hub {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}

.employee-hub-header h2 {
    font-size: 20px;
    font-weight: 650;
}

.employee-hub-header p {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.employee-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.employee-card {
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: left;
    transition: all var(--transition);
}

.employee-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.employee-card-add {
    border-style: dashed;
    background: linear-gradient(135deg, rgba(77, 171, 247, 0.12), rgba(132, 94, 247, 0.1));
}

.employee-card-add:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(77, 171, 247, 0.2), rgba(132, 94, 247, 0.16));
}

.employee-avatar-add {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #4dabf7, #845ef7);
}

.employee-add-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
}

.employee-add-modal.active {
    display: block;
}

.employee-add-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 10, 24, 0.5);
}

.employee-add-modal-panel {
    position: relative;
    width: min(640px, calc(100vw - 24px));
    margin: 8vh auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.employee-add-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.employee-add-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}

.employee-add-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
}

.employee-add-modal-body {
    padding: 14px 16px;
    display: grid;
    gap: 8px;
}

.employee-add-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.employee-add-modal-actions {
    padding: 12px 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.employee-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.employee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--employee-color, var(--accent)), var(--accent3));
    flex-shrink: 0;
}

.employee-meta {
    min-width: 0;
}

.employee-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.employee-title {
    font-size: 12px;
    color: var(--text-secondary);
}

.employee-summary {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.employee-card-bottom {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Chat */
.employee-chat-shell {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    min-height: calc(100vh - var(--topbar-height) - 82px);
    max-height: calc(100vh - var(--topbar-height) - 82px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.employee-chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.employee-chat-agent {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.employee-back-btn,
.employee-clear-btn {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    transition: all var(--transition);
}

.employee-back-btn:hover,
.employee-clear-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.employee-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        radial-gradient(circle at top right, rgba(233,30,99,0.08), transparent 35%),
        radial-gradient(circle at bottom left, rgba(124,77,255,0.08), transparent 35%),
        var(--bg-primary);
}

.employee-empty {
    margin: auto;
    color: var(--text-muted);
    font-size: 13px;
}

.employee-message-row {
    display: flex;
}

.employee-message-row.user {
    justify-content: flex-end;
}

.employee-message-row.assistant {
    justify-content: flex-start;
}

.employee-bubble {
    max-width: min(78%, 780px);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    word-break: break-word;
}

.employee-bubble.user {
    background: linear-gradient(135deg, rgba(233,30,99,0.18), rgba(124,77,255,0.12));
    border-color: rgba(233,30,99,0.35);
}

.employee-bubble.assistant {
    background: var(--bg-input);
}

.employee-msg-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.employee-msg-images {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.employee-msg-images img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: zoom-in;
}

.employee-msg-time {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

.employee-compose {
    border-top: 1px solid var(--border-color);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-card);
}

.employee-pending-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
    gap: 8px;
}

.employee-pending-item {
    position: relative;
}

.employee-pending-item img {
    width: 100%;
    height: 66px;
    object-fit: contain;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.employee-remove-image {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.employee-compose-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.employee-compose-tip {
    font-size: 11px;
    color: var(--text-muted);
}

.employee-compose-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.employee-textarea {
    margin: 0;
    min-height: 42px;
    max-height: 160px;
    resize: vertical;
}

.employee-send-btn {
    width: 110px;
    margin: 0;
    flex-shrink: 0;
}

.employee-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.employee-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: employeeBlink 1s infinite;
}

.employee-typing span:nth-child(2) { animation-delay: 0.2s; }
.employee-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes employeeBlink {
    0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 900px) {
    .employee-chat-shell {
        min-height: calc(100vh - var(--topbar-height) - 56px);
        max-height: calc(100vh - var(--topbar-height) - 56px);
    }

    .employee-bubble {
        max-width: 92%;
    }

    .employee-chat-header {
        flex-wrap: wrap;
    }

    .employee-compose-row {
        flex-direction: column;
        align-items: stretch;
    }

    .employee-send-btn {
        width: 100%;
    }
}
