.discher-service-form {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
}

.discher-service-form label {
    color: #333 !important;
}

.discher-service-form h3 {
    color: #0073aa !important;
}

.discher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.discher-header h2 {
    margin: 0;
    font-size: 28px;
    color: #0073aa;
}

.company-info {
    text-align: right;
    font-size: 11px;
    line-height: 1.6;
}

.form-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.activity-section {
    display: block;
}

/* Full-width activity textarea block */
.activity-block {
    margin-bottom: 25px;
}

.activity-block textarea {
    width: 100%;
    min-height: 200px !important;
    height: 200px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
    color: #000 !important;
    background-color: #fff !important;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    color: #000 !important;
    background-color: #fff !important;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px !important;
    height: auto;
}

.discher-service-form .activity-section textarea {
    min-height: 200px !important;
    height: 200px;
}

h3 {
    margin: 30px 0 20px 0;
    font-size: 20px;
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Time Entries */
.time-entry {
    position: relative;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.time-entry-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.time-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.time-pair {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 10px;
}

.time-pair-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #0073aa;
    margin-bottom: 8px;
    text-align: center;
}

.time-pair-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.time-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: #f0f8ff;
    border-radius: 4px;
}

.button-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.button-remove:hover {
    background: #c82333;
}

/* Material Rows */
.material-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 3fr 1fr 3fr;
    gap: 10px;
    margin-bottom: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Signature Section */
.signature-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.signature-box {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #0073aa;
}

.signature-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tap-hint {
    font-size: 11px;
    font-weight: normal;
    color: #666;
    font-style: italic;
}

.signature-box input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    color: #000 !important;
    background-color: #fff !important;
}

/* Signature Canvas Wrapper - clickable area */
.signature-canvas-wrapper {
    position: relative;
    border: 2px solid #0073aa;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    height: 150px;
    background: #f8f8f8;
    overflow: hidden;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.signature-canvas-wrapper:hover {
    box-shadow: 0 0 15px rgba(0, 115, 170, 0.3);
    background: #fff;
    border-color: #005a87;
}

.signature-canvas-wrapper:active {
    transform: scale(0.99);
}

.signature-canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    pointer-events: none; /* Canvas is not interactive - clicks go to wrapper */
}

/* Overlay hint text */
.signature-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: #999;
    font-size: 14px;
    font-style: italic;
    transition: opacity 0.3s;
}

.signature-canvas-wrapper.has-signature .signature-overlay {
    opacity: 0;
}

.clear-signature {
    margin-top: 10px;
    padding: 8px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.clear-signature:hover {
    background: #5a6268;
}

/* Fullscreen Signature Modal */
.signature-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.signature-modal-content {
    position: relative;
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
}

.signature-modal-header {
    padding: 15px 20px;
    background: #0073aa;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    height: 70px;
    box-sizing: border-box;
}

.signature-modal-header h3 {
    margin: 0;
    color: white;
    border: none;
    padding: 0;
    font-size: 20px;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 0.8;
}

#modal-signature {
    flex: 1;
    width: 100%;
    min-height: 300px;
    border: none;
    background: white;
    touch-action: none;
    cursor: crosshair;
    display: block;
    -webkit-tap-highlight-color: transparent;
}

.signature-modal-footer {
    padding: 15px 20px;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-shrink: 0;
    height: 90px;
    box-sizing: border-box;
    align-items: center;
}

.modal-clear,
.modal-done {
    padding: 12px 35px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}

.modal-clear {
    background: #6c757d;
    color: white;
}

.modal-clear:hover,
.modal-clear:active {
    background: #5a6268;
}

.modal-done {
    background: #28a745;
    color: white;
}

.modal-done:hover,
.modal-done:active {
    background: #218838;
}

/* Mobile optimizations for modal */
@media (max-width: 768px) {
    .signature-modal-header {
        padding: 10px 15px;
        height: 60px;
    }
    
    .signature-modal-header h3 {
        font-size: 16px;
    }
    
    .modal-close {
        font-size: 30px;
        width: 35px;
        height: 35px;
    }
    
    .signature-modal-footer {
        padding: 10px 15px;
        height: 80px;
        gap: 10px;
    }
    
    .modal-clear,
    .modal-done {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    #modal-signature {
        cursor: none;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .signature-modal-header {
        height: 50px;
        padding: 8px 15px;
    }
    
    .signature-modal-header h3 {
        font-size: 14px;
    }
    
    .modal-close {
        font-size: 24px;
        width: 30px;
        height: 30px;
    }
    
    .signature-modal-footer {
        height: 60px;
        padding: 8px 15px;
    }
    
    .modal-clear,
    .modal-done {
        padding: 8px 20px;
        font-size: 13px;
    }
}

/* Buttons */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background 0.3s;
}

.button:hover {
    background: #005a87;
}

.button-primary {
    background: #0073aa;
    font-size: 18px;
    padding: 15px 40px;
    font-weight: 600;
}

.button-primary:hover {
    background: #005a87;
}

.form-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #0073aa;
}

/* Messages */
#form-message {
    margin-top: 20px;
    text-align: center;
}

#form-message p {
    padding: 15px;
    border-radius: 4px;
    font-weight: 600;
}

#form-message .success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#form-message .error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#form-message .loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 1024px) {
    .time-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .time-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .form-section {
        grid-template-columns: 1fr;
    }
    
    .time-entry-header {
        grid-template-columns: 1fr;
    }
    
    .time-row {
        grid-template-columns: 1fr;
    }
    
    .time-summary {
        grid-template-columns: 1fr;
    }
    
    .signature-section {
        grid-template-columns: 1fr;
    }
    
    .material-row {
        grid-template-columns: 1fr;
    }
    
    .discher-header {
        flex-direction: column;
    }
    
    .company-info {
        text-align: left;
        margin-top: 15px;
    }
}

/* Admin styles */
.button-danger {
    background: #dc3545;
    color: white;
}

.button-danger:hover {
    background: #c82333;
}

input[readonly] {
    background: #e9ecef;
    cursor: not-allowed;
}

/* 3-column form grid for customer info */
.form-section-3col {
    grid-template-columns: repeat(2, 1fr);
}

/* ===== DRAFT REVIEW OVERLAY ===== */
.draft-review-overlay {
    position: fixed;
    z-index: 99998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    overflow: hidden;
}

.draft-review-content {
    position: relative;
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.draft-review-header {
    padding: 18px 25px;
    background: #0073aa;
    color: white;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.draft-review-header h2 {
    margin: 0;
    font-size: 22px;
    color: #fff;
}

.draft-review-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.draft-review-footer {
    padding: 15px 25px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: 0 0 8px 8px;
}

.button-back {
    background: #6c757d;
    color: white;
    font-size: 16px;
    padding: 12px 30px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.button-back:hover {
    background: #5a6268;
}

.button-send {
    background: #28a745;
    color: white;
    font-size: 16px;
    padding: 12px 30px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.button-send:hover {
    background: #218838;
}

/* Draft review content styles */
.draft-section {
    margin-bottom: 20px;
}

.draft-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 6px;
}

.draft-table {
    width: 100%;
    border-collapse: collapse;
}

.draft-table td,
.draft-table th {
    padding: 6px 10px;
    border: 1px solid #ddd;
    font-size: 13px;
    text-align: left;
}

.draft-table th {
    background: #f0f0f0;
    font-weight: 600;
    font-size: 12px;
}

.draft-table-full {
    font-size: 12px;
}

.draft-table-full td {
    text-align: center;
}

.draft-table-full td:nth-child(2) {
    white-space: nowrap;
}

.draft-text {
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.draft-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.draft-sig-box {
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.draft-sig-img {
    max-width: 100%;
    max-height: 80px;
    margin-top: 8px;
    border: 1px solid #eee;
    border-radius: 3px;
    background: #fff;
}

.draft-sig-missing {
    color: #dc3545;
    font-weight: 600;
}

/* Mobile adjustments for draft review */
@media (max-width: 768px) {
    .draft-review-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .draft-review-body {
        padding: 15px;
    }
    
    .draft-review-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-back,
    .button-send {
        width: 100%;
        text-align: center;
    }
    
    .draft-signatures {
        grid-template-columns: 1fr;
    }
    
    .draft-table-full {
        font-size: 11px;
    }
    
    .draft-table-full td,
    .draft-table-full th {
        padding: 4px 5px;
    }
    
    .form-section-3col {
        grid-template-columns: 1fr;
    }
}

/* ===== IMAGE UPLOAD SECTION ===== */
.image-upload-section {
    margin-bottom: 25px;
}

.image-upload-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.button-upload {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: white !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    text-decoration: none;
}

.button-upload:hover {
    background: #005a87;
    color: white !important;
}

.image-count {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.image-preview-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
}

.image-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.image-preview-item .image-name {
    display: block;
    padding: 3px 5px;
    font-size: 10px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-remove-btn:hover {
    background: #dc3545;
}

@media (max-width: 768px) {
    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    
    .image-preview-item img {
        height: 80px;
    }
}