/**
 * Стили для нового личного кабинета пользователя CTR LAB
 * Шрифты: заголовки 32px, текст 24px (изменено на 14px для всего кабинета)
 */

/* ============================================
   ОСНОВНЫЕ СТИЛИ
   ============================================ */

.ctr-lab-new-dashboard {
    display: flex;
    min-height: 100vh;
    background: #f5f5f5;
    font-size: 14px;
}

.ctr-lab-new-dashboard h1,
.ctr-lab-new-dashboard h2,
.ctr-lab-new-dashboard h3 {
    font-size: 14px;
    font-weight: 600;
}

.ctr-lab-new-dashboard p,
.ctr-lab-new-dashboard span,
.ctr-lab-new-dashboard div,
.ctr-lab-new-dashboard a,
.ctr-lab-new-dashboard li,
.ctr-lab-new-dashboard td,
.ctr-lab-new-dashboard th,
.ctr-lab-new-dashboard label,
.ctr-lab-new-dashboard input,
.ctr-lab-new-dashboard select,
.ctr-lab-new-dashboard textarea,
.ctr-lab-new-dashboard button {
    font-size: 14px;
}

/* ============================================
   БОКОВОЕ МЕНЮ
   ============================================ */

.ctr-lab-sidebar {
    width: 250px;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    transition: width 0.3s;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.ctr-lab-sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 14px;
    color: #0073aa;
    white-space: nowrap;
    overflow: hidden;
}

.ctr-lab-sidebar.collapsed .sidebar-header h2 {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: transform 0.3s;
}

.ctr-lab-sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar-menu {
    flex: 1;
    padding: 10px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: #f9f9f9;
    color: #0073aa;
}

.menu-item.active {
    background: #f0f7fc;
    color: #0073aa;
    border-left-color: #0073aa;
}

.menu-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.ctr-lab-sidebar.collapsed .menu-item .menu-text {
    display: none;
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================ */

.ctr-lab-main-content {
    flex: 1;
    padding: 8px 15px;
    overflow-x: hidden;
}

.ctr-lab-page {
    display: none;
}

.ctr-lab-page.active {
    display: block;
}

.page-header {
    margin-bottom: 10px;
}

.page-header h1 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* ============================================
   ПОКАЗАТЕЛИ ДАШБОРДА
   ============================================ */

.dashboard-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.indicator-card {
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.indicator-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
    line-height: 1.2;
}

.indicator-value {
    font-size: 16px;
    font-weight: 700;
    color: #0073aa;
    line-height: 1.2;
}

/* ============================================
   ДЕЙСТВИЯ ДАШБОРДА
   ============================================ */

.dashboard-actions {
    margin-bottom: 10px;
}

/* ============================================
   БЛОКИ ПРОЕКТОВ
   ============================================ */

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.project-block {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: move;
    min-width: 0;
    max-width: 100%;
}

.project-block:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.project-block.dragging {
    opacity: 0.5;
}

.project-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    min-width: 0;
}

.project-drag-handle {
    cursor: grab;
    color: #999;
    padding: 2px;
}

.project-drag-handle .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.project-drag-handle:active {
    cursor: grabbing;
}

.project-main-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.project-domain {
    margin: 0 0 2px 0;
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-domain a {
    color: #0073aa;
    text-decoration: none;
}

.project-domain a:hover {
    text-decoration: underline;
}

.project-creator {
    font-size: 10px;
    color: #999;
    line-height: 1.2;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    transition: color 0.3s;
}

.action-btn:hover {
    color: #0073aa;
}

.action-btn.delete-project:hover {
    color: #dc3232;
}

.action-btn.permanently-delete-project {
    color: #d63638;
}

.action-btn.permanently-delete-project:hover {
    color: #b52727;
}

.action-btn.restore-project:hover {
    color: #46b450;
}

.archived-project .project-domain a {
    pointer-events: none;
    cursor: default;
    opacity: 0.6;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.action-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.project-block-body {
    padding: 8px 12px;
    min-width: 0;
}

.project-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    min-width: 0;
}

.stat-item {
    display: flex;
    gap: 3px;
    min-width: 0;
}

.stat-label {
    font-size: 10px;
    color: #999;
    line-height: 1.1;
}

.stat-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.stat-item.stat-improved .stat-value {
    color: #46b450;
}

.stat-item.stat-degraded .stat-value {
    color: #dc3232;
}

.empty-projects {
    text-align: center;
    padding: 30px 15px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.empty-projects p {
    margin: 0 0 12px 0;
    color: #999;
    font-size: 13px;
}

/* ============================================
   КНОПКИ
   ============================================ */

.ctr-lab-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1.3;
}

.ctr-lab-btn-primary {
    background: #0073aa;
    color: #fff;
}

.ctr-lab-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.ctr-lab-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.ctr-lab-btn-secondary:hover {
    background: #e0e0e0;
}

.ctr-lab-btn .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/* ============================================
   МОДАЛЬНЫЕ ОКНА
   ============================================ */

.ctr-lab-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.ctr-lab-modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

/* Таблица CTR в настройках аналитики: 10 столбцов, цифра и поле в одну строку */
.ctr-table-grid-10col {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.4rem 0.6rem;
    margin-top: 1rem;
    max-width: 100%;
}

.ctr-table-grid-10col .ctr-table-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    min-width: 0;
}

.ctr-table-grid-10col .ctr-table-cell .ctr-position-label {
    display: inline !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    font-weight: 600;
    min-width: auto;
    width: auto;
    text-align: right;
    color: #555;
    font-size: 13px;
    flex-shrink: 0;
}

.ctr-table-grid-10col .ctr-table-cell .ctr-value-input {
    width: 4.5em;
    min-width: 0;
    max-width: 100%;
    padding: 0.3rem 0.4rem;
    font-size: 13px;
    flex: 1;
    box-sizing: border-box;
}

.ctr-lab-input,
.ctr-lab-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.ctr-lab-input:focus,
.ctr-lab-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.form-actions .ctr-lab-btn {
    min-width: 120px;
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0;
}

/* ============================================
   УПРАВЛЕНИЕ КАБИНЕТОМ
   ============================================ */

.management-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.management-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.balance-amount {
    font-size: 24px;
    font-weight: 600;
    color: #0073aa;
}

.current-tariff {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.tariffs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tariff-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.tariff-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 8px rgba(0,115,170,0.2);
}

.tariff-card.current {
    border-color: #0073aa;
    background: #f0f8ff;
}

.tariff-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.tariff-price {
    font-size: 24px;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 15px;
}

.tariff-features {
    margin-bottom: 20px;
    text-align: left;
}

.tariff-features p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

/* ============================================
   ДОСТУПЫ К ПРОЕКТАМ
   ============================================ */

.access-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.access-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.accounts-list,
.project-accesses-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.account-item,
.access-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.account-info,
.access-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.account-info strong,
.access-info strong {
    font-size: 16px;
    color: #333;
}

.account-email,
.access-user,
.access-level {
    font-size: 14px;
    color: #666;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .ctr-lab-sidebar {
        position: fixed;
        left: -250px;
        z-index: 1000;
        height: 100vh;
    }
    
    .ctr-lab-sidebar.active {
        left: 0;
    }
    
    .ctr-lab-main-content {
        padding: 15px;
    }
    
    .dashboard-indicators {
        grid-template-columns: 1fr;
    }
    
    .project-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tariffs-list {
        grid-template-columns: 1fr;
    }
    
    .account-item,
    .access-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* ============================================
   СТИЛИ ДЛЯ СБОРА ПОЗИЦИЙ
   ============================================ */

.action-btn.collect-positions-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #2271b1;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.3s, opacity 0.3s;
}

.action-btn.collect-positions-btn:hover {
    background: #135e96;
    color: #fff;
}

.action-btn.collect-positions-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn.collect-positions-btn .btn-text {
    font-size: 13px;
}

.action-btn.collect-positions-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.collect-positions-status {
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.collect-positions-status .status-info {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.collect-positions-status .status-progress {
    flex: 1;
    min-width: 0;
}

.collect-positions-status .progress-bar-wrapper {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 5px;
    position: relative;
}

.collect-positions-status .progress-bar {
    background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 0;
}

.collect-positions-status .status-message {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.collect-positions-status .last-collect-date {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.collect-positions-status .last-collect-date .date-label {
    color: #999;
}

.collect-positions-status .last-collect-date .date-value {
    font-weight: 600;
    color: #333;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.action-btn.collect-positions-btn .dashicons-update-alt {
    animation: spin 1s linear infinite;
}

.action-btn.cancel-collect-positions-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #dc3232;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.3s, opacity 0.3s;
}

.action-btn.cancel-collect-positions-btn:hover {
    background: #b52727;
    color: #fff;
}

.action-btn.cancel-collect-positions-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn.cancel-collect-positions-btn .btn-text {
    font-size: 13px;
}

.action-btn.cancel-collect-positions-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.action-btn.remove-from-queue-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f0b849;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.3s, opacity 0.3s;
}

.action-btn.remove-from-queue-btn:hover {
    background: #d4a03a;
    color: #fff;
}

.action-btn.remove-from-queue-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn.remove-from-queue-btn .btn-text {
    font-size: 13px;
}

.action-btn.remove-from-queue-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================
   ВЫПАДАЮЩЕЕ МЕНЮ ОТМЕНЫ ДЕЙСТВИЙ (таблица запросов)
   ============================================ */

.ctr-lab-undo-dropdown {
    position: fixed !important;
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    width: 320px;
    z-index: 999999;
    animation: ctr-lab-undo-slideDown 0.15s ease-out;
    overflow: hidden;
    margin-top: 4px;
}

@keyframes ctr-lab-undo-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ctr-lab-undo-dropdown-header {
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
    background: #f6f7f7;
    background-color: #f6f7f7;
}

.ctr-lab-undo-dropdown-title {
    font-size: 12px;
    font-weight: 600;
    color: #50575e;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ctr-lab-undo-actions-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    background-color: #fff;
}

.ctr-lab-undo-actions-list::-webkit-scrollbar {
    width: 6px;
}

.ctr-lab-undo-actions-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ctr-lab-undo-actions-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ctr-lab-undo-actions-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.ctr-lab-undo-action-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    background-color: #fff;
    position: relative;
}

.ctr-lab-undo-action-item:hover {
    background: #f0f6fc;
    border-color: #2271b1;
    box-shadow: 0 1px 3px rgba(34, 113, 177, 0.1);
}

.ctr-lab-undo-action-item:last-child {
    margin-bottom: 0;
}

.ctr-lab-undo-action-item.ctr-lab-undo-action-latest {
    border-color: #2271b1;
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

.ctr-lab-undo-action-item.ctr-lab-undo-action-latest:hover {
    background: #e6f2ff;
    border-color: #135e96;
}

.ctr-lab-undo-action-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.ctr-lab-undo-action-item.ctr-lab-undo-action-latest .ctr-lab-undo-action-number {
    background: #135e96;
    box-shadow: 0 2px 4px rgba(19, 94, 150, 0.3);
}

.ctr-lab-undo-action-icon {
    font-size: 18px;
    color: #2271b1;
    margin-right: 12px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.ctr-lab-undo-action-text {
    font-size: 14px;
    color: #333;
    flex: 1;
    min-width: 0;
}

.ctr-lab-undo-action-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #2271b1;
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .ctr-lab-undo-dropdown {
        min-width: 280px;
        max-width: 90vw;
    }

    .ctr-lab-undo-dropdown-header {
        padding: 10px 14px;
    }

    .ctr-lab-undo-actions-list {
        padding: 6px;
    }

    .ctr-lab-undo-action-item {
        padding: 10px 12px;
    }

    .ctr-lab-undo-action-text {
        font-size: 13px;
    }
}


