/* Dashboard Styles - Premium Professional Redesign */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --primary-lighter: #f5f7ff;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --background: #f1f5f9;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-main: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: #FFFFFF;
    font-family: var(--font-body);
    color: var(--text-main);
    min-height: 100vh;
}

.dashboard-container {
    max-width: calc(100% - 56px);
    margin-left: 56px; /* Account for sidebar */
    padding: 32px;
    background-color: var(--background);
    border-top-left-radius: 32px;
    min-height: calc(100vh - 73px);
}

/* Header Section */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.welcome-text {
    margin: 0;
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.5;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-add-widget {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    font-family: var(--font-body);
}

.btn-add-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-add-widget .icon {
    font-size: 18px;
    line-height: 1;
}

.btn-edit-mode {
    background: var(--surface);
    color: var(--text-main);
    border: 2px solid var(--border);
    padding: 11px 22px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-body);
}

.btn-edit-mode:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-lighter);
}

.btn-edit-mode.active {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-edit-mode.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* Widgets Grid - iPhone-style fixed grid */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 160px; /* Smaller fixed cell height for iPhone feel */
    gap: 16px;
    margin-bottom: 48px;
    position: relative;
    min-height: 352px; /* 2 rows + gap */
    padding: 8px;
}

.widgets-grid * {
    box-sizing: border-box;
}

/* Widget Size Classes - Based on grid cells */
.widget {
    /* Ensure widget fills the grid area */
    width: 100%;
    height: 100%;
    min-height: 0; /* Prevent grid blowout */
}

/* Legacy size classes for backward compatibility */
.widget.widget-small {
    /* 1x1 grid cell */
    min-height: 160px;
    max-height: 160px;
}

.widget.widget-medium {
    /* 2x1 grid cells */
    min-height: 160px;
    max-height: 160px;
}

.widget.widget-large {
    /* 2x2 grid cells */
    min-height: calc(160px * 2 + 16px); /* 2 rows + gap */
    max-height: calc(160px * 2 + 16px);
}

.widget.widget-wide {
    /* 4x1 grid cells */
    min-height: 160px;
    max-height: 160px;
}

.widget.widget-tall {
    /* 1x2 grid cells */
    min-height: calc(160px * 2 + 16px);
    max-height: calc(160px * 2 + 16px);
}

.widget.widget-wide-tall {
    /* 3x2 grid cells */
    min-height: calc(160px * 2 + 16px);
    max-height: calc(160px * 2 + 16px);
}

.widget.widget-tall-large {
    /* 2x3 grid cells */
    min-height: calc(160px * 3 + 32px);
    max-height: calc(160px * 3 + 32px);
}

.widget.widget-huge {
    /* 3x3 grid cells */
    min-height: calc(160px * 3 + 32px);
    max-height: calc(160px * 3 + 32px);
}

.widget-content {
    flex: 1;
    overflow: hidden; /* Prevent content from expanding widget */
    display: flex;
    flex-direction: column;
    min-height: 0; /* Crucial for nested flex scrolling */
}

.widget.widget-wide {
    /* 4x1 grid cells */
    min-height: 160px;
    max-height: 160px;
}

/* Edit Mode Grid Overlay - Clear visual grid cells */
.widgets-grid.edit-mode {
    background-color: rgba(99, 102, 241, 0.02);
    padding: 16px;
    margin: -16px;
    border-radius: var(--radius-lg);
    border: 2px dashed rgba(99, 102, 241, 0.4);
    transition: all var(--transition-smooth);
    min-height: calc(160px * 3 + 16px * 2 + 32px); /* 3 rows minimum */
}

/* Grid drop zones for iPhone-style placement */
.grid-drop-zone {
    background: rgba(99, 102, 241, 0.04);
    border: 2px dashed rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    min-height: 160px;
}

.grid-drop-zone:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
    border-style: solid;
    opacity: 1;
    /* transform removed to prevent layout issues */
}

.grid-drop-zone.active {
    opacity: 1;
    animation: pulse-zone 1.5s infinite;
}

.grid-drop-zone.drag-over {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    border-style: solid;
    /* transform removed */
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.drop-zone-icon {
    font-size: 24px;
    color: var(--primary);
    opacity: 0.5;
    transition: all 0.2s ease;
}

.grid-drop-zone:hover .drop-zone-icon,
.grid-drop-zone.drag-over .drop-zone-icon {
    opacity: 1;
    transform: scale(1.2);
}

@keyframes pulse-zone {
    0%, 100% { 
        border-color: rgba(99, 102, 241, 0.3);
        background: rgba(99, 102, 241, 0.05);
    }
    50% { 
        border-color: rgba(99, 102, 241, 0.6);
        background: rgba(99, 102, 241, 0.1);
    }
}

/* Edit mode instruction banner - Removed */
.widgets-grid.edit-mode::before {
    display: none;
}

/* Grid Cell Placeholders - Legacy (now using grid-drop-zone) */
.grid-cell-placeholder {
    background: rgba(99, 102, 241, 0.06);
    border: 2px dashed rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    cursor: pointer;
}

.grid-cell-placeholder:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.5);
    border-style: solid;
}

.grid-cell-placeholder-content {
    text-align: center;
    color: var(--primary);
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.grid-cell-placeholder:hover .grid-cell-placeholder-content {
    opacity: 0.8;
}

.grid-cell-placeholder-icon {
    font-size: 24px;
    margin-bottom: 6px;
    display: block;
}

.grid-cell-placeholder-text {
    font-size: 13px;
    font-weight: 500;
}

/* Legacy placeholder support */
.grid-placeholder {
    background: rgba(99, 102, 241, 0.04);
    border: 2px dashed rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.grid-placeholder:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
}

.grid-placeholder-icon {
    font-size: 32px;
    opacity: 0.3;
    color: var(--primary);
}

@media (max-width: 1200px) {
    .widgets-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px;
    }
    
    /* Force wide widgets to span full width on tablet */
    .widget.widget-wide {
        grid-column: span 2 !important;
    }
    
    /* Medium widgets stay 2 columns on tablet */
    .widget.widget-medium {
        grid-column: span 2 !important;
    }
    
    /* Large widgets stay 2x2 on tablet */
    .widget.widget-large {
        grid-column: span 2 !important;
        grid-row: span 2 !important;
    }
    
    .widgets-grid.edit-mode {
        min-height: calc(160px * 4 + 16px * 3);
    }
    
    .grid-drop-zone {
        min-height: 160px;
    }
}

@media (max-width: 768px) {
    .widgets-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 140px;
        gap: 12px;
    }
    
    /* Small widgets take 1 column on mobile */
    .widget.widget-small {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: 140px;
        max-height: 140px;
    }
    
    /* Medium/wide widgets take full width on mobile */
    .widget.widget-medium,
    .widget.widget-wide {
        grid-column: span 2 !important;
        grid-row: span 1 !important;
        min-height: 140px;
        max-height: 140px;
    }
    
    /* Large widgets take full width, 2 rows on mobile */
    .widget.widget-large {
        grid-column: span 2 !important;
        grid-row: span 2 !important;
        min-height: calc(140px * 2 + 12px);
        max-height: calc(140px * 2 + 12px);
    }
    
    .dashboard-container {
        padding: 20px 16px;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
    
    .widgets-grid.edit-mode::before {
        font-size: 12px;
        padding: 8px 16px;
        top: -40px;
    }
    
    .grid-drop-zone {
        min-height: 140px;
    }
}

/* Widget Card */
.widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Subtle gradient overlay for depth */
.widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, #8b5cf6 50%, #ec4899 100%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.widget:hover:not(.dragging):not(.edit-mode) {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: translateY(-2px);
    border-color: transparent;
}

.widget:hover:not(.dragging):not(.edit-mode)::before {
    opacity: 1;
}

/* Edit mode widget styling - iPhone-style */
.widget.edit-mode {
    border: 2px solid var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    animation: wiggle 0.3s ease-in-out infinite;
    cursor: grab;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-0.5deg); }
    50% { transform: rotate(0.5deg); }
}

.widget.edit-mode:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    animation: none;
    transform: scale(1.02);
}

.widget.edit-mode .widget-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.03) 100%);
    margin: -16px -16px 12px -16px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Drag over state */
.widget.drag-over {
    border: 2px dashed #8b5cf6 !important;
    background: rgba(139, 92, 246, 0.08) !important;
    transform: scale(1.03);
    animation: none !important;
}

/* Dragging widget */
.widget.dragging {
    opacity: 0.7;
    transform: scale(0.95) rotate(2deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    cursor: grabbing;
    animation: none !important;
}

/* Widget Header */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}
}

.widget-icon {
    font-size: 16px;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    margin-right: 0;
    flex-shrink: 0;
}

/* Widget Actions */
.widget-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-widget-remove {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
    opacity: 0;
}

.widget.edit-mode .btn-widget-remove {
    opacity: 1;
}

.btn-widget-remove:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* Widget Content Area */
.widget-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    font-size: 13px;
}

.widget-content::-webkit-scrollbar {
    width: 4px;
}

.widget-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.widget-content::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
}

.widget-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Drag & Resize Handles */
.widget-drag-handle {
    color: var(--text-muted);
    cursor: grab;
    margin-right: 8px;
    display: none;
    padding: 6px;
    border-radius: var(--radius-xs);
    background: var(--border-light);
    transition: all var(--transition-fast);
    font-size: 14px;
}

.widget.edit-mode .widget-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget.edit-mode .widget-drag-handle:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.1);
}

.widget.edit-mode .widget-drag-handle:active {
    cursor: grabbing;
}

.widget-resize-handle {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    cursor: se-resize;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    border-radius: 50%;
    z-index: 10;
    transition: all var(--transition-fast);
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.widget.edit-mode .widget-resize-handle {
    display: flex;
}

.widget.edit-mode .widget-resize-handle:hover {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    box-shadow: var(--shadow-md);
    transform: scale(1.1);
}

/* Edit mode size indicators */
.widget.edit-mode::after {
    content: attr(data-size);
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.widget-small.edit-mode::after { content: '1×1 Small'; }
.widget-medium.edit-mode::after { content: '2×1 Medium'; }
.widget-large.edit-mode::after { content: '2×2 Large'; }
.widget-wide.edit-mode::after { content: '4×1 Wide'; }

/* --- Specific Widget Styles --- */

/* Events Widget */
.widget-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-events .event-item {
    padding: 10px 12px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.widget-events .event-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    transition: all var(--transition-smooth);
}

.widget-events .event-item:hover {
    background: white;
    border-color: var(--primary-light);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.widget-events .event-item:hover::before {
    background: var(--primary);
}

.event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.event-date-badge {
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    color: var(--primary);
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    text-align: center;
    min-width: 50px;
    flex-shrink: 0;
}

.event-day {
    font-size: 16px;
    font-weight: 800;
    display: block;
    line-height: 1;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.event-month {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 2px;
    display: block;
    opacity: 0.8;
}

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

.event-title {
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 3px 0 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

/* Tasks Widget */
.widget-tasks {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.widget-tasks .task-item {
    padding: 10px 12px;
    background: white;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-smooth);
}

.widget-tasks .task-item:last-child {
    border-bottom: none;
}

.widget-tasks .task-item:hover {
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    padding-left: 14px;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.task-checkbox:checked {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-color: var(--success);
}

.task-checkbox:checked::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: bold;
}

.task-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-main);
    transition: all var(--transition-fast);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-checkbox:checked + .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-priority {
    font-size: 12px;
    flex-shrink: 0;
}

/* AI Insights Widget */
.widget-ai {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.widget-ai .ai-widget-rotator {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.widget-ai .ai-insight-display {
    flex: 1;
}

.widget-ai .insight-card {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    color: white;
    padding: 16px;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.insight-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-text {
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.95;
    margin: 0;
}

.ai-rotation-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.rotation-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    transition: all var(--transition-fast);
}

.rotation-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}

/* Achievements Widget */
.widget-achievements {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievements-grid-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.achievement-badge-card {
    padding: 12px 10px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.achievement-badge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color, var(--primary)) 0%, #8b5cf6 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.achievement-badge-card:hover {
    border-color: transparent;
    background: white;
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px) scale(1.02);
}

.achievement-badge-card:hover::before {
    opacity: 1;
}

.badge-icon {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.badge-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievements-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    border-radius: var(--radius-md);
}

.summary-count {
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
}

.summary-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievements-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.achievements-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.achievements-empty-state .empty-message {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 16px;
}

.achievements-empty-state .empty-hint {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Goals Widget */
.widget-goals {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.goals-header {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.goals-stat {
    padding: 16px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-smooth);
}

.goals-stat:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    font-family: var(--font-heading);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.goals-progress-section {
    padding: 16px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.progress-bar-container {
    height: 8px;
    background: var(--border);
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 50px;
    transition: width var(--transition-smooth);
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
}

.goal-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.goal-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.goal-item[data-completed="true"] .goal-status-indicator {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

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

.goal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.goal-deadline {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.goals-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.goals-empty-state .goals-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.goals-empty-state .goals-empty-text {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 16px;
}

.goals-empty-state .goals-empty-hint {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Empty States */
.no-items {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
    font-size: 15px;
    line-height: 1.5;
}

/* Add Widget Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    animation: fadeIn var(--transition-normal) forwards;
}

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

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 860px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    animation: slideUp var(--transition-normal) forwards;
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-light);
    padding: 24px 28px;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.6rem;
    margin: 0;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.modal-close {
    background: var(--border-light);
    border: none;
    font-size: 20px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    transition: all var(--transition-fast);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-body {
    padding: 28px;
}

.available-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.widget-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: all var(--transition-smooth);
    cursor: pointer;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    display: flex;
    align-items: flex-start;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.widget-option::before {
    content: '+';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.widget-option:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.widget-option:hover::before {
    opacity: 1;
}

.widget-option-icon {
    font-size: 26px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.widget-option-info h3 {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.widget-option-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Dark Mode Overrides */
body.dark-mode {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-elevated: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --text-main: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary-light: #312e81;
    --primary-lighter: #1e1b4b;
}

body.dark-mode .widget {
    background: var(--surface);
    border-color: var(--border);
}

body.dark-mode .widget::before {
    display: none;
}

body.dark-mode .widget:hover:not(.dragging):not(.edit-mode) {
    border-color: var(--primary);
}

body.dark-mode .widget.edit-mode {
    background: var(--primary-lighter);
    border-color: var(--primary);
}

body.dark-mode .btn-edit-mode {
    background: var(--surface);
    color: var(--text-main);
    border-color: var(--border);
}

body.dark-mode .goals-stat,
body.dark-mode .achievement-badge-card,
body.dark-mode .no-items,
body.dark-mode .widget-tasks,
body.dark-mode .widget-events .event-item,
body.dark-mode .goal-item,
body.dark-mode .goals-progress-section {
    background: var(--background);
    border-color: var(--border);
}

body.dark-mode .widget-tasks .task-item {
    background: var(--surface);
    border-color: var(--border);
}

body.dark-mode .widget-tasks .task-item:hover {
    background: #334155;
}

body.dark-mode .widget-ai .insight-card {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .widgets-grid.edit-mode {
    background-color: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.4);
}

body.dark-mode .grid-drop-zone {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
}

body.dark-mode .grid-drop-zone:hover,
body.dark-mode .grid-drop-zone.drag-over {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
}

/* Drag and Drop Visuals */
.widget.dragging {
    opacity: 0.7;
    border: 2px dashed var(--primary);
    transform: scale(0.95) rotate(2deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    cursor: grabbing;
    z-index: 1000;
    animation: none !important;
}

.widget.drag-over {
    border: 2px dashed var(--primary);
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.03);
    box-shadow: var(--shadow-lg), 0 0 0 4px rgba(99, 102, 241, 0.15);
    z-index: 100;
    position: relative;
    animation: none !important;
}

/* Add a placeholder indicator */
.widget.drag-over::after {
    content: '↓ Drop here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    pointer-events: none;
    background: white;
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
}

/* Improve cursor for drag handle */
.widget-drag-handle {
    cursor: grab;
}

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


/* Activity Timeline Widget */
.activity-timeline-widget {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition-smooth);
}

.timeline-item:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.timeline-icon {
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-text {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.5;
    font-weight: 500;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.activity-timeline-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    text-align: center;
}

.activity-timeline-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}


/* Daily Briefing Widget */
.daily-briefing-widget {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.briefing-header h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

.briefing-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.briefing-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition-smooth);
}

.briefing-item:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.briefing-icon {
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.briefing-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.briefing-text strong {
    color: var(--primary);
    font-weight: 700;
}

/* Achievement Progress Widget */
.widget-achievement-progress {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.achievement-progress-card {
    padding: 18px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition-smooth);
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.achievement-progress-card:hover {
    background: white;
    box-shadow: var(--shadow-md);
}

.progress-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.progress-icon-container {
    padding: 10px;
    border-radius: var(--radius-sm);
}

.progress-card-icon {
    font-size: 20px;
}

.progress-card-info {
    flex: 1;
}

.progress-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
}

.progress-card-milestone {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.progress-badge-complete {
    font-size: 12px;
    font-weight: 700;
    color: var(--success);
    background: var(--success-light);
    padding: 4px 10px;
    border-radius: 50px;
}

.progress-badge-remaining {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-percentage {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 8px;
}

/* Widget Recent Achievements */
.widget-recent {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.recent-icon {
    font-size: 24px;
}

.recent-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* ============================================
   EDIT MODE GRID OVERLAY
   ============================================ */

.grid-overlay {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    padding: 0 32px;
}

.grid-overlay-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 360px;
    gap: 28px;
    opacity: 0.6;
}

.grid-cell-placeholder {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 2px dashed rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    position: relative;
}

.grid-cell-placeholder::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed rgba(99, 102, 241, 0.15);
    border-radius: calc(var(--radius-lg) - 4px);
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.4;
}

.placeholder-icon {
    font-size: 32px;
    color: var(--primary);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    font-weight: 300;
}

.placeholder-text {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dark mode grid overlay */
body.dark-mode .grid-overlay-inner {
    opacity: 0.4;
}

body.dark-mode .grid-cell-placeholder {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

body.dark-mode .placeholder-icon {
    background: rgba(99, 102, 241, 0.2);
}

/* Responsive grid overlay */
@media (max-width: 1200px) {
    .grid-overlay-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-overlay-inner {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .grid-overlay {
        padding: 0 16px;
    }
}

/* ============================================
   EDIT MODE INSTRUCTIONS BANNER
   ============================================ */

.edit-mode-banner {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    animation: slideDown 0.3s ease;
}

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

.edit-mode-banner-icon {
    font-size: 20px;
}

.edit-mode-banner-text {
    font-size: 14px;
    font-weight: 600;
}

.edit-mode-banner-hint {
    font-size: 13px;
    opacity: 0.85;
    margin-left: 8px;
}
/* ============================================
   WIDGET SIZE-ADAPTIVE STYLES
   Ensures widgets look great at any size
   ============================================ */

/* Small widget adaptations - compact layouts */
.widget-small .widget-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.widget-small .widget-title {
    font-size: 12px;
}

.widget-small .widget-icon {
    width: 22px;
    height: 22px;
    font-size: 12px;
}

.widget-small .widget-content {
    font-size: 11px;
}

/* Small widget - achievements grid to 2 columns */
.widget-small .achievements-grid-new {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.widget-small .achievement-badge-card {
    padding: 8px 6px;
}

.widget-small .badge-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.widget-small .badge-name {
    font-size: 8px;
}

/* Small widget - events list compact */
.widget-small .event-item {
    padding: 12px;
    gap: 10px;
}

.widget-small .event-title {
    font-size: 13px;
}

.widget-small .event-time {
    font-size: 11px;
}

/* Small widget - tasks list compact */
.widget-small .task-item {
    padding: 10px 12px;
}

.widget-small .task-title {
    font-size: 13px;
}

/* Medium widget - balanced layouts */
.widget-medium .achievements-grid-new {
    grid-template-columns: repeat(3, 1fr);
}

.widget-medium .widget-header {
    margin-bottom: 10px;
}

/* Large widget - expanded layouts */
.widget-large .achievements-grid-new {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.widget-large .achievement-badge-card {
    padding: 16px 12px;
}

.widget-large .badge-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.widget-large .badge-name {
    font-size: 12px;
}

.widget-large .event-item {
    padding: 20px 24px;
}

/* Wide widget - horizontal layouts */
.widget-wide .achievements-grid-new {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.widget-wide .widget-events,
.widget-wide .widget-tasks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Tasks widget improvements */
.widget-tasks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.widget-tasks .task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
}

.widget-tasks .task-item:hover {
    background: white;
    border-color: var(--primary-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.widget-tasks .task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.widget-tasks .task-checkbox.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.widget-tasks .task-info {
    flex: 1;
    min-width: 0;
}

.widget-tasks .task-title {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-tasks .task-due {
    font-size: 12px;
    color: var(--text-muted);
}

.widget-tasks .no-items {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--border-light);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
}

/* Events widget improvements */
.widget-events .no-items {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--border-light);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
}

/* Achievements summary improvements */
.achievements-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    border-radius: var(--radius-md);
    margin-top: auto;
}

.widget-small .achievements-summary {
    padding: 12px 14px;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.widget-small .summary-count {
    font-size: 13px;
}

.widget-small .summary-status {
    font-size: 10px;
}

/* AI Insights widget */
.widget-ai-insights .insight-card {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border-radius: var(--radius-md);
    color: white;
}

.widget-small .insight-card {
    padding: 14px;
}

.widget-small .insight-card h4 {
    font-size: 14px;
}

.widget-small .insight-card p {
    font-size: 12px;
}

/* Goals widget size adaptations */
.widget-goals .goal-item {
    padding: 16px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.widget-small .goal-item {
    padding: 12px;
    margin-bottom: 8px;
}

.widget-small .goal-item .goal-title {
    font-size: 13px;
}

.widget-small .goal-item .goal-progress-bar {
    height: 6px;
}

/* Responsive widget content for different screen sizes */
@media (max-width: 768px) {
    .widget .achievements-grid-new {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .widget .widget-events,
    .widget .widget-tasks {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .widget .widget-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .widget .widget-title {
        font-size: 16px;
    }
}