.att-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    gap: 0;
    min-height: 0;
    background: #f8fafc;
}

.att-operator-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
    font-size: 0.82rem;
    font-weight: 700;
}

.att-banner-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    font-size: 0.9rem;
}

.att-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.att-summary-card {
    padding: 1rem 1.1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.att-summary-primary {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.13), rgba(59, 130, 246, 0.08));
}

.att-summary-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(251, 191, 36, 0.08));
}

.att-summary-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(248, 113, 113, 0.08));
}

.att-summary-neutral {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(148, 163, 184, 0.08));
}

.att-summary-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.att-summary-value {
    margin-top: 0.55rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

.att-summary-caption {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.att-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
    padding: 1rem 1.1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(18px);
}

.att-toolbar-copy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.att-toolbar-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
}

.att-toolbar-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.att-filters {
    display: grid;
    grid-template-columns: 170px 170px minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: end;
}

.att-filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.att-filter-item label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.att-filter-item .form-input {
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}

.att-filter-search {
    min-width: 0;
}

.att-filter-button {
    height: 46px;
    white-space: nowrap;
}

.att-workspace {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 300px;
    gap: 0;
    flex: 1;
    min-height: 0;
    border-radius: 0;
    overflow: hidden;
    border: none;
    background: transparent;
    box-shadow: none;
}

.att-conv-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid #e2e8f0;
    background: white;
}

.att-conv-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.att-filters-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.att-search-box {
    position: relative;
}

.att-search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.att-search-box .form-input {
    width: 100%;
    padding-left: 2.2rem;
    height: 38px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    background: white;
}

.att-filter-row {
    display: flex;
    gap: 0.5rem;
}

.att-filter-row .form-input {
    flex: 1;
    height: 34px;
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 0 0.5rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--text-muted);
}

.att-scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.08);
    color: #0369a1;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
}

.att-scope-chip i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.att-conv-list-subtitle {
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.att-count-badge {
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
}

.att-conv-scroll {
    flex: 1;
    overflow-y: auto;
}

.att-conv-item {
    display: flex;
    gap: 0.85rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.att-conv-item:hover {
    background: rgba(255, 255, 255, 0.78);
}

.att-conv-item.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(59, 130, 246, 0.06));
    border-left-color: #0284c7;
}

.att-conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(16, 185, 129, 0.16));
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.att-conv-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.att-conv-top {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: baseline;
}

.att-conv-name {
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.att-conv-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.att-conv-preview {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.att-conv-extra {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.att-conv-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.15rem;
}

.att-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.att-status-open {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.att-status-pending_human {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.att-status-human {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.att-status-resolved {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.att-unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--danger);
    color: white;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.att-chat-area {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f8fafc;
}

.att-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.att-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.att-chat-avatar-lg {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0284c7, #10b981);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.att-chat-contact-name {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-main);
}

.att-chat-contact-sub {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.att-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.att-chat-meta-card {
    min-width: 116px;
    padding: 0.55rem 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.att-chat-meta-label {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.att-chat-meta-card strong {
    font-size: 0.86rem;
    color: var(--text-main);
}

.att-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 0;
}

.att-msg {
    display: flex;
}

.att-msg-inbound {
    justify-content: flex-start;
}

.att-msg-outbound {
    justify-content: flex-end;
}

.att-msg-internal {
    justify-content: center;
}

.att-msg-bubble {
    max-width: 78%;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    position: relative;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.att-bubble-inbound {
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-bottom-left-radius: 6px;
}

.att-bubble-outbound {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(14, 165, 233, 0.12);
    border-bottom-right-radius: 6px;
}

.att-bubble-operator {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(45, 212, 191, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.14);
}

.att-bubble-internal {
    max-width: 92%;
    background: rgba(245, 158, 11, 0.1);
    border: 1px dashed rgba(245, 158, 11, 0.28);
    color: #92400e;
    box-shadow: none;
}

.att-msg-sender {
    display: flex;
    align-items: center;
    gap: 0.32rem;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.att-msg-text {
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-main);
}

.att-reply-box {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.att-reply-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.att-reply-hint {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.att-reply-form {
    display: flex;
    gap: 0.85rem;
    align-items: flex-end;
}

.att-reply-input {
    flex: 1;
    min-height: 52px;
    max-height: 160px;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: white;
    resize: none;
    font: inherit;
    font-size: 0.92rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.att-reply-input:focus {
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.att-reply-send {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #0284c7, #10b981);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 32px rgba(14, 165, 233, 0.22);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.att-reply-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px rgba(14, 165, 233, 0.26);
}

.att-reply-send:active {
    transform: scale(0.97);
}

.att-details-panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-left: 1px solid #e2e8f0;
    background: white;
}

.att-details-section {
    padding: 1.1rem 1.15rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.att-details-title {
    margin-bottom: 0.85rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.att-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.42rem 0;
    font-size: 0.85rem;
}

.att-detail-label {
    color: var(--text-muted);
    font-weight: 600;
}

.att-detail-value {
    color: var(--text-main);
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

.att-action-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.att-action-form .form-input {
    border-radius: 14px;
}

.att-inline-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.att-inline-btn {
    width: 100%;
    justify-content: center;
}

.att-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.83rem;
    color: var(--text-muted);
}

.att-checkbox-label input[type="checkbox"] {
    accent-color: #0284c7;
}

.att-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.att-empty-state h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.att-empty-state p {
    max-width: 320px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.att-empty-state-full {
    height: 100%;
}

@media (max-width: 1400px) {
    .att-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .att-workspace {
        grid-template-columns: 300px minmax(0, 1fr) 290px;
    }
}

@media (max-width: 1180px) {
    .att-toolbar {
        grid-template-columns: 1fr;
    }

    .att-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .att-filter-search {
        grid-column: 1 / -1;
    }

    .att-filter-button {
        width: 100%;
    }

    .att-workspace {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .att-details-panel {
        display: none;
    }
}

@media (max-width: 860px) {
    .att-container {
        height: auto;
        min-height: calc(100vh - 118px);
    }

    .att-overview-grid {
        grid-template-columns: 1fr;
    }

    .att-workspace {
        grid-template-columns: 1fr;
    }

    .att-conv-list {
        max-height: 38vh;
    }

    .att-chat-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .att-chat-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .att-msg-bubble {
        max-width: 90%;
    }

    .att-reply-toolbar {
        align-items: flex-start;
    }

    .att-reply-hint {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .att-filters {
        grid-template-columns: 1fr;
    }

    .att-conv-list {
        max-height: 42vh;
    }

    .att-reply-form {
        flex-direction: column;
        align-items: stretch;
    }

    .att-reply-send {
        width: 100%;
    }
}
