/* ==================================================
   JOBCARD SIGNATURES – FINAL RESPONSIVE VERSION
================================================== */

/* ==================================================
   SIGNATURE GRID (PC / TABLET)
================================================== */

.jobcard-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.jobcard-signatures .signature-block {
    width: 100%;
}

/* Stack signatures on mobile */
@media (max-width: 768px) {
    .jobcard-signatures {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   SIGNATURE PREVIEW BLOCKS
================================================== */

.jobcard-signatures .signature-preview {
    border: 1px dashed #9ca3af;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

.jobcard-signatures .signature-preview img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.jobcard-signatures .signature-preview.signed {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

/* Tighter preview on desktop */
@media (min-width: 769px) {

    .jobcard-signatures {
        align-items: start;
    }

    .jobcard-signatures .signature-preview {
        min-height: 120px;
        max-height: 140px;
        padding: 8px;
    }

    .jobcard-signatures .signature-preview img {
        max-height: 120px;
        object-fit: contain;
    }
}

/* ==================================================
   SIGNATURE MODAL
================================================== */

#signature-modal {
    display: none;
}

#signature-modal.is-open {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

/* ==================================================
   MODAL CONTENT
================================================== */

.signature-modal-content {
    background: #ffffff;
    width: 100%;
    height: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

/* ==================================================
   SIGNATURE PAD – DESKTOP / TABLET
================================================== */

.signature-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 3 / 1;
    position: relative;
    flex-shrink: 0;
}

.signature-canvas {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 2px dashed #9ca3af;
    border-radius: 8px;
    touch-action: none;
}

.signature-hint {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-size: 14px;
    color: #9ca3af;
    pointer-events: none;
}

/* ==================================================
   MODAL BUTTONS
================================================== */

.signature-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* ==================================================
   MOBILE SIGNATURE PAD (IMPORTANT SECTION)
================================================== */

@media (max-width: 768px) {

    .signature-modal-content {
        padding: 10px;
    }

    .signature-wrapper {
        width: 100%;

        /* ==================================================
           🔧 ADJUST SIGNATURE HEIGHT HERE 🔧
           Increase/decrease this value if needed
           Examples:
           - 65vh  → smaller
           - 70vh  → balanced (recommended)
           - 75vh  → bigger
        ================================================== */
        height: min(70vh, 520px);

        aspect-ratio: auto;
        margin-bottom: 12px;
    }

    .signature-modal-actions {
        margin-top: auto;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .signature-hint {
        transform: rotate(90deg);
        transform-origin: right bottom;
        right: 25px;
        bottom: 50%;
        font-size: 13px;
    }
}

/* =========================================
   PHOTOS – JOB CARD
========================================= */

.photos-section {
    margin-bottom: 24px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.photo-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.photo-thumb img {
    width: 100%;
    height: 90px;
    object-fit: cover;
}

.photo-thumb button {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.photo-add {
    height: 90px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #777;
    font-size: 13px;
}

.photo-add input {
    display: none;
}

/* =========================================
   Jobcard Process Page
========================================= */

.jobcard-header {
    margin-bottom: 18px;
}

.jobcard-meta {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.jobcard-section {
    margin-top: 32px;
}

.jobcard-section h3 {
    margin-bottom: 6px;
    color: var(--primary-color);
}

.materials-block {
    margin-bottom: 32px;
}

.materials-block h4 {
    margin-bottom: 10px;
}

.muted {
    color: #666;
    font-size: 14px;
}

/* =========================================
   Jobcard Process Page - Read Only Text
========================================= */

.readonly-text {
    font-size: 14px;
    line-height: 1.5;
    padding: 6px 0;
    color: #000;
}

/* =========================================
   GENERIC PILL GROUP
========================================= */

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2f6;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: #333;
    white-space: nowrap;
}

/* Priority emphasis */
.pill-priority {
    background: #ffe5e5;
    color: #b00000;
    
}


/* =========================================
   STATUS DISPLAY (TOP CENTER)
========================================= */

.jobcard-status-center {
    text-align: center;
    margin: 8px 0 18px;
}

.pill-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Draft */
.pill-status-draft {
    background: #eef2f6;
    color: #333;
border: 1px solid #10b981;
}

/* Ready to sign */
.pill-status-ready {
    background: #e0f2ff;
    color: #004c80;
border: 1px solid #10b981;
}

/* Finalised (Signed) */
.pill-status-finalised {
    background: #e6ffed;
    color: #0a7a2f;
border: 1px solid #10b981;
}

/* Closed */
.pill-status-completed {
    background: #f0f0f0;
    color: #555;
border: 1px solid #10b981;
}
/* =========================================
   STATUS TIMELINE (UNDER PILL)
========================================= */

.jobcard-timeline {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.jobcard-timeline span {
    white-space: nowrap;
}

/* =========================================
   JOB META GRID
========================================= */

.job-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Prevent layout breaking on small screens */
@media (max-width: 600px) {
    .job-meta-row {
        grid-template-columns: 1fr;
    }
}

</style>


.btn-small{
    padding:4px 10px;
    font-size:12px;
    border-radius:6px;
    background:#eee;
    border:1px solid #ccc;
    cursor:pointer;
}

.btn-small:hover{
    background:#ddd;
}