body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #1f2937;
    color: #fff;
}
.topbar .brand {
    font-size: 1.2rem;
    font-weight: bold;
}
.topbar .nav-links a {
    color: #ddd;
    margin-left: 1rem;
    text-decoration: none;
}
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}
h1, h2 {
    margin: 0 0 1rem;
}
.card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.summary-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
}
.summary-card strong {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
table th, table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}
table th {
    background: #f9fafb;
}
a { color: #2563eb; }
button {
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 0.9rem 1.4rem;
    border-radius: 8px;
    cursor: pointer;
}
button.button-secondary {
    background: #10b981;
}
button:hover { opacity: 0.95; }
input, select, textarea {
    width: 100%;
    padding: 0.9rem;
    margin-top: 0.4rem;
    margin-bottom: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}
label { display: block; font-weight: 600; margin-top: 1rem; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-success { background: #d1fae5; color: #065f46; }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.hidden { display: none; }
.radio-group label { display: inline-flex; margin-right: 1rem; align-items: center; }
.radio-group input { margin-right: 0.4rem; }
.notes-list { margin-top: 1rem; }
.note-item { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.note-meta { font-size: 0.95rem; color: #4b5563; margin-bottom: 0.75rem; }
.attachments a { display: inline-block; margin-right: 0.75rem; color: #2563eb; }
.calendar-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.calendar-nav { display: flex; align-items: center; gap: 1rem; }
.calendar-nav button { padding: 0.5rem 1rem; }
#current-period { font-weight: bold; font-size: 1.1rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e5e7eb; border: 1px solid #e5e7eb; }
.calendar-header { background: #f9fafb; padding: 1rem; text-align: center; font-weight: bold; border: 1px solid #e5e7eb; }
.calendar-day { background: #fff; min-height: 120px; padding: 0.5rem; border: 1px solid #e5e7eb; position: relative; }
.calendar-day.other-month { background: #f9fafb; color: #9ca3af; }
.day-number { font-weight: bold; margin-bottom: 0.5rem; }
.calendar-job { background: #2563eb; color: white; padding: 0.25rem 0.5rem; margin-bottom: 0.25rem; border-radius: 4px; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; display: block; }
.calendar-job:hover { opacity: 0.8; text-decoration: none; color: white; }
.calendar-job.completed { opacity: 0.6; }
.calendar-job-card.completed { opacity: 0.7; background-color: #f3f4f6; }
.calendar-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e5e7eb; border: 1px solid #e5e7eb; }
.calendar-week-day { background: #fff; min-height: 400px; padding: 0.5rem; border: 1px solid #e5e7eb; }
.week-day-header { font-weight: bold; text-align: center; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #e5e7eb; }
.calendar-day-view { background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.calendar-job-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; }
.calendar-job-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-decoration: none; color: inherit; }
.calendar-job-card h3 { margin: 0 0 0.5rem 0; }
.job-color { width: 20px; height: 20px; border-radius: 50%; }
.legend { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.legend-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; }
.section-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.section-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.search-form { display: flex; align-items: center; gap: 0.5rem; }
.search-input { padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 4px; width: 200px; }
.search-button { padding: 0.5rem 1rem; background: #2563eb; color: white; border: none; border-radius: 4px; cursor: pointer; }
.search-button:hover { opacity: 0.9; }
.clear-search { color: #6b7280; text-decoration: none; font-size: 0.9rem; }
.clear-search:hover { color: #374151; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.current-user {
    background-color: #f0f9ff;
    border-left: 4px solid #3b82f6;
}

/* Attachments and Thumbnails */
.attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.attachment-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 120px;
}

.thumbnail-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s ease;
}

.thumbnail-image:hover {
    border-color: #3b82f6;
}

.thumbnail-caption {
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
    margin-top: 0.25rem;
    word-break: break-all;
    max-width: 100px;
}

.attachment-link {
    display: flex;
    align-items: center;
}

.attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.attachment-file:hover {
    background: #e5e7eb;
    text-decoration: none;
    color: #111827;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.quick-actions .button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.quick-actions .button-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.quick-actions .button-primary {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.quick-actions .button-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.quick-actions .button:hover {
    text-decoration: none;
}
.sort-links a { margin-left: 0.75rem; color: #374151; text-decoration: none; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 100%; max-width: 420px; }
.status-completed { background-color: #10b981; color: white; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
