:root {
    --primary-gradient: linear-gradient(#f4f4f4, #e5e5db);
    --primary-dark: #2f353b;
    --success-color: #94c818;
    --danger-color: #f30000;
}

body {
    font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif;
    font-size: 14px;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar (variant A — Operations Grid) ──────────────────────────── */
.sidebar {
    width: 240px;
    background: #f4f5f8;
    color: #334155;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    left: -240px;
    transition: left 0.3s ease;
    border-right: 1px solid #e6e8ec;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.active {
    left: 0;
}

/* ── Logo / branding ─────────────────────────────────────────────────── */
.sidebar-logo {
    padding: 12px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid #e6e8ec;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-link {
    display: block;
    line-height: 0;
}

.sidebar-logo-img {
    max-width: 160px;
    height: auto;
    display: block;
}

/* ── Sidebar search ──────────────────────────────────────────────────── */
.sidebar-search {
    padding: 8px 10px 6px;
    flex-shrink: 0;
}

.sidebar-search input {
    width: 100%;
    background: #fff;
    border: 1px solid #e6e8ec;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    color: #475569;
    outline: none;
    transition: border-color 0.15s;
}

.sidebar-search input:focus {
    border-color: #a5b4fc;
}

.sidebar-search input::placeholder {
    color: #b0b8c8;
}

/* ── Nav items ───────────────────────────────────────────────────────── */
.sidebar-menu {
    padding: 4px 10px 12px;
    list-style: none;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 450;
    color: #475569;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    line-height: 1.4;
}

.sidebar-menu li a:hover {
    background: rgba(99, 102, 241, 0.07);
    color: #334155;
}

.sidebar-menu li.active > a {
    background: rgba(99, 102, 241, 0.11);
    color: #4338ca;
    font-weight: 580;
    border-left: none;
}

.sidebar-menu li a i {
    font-size: 13px;
    width: 14px;
    flex-shrink: 0;
    text-align: center;
}

/* ── Section headers (has-submenu parent) ────────────────────────────── */
.has-submenu > a {
    padding: 11px 8px 3px !important;
    font-size: 10px !important;
    color: #94a3b8 !important;
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
    font-weight: 650 !important;
    cursor: default !important;
    border-radius: 0 !important;
    pointer-events: none;
    background: transparent !important;
    gap: 0 !important;
}

.has-submenu > a i {
    display: none !important;
}

.menu-arrow {
    display: none;
}

/* ── Submenu — always expanded, flat ─────────────────────────────────── */
.submenu {
    padding: 0;
    list-style: none;
    margin: 0;
    max-height: none !important;
    overflow: visible !important;
    transition: none !important;
}

.submenu li a {
    padding-left: 14px !important;
}

.submenu li.active > a {
    background: rgba(99, 102, 241, 0.11) !important;
    color: #4338ca !important;
    font-weight: 580 !important;
}

.submenu .dropdown-divider {
    display: none;
}

/* ── nav-label inside submenu ────────────────────────────────────────── */
.submenu li.nav-label {
    list-style: none;
    cursor: default;
    pointer-events: none;
}

.submenu li.nav-label span {
    display: block;
    padding: 10px 8px 2px 14px;
    font-size: 10px;
    font-weight: 650;
    color: #94a3b8;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* ── User profile footer ─────────────────────────────────────────────── */
.sidebar-footer {
    padding: 10px 14px !important;
    border-top: 1px solid #e6e8ec;
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: static !important;
    bottom: auto !important;
    width: auto !important;
    background: #f4f5f8;
}

.sidebar-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.sidebar-user-name {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-gear {
    color: #94a3b8;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.15s;
}

.sidebar-user-gear:hover {
    color: #475569;
}

.sidebar-footer:hover {
    background: #eceef2;
}

/* ── Страница настроек (#page/personal) — левое меню как в claude.ai ──── */
.settings-nav-card {
    padding: 8px;
    position: sticky;
    top: 0;
}

.settings-nav .list-group-item {
    border: 0;
    border-radius: 8px;
    margin-bottom: 2px;
    padding: 8px 12px;
    font-size: 14px;
    background: transparent;
    color: #334155;
    text-align: left;
    transition: background 0.15s;
}

.settings-nav .list-group-item:hover {
    background: #eceef2;
}

.settings-nav .list-group-item.active {
    background: #e4e6eb;
    color: #111827;
    font-weight: 600;
}

.settings-page .field-row {
    margin-bottom: 14px;
}

/* Main content */
.main-content {
    width: 100%;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease, width 0.3s ease;
    margin-left: 0;
    overflow: hidden;
}

.main-content.sidebar-active {
    margin-left: 240px;
    width: calc(100% - 240px);
    height: 100vh;
}

/* Overlay when sidebar is open */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}

.frame-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.frame-content.container-fluid {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Advanced search fields */
.advanced-fields {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.advanced-fields.active {
    display: block;
}

/* Quick search buttons */
.quick-search-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.quick-search-buttons .btn {
    flex: 1 0 calc(50% - 8px);
    min-width: 120px;
    white-space: nowrap;
}

/* Email details modal */
.email-details-modal .modal-body {
    padding: 20px;
}

.email-details-modal .email-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.email-details-modal .email-header h5 {
    font-weight: bold;
    margin-bottom: 10px;
}

.email-details-modal .email-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.email-details-modal .email-meta-item {
    display: flex;
    align-items: center;
}

.email-details-modal .email-meta-item i {
    margin-right: 5px;
    color: #6c757d;
}

.email-details-modal .email-content {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    white-space: pre-wrap;
}

.email-details-modal .attachments {
    margin-top: 20px;
}

.email-details-modal .attachment-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 8px;
}

.email-details-modal .attachment-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    color: #6c757d;
}

/* Table row clickable */
.table-custom tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.table-custom tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
}

/* Мобильный бургер (top navbar удалён, настройки в footer сайдбара) */
.mobile-menu-fab {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 998;
    padding: 5px 10px;
}

@media (max-width: 767px) {
    .mobile-menu-fab {
        display: inline-block;
    }
}

/* Cards */
.card {
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: bold;
}

/* Custom buttons */
.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    color: #333;
    text-shadow: 0 1px #fff;
    box-shadow: inset 0 1px 1px #fff, 0 1px 3px #aaa;
}

.btn-gradient:hover {
    background: linear-gradient(#f4f4f4, #d7d7d7);
}

/* Table styling */
.table-custom {
    width: 100%;
}

.table-custom thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table-custom tbody tr:hover {
    background-color: rgba(232, 240, 255, 0.6);
}

/* Status badges */
.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

/* Custom alerts */
.alert-black {
    background-color: var(--primary-dark);
    color: white;
}

/* Filter section */
.filter-section {
    background: white;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

/* Scrollable table container */
.table-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fixed header for scrollable table */
.table-container thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
}

/* Action dropdown */
.action-dropdown .dropdown-toggle::after {
    display: none;
}

/* Bulk actions panel */
.bulk-actions-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
    align-items: center;
    gap: 15px;
}

.bulk-actions-panel.active {
    display: flex;
}

.bulk-actions-panel .selected-count {
    font-weight: bold;
    margin-right: 10px;
}

/* Checkbox column */
.checkbox-column {
    width: 40px;
    text-align: center;
}



/* Responsive adjustments */
@media (min-width: 992px) {
    .main-content-wrapper {
        flex-direction: row;
        align-items: stretch;
    }
    .list-area {
        flex: 1 1 0;
        min-height: 0;
    }
    .quick-search-column {
        width: 350px;
        flex-shrink: 0;
    }
}

@media (max-width: 991.98px) {
    .quick-search-column {
        margin-bottom: 20px;
    }
}

/* main-content-wrapper и list-area: flex-chain для заполнения высоты */
.main-content-wrapper {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* При открытой панели поиска — горизонтальный ряд */
.main-content-wrapper.with-search-panel {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
}

.list-area {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Правая панель поиска */
.search-panel-area {
    flex: 0 0 200px;
    width: 200px;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.search-panel-card {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    font-size: .875rem;
}

.search-history-item:hover {
    background-color: #f8f9fa;
}

.search-history-link {
    cursor: pointer;
}
.search-history-link:hover {
    background-color: #f8f9fa;
}

@media (min-width: 768px) {
    .main-content.sidebar-active {
        width: calc(100% - 240px);
    }

    .bulk-actions-panel {
        left: calc(50% + 120px);
    }
}

@media (max-width: 767px) {
    .bulk-actions-panel {
        width: 90%;
        justify-content: space-between;
        border-radius: 10px;
    }
    
    .bulk-actions-panel .btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Мобильная версия - боковое меню скрыто по умолчанию */
@media (max-width: 767px) {
    .sidebar {
        left: -240px !important;
    }

    .sidebar.active {
        left: 0 !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .main-content.sidebar-active {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Оверлей для меню */
    .overlay {
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .overlay.active {
        display: block;
    }
}


/* Selected row style */
.table-custom tbody tr.selected {
    background-color: rgba(13, 110, 253, 0.15) !important;
}

/* Clear input buttons */
.clear-input {
    border-left: none;
    padding: 0.375rem 0.75rem;
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-right: none;
}
.input-group > .form-control:not(:first-child):not(:last-child),
.input-group > .form-select:not(:first-child):not(:last-child) {
    border-radius: 0.375rem 0 0 0.375rem;
}
.input-group > .btn:last-child {
    border-radius: 0 0.375rem 0.375rem 0;
}

.table-container {
    overflow-y: auto;
}

.clear-all {
    padding: 0.375rem 0.75rem;
}

.pagination-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* has-submenu positional helper */
.has-submenu {
  position: relative;
}

.nav-link.active .submenu-icon {
  color: #4338ca;
}

.date-filter {
    max-width: 300px;
}
.date-filter .form-select {
    flex: 2;
}
.date-filter .d-none {
    display: none;
}
.date-filter .custom-date-visible {
    display: block !important;
}

.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

.auth-form {
  transition: opacity 0.3s ease;
}

.fade-in {
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.list-card.compact-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  margin-bottom: 2px;
}

.top-row {
  display: flex;
  gap: 12px;
}

.message-main-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.first-line {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.second-line, .third-line {
  font-size: 0.8rem;
  display: flex;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sender-line, .recipients-line {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recipients-line span:not(:first-child) {
  margin-left: 8px;
}

.actions-block {
  margin-left: auto;
  flex-shrink: 0;
}

.btn-sm {
  padding: 2px 6px;
  font-size: 0.8rem;
}

.status-block {
  width: 100%;
  padding: 8px 12px;
  border-left: 3px solid #28a745;
  background: #e8f5e9;
}

.status-content {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
}

.status-details-expanded {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.score-badge {
  background: #28a745;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.status-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
}

.status-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #a5d6a7;
}

.action-taken {
  font-weight: 500;
}

.action-alert-deliv{color: #468847;background-color: #DFF0D8;border-color: #D6E9C6;}
.action-alert-info{color: #3A87AD; background-color: #D9EDF7;border-color: #BCE8F1;}
.action-alert-warning{color:#C09853;background-color:#FCF8E3;border: 1px solid #FBEED5}
.action-alert-error{color: #B94A48;background-color: #F2DEDE;border-color: #EED3D7;}
.action-alert-spam{color: #B94A48;background-color: #F2DEDE;border-color: #EED3D7;}
.action-alert-bounce{color: #B94A48;background-color: #F2DEDE;border-color: #EED3D7;}
.action-alert-trap{color: #B94A48;background-color: #F2DEDE;border-color: #EED3D7;}
.action-alert-black{color: #fff;background-color: #2f353b;border-color: #000;}
.action-alert-black a{color: #fff; border-bottom: dashed 1px #fff;}
.action-alert-white{color: #fff;background-color: #007ee6;border-color: #1373b5;}
.action-alert-disable{color: #fff;background-color: grey;border-color: grey;}
.action-alert-disable span.alert{padding:0px; color: white}
.alert-none{display:none;}

.action-time {
  color: #689f38;
  font-size: 0.8rem;
}

.bi {
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .top-row {
    flex-wrap: wrap;
  }
  
  .message-main-block {
    flex-basis: 100%;
  }
  
  .actions-block {
    order: 1;
  }
}

.status-actions pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.email-meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.email-meta-item strong {
    min-width: 140px;
}
.email-meta-value {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.dropdown-btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
}
.act-smid {
    color: #0d6efd;
    text-decoration: underline;
}
pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-family: monospace;
}
.nav-tabs .nav-link.active {
    background-color: #f8f9fa;
    border-bottom-color: #f8f9fa;
}
.status-block {
    border-left: 4px solid #28a745;
}

.email-meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.email-meta-item strong {
    min-width: 140px;
}
.email-meta-value {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
}
.email-meta-text {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dropdown-btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.act-smid {
    color: #0d6efd;
    text-decoration: underline;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.email-meta-item strong {
    min-width: 140px;
    flex-shrink: 0;
}
.email-meta-value {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    flex-grow: 1;
}
.email-meta-text {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.email-meta-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}
.dropdown-btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
}
.act-smid {
    color: #0d6efd;
    text-decoration: underline;
}

.compact-alert {
    margin: 0 auto;
    background: #2f353b;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
.alert-header {
    background-color: rgba(0, 0, 0, 0.25);
    padding: 10px 15px;
    border-bottom: 1px solid #495057;
    display: flex;
    align-items: center;
}
.alert-icon {
    font-size: 1.2rem;
    margin-right: 10px;
    color: #ff6b6b;
}
.alert-title {
    font-weight: 600;
    font-size: 1rem;
}
.alert-items {
    padding: 0;
}
.alert-item {
    padding: 12px 15px;
    border-bottom: 1px solid #3b4046;
}
.alert-item:last-child {
    border-bottom: none;
}
.item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.item-content {
    flex: 1;
}
.item-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.item-type {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-right: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}
.item-value {
    font-weight: 500;
    line-height: 1.3;
}
.item-link {
    color: #4dabf7;
    text-decoration: none;
}
.item-link:hover {
    color: #74c0fc;
    text-decoration: underline;
}
.ip-info {
    font-size: 0.85rem;
    color: #adb5bd;
    margin-top: 5px;
    padding-left: 10px;
    border-left: 2px solid #74c0fc;
}
.item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    min-width: 140px;
    margin-left: 15px;
}
.delete-btn {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.delete-btn:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
}
.rule-active {
    font-size: 0.75rem;
    color: #adb5bd;
    display: flex;
    align-items: center;
}
.rule-icon {
    margin-right: 5px;
    font-size: 0.7rem;
}
.added-info {
    font-size: 0.8rem;
    color: #adb5bd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.added-by {
    flex: 1;
}

.input-group {
    position: relative;
    min-width: 160px;
}

.clear-input, .search-submit {
    transition: all 0.3s ease;
}

.search-submit {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.clear-input {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Плавное появление кнопок */
.d-none {
    display: none !important;
}

.d-flex {
    display: flex !important;
}        

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
}

.message-main-block {
    flex: 1;
    min-width: 0; /* Для корректного обрезания длинного текста */
}

.first-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.address-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.sender-address, .recipient-address {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.message-actions-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.action-time {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
}

/* Стили для кнопки с тремя точками */
.btn-outline-secondary.dropdown-toggle {
    padding: 2px 8px;
    font-size: 0.9rem;
    border-radius: 4px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .top-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .message-actions-block {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        align-items: center;
    }
    
    .first-line {
        gap: 5px;
    }
}

/* Компактный белый (синий) alert */
.alert-white {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
    overflow: hidden;
    border: none;
}

.alert-white .alert-header {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    min-height: 36px;
}

.alert-white .alert-icon {
    font-size: 1rem;
    margin-right: 8px;
    color: #a5d6fd;
}

.alert-white .alert-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-white .alert-items {
    padding: 0;
}

.alert-white .alert-item {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

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

.alert-white .item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.alert-white .item-content {
    flex: 1;
    min-width: 0;
}

.alert-white .item-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.alert-white .item-type {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-right: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.alert-white .item-value {
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-white .item-link {
    color: #a5d6fd;
    text-decoration: none;
}

.alert-white .item-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.alert-white .delete-btn {
    background: rgba(220, 53, 69, 0.25);
    color: #ffb8c6;
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    margin-left: 8px;
    flex-shrink: 0;
}

.alert-white .delete-btn:hover {
    background: rgba(220, 53, 69, 0.4);
    border-color: rgba(220, 53, 69, 0.6);
}

.alert-white .added-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.alert-white .rule-active {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
}

.alert-white .rule-icon {
    margin-right: 4px;
    font-size: 0.65rem;
}

/* Черный alert */
.alert-black {
    background: linear-gradient(135deg, #2f353b 0%, #1a1d21 100%);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid #495057;
}

.alert-black .alert-header {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px 12px;
    border-bottom: 1px solid #495057;
    display: flex;
    align-items: center;
    min-height: 40px;
}

.alert-black .alert-icon {
    font-size: 1rem;
    margin-right: 8px;
    color: #adb5bd;
}

.alert-black .alert-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-black .alert-items {
    padding: 0;
}

.alert-black .alert-item {
    padding: 12px 12px;
    border-bottom: 1px solid #3b4046;
}

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

.alert-black .item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.alert-black .item-content {
    flex: 1;
    min-width: 0;
}

.alert-black .item-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.alert-black .item-type {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-right: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.alert-black .item-value {
    font-weight: 500;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-black .item-link {
    color: #4dabf7;
    text-decoration: none;
}

.alert-black .item-link:hover {
    color: #74c0fc;
    text-decoration: underline;
}

.alert-black .delete-btn {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    margin-left: 10px;
    flex-shrink: 0;
}

.alert-black .delete-btn:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
}

.alert-black .added-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #adb5bd;
}

.alert-black .rule-active {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
}

.alert-black .rule-icon {
    margin-right: 5px;
    font-size: 0.7rem;
}

/* Серый alert */
.alert-gray {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
    overflow: hidden;
    border: 1px solid #868e96;
}

.alert-gray .alert-header {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 9px 12px;
    border-bottom: 1px solid #868e96;
    display: flex;
    align-items: center;
    min-height: 38px;
}

.alert-gray .alert-icon {
    font-size: 1rem;
    margin-right: 8px;
    color: #dee2e6;
}

.alert-gray .alert-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-gray .alert-items {
    padding: 0;
}

.alert-gray .alert-item {
    padding: 11px 12px;
    border-bottom: 1px solid #868e96;
}

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

.alert-gray .item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.alert-gray .item-content {
    flex: 1;
    min-width: 0;
}

.alert-gray .item-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.alert-gray .item-type {
    font-size: 0.73rem;
    color: #e9ecef;
    margin-right: 7px;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}

.alert-gray .item-value {
    font-weight: 500;
    font-size: 0.88rem;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-gray .item-link {
    color: #a3daff;
    text-decoration: none;
}

.alert-gray .item-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.alert-gray .delete-btn {
    background: rgba(220, 53, 69, 0.25);
    color: #ffb8c6;
    border: 1px solid rgba(220, 53, 69, 0.35);
    border-radius: 4px;
    padding: 4px 9px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    margin-left: 9px;
    flex-shrink: 0;
}

.alert-gray .delete-btn:hover {
    background: rgba(220, 53, 69, 0.35);
    border-color: rgba(220, 53, 69, 0.55);
}

.alert-gray .added-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #dee2e6;
}

.alert-gray .rule-active {
    display: flex;
    align-items: center;
    font-size: 0.73rem;
}

.alert-gray .rule-icon {
    margin-right: 5px;
    font-size: 0.68rem;
}

/* Общие улучшения для компактности */
.compact-alert {
    margin: 0 auto;
    font-size: 0.9rem;
    line-height: 1.2;
}

/* Адаптивность */
@media (max-width: 768px) {
    .compact-alert {
        font-size: 0.85rem;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-type {
        margin-bottom: 4px;
    }
}


.cards-container {
    padding: 15px;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

/* Стили для карточек в одну строку с фиксированными полями */
.compact-row-card {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    min-height: 56px;
}

.compact-row-card:hover {
    background-color: rgba(232, 240, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Фиксированные ширины для каждого поля */

/* Стили для карточек */
.list-card {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    min-height: 56px;
}

.list-card:hover {
    background-color: rgba(232, 240, 255, 0.6);
}


/* Прокручиваемая область списка */
.card-body.p-0.flex-grow-1 {
    display: flex;
    flex-direction: column;
}

.cards-container.h-100 {
    flex: 1;
    min-height: 0; /* Важно для правильной работы flex в Firefox */
}

/* Стили для карточек */
.list-card {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    min-height: 56px;
    flex-shrink: 0;
}

.list-card:hover {
    background-color: rgba(232, 240, 255, 0.6);
}

.list-card .actions-field {
    flex: 0 0 50px;
    min-width: 0;
    padding: 0 8px;
    display: flex;
    justify-content: center;
}

/* Исправление для текста внутри полей */
.list-card .field-content {
    width: 100%;
    overflow: hidden;
}


/* Бейджи статусов */
.list-card .list-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    font-size: 0.8rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Фиксированная пагинация */
.card-footer.pagination-container {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Улучшение скроллбара */
.cards-container::-webkit-scrollbar {
    width: 8px;
}

.cards-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cards-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.cards-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* Стили для блока recent-list-card */
#recent-list-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

#recent-list-card .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#recent-list-card .cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Стили для модального окна */
#recordModal .view-mode,
#recordModal .edit-mode {
    transition: opacity 0.3s ease;
}

#recordModal .form-label {
    color: #495057;
    margin-bottom: 0.5rem;
}

#recordModal .invalid-feedback {
    display: none;
}

#recordModal .form-control.is-invalid {
    border-color: #dc3545;
}

#recordModal .form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Для кнопок переходов в настройки */
#recordModal .btn-goto-settings {
    padding: 2px 6px;
    font-size: 0.8rem;
}

#recordModal .dropdown-toggle {
    padding: 2px 6px;
    font-size: 0.8rem;
}


/* Добавьте этот стиль в ваш CSS файл */
.email-meta-item .act-smid {
    max-width: 200px; /* Настройте под ваш дизайн */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

/* Для показа полного текста при наведении */
.email-meta-item .act-smid:hover {
    max-width: none;
    overflow: visible;
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: normal;
    word-break: break-all;
}

/* ── Строка пагинации ─────────────────────────────────────────────────── */
.pagination-container {
    padding: 0.5rem 1rem;
}

.pagebar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;  /* вся строка — в одну линию */
    min-width: 0;
}

/* Левая часть: perpage + всего */
.pagebar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.perpage-select {
    min-width: 70px;
}

/* Правая часть: номера страниц — не сжимается и не переносится */
.pagebar-right {
    flex-shrink: 0;
}

/* Центр: ползунок — занимает всё свободное место */
.pagebar-slider {
    flex: 1 1 0;
    min-width: 80px;
}

.pagebar-right .pagination {
    flex-wrap: nowrap;
    margin-bottom: 0;
}

/* ── Ползунок страниц ─────────────────────────────────────────────────── */
.page-slider-wrap {
    position: relative;
    padding-top: 4px;
}

.page-slider {
    width: 100%;
    cursor: pointer;
    accent-color: #0d6efd;
    margin: 0;
}

.page-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1px;
}

/* Тултип ползунка */
.page-slider-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    background: #1e293b;
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
    z-index: 200;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    text-align: center;
    min-width: 110px;
}

.pst-page {
    font-weight: 700;
    font-size: 0.85rem;
    color: #93c5fd;
    display: block;
}

.pst-date {
    color: #e2e8f0;
    display: block;
}

.pst-count {
    color: #94a3b8;
    font-size: 0.72rem;
    display: block;
}

/* Стрелка вниз тултипа */
.page-slider-tip-arrow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1e293b;
}

/* Адаптивность */
@media (max-width: 768px) {
    .pagebar-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .pagebar-right .pagination {
        justify-content: center !important;
    }
}

/* Эллипсис-разделитель в пагинации */
.page-ellipsis {
    cursor: default;
    color: #6c757d;
    pointer-events: none;
    padding-left: 6px;
    padding-right: 6px;
}

/* Стили для активного выбора записей */
.perpage-option.active {
    background-color: #0d6efd;
    color: white;
}

.perpage-option.active:hover {
    background-color: #0b5ed7;
    color: white;
}

/* Стили для кнопок пагинации */
.page-link {
    cursor: pointer;
    user-select: none;
}

.page-item.disabled .page-link {
    cursor: not-allowed;
}


/* Стили для временного ползунка */
.time-slider-container {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.time-slider {
    height: 6px;
    border-radius: 3px;
}

.time-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: #0d6efd;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0d6efd;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Двойной ползунок */
.multi-slider {
    position: relative;
    height: 30px;
    padding: 0 10px;
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    transform: translateY(-50%);
}

.range-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

.range-slider::-webkit-slider-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
}

.range-slider::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
}

.slider-selection {
    position: absolute;
    top: 50%;
    height: 4px;
    background: #0d6efd;
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Часовые метки */
.hour-slider-container {
    position: relative;
}

.hour-marks {
    height: 20px;
}

.hour-mark {
    position: absolute;
    top: 0;
    font-size: 10px;
    color: #6c757d;
    transform: translateX(-50%);
}

.hour-mark:nth-child(2n) {
    top: 10px;
    font-size: 8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .time-slider-container {
        padding: 0.75rem;
    }
    
    .slider-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .slider-controls button {
        width: 100%;
    }
    
    .time-presets .btn-group {
        flex-wrap: wrap;
    }
    
    .time-presets .btn {
        flex: 1 0 auto;
        min-width: 100px;
        margin-bottom: 0.25rem;
    }
}

/* Анимации */
.time-range-value {
    transition: all 0.3s ease;
}

.time-range-value:hover {
    background: #e9ecef !important;
}

.slider-info {
    transition: all 0.2s ease;
}

/* Стили для заголовка карточки */
.card-header h5 {
    font-weight: 600;
}

/* Стили для бейджа с количеством */
.records-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .card-header > div:first-child {
        margin-bottom: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .card-header > div:last-child {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Стили для прогресс-бара в заголовке */
.card-header .progress {
    background-color: rgba(0,0,0,0.1);
}

.card-header .progress-bar {
    background-color: #0d6efd;
    transition: width 0.3s ease;
}

.filter-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
}

/* Стили для dropdown пользователей */
.user-dropdown {
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #dee2e6;
    margin-top: 2px;
}

.user-dropdown .dropdown-header {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.user-dropdown .dropdown-body {
    padding: 0.5rem 0;
}

.user-dropdown .dropdown-footer {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.user-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-item:hover {
    background-color: #e9ecef;
}

.user-item.active {
    background-color: #0d6efd;
    color: white;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 500;
}

.user-email {
    font-size: 0.85em;
    color: #6c757d;
}

.user-item:hover .user-email,
.user-item.active .user-email {
    color: #dee2e6;
}

/* Стили для параметров */
#parametersContainer {
    background: white;
}

.parameter-checkbox:checked + label {
    font-weight: 600;
}

/* Анимации */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Адаптивность */
@media (max-width: 768px) {
    .filter-form {
        padding: 1rem;
    }
    
    .user-dropdown {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-top: 5px;
    }
}

/* Индикатор загрузки */
.loading-users {
    position: relative;
}

.loading-users::after {
    content: '';
    position: absolute;
    right: 40px;
    top: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Стили для выбранных параметров */
.selected-params {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.param-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
}


.row-fixed-height {
    min-height: 60px;
    height: 60px;
    overflow: visible;
}



.list-card.compact-view {
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.list-card.compact-view:hover {
  background-color: rgba(232, 240, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-row {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  width: 100%;
}

/* Первая колонка: Статус и Дата */
.status-date-col {
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-right: 15px;
  border-right: 1px solid #eee;
}

.list-status.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.message-date {
  font-size: 0.85rem;
  color: #333;
  line-height: 1.2;
}

/* Вторая колонка: Контент */
.content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.main-info-row {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: nowrap;
  min-height: 24px;
}

.address-text:hover {
  text-decoration: underline;
  color: #0a58ca;
}

.address-text.text-truncate {
  max-width: 100%;
}

/* Детали статуса */
.status-details-row {
  min-height: 18px;
}

.list-status-details {
  display: block;
  line-height: 1.2;
  font-size: 0.8rem;
  color: #6c757d !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  max-width: 100%;
}

.list-status-details:hover {
  color: #495057 !important;
}

/* Третья колонка: Действия */
.actions-col {
  flex: 0 0 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-left: 15px;
  border-left: 1px solid #eee;
}

.message-actions-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.action-time {
  font-size: 0.8rem;
  color: #689f38;
  white-space: nowrap;
}

/* Выпадающее меню действий */
.dropdown-toggle {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
}


/* Десктопные улучшения */
@media (min-width: 769px) {
  .main-info-row {
    justify-content: flex-start;
  }
}

.list-card.compact-view {
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.list-card.compact-view:hover {
  background-color: rgba(232, 240, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-row {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  width: 100%;
  min-width: 0;
}

/* Первая колонка: Статус и Дата */
.status-date-col {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-right: 15px;
  border-right: 1px solid #eee;
  min-width: 0;
}

.list-status.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-date {
  font-size: 0.85rem;
  color: #333;
  line-height: 1.2;
  white-space: nowrap;
}

/* Вторая колонка: Контент */
.content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

/* Основная строка с полями */
.main-info-row {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: nowrap;
  min-height: 24px;
  width: 100%;
  min-width: 0;
}


/* Детали статуса - ограничение по ширине */
.status-details-row {
  min-height: 18px;
  width: 100%;
  max-width: calc(240px + 180px + 150px + 30px); /* сумма полей + gap * 2 */
  min-width: 0;
  overflow: hidden;
}

.list-status-details {
  display: block;
  line-height: 1.2;
  font-size: 0.8rem;
  color: #6c757d !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
}

.list-status-details:hover {
  color: #495057 !important;
}

/* Третья колонка: Действия */
.actions-col {
  flex: 0 0 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-left: 15px;
  border-left: 1px solid #eee;
  flex-shrink: 0;
}

.message-actions-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
}

.action-time {
  font-size: 0.8rem;
  color: #689f38;
  white-space: nowrap;
  text-align: right;
}

/* Выпадающее меню действий */
.dropdown-toggle {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .list-card.compact-view {
    padding: 8px;
  }
  
  .card-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .status-date-col {
    flex: 0 0 100%;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
  }
  
  .content-col {
    flex: 1 0 100%;
    order: 2;
  }
  
  .main-info-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  
  /* На мобильных детали статуса показываем с ограничением */
  .status-details-row {
    max-width: 100%;
    display: block !important;
  }
  
  .actions-col {
    flex: 0 0 auto;
    order: 1;
    padding-left: 0;
    border-left: none;
    margin-left: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  
  .message-actions-block {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
}

/* Десктопные улучшения */
@media (min-width: 769px) {
  .main-info-row {
    justify-content: flex-start;
  }
  
  /* Скрываем детали статуса на мобильных */
  .status-details-row.d-md-block {
    display: block;
  }
}

@media (max-width: 768px) {
  .status-details-row.d-md-block {
    display: none !important;
  }
}





/* LIST 11111111111111111111*/
/* Общие стили для карточки списка */
.list-card {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    min-height: 56px;
    width: 100%;
}


.list-card:hover {
    background-color: rgba(232, 240, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Общие правила для всех полей */
.list-card .list-fields {
    flex: 0 0 200px;
    min-width: 200px;
    display: flex;
    align-items: center;
    min-height: 36px; /* Фиксированная высота для вертикального выравнивания */
    overflow: hidden;
    border-right: 1px solid #eee;
    margin: 8px 8px;
}


/* Стили для текста внутри полей */
.list-card .text-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    line-height: 1.3;
    font-size: 0.9rem;
}

/* Адресные тексты */
.list-card .address-text {
    color: #333;
    text-decoration: none;
    display: block;
}

.list-card .address-text:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* 1111111111111111111  list-header - 1*/
/* Стили для заголовков колонок (если нужны) */
.list-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    min-width: 150px;
    min-height: 50px;
    border-bottom: 2px solid #dee2e6;
}


/* 1111111111111111111  list-header - 2*/

/* Адаптивность для мобильных устройств */
@media (max-width: 1200px) {
    .list-card {
        flex-wrap: wrap;
        padding: 8px;
    }
    
    .list-card .list-fields,
    .list-card .actions-field {
        flex: 0 0 50% !important;
        min-width: 50% !important;
        max-width: 50% !important;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 4px 8px;
        margin-bottom: 4px;
    }
    
    .list-card .list-fields:first-child {
        border-right: none;
    }
    
    .list-card .actions-field {
        justify-content: flex-start;
        padding-top: 8px;
    }
    
    /* Для заголовков на мобильных */
    .list-header {
        flex-wrap: wrap;
        padding: 8px;
    }
    
    .list-header > div {
        flex: 0 0 50% !important;
        padding: 4px 8px;
        margin-bottom: 4px;
    }
}

@media (max-width: 768px) {
    .list-card .list-fields,
    .list-card .actions-field,
    .list-header > div {
        flex: 0 0 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
}

/* 1111111111111111111  list-header - 3*/

/* Дополнительные утилитарные классы */
.text-truncate-multiline {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

/* Стили для бейджей разных цветов */
.bg-info {
    background-color: var(--primary-dark) !important;
    color: white !important;
}

.bg-success {
    background-color: var(--success-color) !important;
    color: white !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
    color: white !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #333 !important;
}


/* 1111111111111111111  list-header - 4*/

/* Общий заголовок столбцов - всегда виден 222222222222*/
/*
#recent-list-card .list-header {
    display: block;
    width: 100%;
}
*/


/* Стили для заголовков колонок */
.list-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    min-height: 50px;
    border-bottom: 2px solid #dee2e6;
    width: 100%;

    flex-shrink: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Общие правила для всех заголовочных полей */
.list-header .head-fields {
    flex: 0 0 200px;
    min-width: 200px;
    display: flex;
    align-items: center;
    min-height: 36px;
    overflow: hidden;
    margin: 8px 8px;

}

/* Текст заголовков */
.list-header .header-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    width: 100%;
    min-width: 0;
}

/* 1111111111111111111  list-header - 5*/
/* Ширины заголовков (соответствуют полям в карточках) */

/* Статус - 120px */
.list-header .status-field,
.list-card .status-field {
    flex: 0 0 120px;
    min-width: 120px;
    padding-right: 15px;
}

/* Отправитель - 200px */
.list-header .sender-field,
.list-card .sender-field {
    flex: 0 0 300px;
    min-width: 300px;
    padding: 0 15px;
}

/* Получатель - 180px */
.list-header .recipient-field,
.list-card .recipient-field {
    flex: 0 0 180px;
    min-width: 180px;
    padding: 0 15px;
}

 /* Комментарий - растягивается на оставшееся пространство */
.list-header .comment-field,
.list-card .comment-field {
    flex: 1;
    min-width: 150px;
    padding: 0 15px;
}


/* Ширины полей (только управление шириной) */
/* Поле действий - фиксированная ширина */
.list-card .actions-field {
    flex: 0 0 50px;
    min-width: 50px;
    padding-left: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Стили для выпадающего меню */
.list-card .dropdown-toggle {
    padding: 3px 6px;
    min-width: 32px;
    border-radius: 4px;
    font-size: 0.9rem;
}


/* Адаптивность для заголовков */
@media (max-width: 1200px) {
    .list-header {
        flex-wrap: wrap;
        padding: 8px;
    }
    
    .list-header .head-fields {
        flex: 0 0 50% !important;
        min-width: 50% !important;
        max-width: 50% !important;
        border-right: none !important;
        border-bottom: 1px solid #dee2e6;
        padding: 4px 8px !important;
        margin-bottom: 4px;
    }
    
    .list-header .head-fields.status-field {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .list-header .head-fields {
        flex: 0 0 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
}

/* Добавьте эти стили в ваш CSS файл */
.btn-sm.btn-primary {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.btn-sm.btn-primary i {
    font-size: 0.875rem;
}

/* Звездочка после label (если есть) */
label[for="editSender"]::after {
    content: " *";
    color: #dc3545;
}

/* Стиль для обязательных полей */
.form-control:required {
    border-left: 3px solid #0d6efd;
}

.form-control:required:invalid {
    border-left: 3px solid #dc3545;
}

.form-control:required:valid {
    border-left: 3px solid #198754;
}


/* ===== Модальное окно редактирования домена ===== */

/* Основные стили для модального окна */
/* ══════════════════════════════════════════════════════════════════════
   record-modal  —  variant A style
   ══════════════════════════════════════════════════════════════════════ */

.record-modal {
    max-height: 92vh;
    overflow: hidden;
}

.record-modal .modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: none;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────── */
.record-modal .modal-header {
    flex-shrink: 0;
    padding: 16px 22px 14px;
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    align-items: flex-start;
    gap: 12px;
}

.record-modal .modal-header-inner {
    flex: 1;
    min-width: 0;
}

.record-modal .modal-subtitle {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.2;
}

.record-modal .modal-title {
    color: #0f172a;
    font-weight: 650;
    font-size: 17px;
    margin: 0;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.record-modal .modal-header .btn-group {
    margin-left: auto;
    flex-shrink: 0;
}

/* Close button */
.record-modal .modal-header .btn-close,
.record-modal .modal-header .btn.btn-secondary.btn-close {
    background: #f4f5f8 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23475569'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/0.875em auto no-repeat;
    border: none;
    border-radius: 7px;
    width: 32px;
    height: 32px;
    padding: 0;
    opacity: 1;
    flex-shrink: 0;
    transition: background 0.15s;
    box-shadow: none;
}

.record-modal .modal-header .btn-close:hover,
.record-modal .modal-header .btn.btn-secondary.btn-close:hover {
    background-color: #e8eaee;
    opacity: 1;
}

/* ── Body ────────────────────────────────────────────────────────────── */
.record-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
.record-modal .nav-tabs {
    flex-shrink: 0;
    padding: 0 22px;
    border-bottom: 1px solid #eef0f3;
    background: #fff;
    gap: 0;
}

.record-modal .nav-tabs .nav-link {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: #64748b;
    margin-bottom: -1px;
    transition: color 0.12s;
    background: transparent;
}

.record-modal .nav-tabs .nav-link:hover {
    color: #334155;
    background: transparent;
    border-bottom-color: #cbd5e1;
}

.record-modal .nav-tabs .nav-link.active {
    color: #4f46e5;
    background: transparent;
    border-bottom: 2px solid #4f46e5;
    font-weight: 600;
}

/* ── Tab content ─────────────────────────────────────────────────────── */
.record-modal .tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
}

.record-modal .tab-pane {
    max-width: none;
    margin: 0;
    animation: rmSlideIn 0.15s ease-out;
}

@keyframes rmSlideIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Field rows ──────────────────────────────────────────────────────── */
.record-modal .field-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 14px;
    border-radius: 6px;
    padding: 2px 4px;
    transition: background 0.12s;
}

.record-modal .field-row:hover {
    background: rgba(99,102,241,0.04);
}

.record-modal .field-label {
    flex: 0 0 28%;
    max-width: 28%;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-right: 14px;
    text-align: right;
    line-height: 1.6;
}

.record-modal .field-value {
    flex: 1;
    min-width: 0;
}

.record-modal .field-value span {
    display: block;
    padding: 2px 0;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.field-value textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.record-modal .field-value .edit-mode {
    display: block;
    width: 100%;
}

.superselect-wrapper {
    display: block;
    width: 100%;
}

.superselect-dropdown .list-group-item {
    cursor: pointer;
    font-size: 0.875rem;
}

/* Страница (page-item-wrapper): modal-dialog отображается как карточка */
.page-item-wrapper {
    width: 100%;        /* в flex-колонке .list-area margin:auto без width сжимает блок до fit-content */
    max-width: 720px;
    margin: 0 auto;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Страница настроек шире обычной карточки */
.page-item-wrapper:has(.settings-page) {
    max-width: 1100px;
}

.page-item-wrapper .modal-dialog {
    max-width: 100%;
    margin: 0;
}

.page-item-wrapper .modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}


/* Стили для полей ввода */
.record-modal .form-control,
.record-modal .form-select {
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.record-modal .form-control:focus,
.record-modal .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.record-modal .form-control:disabled,
.record-modal .form-select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Стили для селектов */
.record-modal .form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

/* Стили для сообщений об ошибках */
.record-modal .invalid-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: #dc3545;
    display: none;
}

.record-modal .form-control.is-invalid,
.record-modal .form-select.is-invalid {
    border-color: #dc3545;
}

.record-modal .form-control.is-invalid ~ .invalid-feedback,
.record-modal .form-select.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Алерты */
.record-modal .alert {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.record-modal .alert-none {
    display: none;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.record-modal .modal-footer {
    flex-shrink: 0;
    padding: 12px 22px;
    border-top: 1px solid #eef0f3;
    background: #fbfbfd;
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-modal .modal-footer .btn {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 7px;
    font-weight: 500;
    transition: background 0.12s, box-shadow 0.12s;
    min-width: 0;
}

.record-modal .modal-footer .btn:hover {
    transform: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.record-modal .modal-footer .btn:active {
    transform: none;
}

/* Режимы просмотр / редактирование */
.record-modal .view-mode,
.record-modal .edit-mode {
    display: flex;
    gap: 8px;
    align-items: center;
}

.record-modal .edit-mode.d-none {
    display: none !important;
}

/* Кнопка «Редактировать» / «Сохранить» — indigo */
.record-modal .btn-edit,
.record-modal .btn-save {
    background: #4f46e5;
    border: none;
    color: #fff;
    font-weight: 600;
}

.record-modal .btn-edit:hover,
.record-modal .btn-save:hover {
    background: #4338ca;
    color: #fff;
}

/* Кнопка «Закрыть» / «Отмена» — ghost */
.record-modal .btn-secondary,
.record-modal .btn-cancel {
    background: transparent;
    border: 1px solid transparent;
    color: #475569;
}

.record-modal .btn-secondary:hover,
.record-modal .btn-cancel:hover {
    background: #f1f3f6;
    color: #334155;
}

/* Кнопка «Удалить» — красная, прижата влево */
.record-modal .btn-delete {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-weight: 600;
    margin-right: auto;
}

.record-modal .btn-delete:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Adaptive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .record-modal .modal-dialog {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .record-modal .field-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 4px 6px;
    }

    .record-modal .field-label {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: left;
        padding-right: 0;
        margin-bottom: 2px;
    }

    .record-modal .field-value {
        width: 100%;
    }

    .record-modal .nav-tabs {
        padding: 0 12px;
    }

    .record-modal .nav-tabs .nav-link {
        padding: 8px 10px;
        font-size: 12px;
    }

    .record-modal .tab-content {
        padding: 14px 14px;
    }

    .record-modal .modal-footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    .record-modal .modal-footer .btn {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .record-modal .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .record-modal .nav-tabs .nav-item {
        flex-shrink: 0;
    }

    .record-modal .modal-footer .view-mode,
    .record-modal .modal-footer .edit-mode {
        flex-wrap: wrap;
    }
}

/* ── Scrollbar ───────────────────────────────────────────────────────── */
.record-modal .modal-body::-webkit-scrollbar,
.record-modal .tab-content::-webkit-scrollbar {
    width: 5px;
}

.record-modal .modal-body::-webkit-scrollbar-track,
.record-modal .tab-content::-webkit-scrollbar-track {
    background: transparent;
}

.record-modal .modal-body::-webkit-scrollbar-thumb,
.record-modal .tab-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.record-modal .modal-body::-webkit-scrollbar-thumb:hover,
.record-modal .tab-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.record-modal .modal-body,
.record-modal .tab-content {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}


/* Более детальные стили для popup фильтра */
.filter-popup {
    position: absolute;
    inset: 0px 0px auto auto;
    margin: 0;
    padding: 16px !important;
    transform: translate(-116px, 55px);
    min-width: 300px;
    max-width: 350px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    z-index: 1000;
}

/* Заголовок истории */
.filter-history-title {
    display: block;
    margin-bottom: 12px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Контейнер истории */
.filter-history-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

/* Элементы истории с улучшенным дизайном */
.search-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: block;
    text-decoration: none;
    color: #2c3e50;
    font-size: 14px;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.history-item:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-item:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Поля ввода с улучшенными отступами */
.filter-field {
    margin: 5px;
}

.filter-field:last-of-type {
    margin-bottom: 20px;
}

/* Кастомные стили для полей ввода */
.filter-field .form-control,
.filter-field .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-field .form-control:focus,
.filter-field .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

/* Секция кнопки */
.filter-apply-section {
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.filter-apply-section .btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.filter-apply-section .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.filter-apply-section .btn:active {
    transform: translateY(0);
    box-shadow: none;
}



/* ===== СТАТУСЫ ПИСЕМ ДЛЯ КАРТОЧЕК ТРЕКЕРА ===== */

/* Базовый класс бейджа статуса */
.list-status.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 30px;
    line-height: 1;
    color: white;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
}

/* Доставлено (deliv) */
.list-status.badge-deliv {
    background-color: #2c8a4c;
    color: white;
}
.list-status.badge-deliv i {
    color: #b7ffb7;
}

/* В очереди (queue) */
.list-status.badge-queue {
    background-color: #ffb347;
    color: #1e1e1e;
}
.list-status.badge-queue i {
    color: #594300;
}

/* Спам */
.list-status.badge-spam {
    background-color: #b91c1c;
    color: white;
}
.list-status.badge-spam i {
    color: #ffe1e1;
}

/* Черный список */
.list-status.badge-black {
    background-color: #1e1e1e;
    color: white;
}
.list-status.badge-black i {
    color: #ff9999;
}

/* Спам-ловушка */
.list-status.badge-trap {
    background-color: #7d3c98;
    color: white;
}
.list-status.badge-trap i {
    color: #f0c0ff;
}

/* Ошибка доставки / Bounce */
.list-status.badge-bounce,
.list-status.badge-error {
    background-color: #c23b22;
    color: white;
}
.list-status.badge-bounce i,
.list-status.badge-error i {
    color: #ffd1c0;
}

/* Дефолтный статус (на случай отсутствия) */
.list-status.badge {
    background-color: #6c757d;
    color: white;
}


/* ===== ОДНОСТРОЧНАЯ КАРТОЧКА С РАСШИРЕНИЕМ ===== */

.list-card.compact-view {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
}

/* Основная строка карточки (всегда видима) */
.card-main-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
}

.list-card.compact-view:hover {
    background-color: rgba(232, 240, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Первая колонка: Статус и Дата */
.status-date-col {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-right: 12px;
    border-right: 1px solid #eee;
    min-width: 0;
}


.message-date {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

/* Вторая колонка: Контент */
.content-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 12px;
    overflow: hidden;
}

.main-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    overflow: hidden;
}

.address-text {
    display: block;
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.3;
}

.address-text:hover {
    text-decoration: underline;
    color: #0a58ca;
}

/* Новая колонка: Информация о времени обработки */
.info-col {
    flex: 0 0 130px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 0 12px;
    border-left: 1px solid #eee;
    min-width: 0;
}

/* Дата в info-col */
.info-item.date-info {
    font-size: 0.72rem;
    color: #6c757d;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Spam score — цветовая индикация */
.info-item.spam-score {
    font-size: 0.72rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.spam-score-low    { color: #198754; font-weight: 600; }
.spam-score-medium { color: #fd7e14; font-weight: 600; }
.spam-score-high   { color: #dc3545; font-weight: 700; }

.processing-time {
    font-size: 0.75rem;
    color: #2c8a4c;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.processing-time i {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Колонка действий */
.actions-col {
    flex: 0 0 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 12px;
    border-left: 1px solid #eee;
    flex-shrink: 0;
}

.message-actions-block {
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid #ced4da;
    color: #495057;
}

.dropdown-toggle:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* ===== РАСШИРЕННАЯ ЧАСТЬ КАРТОЧКИ (скрыта по умолчанию) ===== */
.card-expand-row {
    display: none;
    padding: 12px 15px 15px;
    background-color: #fafbfc;
    border-top: 1px dashed #dee2e6;
    width: 100%;
    box-sizing: border-box;
}

.list-card.compact-view.expanded .card-expand-row {
    display: block;
}

.status-details-container {
    width: 100%;
}

.status-details-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.status-details-header i {
    color: #6c757d;
    margin-right: 6px;
    font-size: 0.8rem;
}

.status-details-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-details-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #212529;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Скрываем оригинальный статус детали */
.status-details-row {
    display: none !important;
}

/* ===== ГАРАНТИЯ, ЧТО КАРТОЧКА НЕ ВЫХОДИТ ЗА ГРАНИЦЫ ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cards-container,
#recent-list-card .cards-container,
.table-responsive .cards-container {
    width: 100%;
    box-sizing: border-box;
}

.list-card.compact-view,
.card-main-row,
.card-expand-row {
    max-width: 100%;
    box-sizing: border-box;
}


/* Тема — растягивается на оставшееся место, не выталкивает другие колонки */
.subject-field {
    flex: 1 1 180px;
    min-width: 120px;
    overflow: hidden;
}

.sender-field .domain { color: #0000cc; }
.recipient-field .address { color: #D30C05; }

/* Фиксируем ширины статичных колонок; subject — flex:1, занимает остаток */
@media (min-width: 1200px) {
    .status-date-col { flex: 0 0 140px; }
    .sender-field    { flex: 0 0 220px; min-width: 220px; }
    .recipient-field { flex: 0 0 160px; min-width: 160px; }
    .info-col        { flex: 0 0 130px; }
    .actions-col     { flex: 0 0 60px; }
}

@media (max-width: 1199px) and (min-width: 992px) {
    .status-date-col { flex: 0 0 120px; }
    .sender-field    { flex: 0 0 180px; min-width: 180px; }
    .recipient-field { flex: 0 0 140px; min-width: 140px; }
    .info-col        { flex: 0 0 110px; }
}



.alert{padding:10px 18px; font-size:13px; line-height:18px; margin:0 0 20px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; text-shadow:0 1px rgba(255, 255, 255, .3)}
.alert-success{color: #468847;background-color: #DFF0D8;border-color: #D6E9C6;}
.alert-info{color: #3A87AD; background-color: #D9EDF7;border-color: #BCE8F1;}
.alert-warning{color:#C09853;background-color:#FCF8E3;border: 1px solid #FBEED5}
.alert-error{color: #B94A48;background-color: #F2DEDE;border: 1px solid #EED3D7;}
.alert-black{color: #fff;background-color: #2f353b;border-color: #000;}
.alert-black a{color: #fff; border-bottom: dashed 1px #fff;}
.alert-white{color: #fff;background-color: #007ee6;border-color: #1373b5;}
.alert-disable{color: #fff;background-color: grey;border-color: grey;}
.alert-disable span.alert{padding:0px; color: white}
.alert-none{display:none;}




.info-col {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    border-left: 1px solid #eee;
    min-width: 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-item i {
    font-size: 0.8rem;
    color: #6c757d;
    flex-shrink: 0;
    width: 14px;
}

.info-item .info-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-item .info-text strong {
    font-weight: 600;
    color: #0d6efd;
}

/* Специфичные цвета */
.date-info i { color: #6c757d; }
.processing-time i { color: #28a745; }
.spam-score i { color: #dc3545; }

/* Адаптивность */
@media (max-width: 768px) {
    .info-col {
        flex: 0 0 100%;
        border-left: none;
        border-top: 1px solid #eee;
        margin-top: 8px;
        padding-top: 8px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .info-item {
        flex: 1 0 auto;
    }
}


/* Адаптация для мобильных */
@media (max-width: 768px) {
    .sender-field {
        min-width: 100%;
        max-width: 100%;
    }
    
    .sender-details {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 8px;
    }
    
    .sender-name {
        font-size: 0.85rem;
    }
    
    .sender-address {
        font-size: 0.75rem;
    }
}

/* Для очень узких экранов */
@media (max-width: 480px) {
    .sender-details {
        flex-direction: column;
        gap: 2px;
    }
}


/* ===== СТИЛИ ДЛЯ КАРТОЧКИ ПИСЬМА В МОДАЛЬНОМ ОКНЕ ===== */

/* Заголовок с темой письма */
.email-subject-card .subject-link {
    color: #0d6efd;
    font-weight: 500;
    transition: color 0.2s ease;
}

.email-subject-card .subject-link:hover {
    color: #0a58ca;
    text-decoration: underline !important;
}

/* Кнопки действий в заголовке */
.email-subject-card .btn-outline-secondary {
    border-color: #dee2e6;
    background: transparent;
    transition: all 0.2s ease;
}

.email-subject-card .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}




/* ===== УЛУЧШЕННЫЕ СТИЛИ ДЛЯ DROPDOWN ===== */

/* Отключаем ограничение по родительскому контейнеру */
.dropdown-menu {
    position: fixed !important; /* Фиксированная позиция относительно окна */
    z-index: 9999 !important;   /* Максимальный z-index поверх всех элементов */
    max-height: 400px;
    overflow-y: auto;
    min-width: 280px;
    max-width: 400px;
    margin: 2px 0 0 !important;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25) !important;
    background: #2f353b; /* Темный фон для dropdown-menu-dark */
    color: white;
    transform: none !important; /* Отключаем трансформацию от Bootstrap */
    inset: auto !important; /* Отключаем автоматическое позиционирование */
    top: auto !important;
    left: auto !important;
}

/* Светлая тема для dropdown (если нужна) */
.dropdown-menu:not(.dropdown-menu-dark) {
    background: white;
    color: #212529;
}

/* Стили для темного dropdown */
.dropdown-menu-dark {
    background: #2f353b;
    border-color: #495057;
}

/* Заголовок в dropdown */
.dropdown-menu .dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Разделитель */
.dropdown-divider {
    margin: 0.3rem 0;
    border-top: 1px solid #495057;
}

.dropdown-menu-dark .dropdown-divider {
    border-top-color: #6c757d;
}

/* Элементы dropdown */
.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: normal; /* Разрешаем перенос текста */
    word-break: break-word;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.dropdown-menu-dark .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
}

.dropdown-menu-dark .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.dropdown-item:active {
    background: #0d6efd;
    color: white;
}

/* Кнопки открытия dropdown */
.dropdown-btn {
    padding: 0.15rem 0.4rem !important;
    font-size: 0.8rem !important;
    line-height: 1.2;
    border-radius: 4px;
    transition: all 0.15s ease;
}


/* Класс для позиционирования dropdown */
.dropdown {
    position: relative;
}

/* JavaScript обработчик для позиционирования */
.dropdown-menu.position-fixed {
    position: fixed !important;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed !important;
        left: 5% !important;
        right: 5% !important;
        width: 90% !important;
        max-width: 90%;
        max-height: 60vh;
        transform: none !important;
        margin: 0 auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .dropdown-menu {
        left: 2% !important;
        right: 2% !important;
        width: 96% !important;
    }
}


/* Основная карточка с информацией */
.info-card {
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Строки с информацией */
.info-row {
    display: flex;
    align-items: stretch;
    min-height: 42px;
    transition: background-color 0.15s ease;
}

.info-row:hover {
    background-color: rgba(0,0,0,0.02);
}

.info-row.border-bottom {
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}

/* Заголовок поля */
.info-label {
    width: 180px;
    flex-shrink: 0;
    background-color: #f8f9fa;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.info-label i {
    color: #6c757d;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

/* Контейнер значения */
.info-value {
    flex: 1;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

/* Текст значения */
.info-text {
    color: #212529;
    font-size: 0.9rem;
    line-height: 1.4;
}

.info-text a {
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.2s ease;
}

.info-text a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* Контейнер для кнопок действий */
.info-actions {
    flex-shrink: 0;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 70px;
    justify-content: flex-end;
}

/* Кнопки действий в строках */
.btn-action-icon {
    padding: 0;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1;
    background: transparent;
    border: none;
    transition: color 0.2s ease;
}

.btn-action-icon:hover {
    color: #0d6efd;
}

.btn-action-icon.text-danger:hover {
    color: #dc3545 !important;
}

/* Иконки настроек (шестеренка, глобус) */
.settings-link {
    color: #6c757d;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.settings-link:hover {
    color: #0d6efd;
}

/* Стили для act-smid ссылок */
.act-smid {
    color: #0d6efd;
    text-decoration: none;
    border-bottom: 1px dashed #0d6efd;
}

.act-smid:hover {
    color: #0a58ca;
    border-bottom-color: #0a58ca;
}

/* Компактные алерты - улучшение существующих стилей */
.compact-alert {
    margin-bottom: 0.5rem;
    border-radius: 6px;
    overflow: hidden;
}

.compact-alert .alert-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.compact-alert .alert-header .alert-icon {
    font-size: 0.9rem;
}

.compact-alert .alert-items {
    padding: 0;
}

.compact-alert .alert-item {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.compact-alert .alert-item:first-child {
    border-top: none;
}

.compact-alert .item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.compact-alert .item-content {
    flex: 1;
    min-width: 0;
}

.compact-alert .item-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.compact-alert .item-type {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    color: rgba(255,255,255,0.9);
}

.compact-alert .item-value {
    font-weight: 500;
    font-size: 0.85rem;
}

.compact-alert .item-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255,255,255,0.3);
}

.compact-alert .item-link:hover {
    color: white;
    border-bottom-color: white;
}

.compact-alert .delete-btn {
    background: rgba(220,53,69,0.2);
    border: 1px solid rgba(220,53,69,0.3);
    color: #ffb8c6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-alert .delete-btn:hover {
    background: rgba(220,53,69,0.3);
    border-color: rgba(220,53,69,0.5);
}

.compact-alert .added-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
}

.compact-alert .rule-active {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Белый алерт */
.alert-white {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(13,110,253,0.2);
}

/* Статус доставки */
.delivery-status-alert {
    border-radius: 6px;
    border-left-width: 4px;
}

.delivery-status-alert.alert-success {
    border-left-color: #198754;
    background-color: #f0f9f0;
}

.delivery-status-alert pre {
    font-family: inherit;
    background: transparent !important;
    color: #2c3e50;
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 0.5rem 0 0 0;
    padding: 0;
}

.delivery-status-alert a {
    color: #0d6efd;
    text-decoration: none;
    border-bottom: 1px dashed #0d6efd;
}

.delivery-status-alert a:hover {
    color: #0a58ca;
    border-bottom-color: #0a58ca;
}

/* Адаптивность */
@media (max-width: 768px) {
    .info-row {
        flex-wrap: wrap;
    }
    
    .info-label {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        background-color: #f8f9fa;
    }
    
    .info-value {
        width: 100%;
        padding: 0.5rem;
    }
    
    .info-actions {
        width: 100%;
        justify-content: flex-start;
        padding-left: 0.5rem;
        border-top: 1px solid rgba(0,0,0,0.05);
    }
    
    .email-subject-card .d-flex {
        flex-wrap: wrap;
    }
    
    .email-subject-card .flex-shrink-0.ms-3 {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-start;
    }
}

/* Для очень узких экранов */
@media (max-width: 480px) {
    .info-value {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-meta {
        margin-left: 0;
    }
}



/* Контейнер логов */
.logs-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 4px;
    max-height: 500px;
    overflow-y: auto;
}

/* Элемент лога */
.log-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 6px 10px;
    line-height: 1.2;
}

/* Дата */
.log-date {
    display: inline-block;
    font-size: 0.75rem;
    color: #666;
    font-family: monospace;
    margin-right: 10px;
    white-space: nowrap;
}

/* Заголовок */
.log-title {
    display: inline;
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
}

/* Детали в pre */
.log-details {
    margin: 4px 0 0 0;
    padding: 6px 8px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #2c3e50;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

/* Ссылки внутри pre */
.log-details a {
    color: #0d6efd;
    text-decoration: none;
    border-bottom: 1px dashed #0d6efd;
}

/* Адаптивность */
@media (max-width: 768px) {
    .log-date {
        display: block;
        margin-bottom: 2px;
    }
    
    .log-title {
        display: block;
        margin-bottom: 4px;
    }
}

/* Узкий скроллбар */
.logs-container::-webkit-scrollbar {
    width: 4px;
}

.logs-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.logs-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}



/* ========== DOMAINS LIST CUSTOM STYLES ========== */

/* Карточки с эффектом наведения */
.list-card.hover-shadow {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.list-card.hover-shadow:hover {
    background-color: #f8f9ff !important;
    border-left-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Статусные бейджи */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-badge i {
    font-size: 1.2rem;
}

.status-badge.status-normal {
    color: #198754;
    background-color: #f0fff4;
}

.status-badge.status-failed {
    color: #dc3545;
    background-color: #fff0f0;
}

.status-badge.status-blocked {
    color: #6c757d;
    background-color: #f8f9fa;
}

/* Доменное имя */
.domain-name {
    font-size: 0.95rem;
    line-height: 1.3;
}

/* Сервер */
.server-name {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.server-name i {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Тип обучения */
.boxtype-text {
    font-size: 0.9rem;
}

/* Индикатор спама */
.spam-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.spam-indicator .badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Прогресс-бар спама (альтернатива) */
.spam-progress {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.spam-progress-bar {
    height: 100%;
    background-color: #ffc107;
    border-radius: 2px;
}

.spam-progress-bar.high {
    background-color: #dc3545;
}

.spam-progress-bar.low {
    background-color: #198754;
}

/* Количество ящиков */
.emailcnt-field .badge {
    font-size: 0.8rem;
    font-weight: normal;
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

/* Комментарий */
.comment-text {
    font-size: 0.85rem;
    color: #6c757d;
    max-width: 100%;
}

/* Кнопка действий без стрелки dropdown */
.dropdown-toggle-noarrow::after {
    display: none !important;
}

.dropdown-toggle-noarrow {
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.dropdown-toggle-noarrow:hover {
    background-color: #e9ecef;
}

/* Адаптация для мобильных */
@media (max-width: 1200px) {
    .server-field {
        width: 150px !important;
    }
    .boxtype-field {
        width: 120px !important;
    }
    .spamlevel-field {
        width: 80px !important;
    }
}

@media (max-width: 992px) {
    .comment-field {
        display: none;
    }
}

@media (max-width: 768px) {
    .server-field {
        display: none;
    }
    .boxtype-field {
        width: 100px !important;
    }
    .boxtype-field .boxtype-text {
        display: none;
    }
    .boxtype-field i {
        margin-right: 0 !important;
        font-size: 1.2rem;
    }
}

/* Анимации */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.status-failed .status-badge i {
    animation: pulse 2s infinite;
}

/* Стили для пагинации */
.pagination-container {
    background-color: white;
    border-top: 1px solid #dee2e6;
    padding: 0.5rem;
}

.pagination .page-link {
    border: none;
    color: #6c757d;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    color: white;
    border-radius: 4px;
}

.pagination .page-link:hover {
    background-color: #f0f0f0;
    border-radius: 4px;
}

/* Индикаторы типов */
.domain-field i.bi-envelope {
    transition: transform 0.2s;
}

.list-card:hover .domain-field i.bi-envelope {
    transform: scale(1.1);
    color: #0d6efd !important;
}

/* ===== СПИСОК ДОМЕНОВ ===== */

/* Статусные бейджи доменов */
.list-status.badge-domain-normal {
    background-color: #2c8a4c;
    color: #fff;
}
.list-status.badge-domain-blocked {
    background-color: #b91c1c;
    color: #fff;
}
.list-status.badge-domain-failed {
    background-color: #d97706;
    color: #fff;
}
.list-status.badge-domain-pending {
    background-color: #6b7280;
    color: #fff;
}
.list-status.badge-domain-trap {
    background-color: #7d3c98;
    color: #fff;
}

/* Статусы белых списков */
.list-status.badge-wl-any {
    background-color: #0891b2;
    color: #fff;
}
.list-status.badge-wl-domain {
    background-color: #1d4ed8;
    color: #fff;
}
.list-status.badge-wl-personal {
    background-color: #2c8a4c;
    color: #fff;
}
.list-status.badge-wl-blocked {
    background-color: #b91c1c;
    color: #fff;
}

/* Роль пользователя в списке */
.badge-user-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}
.badge-role-admin {
    background-color: #1d4ed8;
    color: #fff;
}
.badge-role-ib {
    background-color: #7d3c98;
    color: #fff;
}
.badge-role-tp {
    background-color: #0891b2;
    color: #fff;
}
.badge-role-user {
    background-color: #6b7280;
    color: #fff;
}

/* MX-колонка в списке доменов */
.mx-col {
    flex: 0 0 180px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 0 12px;
    border-left: 1px solid #e9ecef;
    font-size: 12px;
}
.mx-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 11px;
}
.mx-status.mx-ok   { color: #198754; }
.mx-status.mx-fail { color: #dc3545; }
.mx-status.mx-unknown { color: #6c757d; }
.mx-primary {
    font-size: 11px;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mx-backup {
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .mx-col { display: none; }
}

/* Статусы ящиков */
.list-status.badge-box-normal {
    background-color: #2c8a4c;
    color: #fff;
}
.list-status.badge-box-forward {
    background-color: #0891b2;
    color: #fff;
}
.list-status.badge-box-trap {
    background-color: #7d3c98;
    color: #fff;
}
.list-status.badge-box-unused {
    background-color: #6b7280;
    color: #fff;
}
.list-status.badge-box-personal {
    background-color: #0f766e;
    color: #fff;
}
.list-status.badge-box-free {
    background-color: #d97706;
    color: #fff;
}
.list-status.badge-box-nospam {
    background-color: #15803d;
    color: #fff;
}

/* Поле с именем домена и метаданными */
.domain-info-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 0;
    gap: 2px;
}

.domain-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.3;
}

.domain-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-comment {
    font-style: italic;
    opacity: 0.8;
}

/* Инфо-колонка для доменов */
.domain-info-field + .info-col .spam-info {
    font-size: 0.78rem;
}

/* Цветовые метки для спама */
.spam-indicator[data-value="0"] .badge {
    background-color: #6c757d !important;
    color: white !important;
}

.spam-indicator[data-value="100"] .badge {
    background-color: #dc3545 !important;
    color: white !important;
}

/* Разделители */
.list-card + .list-card {
    border-top: 1px solid #f0f0f0;
}

/* ── Footer layout helpers (view / edit modes) ───────────────────────── */
.record-modal .modal-footer .view-mode {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.record-modal .modal-footer .edit-mode {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Для обычных модальных окон (не только record-modal) */
.modal-header .btn-close-white {
    color: white;
}

/* Убираем лишние стили для кнопки закрытия */
.modal-header .btn-close:focus {
    box-shadow: none;
    outline: none;
}

/* Временная серость при загрузке пагинации */
.list-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.input-group .form-control,
.input-group .btn {
    border: 1px solid #6c757d !important;
}

.input-group .btn {
    border-left: none !important;
}

/* ── Boxes list: checkboxes ──────────────────────────────────────────── */

/* Блок «N выбрано + кнопка Удалить» — скрыт пока нет выбора */
.box-selection-info {
    display: none;
}

/* Колонка чекбокса — в строке и в заголовке */
.box-cb-col {
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Чекбокс в заголовке — всегда виден */
.box-cb-header {
    opacity: 1;
}

/* Чекбоксы в строках — скрыты по умолчанию */
.list-card .box-cb-col {
    opacity: 0;
    transition: opacity 0.12s;
    pointer-events: none;
}

/* Показывать при наведении на строку */
.list-card:hover .box-cb-col {
    opacity: 1;
    pointer-events: auto;
}

/* Показывать у выбранной строки */
.list-card.box-selected .box-cb-col {
    opacity: 1;
    pointer-events: auto;
}

/* Показывать у всех строк когда хотя бы одна выбрана */
.box-list-has-selection .list-card .box-cb-col {
    opacity: 1;
    pointer-events: auto;
}

/* Стиль выбранной строки */
.list-card.box-selected {
    background: rgba(79, 70, 229, 0.05) !important;
}

/* Чекбокс — стиль */
.box-cb,
.box-cb-all {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #4f46e5;
    margin: 0;
}

/* Строка card-main-row занимает оставшееся место */
.box-cb-col ~ .card-main-row {
    flex: 1 1 0;
    min-width: 0;
}


/* Специфично для ваших элементов */
.dropdown-menu-dark .dropdown-item,
.dropdown-menu .btn-action.dropdown-item {
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* При наведении показываем полный текст */
.dropdown-menu-dark .dropdown-item:hover,
.dropdown-menu .btn-action.dropdown-item:hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
    max-width: none;
    background-color: rgba(255, 255, 255, 0.15);
}

/* ============================================================
   Tracker list-area overflow fix
   Используем #recent-list-card (ID + class = высокая специфичность),
   чтобы переопределить общие .list-card .sender-field и т.д.
   ============================================================ */

/* Bootstrap .table-responsive даёт overflow-x:auto — убираем горизонтальный скролл */
#recent-list-card .table-responsive {
    overflow-x: hidden;
}

/* Каждая строка не шире контейнера */
#recent-list-card .list-card.compact-view {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Основная строка: flex, не выходит за границу */
#recent-list-card .card-main-row {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
    cursor: pointer;
    padding: 2px 2px 2px 2px; /* 12px слева — компенсация 4px бордюра */
}

/* Статус: фиксированная ширина, чтобы колонка не прыгала */
#recent-list-card .list-status.badge {
    width: 110px;
    flex-shrink: 0;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* content-col растягивается, min-width:0 обязателен для flex-shrink */
#recent-list-card .content-col {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}

/* main-info-row не переносится и не скроллится */
#recent-list-card .main-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
    flex-wrap: nowrap;
}

/* Отправитель: фиксированная ширина, может сжиматься */
#recent-list-card .sender-field {
    flex: 0 0 180px;
    min-width: 0;
    max-width: 180px;
    overflow: hidden;
    padding: 0 4px;
}

/* Тема: занимает оставшееся место */
#recent-list-card .subject-field {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#recent-list-card .subject-field > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Лог статуса под темой — вторая строка, приглушённая */
#recent-list-card .status-log-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.2;
    margin-top: 1px;
}

/* Получатель: фиксированная ширина, может сжиматься */
#recent-list-card .recipient-field {
    flex: 0 0 150px;
    min-width: 0;
    max-width: 150px;
    overflow: hidden;
    padding: 0 4px;
}

/* Только прямой дочерний span (text-truncate) — блочный с ellipsis */
#recent-list-card .recipient-field > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Вложенные span (address, domain, @) — остаются инлайн */
#recent-list-card .recipient-field > span span,
#recent-list-card .recipient-field > span .address,
#recent-list-card .recipient-field > span .domain {
    display: inline;
    overflow: visible;
    white-space: inherit;
}

/* Текстовые строки отправителя */
#recent-list-card .sender-name,
#recent-list-card .sender-address {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* info-col: правая колонка с датой/скором, строго фиксирована */
#recent-list-card .info-col {
    flex: 0 0 170px;
    width: 170px;
    min-width: 0;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0 6px;
}

/* На экранах < 992px: скрываем recipient, уменьшаем sender */
@media (max-width: 991.98px) {
    #recent-list-card .recipient-field {
        display: none;
    }
    #recent-list-card .sender-field {
        flex: 0 0 140px;
        max-width: 140px;
    }
    #recent-list-card .info-col {
        flex: 0 0 150px;
        width: 150px;
    }
}

/* На экранах < 576px: скрываем и sender, оставляем только статус + тема */
@media (max-width: 575.98px) {
    #recent-list-card .sender-field {
        display: none;
    }
    #recent-list-card .info-col {
        flex: 0 0 130px;
        width: 130px;
    }
}

/* На больших экранах (≥1200px): шире поля, используем доступное пространство */
@media (min-width: 1200px) {
    #recent-list-card .sender-field {
        flex: 0 0 240px;
        max-width: 240px;
    }
    #recent-list-card .recipient-field {
        flex: 0 0 190px;
        max-width: 190px;
    }
    #recent-list-card .info-col {
        flex: 0 0 190px;
        width: 190px;
    }
}

/* Высота карточки трекера */
#recent-list-card {
    height: calc(100vh - 280px);
}

/* Прокручиваемая область списка */
#recent-list-card .card-body > .flex-grow-1 {
    overflow-y: auto;
    min-height: 0;
}

/* Колонка статус + дата: две строки */
#recent-list-card .list-status {
    width: 155px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
}

/* Кнопка-пилюля статуса — на всю ширину колонки, содержимое по центру */
#recent-list-card .tracker-status-pill {
    font-size: 0.72rem;
    line-height: 1.4;
    width: 100%;
    overflow: hidden;
    justify-content: center;
}

/* Текст внутри кнопки — обрезается */
#recent-list-card .tracker-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Строка даты под кнопкой */
#recent-list-card .tracker-status-date {
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 2px;
}

/* Кнопка "все получатели" */
#recent-list-card .btn-rcpt-toggle {
    font-size: 0.72rem;
    line-height: 1;
}

/* Строки развёрнутого списка получателей */
#recent-list-card .rcpt-list > div {
    font-size: 0.75rem;
}
#recent-list-card .rcpt-list .bi-person-fill {
    font-size: 0.65rem;
}

/* ============================================================
   Цветной левый бордюр карточки трекера по статусу письма
   ============================================================ */

#recent-list-card .list-card.compact-view {
    border-left: 4px solid #e4e4e4; /* дефолт — серый */
}

#recent-list-card .list-card.compact-view.status-deliv {
    border-left-color: #c4dece;
}

#recent-list-card .list-card.compact-view.status-queue {
    border-left-color: #f8e4bc;
}

#recent-list-card .list-card.compact-view.status-spam {
    border-left-color: #f2c8c8;
}

#recent-list-card .list-card.compact-view.status-black {
    border-left-color: #c8c8c8;
}

#recent-list-card .list-card.compact-view.status-trap {
    border-left-color: #dccce4;
}

#recent-list-card .list-card.compact-view.status-bounce,
#recent-list-card .list-card.compact-view.status-error {
    border-left-color: #ecc8bc;
}

/* Hover: бордюр чуть темнее */
#recent-list-card .list-card.compact-view.status-deliv:hover  { border-left-color: #a8cdb8; }
#recent-list-card .list-card.compact-view.status-spam:hover   { border-left-color: #f2c8c8; }
#recent-list-card .list-card.compact-view.status-queue:hover  { border-left-color: #f5d49a; }
#recent-list-card .list-card.compact-view.status-black:hover  { border-left-color: #aaa; }
#recent-list-card .list-card.compact-view.status-trap:hover   { border-left-color: #ccb0d8; }
#recent-list-card .list-card.compact-view.status-bounce:hover,
#recent-list-card .list-card.compact-view.status-error:hover  { border-left-color: #e0aa98; }

/* Кастомный бейдж для спама/ловушки/bounce в трекере */
.badge.tracker-spam {
    background-color: #B94A48;
    color: #fcf5f5;
}

/* Цвет status-log-text по статусу карточки */
#recent-list-card .list-card.compact-view.status-spam   .status-log-text { color: #B94A48 !important; }
#recent-list-card .list-card.compact-view.status-error  .status-log-text { color: #c23b22 !important; }
#recent-list-card .list-card.compact-view.status-bounce .status-log-text { color: #c23b22 !important; }
#recent-list-card .list-card.compact-view.status-trap   .status-log-text { color: #7d3c98 !important; }
#recent-list-card .list-card.compact-view.status-black  .status-log-text { color: #555    !important; }
#recent-list-card .list-card.compact-view.status-queue  .status-log-text { color: #e69500 !important; }
#recent-list-card .list-card.compact-view.status-deliv  .status-log-text { color: #2c8a4c !important; }


/* ── Трекер: мобильная оптимизация ──────────────────────────────── */
@media (max-width: 768px) {

  /* Карточка-строка: вертикальный стек */
  .main-info-row {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    align-items: stretch !important;
  }

  /* Порядок строк */
  .tracker-row-status    { order: 1; }
  .tracker-row-subject   { order: 2; }
  .tracker-row-sender    { order: 3; }
  .tracker-row-recipient { order: 4; }
  .tracker-row-status-text { order: 5; display: flex !important; align-items: center; }

  /* Строка 1: статус + дата в одну линию */
  .tracker-row-status {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .tracker-row-status .tracker-status-date {
    font-size: 0.78rem;
    white-space: nowrap;
  }

  /* Строки 2–4: полная ширина */
  .tracker-row-subject,
  .tracker-row-sender,
  .tracker-row-recipient {
    width: 100%;
    min-width: 0;
  }

  /* Скрываем время обработки и spam score */
  .tracker-info-col {
    display: none !important;
  }

  /* Карточка компактнее */
  .list-card.compact-view {
    padding: 8px 10px;
  }

  .card-main-row {
    flex-wrap: nowrap;
  }
}

/* ============================================================
   Tracker: кнопка масштаба — превью-иконки в dropdown
   ============================================================ */

/* Иконка-превью: три горизонтальные полоски разной плотности */
.scale-preview-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 22px;
    height: 14px;
    border-radius: 1px;
    background-repeat: repeat-y;
    opacity: 0.65;
}

/* Разная высота полоски и промежутка = разная плотность */
.scale-preview-icon.sp1 {
    background-image: repeating-linear-gradient(
        to bottom,
        #495057 0, #495057 1px,
        transparent 1px, transparent 3px
    );
}
.scale-preview-icon.sp2 {
    background-image: repeating-linear-gradient(
        to bottom,
        #495057 0, #495057 2px,
        transparent 2px, transparent 5px
    );
}
.scale-preview-icon.sp3 {
    background-image: repeating-linear-gradient(
        to bottom,
        #495057 0, #495057 2px,
        transparent 2px, transparent 7px
    );
}
.scale-preview-icon.sp4 {
    background-image: repeating-linear-gradient(
        to bottom,
        #495057 0, #495057 3px,
        transparent 3px, transparent 9px
    );
}
.scale-preview-icon.sp5 {
    background-image: repeating-linear-gradient(
        to bottom,
        #495057 0, #495057 4px,
        transparent 4px, transparent 12px
    );
}

/* Активная опция в меню */
.tracker-scale-menu .scale-opt.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    font-weight: 600;
}
.tracker-scale-menu .scale-opt.active .scale-preview-icon {
    opacity: 1;
    filter: none;
    background-image: repeating-linear-gradient(
        to bottom,
        #4338ca 0, #4338ca var(--sp-bar),
        transparent var(--sp-bar), transparent var(--sp-period)
    );
}
.tracker-scale-menu .scale-opt[data-scale="1"].active .scale-preview-icon { --sp-bar:1px; --sp-period:3px; }
.tracker-scale-menu .scale-opt[data-scale="2"].active .scale-preview-icon { --sp-bar:2px; --sp-period:5px; }
.tracker-scale-menu .scale-opt[data-scale="3"].active .scale-preview-icon { --sp-bar:2px; --sp-period:7px; }
.tracker-scale-menu .scale-opt[data-scale="4"].active .scale-preview-icon { --sp-bar:3px; --sp-period:9px; }
.tracker-scale-menu .scale-opt[data-scale="5"].active .scale-preview-icon { --sp-bar:4px; --sp-period:12px; }

/* Активна кнопка масштаба — подсвечиваем */
.btn-tracker-scale.scale-active {
    background-color: rgba(99, 102, 241, 0.08);
    border-color: #a5b4fc;
    color: #4338ca;
}

/* ============================================================
   Tracker: 5 уровней масштабирования строк
   Класс .tracker-scale-N вешается на #recent-list-card
   Масштаб 3 = текущий дефолт, без переопределений
   ============================================================ */

/* ── Масштаб 1: Минимальный ──────────────────────────────────── */
#recent-list-card.tracker-scale-1 .card-main-row {
    padding-top: 1px;
    padding-bottom: 1px;
}
#recent-list-card.tracker-scale-1 .list-card.compact-view {
    margin-bottom: 1px !important;
}
#recent-list-card.tracker-scale-1 .list-status {
    width: 130px;
}
#recent-list-card.tracker-scale-1 .tracker-status-pill {
    font-size: 0.60rem;
}
#recent-list-card.tracker-scale-1 .tracker-status-date {
    font-size: 0.60rem;
}
#recent-list-card.tracker-scale-1 .sender-name,
#recent-list-card.tracker-scale-1 .sender-address {
    font-size: 0.60rem;
}
#recent-list-card.tracker-scale-1 .subject-field > span,
#recent-list-card.tracker-scale-1 .status-log-text {
    font-size: 0.60rem;
}
#recent-list-card.tracker-scale-1 .sender-field {
    flex: 0 0 156px;
    max-width: 156px;
}
#recent-list-card.tracker-scale-1 .recipient-field {
    flex: 0 0 132px;
    max-width: 132px;
    font-size: 0.60rem;
}
#recent-list-card.tracker-scale-1 .info-col {
    flex: 0 0 150px;
    width: 150px;
    font-size: 0.60rem;
}

/* ── Масштаб 2: Мелкий ───────────────────────────────────────── */
#recent-list-card.tracker-scale-2 .card-main-row {
    padding-top: 4px;
    padding-bottom: 4px;
}
#recent-list-card.tracker-scale-2 .list-card.compact-view {
    margin-bottom: 1px !important;
}
#recent-list-card.tracker-scale-2 .list-status {
    width: 156px;
}
#recent-list-card.tracker-scale-2 .tracker-status-pill {
    font-size: 0.66rem;
}
#recent-list-card.tracker-scale-2 .tracker-status-date {
    font-size: 0.66rem;
}
#recent-list-card.tracker-scale-2 .sender-name,
#recent-list-card.tracker-scale-2 .sender-address {
    font-size: 0.68rem;
}
#recent-list-card.tracker-scale-2 .subject-field > span,
#recent-list-card.tracker-scale-2 .status-log-text {
    font-size: 0.68rem;
}
#recent-list-card.tracker-scale-2 .sender-field {
    flex: 0 0 186px;
    max-width: 186px;
}
#recent-list-card.tracker-scale-2 .recipient-field {
    flex: 0 0 156px;
    max-width: 156px;
    font-size: 0.68rem;
}
#recent-list-card.tracker-scale-2 .info-col {
    flex: 0 0 180px;
    width: 180px;
    font-size: 0.68rem;
}

/* ── Масштаб 3: Средний (дефолт) ─────────────────────────────── */
#recent-list-card.tracker-scale-3 .card-main-row {
    padding-top: 8px;
    padding-bottom: 8px;
}
#recent-list-card.tracker-scale-3 .list-card.compact-view {
    margin-bottom: 2px !important;
}

/* ── Масштаб 4: Крупный ──────────────────────────────────────── */
#recent-list-card.tracker-scale-4 .card-main-row {
    padding-top: 9px;
    padding-bottom: 9px;
}
#recent-list-card.tracker-scale-4 .list-card.compact-view {
    margin-bottom: 3px !important;
}
#recent-list-card.tracker-scale-4 .list-status {
    width: 178px;
}
#recent-list-card.tracker-scale-4 .tracker-status-pill {
    font-size: 0.83rem;
}
#recent-list-card.tracker-scale-4 .tracker-status-date {
    font-size: 0.83rem;
}
#recent-list-card.tracker-scale-4 .sender-name,
#recent-list-card.tracker-scale-4 .sender-address {
    font-size: 0.86rem;
}
#recent-list-card.tracker-scale-4 .subject-field > span,
#recent-list-card.tracker-scale-4 .status-log-text {
    font-size: 0.86rem;
}
#recent-list-card.tracker-scale-4 .sender-field {
    flex: 0 0 208px;
    max-width: 208px;
}
#recent-list-card.tracker-scale-4 .recipient-field {
    flex: 0 0 170px;
    max-width: 170px;
    font-size: 0.86rem;
}
#recent-list-card.tracker-scale-4 .info-col {
    flex: 0 0 192px;
    width: 192px;
    font-size: 0.86rem;
}

/* ── Масштаб 5: Максимальный ─────────────────────────────────── */
#recent-list-card.tracker-scale-5 .card-main-row {
    padding-top: 12px;
    padding-bottom: 12px;
}
#recent-list-card.tracker-scale-5 .list-card.compact-view {
    margin-bottom: 4px !important;
}
#recent-list-card.tracker-scale-5 .list-status {
    width: 200px;
}
#recent-list-card.tracker-scale-5 .tracker-status-pill {
    font-size: 0.95rem;
}
#recent-list-card.tracker-scale-5 .tracker-status-date {
    font-size: 0.95rem;
}
#recent-list-card.tracker-scale-5 .sender-name,
#recent-list-card.tracker-scale-5 .sender-address {
    font-size: 1rem;
}
#recent-list-card.tracker-scale-5 .subject-field > span,
#recent-list-card.tracker-scale-5 .status-log-text {
    font-size: 1rem;
}
#recent-list-card.tracker-scale-5 .sender-field {
    flex: 0 0 235px;
    max-width: 235px;
}
#recent-list-card.tracker-scale-5 .recipient-field {
    flex: 0 0 192px;
    max-width: 192px;
    font-size: 1rem;
}
#recent-list-card.tracker-scale-5 .info-col {
    flex: 0 0 215px;
    width: 215px;
    font-size: 1rem;
}


/* Кнопка добавления в чёрный список — цвет как у dropdown-menu-dark */
.btn-blacklist-spz {
    background-color: #343a40 !important;
    border-color: #343a40 !important;
    color: #fff !important;
}
.btn-blacklist-spz:hover,
.btn-blacklist-spz:focus,
.btn-blacklist-spz:active {
    background-color: #343a40 !important;
    border-color: #343a40 !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* Кнопка добавления в белый список */
.btn-whitelist-spz {
    background-color: #fff !important;
    border-color: #6c757d !important;
    color: #6c757d !important;
}
.btn-whitelist-spz:hover,
.btn-whitelist-spz:focus,
.btn-whitelist-spz:active {
    background-color: #fff !important;
    border-color: #6c757d !important;
    color: #6c757d !important;
    box-shadow: none !important;
}

/* Dropdown пересылки — открывается вверх, одна строка */
.fwd-dropdown .dropdown-menu {
    top: auto !important;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 0.125rem;
    min-width: 0;
    width: max-content;
}

/* Строка пары шлюзов (#page/gateways) — целиком кликабельна, открывает
   попап настроек (см. gatewayEditModal / openGatewayEditModal в init.js). */
.gateways-row {
    cursor: pointer;
}
.gateways-row:hover {
    background-color: rgba(0, 0, 0, 0.035);
}
.gateways-chart-cell {
    position: relative;
    width: 100%;
}
.gateways-chart-cell canvas {
    width: 100% !important;
    height: 100% !important;
}
