@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;800&display=swap');

* {
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif !important;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif !important;
    background: #f4f5f7;
    color: #202020;
}

/* Override Bootstrap fonts globally */
html, body, div, p, span, h1, h2, h3, h4, h5, h6, 
a, button, input, select, textarea, label, form, table, 
ul, ol, li, thead, tbody, th, td {
    font-family: 'Roboto', sans-serif !important;
}

.topbar {
    background: #2b2b2b;
    color: white;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-shrink: 0;
}

.nav-center {
    display: flex;
    gap: 18px;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.nav-right {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-shrink: 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 700;
}

.brand img {
    width: 90px;
    height: auto;
    background: white;
    border-radius: 6px;
    padding: 4px;
}

.brand-title {
    font-size: 24px;
    font-weight: 800;
}

.brand-subtitle {
    font-size: 13px;
    color: #ddd;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 12px;
    border-left: 1px solid #555;
}

.username {
    font-weight: 600;
    color: #ddd;
}

.role-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.logout-link {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.logout-link:hover {
    background: rgba(255, 107, 107, 0.1);
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1,
h1 {
    margin-bottom: 4px;
}

.page-header p {
    margin-top: 0;
    color: #666;
}

.primary-button,
.secondary-button,
.small-button,
button {
    display: inline-block;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.primary-button,
button {
    background: #ed1c24;
    color: white;
    padding: 11px 16px;
}

.secondary-button {
    background: #e9e9e9;
    color: #222;
    padding: 11px 16px;
}

.small-button {
    background: #2b2b2b;
    color: white;
    padding: 7px 11px;
}

.danger-button {
    background: #6f1d1b;
}

.billed-toggle {
    background: #c0c0c0;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 7px 11px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.billed-toggle:hover {
    background: #a8a8a8;
}

.billed-toggle.billed-active {
    background: #22c55e;
}

.billed-toggle.billed-active:hover {
    background: #16a34a;
}

.filter-card,
.form-card,
.details-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.filter-card {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #d2d2d2;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
}

textarea {
    min-height: 110px;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.jobs-table th {
    background: #2b2b2b;
    color: white;
    text-align: left;
    padding: 13px;
}

.jobs-table td {
    padding: 13px;
    border-bottom: 1px solid #eee;
}

.job-name {
    font-family: 'Roboto', sans-serif !important;
    font-weight: 600;
}

.yes {
    color: #137333;
    font-weight: 800;
}

.no {
    color: #999;
}

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

label {
    font-weight: 800;
    display: grid;
    gap: 7px;
}

.wide {
    grid-column: 1 / -1;
}

.actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.details-grid {
    display: grid;
    grid-template-columns: 2fr 8fr;
    gap: 18px;
}

.details-grid .details-card {
    padding: 14px;
}

/* Force all sections after Draft PDF to stay in right column */
.details-grid > .details-card:nth-child(3),
.details-grid > .details-card:nth-child(5) {
    grid-column: 2;
}

.wide-card {
    grid-column: 1 / -1;
}

dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: start;
}

dt {
    font-weight: 800;
    margin-top: 10px;
    max-width: none;
    white-space: nowrap;
}

dt:first-child {
    margin-top: 0;
}

dd {
    margin-left: 0;
    margin-top: 2px;
    margin-bottom: 0;
    color: #444;
}

.mini-form {
    margin-top: 15px;
    display: grid;
    gap: 10px;
}

.checklist-preview {
    margin-top: 24px;
    border-top: 1px solid #eee;
    padding-top: 18px;
}

.icon-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.icon-row div {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    font-weight: 800;
    background: #fafafa;
}

.icon-row img {
    height: 42px;
    display: block;
    margin: 0 auto 8px;
}

.status-pill {
    display: inline-block;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Status color gradient from red through orange to green */
.status-pill.status-new {
    background: #f44336; /* Red */
}

.status-pill.status-drafting {
    background: #ff9800; /* Orange */
}

.status-pill.status-sent-to-office {
    background: #ffc107; /* Amber/Yellow */
    color: #333; /* Dark text for light background */
}

.status-pill.status-sent-to-customer {
    background: #ffeb3b; /* Light Yellow */
    color: #333; /* Dark text for light background */
}

.status-pill.status-changes-needed {
    background: #ff5722; /* Deep Orange/Red */
}

.status-pill.status-changes-submitted {
    background: #800000; /* Maroon */
}

.status-pill.status-approved {
    background: #8bc34a; /* Light Green */
}

.status-pill.status-to-print {
    background: #9e9e9e; /* Grey */
    color: white;
}

.status-pill.status-complete {
    background: #9c27b0; /* Purple */
    color: white;
}

.status-timestamp {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    font-style: italic;
}

/* PDF Preview Styles */
.pdf-preview-container {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    margin: 16px 0;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 400px;
}

.pdf-viewer {
    width: 100%;
    min-height: 500px;
    border: none;
    display: block;
}

.pdf-viewer p {
    margin: 20px;
    text-align: center;
    color: #666;
}

/* Update Job Layout with Notes Sidebar */
.update-job-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.update-form {
    display: grid;
    gap: 12px;
}

.notes-form {
    display: grid;
    gap: 12px;
}

.notes-sidebar {
    grid-column: 1 / -1;
    border-top: 1px solid #eee;
    padding-top: 18px;
    margin-top: 0;
}

.notes-sidebar h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #202020;
}

.note-item {
    background: #f9f9f9;
    border-left: 4px solid #2b2b2b;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.note-content {
    margin: 0 0 4px 0;
    color: #202020;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.note-author {
    display: block;
    font-size: 11px;
    color: #555;
    font-weight: 600;
    margin-bottom: 2px;
}

.note-date {
    display: block;
    font-size: 11px;
    color: #999;
    font-style: italic;
}

.note-edit-btn,
.note-delete-btn {
    background: none;
    border: 1px solid #ddd;
    color: #333;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
}

.note-edit-btn:hover {
    background: #e8f4f8;
    border-color: #0069d9;
    color: #0069d9;
}

.note-delete-btn {
    color: #dc3545;
    border-color: #dc3545;
}

.note-delete-btn:hover {
    background: #ffe5e8;
    border-color: #bb2d3b;
    color: #bb2d3b;
}

/* ==================== ADMIN PANEL STYLES ==================== */

.admin-container {
    max-width: 1200px;
    margin: 28px auto;
    padding: 0 20px;
}

.admin-header {
    margin-bottom: 28px;
}

.admin-header h1 {
    font-size: 32px;
    margin: 0 0 8px 0;
    color: #202020;
}

.admin-header .subtitle {
    color: #666;
    margin: 0;
    font-size: 14px;
}

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

.panel-header {
    border-bottom: 2px solid #ed1c24;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0;
    font-size: 20px;
    color: #202020;
}

.admin-form {
    display: grid;
    gap: 16px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #202020;
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ed1c24;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: flex-end;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    margin-left: 6px;
    gap: 6px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #d41920;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(237, 28, 36, 0.2);
}

.btn-secondary {
    background: #e9e9e9;
    color: #202020;
}

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

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

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

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

.users-table-responsive {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.users-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #ed1c24;
}

.users-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #202020;
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.user-row:hover {
    background: #f8f9fa;
}

.users-table .username {
    font-weight: 600;
    color: #202020;
}

.users-table .email {
    color: #666;
    font-size: 13px;
}

.users-table .date-small {
    color: #999;
    font-size: 13px;
}

.role-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.role-badge.role-admin {
    background: #667eea;
    color: white;
}

.role-badge.role-manager {
    background: #f093fb;
    color: white;
}

.role-badge.role-viewer {
    background: #4ecdc4;
    color: white;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.status-badge.status-active {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-action {
    background: none;
    border: none;
    padding: 6px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-action:hover {
    background: #f0f0f0;
}

.btn-action.edit-btn:hover {
    background: #e3f2fd;
}

.btn-action.reset-btn:hover {
    background: #fff3e0;
}

.btn-action.delete-btn:hover {
    background: #ffebee;
}

.modal-header {
    border-bottom: 1px solid #ed1c24;
    background: #f8f9fa;
}

.modal-header .modal-title {
    font-weight: 600;
    color: #202020;
}

.modal-body {
    padding: 20px;
}

.modal-body .mb-3 {
    margin-bottom: 16px;
}

.form-label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #202020;
    font-size: 14px;
}

.form-control {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
}

.form-control:focus {
    border-color: #ed1c24;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
    outline: none;
}

.form-control:disabled {
    background: #f0f0f0;
    color: #999;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert .btn-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.alert .btn-close:hover {
    opacity: 1;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 28px;
    font-style: italic;
}

@media (max-width: 800px) {
    .topbar,
    .page-header,
    .filter-card {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid,
    .details-grid,
    .icon-row,
    .update-job-layout {
        grid-template-columns: 1fr;
    }

    .notes-sidebar {
        grid-column: 1;
    }

    .pdf-viewer {
        min-height: 300px;
    }

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

    .users-table {
        font-size: 12px;
    }

    .users-table th,
    .users-table td {
        padding: 8px;
    }
}

/* Approval Page Styling */
.approval-page-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Roboto', sans-serif !important;
}

.approval-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 40px;
    font-family: 'Roboto', sans-serif !important;
}

.approval-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #ed1c24;
    padding-bottom: 20px;
}

.approval-header h1 {
    color: #333;
    font-weight: 700;
    margin: 0;
    font-size: 28px;
    font-family: 'Roboto', sans-serif !important;
}

.approval-header p {
    color: #666;
    margin: 10px 0 0 0;
    font-size: 14px;
    font-family: 'Roboto', sans-serif !important;
}

.job-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #ed1c24;
    font-family: 'Roboto', sans-serif !important;
}

.job-details strong {
    color: #2b2b2b;
    display: inline-block;
    min-width: 140px;
}

.checklist-title {
    margin-bottom: 25px;
    color: #2b2b2b;
    font-weight: 600;
    font-size: 16px;
}

.approver-info-section {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 5px solid #ed1c24;
}

.approver-info-section label {
    font-weight: 600;
    color: #2b2b2b;
    margin-bottom: 10px;
    display: block;
    font-size: 15px;
}

.approver-info-section input.form-control {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}

.approver-info-section input.form-control:focus {
    border-color: #ed1c24;
    outline: none;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    border-left: 5px solid #ed1c24;
    transition: all 0.2s ease;
    gap: 20px;
    font-family: 'Roboto', sans-serif !important;
}

.checklist-item:hover {
    background-color: #efefef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.checkbox-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 8px;
    position: relative;
}

.approval-checkbox {
    width: 64px;
    height: 64px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.approval-checkbox:hover {
    background: #e8e8e8;
    border-color: #bbb;
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(237, 28, 36, 0.3);
}

.approval-checkbox:checked {
    background: #d4edda;
    border-color: #28a745;
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.5);
}

.approval-checkbox:checked::after {
    content: '✓';
    color: #28a745;
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    color: #333;
    font-family: 'Roboto', sans-serif !important;
}

.checkbox-label strong {
    display: block;
    color: #2b2b2b;
    margin-bottom: 8px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif !important;
}

.checkbox-label span {
    display: block;
    color: #555;
    font-size: 14px;
    margin-bottom: 8px;
    font-family: 'Roboto', sans-serif !important;
}

.checkbox-label ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
    font-size: 14px;
    color: #555;
    font-family: 'Roboto', sans-serif !important;
}

.checkbox-label ul li {
    margin-bottom: 5px;
    line-height: 1.4;
    font-family: 'Roboto', sans-serif !important;
}

.changes-section {
    margin-bottom: 30px;
}

.changes-section label {
    font-weight: 600;
    color: #2b2b2b;
    margin-bottom: 10px;
    display: block;
    font-size: 15px;
    font-family: 'Roboto', sans-serif !important;
}

.changes-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #333;
    resize: vertical;
}

.changes-section textarea:focus {
    border-color: #ed1c24;
    outline: none;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
}

.btn-approve {
    background: #ed1c24;
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-approve:hover {
    background: #c91814;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(237, 28, 36, 0.3);
}

.btn-approve:active {
    transform: translateY(0);
}

.pdf-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.pdf-link {
    display: inline-block;
    background: #ed1c24;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pdf-link:hover {
    background: #c91814;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(237, 28, 36, 0.2);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success strong {
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.progress-bar {
    background: linear-gradient(90deg, #ed1c24 0%, #c91814 100%);
}

@media (max-width: 768px) {
    .approval-card {
        padding: 25px;
    }

    .approval-header h1 {
        font-size: 22px;
    }

    .approval-page-container {
        margin: 20px auto;
        padding: 10px;
    }

    .checklist-item {
        padding: 15px;
    }

    .btn-approve {
        padding: 12px 30px;
        font-size: 15px;
    }
}

/* ==================== REFINED COMPACT LAYOUT ==================== */

/* Compact details grid for job overview */
.job-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.overview-item {
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    font-size: 13px;
    transition: all 0.2s ease;
}

.overview-item:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.overview-item-label {
    font-weight: 700;
    color: #666;
    margin-bottom: 4px;
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-item-value {
    color: #222;
    word-break: break-word;
    font-weight: 500;
}

.overview-item-value .status-pill {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
}

/* Side-by-side grid for PDF and Documents sections */
.deliverables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .deliverables-grid {
        grid-template-columns: 1fr;
    }
}

/* Compact document upload form - inline */
.doc-upload-compact {
    background: linear-gradient(to bottom, #f9f9f9, #f5f5f5);
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #ddd;
}

.doc-upload-compact-row {
    display: grid;
    grid-template-columns: 1fr 1fr 120px 80px;
    gap: 8px;
    align-items: flex-end;
}

.doc-upload-compact-row input {
    padding: 8px;
    font-size: 12px;
}

.doc-upload-compact-row button {
    padding: 8px 12px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .doc-upload-compact-row {
        grid-template-columns: 1fr;
    }
    
    .doc-upload-compact-row button {
        width: 100%;
    }
}

/* Improved document table */
.document-table-wrapper {
    overflow-x: auto;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.document-table thead {
    background: linear-gradient(to right, #f5f5f5, #efefef);
    border-bottom: 2px solid #ddd;
}

.document-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.document-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.document-table tbody tr:hover {
    background: #fafafa;
}

.doc-type-badge {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
}

.doc-file-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

.doc-file-link:hover {
    text-decoration: underline;
}

.doc-meta {
    font-size: 11px;
    color: #888;
}

.doc-actions-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.doc-action-btn {
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.doc-action-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.doc-action-btn.delete:hover {
    background: #ffe5e5;
    border-color: #dc3545;
    color: #dc3545;
}

/* Collapsible section styling */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    user-select: none;
    transition: all 0.2s ease;
}

.collapsible-header h2 {
    margin: 0;
    font-size: 17px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.collapse-indicator {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.collapsible-header.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}

.collapsible-content {
    display: block;
    animation: slideDown 0.3s ease;
}

.collapsible-content.collapsed {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

/* Tab-based interface for Update Job section */
.tabs-wrapper {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #eee;
    margin-bottom: 0;
    flex-wrap: wrap;
    background: white;
    border-radius: 8px 8px 0 0;
}

.tab-btn {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #888;
    font-size: 13px;
    transition: all 0.3s ease;
    margin-right: 2px;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #ed1c24;
    border-bottom-color: #ed1c24;
}

.tab-content-wrapper {
    background: white;
    padding: 16px;
    border-radius: 0 0 8px 8px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Refined status timestamp */
.status-timestamp {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

/* More compact approval section */
.approval-info {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #1976d2;
    font-size: 13px;
}

.approval-info strong {
    color: #1565c0;
}

.approval-status {
    color: #28a745;
    font-weight: 600;
    margin-top: 4px;
}

/* Danger zone refinement */
.danger-section {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 4px solid #dc3545;
    padding: 12px;
    border-radius: 6px;
}

/* Heroicon styling */
svg {
    color: inherit;
}

button svg,
a svg,
h2 svg,
.tab-btn svg {
    flex-shrink: 0;
    line-height: 1;
}

.primary-button svg,
.secondary-button svg,
.danger-button svg {
    stroke-width: 2;
}

/* Billing Amount Input */
.billing-amount-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.billing-display {
    min-width: 70px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    color: #202020;
}

.edit-icon {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #007bff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.edit-icon:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: #0056b3;
}

.edit-icon:active {
    transform: scale(0.95);
}

.billed-amount-input {
    width: 100px;
    padding: 6px 8px !important;
    border: 2px solid #007bff !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-family: 'Roboto Mono', monospace !important;
    text-align: right;
    transition: all 0.2s ease;
}

.billed-amount-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.tally-row {
    background: #f9f9f9;
    border-top: 2px solid #e0e0e0;
    font-weight: 600;
}

/* Drawing Canvas Styles */
#drawingContainer {
    max-width: 100%;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pdfCanvas, #drawingCanvas {
    max-width: 100%;
    height: auto;
    display: block;
}

#drawingCanvas {
    touch-action: none !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.tool-btn {
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.tool-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-active {
    border: 3px solid #fff !important;
    box-shadow: 0 0 0 2px #333 !important;
}

@media (max-width: 768px) {
    #toolBar {
        flex-direction: column;
        gap: 10px;
    }

    #toolBar > div {
        width: 100%;
    }

    .tool-btn {
        padding: 10px 14px !important;
        font-size: 14px !important;
        width: 100%;
        text-align: center;
    }

    #drawingCanvas {
        cursor: pointer;
    }
}
