/* Карточки и типографика */

.card {
    background-color: rgba(15, 23, 42, 0.8); /* bg-slate-900/80 */
    border: 1px solid #1e293b;               /* border-slate-800 */
    border-radius: 1rem;                     /* rounded-2xl */
    padding: 1rem;                            /* p-4 */
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); /* shadow-lg */
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e5e7eb; /* text-slate-100 */
    letter-spacing: -0.01em;
}

.card-kpi {
    background-color: rgba(15, 23, 42, 0.85);
    border: 1px solid #1e293b;
    border-radius: 1rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.card-kpi-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9ca3af; /* text-slate-400 */
    margin-bottom: 0.15rem;
}

.card-kpi-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f9fafb; /* text-slate-50 */
}

.card-kpi-sub {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* AI-ассистент */

#assistant-root {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

/* Кнопка открытия */

.assistant-toggle {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 9999px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;

    background: radial-gradient(circle at 0 0, #22d3ee, #0ea5e9);

    box-shadow:
        0 0 35px rgba(34, 211, 238, 0.7),
        0 10px 30px rgba(15, 23, 42, 0.95);

    cursor: pointer;
    transition: all 180ms ease-out;

    /* убираем текстовые элементы */
    padding: 0;
    overflow: hidden;
}

.assistant-toggle:hover {
    box-shadow:
        0 0 45px rgba(34, 211, 238, 0.95),
        0 14px 34px rgba(15, 23, 42, 1);
    transform: translateY(-2px);
}

/* Иконка – только 🤖 */
.assistant-toggle-icon {
    font-size: 22px;
    width: auto;
    height: auto;
    background: none;
    color: #0b1120;
}

/* скрываем текст */
.assistant-toggle-text {
    display: none;
}


/* Панель чата */

.assistant-panel {
    width: 320px;
    max-width: 100vw;
    background-color: rgba(15, 23, 42, 0.98);
    border-radius: 1.25rem;
    border: 1px solid #1e293b;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.assistant-panel.hidden {
    display: none;
}

.assistant-header {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: radial-gradient(circle at top left, #0f172a, #020617);
}

.assistant-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
}

.assistant-subtitle {
    font-size: 0.7rem;
    color: #9ca3af;
}

.assistant-close-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    border: 1px solid #475569;
    background-color: transparent;
    color: #e5e7eb;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Сообщения чата */

.assistant-messages {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 260px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.assistant-message {
    font-size: 0.78rem;
    line-height: 1.35;
    border-radius: 0.9rem;
    padding: 0.45rem 0.6rem;
    max-width: 95%;
}

.assistant-message-user {
    align-self: flex-end;
    background-color: #0ea5e9;
    color: #020617;
    border-bottom-right-radius: 0.25rem;
}

.assistant-message-assistant {
    align-self: flex-start;
    background-color: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border: 1px solid #1e293b;
    border-bottom-left-radius: 0.25rem;
}

.assistant-message-system {
    align-self: stretch;
    background-color: rgba(15, 23, 42, 0.95);
    color: #cbd5f5;
    border: 1px dashed #1e293b;
}

/* Форма ввода */

.assistant-form {
    border-top: 1px solid #1e293b;
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background-color: #020617;
}

.assistant-input {
    width: 100%;
    resize: none;
    border-radius: 0.75rem;
    border: 1px solid #1e293b;
    background-color: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    font-size: 0.78rem;
    padding: 0.4rem 0.5rem;
    outline: none;
}

.assistant-input:focus {
    border-color: #22d3ee;
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4);
}

.assistant-send-btn {
    align-self: flex-end;
    border-radius: 9999px;
    border: none;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #020617;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    box-shadow: 0 14px 35px rgba(34, 197, 94, 0.6);
}

.assistant-send-btn[disabled] {
    opacity: 0.5;
    cursor: default;
}
