body #sales-weekly-progress,
body #sales-weekly-progress-dashboard {
    font-family: Arial, sans-serif;
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#sales-weekly-progress-dashboard {
    max-width: 900px;
}

#sales-weekly-progress h1,
#sales-weekly-progress-dashboard h1 {
    color: #1DA1F2;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    margin-bottom: 20px;
}

#sales-weekly-progress h1::after,
#sales-weekly-progress-dashboard h1::after {
    content: "🚀";
}

#sales-weekly-progress .user-id,
#sales-weekly-progress-dashboard .user-id,
.weekly-progress-meta,
.weekly-feedback-meta {
    color: #657786;
    font-size: 0.9em;
    margin-bottom: 20px;
}

#sales-weekly-progress .form-group,
#sales-weekly-progress-dashboard .form-group {
    margin-bottom: 15px;
}

#sales-weekly-progress label,
#sales-weekly-progress-dashboard label {
    display: block;
    color: #1DA1F2;
    margin-bottom: 5px;
    font-weight: bold;
}

#sales-weekly-progress input,
#sales-weekly-progress textarea,
#sales-weekly-progress select,
#sales-weekly-progress-dashboard input,
#sales-weekly-progress-dashboard textarea,
#sales-weekly-progress-dashboard select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
}

#sales-weekly-progress textarea,
#sales-weekly-progress-dashboard textarea {
    min-height: 100px;
    resize: vertical;
}

#weeklyProgressSubmitButton,
#weeklyApplyFilter,
.weekly-save-feedback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    margin: 10px 6px 0 0;
    padding: 6px 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    text-decoration: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    background: #28a745;
    color: #fff;
}

#weeklyApplyFilter {
    background: #1DA1F2;
}

#weeklyProgressSubmitButton:hover,
#weeklyApplyFilter:hover,
.weekly-save-feedback:hover {
    opacity: 0.9;
}

#weeklyProgressSubmitButton:disabled,
#weeklyApplyFilter:disabled,
.weekly-save-feedback:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.weekly-progress-message {
    padding: 10px 12px;
    margin: 12px 0;
    border-radius: 8px;
    font-size: 14px;
}

.weekly-progress-message.success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.weekly-progress-message.error,
#weekly-dashboard-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    margin: 12px 0;
    border-radius: 8px;
}

.weekly-feedback-box,
.weekly-summary-card {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 14px;
    margin-top: 18px;
}

.weekly-feedback-box h3 {
    margin-top: 0;
    color: #1DA1F2;
}

.weekly-dashboard-filters {
    display: grid;
    grid-template-columns: 1fr 200px auto;
    gap: 12px;
    align-items: end;
}

#sales-weekly-progress-dashboard .opportunity,
#sales-weekly-progress .opportunity {
    border: 1px solid #ccc;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    position: relative;
    background: #f9f9f9;
}

#sales-weekly-progress-dashboard .opportunity-section {
    margin-top: 10px;
    display: block !important;
}

#sales-weekly-progress-dashboard .opportunity-section .accordion-header {
    background: #1DA1F2;
    color: white;
    padding: 10px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: bold;
    display: block !important;
}

#sales-weekly-progress-dashboard .opportunity-section.open .accordion-header {
    border-bottom: 1px solid #ccc;
    border-radius: 5px 5px 0 0;
}

#sales-weekly-progress-dashboard .opportunity-section .accordion-content {
    padding: 10px;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 5px 5px;
    background: #fff;
    display: none;
}

#sales-weekly-progress-dashboard .opportunity-section.open .accordion-content {
    display: block;
}

.weekly-update-card hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}

.weekly-feedback-editor {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
}

.weekly-missing-card {
    border-color: #fbbf24 !important;
    background: #fffbeb !important;
}

.weekly-missing-label {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: bold;
}

@media (max-width: 700px) {
    body #sales-weekly-progress,
    body #sales-weekly-progress-dashboard {
        max-width: calc(100% - 20px);
        padding: 14px;
    }

    .weekly-dashboard-filters {
        grid-template-columns: 1fr;
    }

    #weeklyApplyFilter,
    #weeklyProgressSubmitButton,
    .weekly-save-feedback {
        width: auto !important;
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 10px;
    }
}

.weekly-inline-field select {
    max-width: 180px;
}

#sales-weekly-progress .weekly-inline-field {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 12px;
    align-items: center;
}

#sales-weekly-progress .weekly-inline-field label {
    margin-bottom: 0;
}

@media (max-width: 700px) {
    #sales-weekly-progress .weekly-inline-field {
        grid-template-columns: 1fr;
    }

    .weekly-inline-field select {
        max-width: 100%;
    }
}

/* Rep history: reads existing saved updates only; no duplicate storage/export files. */
#sales-weekly-progress .weekly-my-history-section {
    margin-top: 22px;
}

#sales-weekly-progress .opportunity-section .accordion-header {
    background: #1DA1F2;
    color: white;
    padding: 10px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: bold;
    display: block !important;
}

#sales-weekly-progress .opportunity-section .accordion-content {
    padding: 10px;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 5px 5px;
    background: #fff;
    display: none;
}

#sales-weekly-progress .opportunity-section.open .accordion-content {
    display: block;
}

.weekly-history-note {
    color: #657786;
    font-size: 0.9em;
    margin: 0 0 12px;
}

.weekly-history-card hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}
