* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    position: sticky;
    top: 10px;
    z-index: 100;
}

header .logo-button {
    font-size: 2rem;
    color: #667eea;
    margin: 0;
    flex-shrink: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 102;
    transition: transform 0.1s ease, opacity 0.1s ease;
}

header .logo-button:active {
    transform: translateX(-50%) scale(0.95);
}

.logo-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 2rem;
    color: #667eea;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-button:hover {
    opacity: 0.8;
}

.logo-button:active {
    opacity: 0.6;
}

.logo-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 4px;
    border-radius: 4px;
}

.mobile-view-divider {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 12px;
    flex-shrink: 0;
}

.mobile-view-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.header-actions-desktop {
    display: none;
}

.desktop-menu {
    display: flex;
    flex: 1;
    justify-content: center;
}

@media (min-width: 901px) {
    .header-actions {
        display: none;
    }

    .header-actions-desktop {
        display: flex;
        flex-shrink: 0;
    }

    .mobile-only {
        display: none !important;
    }

    header {
        justify-content: space-between;
    }

    header .logo-button {
        left: 30px;
        transform: none;
    }

    header .logo-button:active {
        transform: scale(0.95);
    }

    .desktop-menu {
        order: 2;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        justify-content: center;
        overflow: hidden;
        overflow-x: hidden;
    }

    .header-actions-desktop {
        order: 3;
        position: absolute;
        right: 30px;
    }
}

.mobile-add-button {
    display: none;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

a.btn {
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.settings-panel,
.reviews-panel {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.setting-item input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.setting-item input:focus {
    outline: none;
    border-color: #667eea;
}

.setting-help {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #777;
}

.google-drive-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.google-drive-status-authenticated {
    background: #e8f5e9;
    color: #2e7d32;
}

.google-drive-status-info {
    background: #e3f2fd;
    color: #1565c0;
}

.google-drive-status-error {
    background: #ffebee;
    color: #c62828;
}

.google-drive-tester-info {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #856404;
}

.google-drive-tester-info p {
    margin: 0;
    line-height: 1.5;
}

.data-management-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.data-management-actions .btn {
    flex: 1;
    min-width: 120px;
}

main {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.menu {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.mobile-menu {
    display: none;
    position: relative;
    z-index: 101;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.menu-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.menu-btn:hover {
    color: #667eea;
    background: #f8f9ff;
}

.menu-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.setting-item label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.goals-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-card-separator {
    grid-column: 1 / -1;
    height: 1px;
    background: #e0e0e0;
    margin: 24px 0;
    border: none;
}

.dashboard-review-card {
    background: #ffffff;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.15);
}


.all-goals-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.all-goals-controls label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: #555;
    gap: 6px;
}

.all-goals-controls select,
.all-goals-controls input[type="number"] {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    background: #fff;
    font-size: 0.95rem;
    min-width: 160px;
}

/* Status filter multi-select dropdown */
.status-filter-dropdown {
    position: relative;
    min-width: 160px;
}

.status-filter-button {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    background: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    transition: border-color 0.2s ease;
}

.status-filter-button:hover {
    border-color: #667eea;
}

.status-filter-button[aria-expanded="true"] {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.status-filter-button-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-filter-button-arrow {
    margin-left: 8px;
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.2s ease;
}

.status-filter-button[aria-expanded="true"] .status-filter-button-arrow {
    transform: rotate(180deg);
}

.status-filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.status-filter-dropdown-menu[aria-hidden="false"] {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    padding: 4px 0;
}

.status-filter-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 8px;
}

.status-filter-option:hover {
    background-color: #f8f9ff;
}

.status-filter-checkbox {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.status-filter-option span {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

.status-filter-clear {
    width: 100%;
    padding: 8px 12px;
    margin-top: 4px;
    border: none;
    border-top: 1px solid #e0e0e0;
    background: transparent;
    color: #667eea;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
}

.status-filter-clear:hover {
    background-color: #f8f9ff;
}

/* Mobile menu styles */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    z-index: 101;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: #667eea;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    z-index: 101;
    flex-shrink: 0;
    position: relative;
}

.mobile-add-button span {
    position: absolute;
    background: #667eea;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-add-button span:nth-child(1) {
    width: 100%;
    height: 3px;
}

.mobile-add-button span:nth-child(2) {
    width: 3px;
    height: 100%;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.mobile-menu-dropdown {
    position: fixed;
    top: 0;
    right: 10px;
    left: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    max-width: calc(100vw - 20px);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, max-height 0.3s ease;
    z-index: 1000;
}

.mobile-menu-dropdown[aria-hidden="false"] {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    padding: 10px 0;
}

.mobile-menu-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    background: #f8f9ff;
    color: #667eea;
}

.mobile-menu-btn.active {
    background: #f8f9ff;
    color: #667eea;
    font-weight: 600;
    border-left: 3px solid #667eea;
}

.all-goals-controls .toggle-option {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.all-goals-controls .toggle-option input {
    margin: 0;
    width: auto;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background: #fdfdff;
}

.goals-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.goals-table thead {
    background: #f0f1ff;
}

.goals-table th,
.goals-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.goals-table th {
    font-size: 0.9rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.goals-table td {
    font-size: 0.95rem;
    color: #333;
}

.goals-table tbody tr:last-child td {
    border-bottom: none;
}

.goal-state-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.goal-state-actions .btn {
    flex: 1;
    min-width: 100px;
}

.cell-actions {
    text-align: center;
}

.force-activate-btn {
    white-space: nowrap;
}

.force-activated-indicator {
    display: inline-block;
    padding: 4px 8px;
    background: #fff3cd;
    color: #856404;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.goal-row {
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.goal-row:hover,
.goal-row:focus {
    background: rgba(102, 126, 234, 0.08);
    transform: translateX(2px);
    outline: none;
}

.goal-row .goal-status-badge {
    display: inline-block;
}

.empty-state {
    padding: 24px;
    text-align: center;
    color: #777;
    font-size: 0.95rem;
}

.goal-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.goal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.goal-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.goal-card.inactive {
    opacity: 0.7;
    border-color: #ffa500;
}

.goal-card.paused {
    opacity: 0.6;
    border-color: #9e9e9e;
    background: #f5f5f5;
}

.goal-card.manually-paused {
    opacity: 0.6;
    border-color: #9e9e9e;
    background: #f5f5f5;
    position: relative;
}

.goal-card.manually-paused::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(0, 0, 0, 0.03) 10px,
            rgba(0, 0, 0, 0.03) 20px);
    pointer-events: none;
    border-radius: 12px;
}

.goal-pause-indicator {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #856404;
    font-weight: 500;
}

.goal-force-activated-indicator {
    display: inline-block;
    margin-top: 8px;
    margin-right: 8px;
    padding: 4px 8px;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #0d47a1;
    font-weight: 500;
}

.goal-card.completed {
    opacity: 0.6;
    border-color: #28a745;
    background: #f0f8f0;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.goal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    flex: 1;
    transition: color 0.2s ease;
}

.goal-title:hover {
    color: #667eea;
}

.goal-title-input {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    flex: 1;
    width: 100%;
    padding: 2px 4px;
    border: 2px solid #667eea;
    border-radius: 4px;
    background: white;
    font-family: inherit;
    box-sizing: border-box;
}

.goal-title-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.goal-title-input-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.goal-title-input-error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.goal-title-error-message {
    display: block;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: normal;
}

.goal-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 10px;
}

.status-active {
    background: #667eea;
    color: white;
}

.status-inactive {
    background: #9e9e9e;
    color: white;
}

.status-paused {
    background: #ffc107;
    color: #333;
}

.status-completed {
    background: #28a745;
    color: white;
}

.status-abandoned {
    background: #95a5a6;
    color: white;
}

.goal-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.goal-description.dashboard-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    flex: 1;
    margin-bottom: 15px;
}

.goal-description.dashboard-description.is-editing {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    white-space: pre-wrap;
}

.goal-description[contenteditable="true"] {
    border: 1px dashed transparent;
    border-radius: 8px;
    padding: 8px;
    transition: border-color 0.2s ease, background 0.2s ease;
    min-height: 48px;
}

.goal-description[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: #999;
}

.goal-description.is-editing {
    background: #ffffff;
    border-color: rgba(118, 75, 162, 0.4);
    box-shadow: 0 0 0 2px rgba(118, 75, 162, 0.1);
}

.goal-metrics {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.metric {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 80px;
}

.metric-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.metric-value.motivation {
    color: #667eea;
}

.metric-value.urgency {
    color: #e74c3c;
}

.metric-value.priority {
    color: #764ba2;
}

.goal-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    order: 5;
    flex-shrink: 0;
}

.goal-deadline {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

.goal-deadline.urgent {
    color: #e74c3c;
    font-weight: 600;
}

.goal-deadline-wrapper {
    position: relative;
    display: inline-block;
}

.goal-deadline-label {
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-block;
}

.goal-deadline-label:hover {
    background-color: #f0f0f0;
    color: #667eea;
}

.goal-deadline-label.urgent {
    color: #e74c3c;
    font-weight: 600;
}

.goal-deadline-input {
    /* Make the input visible and styled like the label for iOS compatibility */
    /* iOS Safari doesn't support showPicker() on hidden inputs */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: transparent;
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.goal-deadline-input::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}

.goal-steps-section,
.goal-resources-section {
    margin: 15px 0;
    order: 3;
    flex-shrink: 1;
    min-height: 0;
}

.goal-steps-header,
.goal-resources-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.goal-steps-header h4,
.goal-resources-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin: 0;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.85rem;
    min-width: auto;
    flex: 0 0 auto;
}

.goal-steps-list,
.goal-resources-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.goal-step,
.goal-resource {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.goal-step:hover,
.goal-resource:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.goal-step.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.step-checkbox {
    cursor: pointer;
    flex-shrink: 0;
}

.step-text,
.resource-text {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    border: 1px dashed transparent;
    border-radius: 4px;
    padding: 2px 4px;
    min-height: 20px;
    transition: border-color 0.2s ease;
}

.step-text:focus,
.resource-text:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
}

.step-text[contenteditable="true"]:empty::before,
.resource-text[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: #999;
}

.step-delete,
.resource-delete {
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.step-delete:hover,
.resource-delete:hover {
    color: #e74c3c;
}

.steps-empty,
.resources-empty {
    padding: 8px;
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
}

.goal-card.is-editing-description,
.goal-card.is-editing-deadline {
    border-color: #764ba2;
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.15);
}

.goal-deadline-editor {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
    display: none;
    gap: 12px;
    flex-direction: column;
    order: 10;
}

.goal-deadline-editor.is-visible {
    display: flex;
}

.goal-deadline-editor .inline-fields {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.goal-deadline-editor label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: #555;
}

.goal-deadline-editor input {
    padding: 8px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.goal-deadline-editor input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.15);
}

.goal-deadline-editor .inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.goal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 0;
}

.goal-actions .btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.completion-modal {
    max-width: 420px;
    text-align: center;
}

.completion-modal .completion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.pause-modal {
    max-width: 500px;
}

.pause-modal p {
    margin-bottom: 20px;
    color: #555;
}

.pause-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.pause-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.pause-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #f8f9ff;
}

.pause-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
}

.pause-option input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.pause-date-input,
.pause-goal-select {
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 0.95rem;
    width: 100%;
}

.pause-date-input:disabled,
.pause-goal-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

@media (max-width: 900px) {
    .goals-table {
        min-width: 100%;
    }

    .goals-table thead {
        display: none;
    }

    .goals-table tbody tr {
        display: block;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 16px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }

    .goals-table tbody tr:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .goals-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
    }

    .goals-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        margin-right: 16px;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.03em;
    }

    .goals-table tbody td:last-child {
        border-bottom: none;
    }

    .table-wrapper {
        border: none;
        background: transparent;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.is-visible {
    display: block;
    visibility: visible;
    opacity: 1;
    z-index: 9999;
    pointer-events: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-actions .btn {
    min-width: 140px;
}

.migration-modal {
    max-width: 480px;
}

.migration-diff-modal {
    max-width: 960px;
}

.migration-diff-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.diff-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diff-view {
    background-color: #0f172a;
    border-radius: 10px;
    padding: 12px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.diff-line {
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-break: break-word;
}

.diff-line--unchanged {
    opacity: 0.75;
}

.diff-line--added {
    background: rgba(72, 187, 120, 0.18);
    color: #48bb78;
}

.diff-line--removed {
    background: rgba(229, 62, 62, 0.2);
    color: #f56565;
}

.diff-view.is-syncing {
    scroll-behavior: auto;
}

.migration-modal .modal-actions,
.migration-diff-modal .modal-actions {
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .migration-diff-modal {
        max-width: 95%;
    }

    .migration-diff-columns {
        grid-template-columns: 1fr;
    }

    .diff-view {
        max-height: 240px;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
}

.close:hover {
    color: #333;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 100px;
}

.review-feedback {
    border-radius: 8px;
    padding: 12px 16px;
    background: #f1f5ff;
    border-left: 4px solid #667eea;
    color: #2f3b68;
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.review-feedback[data-state="success"] {
    background: #f0f9f5;
    border-left-color: #2d9f6f;
    color: #1f6a4c;
}

.review-feedback[data-state="info"] {
    background: #f1f5ff;
    border-left-color: #667eea;
    color: #2f3b68;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.reviews-empty {
    padding: 24px;
    text-align: center;
    color: #777;
    font-size: 0.95rem;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    background: #fafaff;
}

.review-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 20px;
    box-shadow: 0 6px 14px rgba(102, 126, 234, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 200px;
    justify-content: space-between;
}


.review-card__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    flex-shrink: 0;
}

.review-card__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d2d2d;
    flex: 1 1 auto;
    padding-right: 120px;
    margin-right: 8px;
}

.review-card__sequence {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
}

.review-card__review-badge {
    font-size: 0.85rem;
    color: #f59e0b;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
}

.review-card__due {
    font-size: 0.85rem;
    color: #a94442;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
    position: absolute;
    top: 28px;
    right: 0;
    z-index: 1;
}

.review-card__bottom {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: auto;
    flex-shrink: 0;
}

.review-card__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    align-items: end;
}

.review-card__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.review-card__field-label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
    visibility: visible;
    opacity: 1;
}

.review-card__field-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-card__field-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.review-card__radio-field {
    grid-column: 1 / -1;
}

.review-card__radio-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    justify-content: space-between;
}

.review-card__radio-option {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    flex: 1 1 0;
    min-width: 0;
}

.review-card__radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.review-card__radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 36px;
    height: 36px;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    background: white;
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.review-card__radio-option:hover .review-card__radio-label {
    border-color: #667eea;
    background: #f0f4ff;
}

.review-card__radio-option input[type="radio"]:checked+.review-card__radio-label {
    border-color: #667eea;
    background: #667eea;
    color: white;
    font-weight: 600;
}

.review-card__radio-option.is-current .review-card__radio-label {
    border-color: #f59e0b;
    background: #fff7ed;
    color: #f59e0b;
    font-weight: 600;
}

.review-card__radio-option.is-current input[type="radio"]:checked+.review-card__radio-label {
    border-color: #f59e0b;
    background: #f59e0b;
    color: white;
}

.review-card__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    flex-direction: row;
    width: 100%;
    box-sizing: border-box;
}

.review-card__actions .btn {
    flex: 1 1 auto;
    min-width: 140px;
    max-width: calc(50% - 6px);
    padding: 12px 20px !important;
    white-space: nowrap;
    width: auto;
    font-size: 1rem;
    overflow: visible;
    text-overflow: clip;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    height: auto;
    box-sizing: border-box;
    visibility: visible;
    opacity: 1;
}

.review-card__actions .btn-primary {
    color: white !important;
    background: #667eea !important;
}

.review-card__actions .btn-primary:hover {
    background: #5568d3 !important;
    color: white !important;
}

.review-card__actions .btn-secondary {
    color: #333 !important;
    background: #e0e0e0 !important;
}

.review-card__actions .btn-secondary:hover {
    background: #d0d0d0 !important;
    color: #333 !important;
}

@media (max-width: 600px) {
    .review-card__actions {
        flex-direction: column;
    }

    .review-card__actions .btn {
        min-width: 100%;
        width: 100%;
        flex: 0 0 auto;
    }
}

@media (max-width: 900px) {
    body {
        padding: 10px;
        padding-bottom: 80px;
    }

    main {
        margin-bottom: 20px;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    #dashboardView {
        background: transparent;
    }

    header {
        flex-direction: row;
        align-items: center;
        padding: 12px;
        gap: 0;
        top: 10px;
        margin-bottom: 20px;
        position: relative;
        justify-content: space-between;
    }


    .desktop-menu {
        display: none;
    }

    .mobile-menu {
        display: flex;
        flex-shrink: 0;
        z-index: 2;
        position: relative;
        min-width: 42px;
        height: 42px;
        align-items: center;
        justify-content: flex-end;
        order: 3;
    }

    .header-actions {
        flex-shrink: 0;
        z-index: 2;
        position: relative;
        order: 1;
    }

    .header-actions .btn {
        display: none;
    }

    .mobile-add-button {
        display: flex;
    }

    .menu-btn {
        padding: 0px 0px;
        font-size: 0.9rem;
    }

    .header-actions .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-header .btn {
        width: 100%;
    }

    .goals-list {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .settings-panel {
        padding: 20px 15px;
    }

    .setting-item {
        margin-bottom: 18px;
    }

    .setting-item input,
    .setting-item select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .data-management-actions {
        flex-direction: column;
    }

    .data-management-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .all-goals-controls {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 12px;
        padding: 8px;
        background: #f8f9ff;
        border-radius: 8px;
    }

    .all-goals-controls label {
        width: auto;
        flex: 1;
        min-width: 0;
        font-size: 0.75rem;
        gap: 4px;
    }

    .all-goals-controls label span {
        font-size: 0.7rem;
    }

    .all-goals-controls select,
    .all-goals-controls input[type="number"] {
        width: 100%;
        min-width: 0;
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    .all-goals-controls .status-filter-dropdown {
        min-width: 0;
        max-width: 120px;
    }

    .all-goals-controls .status-filter-button {
        font-size: 0.85rem;
        padding: 6px 8px;
    }

    .all-goals-controls .status-filter-button-text {
        font-size: 0.85rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .all-goals-controls .toggle-option {
        flex-direction: row;
        align-items: center;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .all-goals-controls .toggle-option input {
        width: auto;
        margin: 0;
    }
}

.btn-compact {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Mobile-specific styles */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.mobile-goals-container.mobile-only {
    display: none;
}

@media (max-width: 900px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .mobile-goals-container.mobile-only {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-top: 20px;
    }
}

.mobile-goal-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
}

.mobile-goal-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.mobile-goal-card:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.mobile-goal-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.mobile-goal-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.mobile-goal-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-goal-card__metrics {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.mobile-goal-card__metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 60px;
}

.mobile-goal-card__metric-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.mobile-goal-card__metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.mobile-goal-card__details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.mobile-goal-card__detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.mobile-goal-card__detail-label {
    color: #666;
    font-weight: 500;
}

.mobile-goal-card__detail-value {
    color: #333;
    text-align: right;
}

.mobile-goals-empty {
    padding: 40px 20px;
    text-align: center;
    color: #777;
    font-size: 0.95rem;
    background: #fafaff;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .mobile-goal-card {
        padding: 14px;
    }

    .mobile-goal-card__title {
        font-size: 1rem;
    }

    .mobile-goal-card__metrics {
        gap: 12px;
    }

    .mobile-goal-card__metric {
        min-width: 50px;
    }

    .mobile-goal-card__metric-label {
        font-size: 0.7rem;
    }

    .mobile-goal-card__metric-value {
        font-size: 0.95rem;
    }
}

/* Mobile Dashboard - Single Card View with Swipe Navigation */
.mobile-dashboard-swipe-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 20px;
}

.mobile-dashboard-cards-wrapper {
    position: relative;
    width: 100%;
    min-height: 400px;
    touch-action: pan-y;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-dashboard-card {
    width: 100%;
    top: 0;
    left: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    will-change: transform, opacity;
    transform: translateX(0%);
    opacity: 1;
    display: flex;
    flex-direction: column;
}

.mobile-dashboard-card-hidden {
    pointer-events: none;
    opacity: 0;
}

.mobile-dashboard-card-visible {
    pointer-events: auto;
    opacity: 1;
}

.mobile-dashboard-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-dashboard-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d0d0d0;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-dashboard-indicator:hover {
    background: #a0a0a0;
    transform: scale(1.2);
}

.mobile-dashboard-indicator.active {
    background: #667eea;
    transform: scale(1.3);
}

.mobile-dashboard-indicator:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Desktop: Hide mobile dashboard styles */
@media (min-width: 901px) {
    .mobile-dashboard-swipe-container {
        display: none;
    }

    .goals-list:has(.mobile-dashboard-swipe-container) {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

/* Mobile: Show single card view, hide desktop grid */
@media (max-width: 900px) {
    .goals-list {
        display: block;
        grid-template-columns: none;
        height: 100%;
    }

    .goals-list>.goal-card:not(.mobile-dashboard-card),
    .goals-list>.review-card:not(.mobile-dashboard-card),
    .goals-list>.dashboard-card-separator {
        display: none;
    }

    .mobile-dashboard-card {
        margin-bottom: 0;
        position: relative;
    }

    .mobile-dashboard-card.goal-card,
    .mobile-dashboard-card.review-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    /* Make steps section scrollable when content is long */
    .mobile-dashboard-card .goal-steps-section {
        display: flex;
        flex-direction: column;
        touch-action: pan-y;
    }

    .mobile-dashboard-card .goal-steps-list {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        max-height: 300px;
        padding-right: 4px;
        touch-action: pan-y;
        /* Show scrollbar when content overflows */
        scrollbar-width: thin;
        scrollbar-color: #cbd5e0 transparent;
    }

    /* WebKit scrollbar styling for mobile */
    .mobile-dashboard-card .goal-steps-list::-webkit-scrollbar {
        width: 6px;
    }

    .mobile-dashboard-card .goal-steps-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .mobile-dashboard-card .goal-steps-list::-webkit-scrollbar-thumb {
        background-color: #cbd5e0;
        border-radius: 3px;
    }

    .mobile-dashboard-card .goal-steps-list::-webkit-scrollbar-thumb:hover {
        background-color: #a0aec0;
    }

    /* Allow scrolling in steps list even during horizontal swipe detection */
    .mobile-dashboard-card .goal-steps-list * {
        touch-action: pan-y;
    }

    /* Ensure goal header and footer don't shrink */
    .mobile-dashboard-card .goal-header {
        flex-shrink: 0;
    }

    .mobile-dashboard-card .goal-footer {
        flex-shrink: 0;
        margin-top: auto;
    }

    /* Make description scrollable if needed */
    .mobile-dashboard-card .goal-description {
        max-height: 150px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
/* ===========================================
   Recurring Goals Styling
   =========================================== */

/* Recurring Section in Goal Modal */
.recurring-section {
    background: #f8f9ff;
    border: 2px solid #e8eaff;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.recurring-header label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    font-size: 1rem;
}

.recurring-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.recurring-section .setting-help {
    margin: 8px 0 16px 26px;
    font-size: 0.85rem;
    color: #666;
}

.recurring-date-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8eaff;
}

.recurring-date-container label {
    display: block;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.recurring-date-container input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.recurring-date-container input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.recurring-date-container .setting-help {
   margin: 6px 0 0 0;
}

/* Recurring Badge on Goal Cards */
.goal-recurring-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
    margin-top: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.goal-recurring-badge::before {
    content: '';
    font-size: 0.9em;
}

/* Recurring Period Inputs */
.recurring-period-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.recurring-period-inputs input[type="number"] {
    flex: 0 0 100px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.recurring-period-inputs select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.recurring-period-inputs input[type="number"]:focus,
.recurring-period-inputs select:focus {
    outline: none;
    border-color: #667eea;
}

/* Completion Modal Recurring Section */
.completion-recurring-section {
    background: #f8f9ff;
    border: 2px solid #e8eaff;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
}

.completion-recurring-header label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    font-size: 1rem;
    margin: 0;
}

.completion-recurring-header input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.completion-recur-date-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8eaff;
}

.recur-date-label {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.recur-date-value {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
    margin: 0;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e8eaff;
}

/* Completion Modal Date Input */
.completion-recur-date-info label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.completion-recur-date-input {
    width: 100%;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e8eaff;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
}

.completion-recur-date-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Overview View Styles */
.overview-header {
    margin-bottom: 24px;
}

.period-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-btn {
    padding: 8px 20px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.period-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.period-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border: 2px solid #e8eaff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

.overview-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.chart-section {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
}

.chart-section h3 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.chart-empty {
    text-align: center;
    color: #888;
    padding: 20px;
    font-size: 0.9rem;
}

/* Bar Chart Styles */
.bar-chart-container {
    width: 100%;
}

.bar-chart {
    width: 100%;
    height: auto;
    max-height: 200px;
}

.bar-chart .bar {
    transition: opacity 0.2s ease;
}

.bar-chart .bar:hover {
    opacity: 0.8;
}

.bar-chart .bar-created {
    fill: #667eea;
}

.bar-chart .bar-completed {
    fill: #4caf50;
}

.bar-chart .bar-label {
    font-size: 3px;
    fill: #666;
}

.chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.created {
    background: #667eea;
}

.legend-color.completed {
    background: #4caf50;
}

/* Pie Chart Styles */
.pie-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pie-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
}

.pie-legend {
    width: 100%;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.85rem;
}

.pie-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.pie-legend-label {
    flex: 1;
    color: #333;
}

.pie-legend-value {
    color: #666;
    font-size: 0.8rem;
}

.overview-empty-state {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    font-size: 1rem;
}

/* Mobile Responsive for Overview */
@media (max-width: 900px) {
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .overview-charts {
        grid-template-columns: 1fr;
    }
    
    .pie-chart-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pie-chart {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .overview-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .period-btn {
        flex: 1;
        text-align: center;
    }
}
