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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

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

h1 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.card {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #555;
    margin-bottom: 15px;
}

.summary-box {
    background: #f9f9f9;
    border-left: 4px solid #666;
}

.app-summary {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.data-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #856404;
    margin: 0;
}

.data-notice strong {
    color: #856404;
}

.instructions-box {
    background: #ffffff;
    border-left: 4px solid #2196F3;
}

.instructions-box h2 {
    color: #333;
    margin-bottom: 12px;
}

.instructions-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.instructions-header:hover {
    color: #0b7dda;
}

.toggle-icon {
    font-size: 18px;
    margin-left: 10px;
    font-weight: bold;
    color: #2196F3;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructions-list li {
    padding: 8px 0;
    line-height: 1.6;
    color: #555;
}

.instructions-list li strong {
    color: #333;
}

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

label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input:focus {
    outline: none;
    border-color: #4CAF50;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #45a049;
}

#invoice-list p {
    color: #999;
    text-align: center;
}

.invoice-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.invoice-item:last-child {
    border-bottom: none;
}

.button-group {
    display: flex;
    gap: 10px;
}

.btn-save, .btn-load, .btn-secondary, .btn-export-pdf {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-save:hover, .btn-load:hover, .btn-secondary:hover, .btn-export-pdf:hover {
    background-color: #0b7dda;
}

.btn-export-pdf {
    background-color: #48bb78;
}

.btn-export-pdf:hover {
    background-color: #38a169;
}

.btn-secondary {
    background-color: #ff9800;
    margin-right: 10px;
}

.btn-secondary:hover {
    background-color: #e68900;
}

h3 {
    color: #555;
    margin: 20px 0 10px 0;
    font-size: 16px;
}

.line-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
    align-items: end;
}

.line-item .form-group {
    margin-bottom: 0;
}

#line-items-container {
    margin-bottom: 15px;
}

.line-item-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.btn-duplicate-item,
.btn-remove-item {
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-duplicate-item {
    background-color: #2196F3;
    color: white;
}

.btn-duplicate-item:hover {
    background-color: #0b7dda;
}

.btn-remove-item {
    background-color: #f44336;
    color: white;
}

.btn-remove-item:hover {
    background-color: #d32f2f;
}

.invoice-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.invoice-item:hover {
    background-color: #f0f0f0;
    transform: translateX(5px);
}

.btn-delete:hover {
    background-color: #d32f2f !important;
}

.line-items-display {
    margin-top: 10px;
    padding-left: 20px;
    font-size: 13px;
    color: #666;
}

.invoice-notes-display {
    margin-top: 10px;
    padding-left: 20px;
    font-size: 13px;
    color: #666;
}

.invoice-notes-display strong {
    color: #666;
}

.invoice-note-item {
    padding: 2px 0;
    color: #666;
}

.invoice-note-date {
    font-weight: 500;
    color: #666;
}

.invoice-note-text {
    color: #666;
}

/* Weekly Breakdown Styles */
.month-group {
    margin-bottom: 30px;
}

.month-header {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.week-group {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #48bb78;
}

.week-group.week-empty {
    background: #fafafa;
    border-left: 4px solid #ddd;
    opacity: 0.7;
}

.week-group.week-empty .week-total {
    color: #999;
    font-weight: 400;
    font-size: 14px;
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.week-range {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

.week-total {
    font-weight: 700;
    color: #48bb78;
    font-size: 18px;
}

.week-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.week-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.week-item-dates {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.week-item-details {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.week-item-invoice {
    font-weight: 600;
    color: #667eea;
}

.week-item-type {
    color: #555;
    font-size: 14px;
}

.week-item-charge {
    margin-left: auto;
    font-weight: 700;
    color: #48bb78;
    font-size: 15px;
}

/* Adjustment styles */
.week-item-adjustment {
    background: #eff6ff;
    border-left: 3px solid #2196F3;
}

.adjustment-badge {
    display: inline-block;
    background: #2196F3;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
}

.adjustment-charge {
    color: #2196F3 !important;
}

/* Note item styles */
.note-item {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
    align-items: end;
}

.note-item .form-group {
    margin-bottom: 0;
}

.note-item textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    resize: vertical;
}

.note-item textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

#notes-container {
    margin-bottom: 15px;
}

.note-item-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.btn-duplicate-note,
.btn-remove-note {
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-duplicate-note {
    background-color: #2196F3;
    color: white;
}

.btn-duplicate-note:hover {
    background-color: #0b7dda;
}

.btn-remove-note {
    background-color: #f44336;
    color: white;
}

.btn-remove-note:hover {
    background-color: #d32f2f;
}

/* Weekly breakdown notes styles */
.week-note {
    background: #fff9e6;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
}

.week-note-date {
    font-size: 12px;
    font-weight: 600;
    color: #f57c00;
    margin-bottom: 5px;
}

.week-note-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    background: #f9f9f9;
    border-top: 2px solid #e0e0e0;
}

.footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-style: italic;
}
