/* job sheet */

/* form page */


/* =====================================================
   JOB SHEET FORM – CLEAN RESPONSIVE SYSTEM
   Vehicle + Task Section Unified
===================================================== */

/* ================= SECTION TITLES ================= */

/* Desktop */
.job-form .card-title {
  margin-top: 0px;
  margin-bottom: 12px !important;
  font-weight: 600;
}

.job-form hr {
  margin-top: 0;
  margin-bottom: 0px;
}

/* ================= FIELD SPACING ================= */

/* Desktop field spacing */
.form-group-custom {
  margin-top: 0px !important;
  margin-bottom: 12px !important;
}

/* Label spacing */
.form-group-custom .form-label {
  margin-bottom: 6px;
}

/* ================= TASK BLOCK ================= */

.task-block {
  /* margin-bottom: 20px; */
  border-radius: 6px;
}

/* chhose desc */

/* Default (Desktop) */
.desc-type-wrapper {
  display: flex;
  align-items: center;
  gap: 25px;
  flex-wrap: wrap;
  margin-bottom: 25px !important;
}


/* ================= MOBILE STYLES ================= */

@media (max-width: 768px) {

  /* -----------------------------job form---------------------------------- */
  .job-form>.col-md-6 {
    margin-top: 5px !important;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .job-form>.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* job buttons */
  .jobsheet-btn-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0 !important;
  }

  .jobsheet-btn-wrapper button {
    width: 100%;
    height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
  }

  .jobsheet-btn-wrapper button .icon {
    margin-right: 6px;
  }

  /* Section titles */
  .job-form .card-title {
    margin-top: 5px;
    margin-bottom: 10px !important;
    font-size: 16px !important;
  }

  .job-form hr {
    margin-bottom: 10px;
  }

  /* Field spacing mobile */
  .form-group-custom {
    margin-top: 0px !important;
    margin-bottom: 5px !important;
  }

  .form-group-custom .form-label {
    margin-bottom: 5px !important;
  }

  /* ===== MAKE ALL TASK COLUMNS FULL WIDTH ===== */
  .job-task-container .col-md-6,
  .job-task-container .col-md-12,
  .job-task-container .col-lg-6,
  .job-task-container .col-lg-4,
  .job-task-container .col-lg-3 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* Remove bootstrap gutter inside task */
  .task-block .row {
    --bs-gutter-x: 0 !important;
  }

  /* Task block padding */
  /* .task-block { */
    /* padding: 12px !important; */
    /* margin-bottom: 12px !important; */
  /* } */

  /* Full width inputs */
  .task-block .form-control,
  .task-block .ant-picker,
  .task-block .react-select__control {
    width: 100% !important;
  }

  /* Buttons stack */
  .jobsheet-btn-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0 !important;
  }

  .jobsheet-btn-wrapper button {
    width: 100%;
    height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
  }

  .jobsheet-btn-wrapper button .icon {
    margin-right: 6px;
  }
}

/* ================= EXTRA SMALL MOBILE ================= */

@media (max-width: 550px) {
  .job-task-container {
    padding: 10px !important;
  }

  .desc-type-wrapper {
    flex-wrap: nowrap !important;
    justify-content: space-between;
    gap: 10px;
  }

  .desc-type-wrapper .form-check {
    margin: 0 !important;
  }
}

/* Under 400px → 2 + 2 Grid Layout */
@media (max-width: 400px) {
  .desc-type-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
  }

  .desc-type-wrapper .form-check {
    display: flex;
    align-items: center;
  }
}


/* view page */

.v-antd-custom-tabs {
    width: 100%;
}

.v-tab-label .task-prefix {
    display: inline;
}

.v-meta-text {
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* .receipt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 12px;
    margin-top: 12px;
} */

.receipt-grid {
    display: grid;
    /* auto-fit as many cards as fit with max 120px each */
    grid-template-columns: repeat(auto-fit, minmax(90px, 120px));
    gap: 12px;
    /* space between cards */
    margin-top: 12px;
    justify-content: start;
    /* align items to left instead of stretching */
}

/* Upload Field Responsive Base Fix */
/* .v-media-tabs .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
} */

/* Desktop Default */
/* .v-media-tabs .form-control {
    width: 420px;       
    max-width: 100%;
    box-sizing: border-box;
} */

.v-media-tabs .form-control {
    width: clamp(260px, 40vw, 420px);
    max-width: 100%;
    box-sizing: border-box;
}

.job-completion-grid>.completion-box.desktop {
    display: block;
}

.job-completion-grid>.completion-box.mobile {
    display: none;
}



@media (min-width: 1200px) {

    .v-media-grid,
    .task-image-list,
    .task-video-container {
        grid-template-columns: repeat(5, 1fr);
    }

    .receipt-grid {
        grid-template-columns: repeat(5, 1fr);
    }

}

@media (max-width: 1199px) and (min-width: 992px) {

    .v-media-grid,
    .task-image-list,
    .task-video-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .receipt-grid {
        grid-template-columns: repeat(4, 1fr);
    }

}

@media (max-width: 991px) and (min-width: 768px) {

    .v-media-grid,
    .task-image-list,
    .task-video-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .receipt-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}

@media (max-width: 767px) and (min-width: 576px) {

    .v-media-grid,
    .task-image-list,
    .task-video-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .receipt-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}

@media (max-width: 500px) {

    .v-nav-tabs-container {
        overflow-x: auto;
        /* enable horizontal scroll */
        -webkit-overflow-scrolling: touch;
        /* smooth scroll for mobile */
    }

    .v-antd-custom-tabs .ant-tabs-nav-list {
        flex-wrap: nowrap !important;
        /* prevent tabs from wrapping */
    }

    .v-antd-custom-tabs .ant-tabs-tab {
        flex: 0 0 auto;
        /* make each tab fit content */
        min-width: 80px;
        /* optional: minimum width per tab */
    }

    .v-tab-label .task-prefix {
        display: none;
    }

    .v-main-heading {
        font-size: 1.125rem !important;
    }

    .v-section-title {
        font-size: 1.125rem !important;
    }

    .v-hero-info {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .v-main-heading {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .v-hero-buttons {
        display: flex;
        gap: 8px;
    }

    .task-status-rect {
        min-width: auto;
        width: fit-content;
        min-height: 32px;
        font-size: 11px;
        padding: 0 8px;
    }

    .v-meta-text {
        flex-direction: column;
        gap: 3px;
        margin-bottom: 0px;
    }

    .v-meta-text span {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 0.80rem !important;
    }

    .v-meta-text span:nth-child(1) {
        order: 1;
    }

    .v-meta-text span:nth-child(3) {
        order: 2;
    }

    .v-meta-text span:nth-child(2) {
        order: 3;
    }

    /* media items */
    .v-media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .v-media-grid img,
    .v-media-grid video,
    .v-media-grid .media-box {
        height: 100px;
    }

    /* receipt docs */
    .receipt-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .receipt-card {
        width: 75px;
        padding: 8px;
        border-radius: 8px;
    }

    .pdf-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
    }

    /* job completion card */

    .job-completion-grid>.completion-box.desktop {
        display: none !important;
    }

    .job-completion-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 12px;
    }

    /* .completion-box.amount-completed {
        grid-column: span 1;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        padding: 14px 18px;
    } */

    .job-completion-grid>.completion-box.mobile {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        padding: 14px 18px;
        border-radius: 12px;
        border: 1px solid var(--v-border);
    }

    .job-completion-grid>.completion-box.mobile>div {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
    }

    .job-completion-grid>.completion-box.mobile label {
        font-size: 14px;
    }

    .job-completion-grid>.completion-box.mobile span {
        font-size: 14px;
        word-break: break-word;
    }

    .completion-box.full {
        grid-column: span 1;
    }

}

@media (max-width: 400px) {
    .v-media-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        gap: 5px;
    }

    .v-media-grid img,
    .v-media-grid video,
    .v-media-grid .media-box {
        height: 100px;
    }

    .completion-box span,
    p {
        font-size: 0.80rem !important;
    }


    .completion-box.amount-completed span {
        font-size: 0.80rem !important;
    }


    .job-completion-grid .completion-box.mobile.amount-completed span {
        font-size: 0.80rem !important;
    }
}

/* kanban view page */
@media (max-width: 500px) {

    .job-info-row {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }

    .job-info-row>.col-auto {
        flex: 0 0 33.33% !important;
        max-width: 33.33% !important;
    }

    .job-info-row>.col-auto div:first-child {
        font-size: 13px !important;
    }

    .job-info-row>.col-auto div:last-child {
        font-size: 12px !important;
    }
}

@media (max-width: 390px) {

    .job-info-row>.col-auto {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .job-info-row>.col-auto div:first-child {
        font-size: 12px !important;
    }

    .job-info-row>.col-auto div:last-child {
        font-size: 11px !important;
    }
}

/* job share link page */
@media (max-width: 500px) {

    /* top header bar */

    .v-header-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 12px 16px;
        gap: 6px;
    }

    /* Remove absolute positioning on mobile */
    .task-redirect-detail-logo,
    .task-updated {
        position: static;
    }

    /* Logo */
    .task-redirect-detail-logo {
        flex: 0 0 auto;
    }

    .task-redirect-detail-logo img {
        height: 26px;
        margin-top: 0;
    }

    /* Title beside logo */
    .v-header-title {
        flex: 1;
        font-size: 16px;
        font-weight: 600;
        text-align: left;
    }

    /* Updated goes to next row */
    .task-updated {
        flex: 1 1 100%;
        font-size: 11px;
        color: #888;
        text-align: right;
        margin-top: 2px;
    }

    .task-updated .updated-label {
        display: inline;
        color: #aaa;
        font-weight: 500;
    }

    .task-updated span {
        margin-left: 4px;
        font-weight: 500;
        color: #555;
    }

    /* Field Expert Upload Fix */
    /* .v-media-tabs .form-control {
        width: 100% !important;
        max-width: 100%;
        font-size: 13px;
    } */

    .v-media-tabs .form-control {
        width: 100%;
    }

    .task-image-list,
    .task-video-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .task-image-item img,
    .task-video-preview video {
        width: 100%;
        height: 90px;
        object-fit: cover;
    }


    /*  other all input fields */
    .v-grid-fields {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .v-input-mimic,
    .v-real-input {
        height: 42px;
        /* Slightly bigger for touch */
        font-size: 14px;
        /* Better readability */
    }

    /* footer buttons --------------- */
    .v-sticky-footer {
        display: flex !important;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 12px;
    }

    /* Remove auto push behaviour */
    .v-footer-left {
        margin-right: 0 !important;
    }

    /* Make ALL buttons equal */
    .v-sticky-footer button {
        flex: 1;
        height: 44px;
        font-size: 13px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 0 !important;
        /* override inline style */
    }

}