/**
 * Стили Dashboard
 * @version 1.0.1
 * ИСПРАВЛЕНО: Добавлены стили для кликабельных карточек
 */

/* ==================== Основные переменные ==================== */

.mccd-dashboard {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

/* ==================== Приветствие ==================== */

.mccd-greeting {
    margin-bottom: 24px;
}

.mccd-greeting h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 4px;
}

.mccd-date {
    font-size: 15px;
    color: var(--gray-500);
    margin: 0;
    text-transform: capitalize;
}

/* ==================== Быстрая статистика ==================== */

.mccd-quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* ✅ Кликабельные карточки */
a.mccd-stat-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.mccd-stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mccd-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Активное состояние при клике */
.mccd-stat-card:active {
    transform: translateY(-2px);
}

.mccd-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.mccd-stat-card:hover .mccd-stat-icon {
    transform: scale(1.1);
}

.mccd-stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: white;
}

.mccd-stat-people .mccd-stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.mccd-stat-leaders .mccd-stat-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.mccd-stat-groups .mccd-stat-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.mccd-stat-pending .mccd-stat-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.mccd-stat-info {
    display: flex;
    flex-direction: column;
}

.mccd-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.mccd-stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ==================== Сетка виджетов ==================== */

.mccd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.mccd-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==================== Виджеты ==================== */

.mccd-widget {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.mccd-widget-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mccd-widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mccd-widget-header h3 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--primary);
}

/* ✅ Ссылка в заголовке виджета */
.mccd-widget-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.mccd-widget-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.mccd-widget-body {
    padding: 20px;
}

/* ==================== Badges ==================== */

.mccd-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary);
    color: white;
}

.mccd-badge-success {
    background: var(--success);
}

.mccd-badge-warning {
    background: var(--warning);
}

.mccd-badge-danger {
    background: var(--danger);
}

/* ==================== Посещаемость ==================== */

.mccd-attendance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mccd-attendance-card {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
}

.mccd-attendance-card h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mccd-attendance-card h4 .emoji {
    font-size: 16px;
}

.mccd-attendance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}

.mccd-attendance-row:last-child {
    border-bottom: none;
}

.mccd-attendance-label {
    font-size: 13px;
    color: var(--gray-500);
}

.mccd-attendance-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.mccd-percentage {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mccd-percentage-bar {
    width: 60px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.mccd-percentage-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.3s;
}

.mccd-percentage-fill.low {
    background: var(--danger);
}

.mccd-percentage-fill.medium {
    background: var(--warning);
}

/* ==================== Дни рождения ==================== */

.mccd-birthday-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mccd-birthday-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    transition: background 0.2s;
}

.mccd-birthday-item:hover {
    background: var(--gray-100);
}

.mccd-birthday-item.today {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
}

.mccd-birthday-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.mccd-birthday-info {
    flex: 1;
    min-width: 0;
}

.mccd-birthday-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mccd-birthday-date {
    font-size: 12px;
    color: var(--gray-500);
}

.mccd-birthday-days {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.mccd-birthday-days.today {
    color: var(--warning);
}

/* ==================== Новые люди ==================== */

.mccd-new-person-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mccd-new-person-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: 8px;
    border-left: 3px solid var(--success);
    cursor: pointer;
    transition: background 0.2s;
}

.mccd-new-person-item:hover {
    background: var(--gray-100);
}

.mccd-new-person-info {
    flex: 1;
    min-width: 0;
}

.mccd-new-person-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
}

.mccd-new-person-meta {
    font-size: 12px;
    color: var(--gray-500);
}

/* ==================== События ==================== */

.mccd-events-section {
    margin-bottom: 16px;
}

.mccd-events-section:last-child {
    margin-bottom: 0;
}

.mccd-events-section h4 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mccd-event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mccd-event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.mccd-event-item:hover {
    background: var(--gray-100);
}

.mccd-event-time {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    min-width: 50px;
}

.mccd-event-info {
    flex: 1;
}

.mccd-event-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
}

.mccd-event-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.mccd-sunday-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-radius: 8px;
    border: 1px solid #93c5fd;
}

.mccd-sunday-notice .emoji {
    font-size: 24px;
}

.mccd-sunday-notice-text {
    font-size: 14px;
    color: #1e40af;
}

/* ==================== Незаполненные отчёты ==================== */

.mccd-pending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mccd-pending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 3px solid var(--warning);
    cursor: pointer;
    transition: background 0.2s;
}

.mccd-pending-item:hover {
    background: #fde68a;
}

.mccd-pending-icon {
    font-size: 20px;
}

.mccd-pending-info {
    flex: 1;
}

.mccd-pending-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
}

.mccd-pending-meta {
    font-size: 12px;
    color: var(--gray-500);
}

/* ==================== Пустые состояния ==================== */

.mccd-empty {
    text-align: center;
    padding: 24px;
    color: var(--gray-500);
}

.mccd-empty .emoji {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.mccd-empty p {
    margin: 0;
    font-size: 14px;
}

/* ==================== Загрузка ==================== */

.mccd-loading {
    text-align: center;
    padding: 24px;
    color: var(--gray-500);
}

.mccd-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: mccd-spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes mccd-spin {
    to { transform: rotate(360deg); }
}

/* ==================== Адаптивность ==================== */

@media (max-width: 1200px) {
    .mccd-quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .mccd-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mccd-greeting h1 {
        font-size: 24px;
    }

    .mccd-quick-stats {
        grid-template-columns: 1fr;
    }

    .mccd-stat-card {
        padding: 16px;
    }

    .mccd-stat-value {
        font-size: 24px;
    }

    .mccd-attendance-grid {
        grid-template-columns: 1fr;
    }

    .mccd-widget-body {
        padding: 16px;
    }
    
    .mccd-widget-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .mccd-widget-link {
        width: 100%;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .mccd-greeting h1 {
        font-size: 20px;
    }

    .mccd-stat-icon {
        width: 40px;
        height: 40px;
    }

    .mccd-stat-icon .dashicons {
        font-size: 20px;
    }

    .mccd-stat-value {
        font-size: 22px;
    }

    .mccd-birthday-item {
        flex-wrap: wrap;
    }

    .mccd-birthday-days {
        width: 100%;
        margin-top: 4px;
        text-align: right;
    }
}
