* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background: #f5f6f7;
    color: #222;
}
.topbar {
    background: #2c3e50;
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar .brand {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}
.brand-logo {
    height: 44px;
    display: block;
    background: white;
    padding: 4px 10px;
    border-radius: 4px;
}
.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}
.nav a:hover { text-decoration: underline; }
.nav .btn { color: white; }
.nav .link-btn { color: white; text-decoration: underline; }
.nav-user {
    font-size: 14px;
    color: #cfd8e3;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 16px;
}
main {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px 60px;
}
h1, h2, h3 { color: #2c3e50; }
h2 { margin-top: 32px; }
hr { border: none; border-top: 1px solid #ddd; margin: 24px 0; }

.btn {
    display: inline-block;
    background: #2c7be5;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}
.btn.secondary { background: #6c757d; }
.btn.danger { background: #c0392b; }
.link-btn {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
    padding: 0;
}

.flash {
    background: #eaf7ea;
    border: 1px solid #b6e0b6;
    color: #256029;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.status-header {
    background: #d4edda;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 28px;
}

.status-select {
    background: #d4edda;
    font-weight: 600;
}

.customer-header {
    background: #dbe9f7;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 28px;
    color: #1a4d80;
}

.customer-title-band {
    background: #dbe9f7;
    color: #1a4d80;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: 600;
}

.customer-table thead th {
    background: #dbe9f7;
    color: #1a4d80;
}

.job-title-band {
    background: #d4edda;
    color: #14532d;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: 600;
}

.job-header {
    background: #d4edda;
    color: #14532d;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 28px;
}

.job-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-bottom: 8px;
}
.job-table th, .job-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 14px;
}
.job-table thead th {
    background: #f0f2f4;
    font-weight: 600;
}
.job-table tbody tr[onclick] { cursor: pointer; }
.job-table tbody tr[onclick]:hover { background: #f7fbff; }
.job-number { font-weight: 600; color: #2c7be5; }
.totals-row td { font-weight: 600; border-top: 2px solid #ccc; }

.search { margin-bottom: 8px; }
.view-toggle { margin-bottom: 12px; display: flex; gap: 8px; }
.upload-form + .upload-form { margin-top: 8px; }
.search input[type=text] {
    padding: 8px;
    width: 320px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form fieldset {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.form legend { font-weight: 600; color: #2c3e50; padding: 0 6px; }
.form label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    color: #444;
}
.form input[type=text], .form input[type=email], .form select, .form textarea {
    display: block;
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 4px;
    font-size: 14px;
    font-family: inherit;
}
.form select[multiple] {
    height: auto;
}

.item-form, .upload-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 8px;
}
.item-form input, .upload-form input[type=text] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
    min-width: 90px;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 12px;
}
.file-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
}
.file-card img, .file-card video { width: 100%; border-radius: 4px; display: block; }
.pdf-link { display: block; padding: 20px 8px; text-align: center; }
.file-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    margin-top: 6px;
}
.muted { color: #888; }
.empty { color: #888; font-style: italic; }

dialog {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 20px;
    max-width: 420px;
    width: 90%;
}
dialog::backdrop {
    background: rgba(0,0,0,0.4);
}
dialog h3 { margin-top: 0; }
dialog label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #444;
}
dialog textarea, dialog select {
    display: block;
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 4px;
    font-family: inherit;
    font-size: 14px;
}
