/* Убираем подчёркивание и выравниваем контейнер */
.icon-action {
    display: inline-flex;
    align-items: center; /* вертикально по центру */
    text-decoration: none; /* отключаем «underline» */
    transition: color 0.2s; /* плавная смена цвета */
}

/* Пример: на hover иконка «Edit» (text-warning) делается чуть темнее */
.icon-action.text-warning:hover {
    color: #d97706; /* например, тёмно-янтарный */
}

/* Пример: на hover иконка «Delete» (text-danger) чуть темнее */
.icon-action.text-danger:hover {
    color: #b91c1c; /* например, тёмно-красный */
}

.pos-rel-custom .invalid-feedback {
    position: absolute;
    bottom: -1.25rem; /* чуть ниже поля */
    left: 0;
}

/* Фиксированный размер миниатюр в таблице товаров */
.product-thumb {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    /* при желании можно убрать рамку, если она мешает:
  border: none;
  */
}

fieldset {
    background-color: #ffffff;
}

.form-switch-edit-pg {
    padding-left: 1.2em !important;
}

/* --- Shipping Address (admin) --- */
.admin-shipping-container {
    /* max-width: 800px; */
    /* margin: 40px auto; */
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    background-color: white;
    overflow: hidden;
}

.admin-shipping-header {
    background-color: #3a86ff;
    color: white;
    padding: 25px 30px;
}

.admin-shipping-body {
    padding: 30px;
}

.admin-shipping-body .form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #495057;
}

.admin-shipping-container .form-control,
.admin-shipping-container .form-select {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.admin-shipping-container .form-control:focus,
.admin-shipping-container .form-select:focus {
    border-color: #3a86ff;
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.25);
}

.admin-shipping-container .btn-primary {
    background-color: #3a86ff;
    border: none;
    padding: 12px 24px;
    font-weight: 400;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.admin-shipping-container .btn-primary:hover {
    background-color: #2667cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.3);
}

.admin-shipping-required-field::after {
    content: "*";
    color: #dc3545;
    margin-left: 4px;
}

.admin-shipping-optional-label {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: normal;
    margin-left: 5px;
}

.admin-shipping-section-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
}

.admin-shipping-section-divider hr {
    flex: 1;
    border: none;
    height: 1px;
    background-color: #dee2e6;
}

.admin-shipping-section-divider span {
    padding: 0 15px;
    color: #6c757d;
    font-weight: 500;
}

/* Увеличиваем поля внутри карточки фильтров */
.cnv_filter-card .form-control-lg,
.cnv_filter-card .form-select-lg {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}
/* Сделаем заголовки фильтров чуть крупнее */
.cnv_filter-card .card-header {
    font-size: 1.1rem;
}
/* Увеличим кнопки Apply/Reset */
.cnv_filter-card .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}
/* Слегка увеличим отступы внутри карточки */
.cnv_filter-card .card-body {
    padding: 1.5rem;
}
.cnv_card table th,
.cnv_card table td {
    font-size: 0.95rem;
}

/* 2. Бейджи-статусы: одинаковый размер и выравнивание */
.cnv_status {
    display: inline-block;
    min-width: 4.6875rem; /* 75px  / 16 */
    height: 1.4375rem; /* 23px  / 16 */
    line-height: 1.4375rem; /* 23px  / 16 */
    font-size: 0.75rem; /* 12px  / 16 */
    text-align: center;
    border-radius: 0.25rem; /* 4px   / 16 */
    color: #fff;
}

/* 3. Цвета по статусам */
.cnv_status-sent {
    background-color: #3b82f6; /* синий */
}
.cnv_status-processing {
    background-color: #f59e0b; /* оранжевый */
}
.cnv_status-paid {
    background-color: #10b981; /* зелёный */
}
.cnv_status-unpaid {
    background-color: #ef4444; /* красный */
}
/* Управление шрифтом в заголовках таблицы */
.cnv_table thead th {
    font-size: 1rem; /* 16px */
    font-weight: 500; /* полужирный */
    color: #374151; /* можно перекрасить под вашу палитру */
}

/* Управление шрифтом в теле таблицы */
.cnv_table tbody td {
    font-size: 0.875rem; /* 14px */
    font-weight: 400; /* обычное начертание */
    color: #4b5563; /* чуть темнее */
}

/* По желанию: индивидуальные стили для конкретных колонок */
/* Например, чуть отличное начертание для колонки «Total» */
.cnv_table tbody td.cnv_order-total {
    font-size: 0.9375rem; /* 15px */
    font-weight: 500;
}

/* Modal specific styles with mdl_ prefix */
.mdl_modal-dialog {
    max-width: 900px;
    font-family: "Poppins", sans-serif;
}
.mdl_modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}
.mdl_modal-title {
    font-weight: 500;
    font-size: 1.25rem;
    color: #111827;
}
.mdl_modal-body {
    padding: 1.5rem;
}
.mdl_modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.mdl_section {
    margin-bottom: 2rem;
}
.mdl_section-title {
    font-weight: 500;
    font-size: 1rem;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.mdl_order-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.mdl_info-item {
    margin-bottom: 0.5rem;
}
.mdl_info-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}
.mdl_info-value {
    font-weight: 500;
    color: #111827;
}

.mdl_badge {
    font-weight: 400;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
}
.mdl_badge-paid {
    background-color: #10b981;
    color: #fff;
}
.mdl_badge-unpaid {
    background-color: #ef4444;
    color: #fff;
}
.mdl_badge-processing {
    background-color: #f59e0b;
    color: #fff;
}
.mdl_badge-shipped {
    background-color: #3b82f6;
    color: #fff;
}

/* ——— Products table styles ——— */
.mdl_products-table {
    width: 100%;
    margin-bottom: 0;
}
.mdl_products-table th {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.875rem;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}
.mdl_products-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
}

.mdl_product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mdl_product-name {
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.25rem;
}
.mdl_product-id {
    font-size: 0.75rem;
    color: #6b7280;
}
.mdl_color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    border: 1px solid #e5e7eb;
}

.mdl_quantity {
    font-weight: 500;
}
.mdl_price {
    font-weight: 500;
    text-align: right;
}
.mdl_unit-price {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: right;
}

/* ——— Addresses ——— */
.mdl_address-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.mdl_address-card {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #f9fafb;
}
.mdl_address-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}
.mdl_address-line {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* ——— Shipping form ——— */
.mdl_shipping-form {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #f9fafb;
}
.mdl_form-group {
    margin-bottom: 1rem;
}
.mdl_form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
}
.mdl_form-control,
.mdl_form-select {
    border-color: #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.mdl_form-control:focus,
.mdl_form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.mdl_btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}
.mdl_btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
}
.mdl_btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}
.mdl_btn-secondary {
    background: #9ca3af;
    border-color: #9ca3af;
}
.mdl_btn-secondary:hover {
    background: #6b7280;
    border-color: #6b7280;
}
.mdl_btn-outline {
    color: #6b7280;
    border-color: #d1d5db;
    background: #fff;
}
.mdl_btn-outline:hover {
    background: #f3f4f6;
}

.mdl_spinner {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

.mdl_toast {
    position: fixed;
    top: 3rem;
    right: 1rem;
    z-index: 1060;
    max-width: 350px;
    padding: 0.75rem 1.25rem;
    background: #10b981;
    color: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transition: opacity 0.3s;
    font-family: "Poppins", sans-serif;
}
.mdl_toast.show {
    opacity: 1;
}
.mdl_toast-icon {
    margin-right: 0.5rem;
}
.mdl_toast-message {
    font-weight: 500;
}

.mdl_total-row {
    font-weight: 500;
    border-top: 2px solid #e5e7eb;
}

@media (max-width: 768px) {
    .mdl_address-container {
        grid-template-columns: 1fr;
    }
    .mdl_order-info {
        grid-template-columns: 1fr 1fr;
    }
    .mdl_products-table {
        display: block;
        overflow-x: auto;
    }
}

.loading-search {
    position: relative;
}
.loading-search::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}
.loading-search.active::after {
    opacity: 1;
}
@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.mail-inbox-container {
    font-family: "Poppins", sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
}

.mail-inbox-header {
    color: black;
    padding: 24px 0 24px 20px;
    margin-bottom: 24px;
}

.mail-inbox-title {
    font-weight: 500;
    font-size: 28px;
    margin: 0;
    display: flex;
    align-items: center;
}

.mail-inbox-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.mail-search-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 24px;
}

.mail-search-input {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mail-search-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.mail-message-row {
    border-bottom: 1px solid #f1f3f4;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.mail-message-row:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.mail-message-row.unread {
    background-color: #fafbff;
    border-left: 4px solid #0d6efd;
}

.mail-message-row.unread:hover {
    background-color: #f0f2ff;
}

.mail-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #0d6efd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 16px;
    flex-shrink: 0;
}

.mail-sender-info {
    min-width: 200px;
    flex-shrink: 0;
}

.mail-sender-name {
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
    margin-bottom: 2px;
}

.mail-sender-email {
    color: #718096;
    font-size: 12px;
}

.mail-message-content {
    flex-grow: 1;
    min-width: 0;
}

.mail-message-subject {
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-message-preview {
    color: #718096;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-message-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 120px;
    flex-shrink: 0;
}

.mail-timestamp {
    color: #718096;
    font-size: 12px;
    white-space: nowrap;
}

.mail-message-id {
    font-family: "Courier New", monospace;
    color: #a0aec0;
    font-size: 10px;
}

.mail-status-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mail-status-open {
    background-color: #c6f6d5;
    color: #22543d;
}

.mail-status-closed {
    background-color: #fed7d7;
    color: #742a2a;
}

.mail-new-badge {
    background-color: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.mail-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mail-toolbar-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    color: #495057;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mail-toolbar-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.mail-toolbar-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.mail-stats {
    margin-left: auto;
    color: #718096;
    font-size: 12px;
}

.dataTables_wrapper .dataTables_filter {
    display: none;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    display: none;
}

@media (max-width: 768px) {
    .mail-message-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .mail-sender-info,
    .mail-message-meta {
        min-width: auto;
        width: 100%;
    }

    .mail-message-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
.pagi_mail {
    padding-top: 10px;
    padding-left: 10px;
    padding-bottom: 20px;
}

/* Status Toggle Styles */
.status-toggle {
    position: relative;
}

.status-toggle-input {
    display: none;
}

.status-toggle-label {
    display: flex;
    align-items: center;
    background-color: #c6f6d5;
    color: #22543d;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

.status-toggle-input:checked + .status-toggle-label {
    background-color: #fed7d7;
    color: #742a2a;
}

.status-toggle-input:checked + .status-toggle-label .status-toggle-text {
    display: none;
}

.status-toggle-input:checked + .status-toggle-label::after {
    content: "Closed";
}

.status-toggle-input:not(:checked) + .status-toggle-label .status-toggle-text {
    display: inline;
}

/* Chat Message Styles */
.chat-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-message.client {
    justify-content: flex-start;
}

.chat-message.support {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.client .message-bubble {
    background-color: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.support .message-bubble {
    background-color: #0d6efd;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-info {
    font-size: 11px;
    color: #718096;
    margin-top: 4px;
}

.chat-message.client .message-info {
    text-align: left;
}

.chat-message.support .message-info {
    text-align: right;
}

.support-role {
    font-weight: 500;
    color: #0d6efd;
}

.new-messages-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    text-align: center;
}

.new-messages-divider::before,
.new-messages-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ef4444;
}

.new-messages-divider span {
    background: #f5f7fa;
    padding: 0 16px;
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Auto-resize textarea */
#messageInput {
    transition: height 0.2s ease;
}

@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-body {
        height: 400px;
    }

    .message-bubble {
        max-width: 85%;
    }
}

.create-message-btn {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    margin-left: auto;
}

.create-message-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: white;
}

/* ===== Client Chat (namespace: uc-) — визуально как админка ===== */

/* Контейнер сообщений (совпадает с админским фоном модалки) */
#ucChatMessages {
    background-color: #f5f7fa;
}

/* Один “ряд” сообщения: отступы и компоновка как в админке */
.uc-msg {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-direction: column; /* колонкой, как в админке (пузырь + подпись) */
}

/* Стороны (инверсия относительно админки для клиентской версии) */
.uc-msg--support {
    align-items: flex-start;
} /* саппорт слева */
.uc-msg--client {
    align-items: flex-end;
} /* клиент справа */

/* Пузырь: размеры/радиусы как в админке */
.uc-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Цвета пузырей (ИНВЕРСИЯ админки):
   клиент — синий (#0d6efd) справа, саппорт — белый слева */
.uc-msg--client .uc-bubble {
    background-color: #0d6efd; /* bootstrap primary */
    color: #ffffff; /* белый текст */
    border-bottom-right-radius: 4px; /* акцент как в админке для “своих” */
    border: none;
}

.uc-msg--support .uc-bubble {
    background-color: #ffffff; /* белый пузырь */
    color: #2d3748; /* тёмный шрифт как в админке */
    border-bottom-left-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* Подпись под пузырём (имя/роль/время): стили как у админки */
.uc-meta {
    font-size: 11px;
    color: #718096;
    margin-top: 4px;
}

/* Выравнивание подписей */
.uc-msg--client .uc-meta {
    text-align: right;
}
.uc-msg--support .uc-meta {
    text-align: left;
}

/* Роль саппорта — акцент как в админке */
.support-role {
    font-weight: 500;
    color: #0d6efd;
}

/* Разделитель “New Reply” — в духе .new-messages-divider */
.uc-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    text-align: center;
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.uc-divider::before,
.uc-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ef4444;
}
.uc-divider span {
    background: #f5f7fa;
    padding: 0 16px;
}

/* Адаптивные правки как в админке */
@media (max-width: 768px) {
    .modal-body {
        height: 54px;
    }
    .uc-bubble {
        max-width: 85%;
    }
}

@media (max-width: 475px) {
    .modal-body {
        height: 54px;
    }
}
