.new-page-activity {
  display: flex;
  margin: auto;
  flex-direction: column;
  gap: 30px;
  margin-top: 10%;
  margin-bottom: 15%;
}

button#CloseActivity, .save-activity-button {
  width: 15%;
  text-align: center;
}

.header-number-activity-2 {
  display: flex;
  flex-direction: row;
  flex-direction: row;
  justify-content: space-between;
  width: 40%;
  margin: auto;
}

.progress, .progress-bar {
  width: 40%;
  margin: auto;
}

.date-begin-and-end .ng-binding {
  float: right;
}

.col-md-12.group-item.uploaded-files {
  padding: 0;
  margin-top: 3%;
}

.saveActivity {
  display: flex;
  margin: 3% 0 3% 0;
  flex-direction: row;
  justify-content: center;
  grid-gap: 10px;
}
.saveAndFiles {
  display: flex;
  gap: 2%;
}
.saveActivity .form-group {
  margin-bottom: 0;
}

.activityButtons.service-call-page-buttons {
  margin-top: 0;
}

.date-and-time-container .ng-binding {
  font-size: 16px;
}

.date-and-time-container {
  margin-top: 3%;
}

.container-40 {
  width: 40%;
  margin: auto;
  gap: 20px;
  display: flex;
  flex-direction: column;
}

#textereaSubject {
  width: 100%;
}

.form-group-customer label {
  font-weight: bold;
  font-size: 15px;
}

.form-row, .form-row-Activity {
  margin-top: 2%;
}

.new-page-activity h1 {
  font-size: 30px;
  font-weight: bold;
  text-align: center;
}

.customer-details {
  background-color: white;
  padding: 3%;
}

.CustomerRole {
  width: 100%;
  text-align: right;
}

.customer-details label {
  font-size: 16px;
  text-align: right;
  float: right;
}

.activities-buttons.form-group.col-md-12.col-sm-12 {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.buttons-finish-activity {
display: flex;
justify-content: center;
gap: 10px;
}

.done-activity-button, .transfer-activity-button {
  background: white !important;
  border: 1px solid black;
  color: black;
  text-align: center;
}

input#saveActivity {
  width: auto;
}

@media (max-width: 1024px) {
  .progress-bar, .container-40 {
    width: 90%;
  }

  input#saveCloseActivity {
    width: 100%;
  }

  .container-40 .save-activity-button {
    margin-left: 0;
    height: 38px;
  }

  .header-number-activity-2 {
    width: 90%;
    margin: auto;
  }

  .header-number-activity {
    margin-top: 5%;
  }

    .new-page-activity h1 {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
  }

  .back-to-activities {
    height: 30px;
    width: 45%;
    font-size: 15px;
  }

  .service-call-page {
    padding: 0 !important;
  }

  .saveActivity {
    display: flex;
    flex-direction: column;
     width: 100%; 
  }
  .saveAndFiles {
    display: flex;
    flex-direction: column;
  }
  .unsignFile, .signFile
  {
    width:100% !important;
  }
  input #saveActivity {
    width: 100%;
  }

  .form-control.custom-select {
    height: 45px !important;
  }

  .save-activity-button {
    margin-left: 0 !important;
  }
}


/*new activity---------//////////*/

/* --- Figma Design applied to EXISTING classes --- */
body, .master-wrapper-page {
    background-color: #f5f6f8 !important;
    font-family: 'Plus Jakarta Sans', 'Arimo', 'Heebo', sans-serif;
}

/* Base Wrapper */
.new-page-activity {
    background-color: #f5f6f8;
    max-width: 450px;
    margin: 0 auto;
    direction: rtl;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

    .new-page-activity .container-40 {
        width: 100% !important;
    }

        .new-page-activity .container-40 form {
            display: flex;
            flex-direction: column;
        }

    /* Replicate White Rounded Cards used in Figma */
    .new-page-activity .header-number-activity,
    .new-page-activity .customer-details-activity-container,
    .new-page-activity .date-and-time-container,
    .new-page-activity .form-row-Activity,
    .new-page-activity .ActivityFields {
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
    }

    /* Specific spacing for time row so it stands as its own white card */
    .new-page-activity .date-and-time-container {
        padding-bottom: 10px;
    }

    .new-page-activity .form-row-addRow {
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
    }

    .new-page-activity .remove-row {
        color: #d11c1c;
        font-size: 20px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 10px;
    }

    .new-page-activity .row-item {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
    }

    /* Bottom Card Items */
    .new-page-activity .form-group-upload-file,
    /* .new-page-activity .saveActivity, */
    .new-page-activity .buttons-finish-activity {
        background-color: #ffffff;
        padding: 10px 16px;
        border-left: 1px solid #e0e0e0;
        border-right: 1px solid #e0e0e0;
    }

    .new-page-activity .form-group-upload-file {
        border-top: 1px solid #e0e0e0;
        border-top-right-radius: 8px;
        border-top-left-radius: 8px;
        padding-top: 16px;
    }

    .new-page-activity .buttons-finish-activity {
        border-bottom: 1px solid #e0e0e0;
        border-bottom-right-radius: 8px;
        border-bottom-left-radius: 8px;
        padding-bottom: 16px;
        margin-bottom: 12px;
    }

    .new-page-activity .customer-details-activity-container {
        display: flex;
        gap: 15px;
        align-items: flex-end;
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 12px;
        flex-direction: row-reverse;
    }

    .new-page-activity .customer-right-col {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        text-align: right;
    }

    .new-page-activity .customer-left-col {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .new-page-activity .customer-detail-title {
        font-size: 16px;
        font-weight: bold;
        margin: 0 0 5px 0;
        color: #000;
    }

    /* ========================================================================= */
    /* DATES AND TIMES (SIDE-BY-SIDE LAYOUT)                                     */
    /* ========================================================================= */
    .new-page-activity .side-by-side-container {
        display: flex;
        gap: 10px;
        flex-wrap: nowrap;
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
        flex-direction: row-reverse;
    }

    .new-page-activity .side-by-side-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0; /* Fixes text/padding overflow in flex items */
    }

        .new-page-activity .side-by-side-item label {
            margin-bottom: 5px;
            font-size: 13px;
        }


    .new-page-activity .position-relative {
        position: relative;
    }

    .new-page-activity .date-picker-icon-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 40px;
        z-index: 2;
        cursor: pointer;
    }

    .new-page-activity .calendar-icon-overlay {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
    }

    /* Specific inner overrides for time inputs matching Figma */
    .new-page-activity .input-with-icon.start-end-input input {
        padding-left: 30px !important;
        padding-right: 30px !important;
        text-align: center !important;
    }

    .new-page-activity .customer-detail-name {
        font-size: 15px;
        margin-bottom: 10px;
        color: #333;
    }

    .new-page-activity .whatsapp-banner {
        background-color: #55cd6c;
        height: 35px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        padding: 0 10px;
        width: 100%;
        justify-content: flex-start;
        cursor: pointer;
    }

    .new-page-activity .info-badge {
        background-color: #dcdcdc;
        border-radius: 6px;
        padding: 6px 12px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        cursor: default;
    }

        .new-page-activity .info-badge.clickable {
            cursor: pointer;
        }

        .new-page-activity .info-badge span {
            color: #333;
            font-size: 14px;
        }

        .new-page-activity .info-badge svg {
            margin-left: 8px;
        }

    /* 1. Header Card */
    .new-page-activity .header-number-activity {
        background-color: #ededed;
        border: 1px solid #d4d4d4;
        text-align: center;
        /*order: 2;*/
    }

        .new-page-activity .header-number-activity h1 {
            font-size: 16px;
            color: #0056b3;
            font-weight: bold;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            margin: 0 0 5px 0;
        }

    /* 2. Form Groups & Grids */
    .new-page-activity .form-row {
        display: flex;
        flex-wrap: wrap;
        margin-right: -5px;
        margin-left: -5px;
        margin-bottom: 10px;
        align-items: flex-start;
    }

    .new-page-activity .date-and-time-container, .new-page-activity .form-row-Activity {
        display: flex;
        flex-wrap: nowrap;
        margin-right: -5px;
        margin-left: -5px;
    }

    .new-page-activity .customer-details-title-activity {
        width: 100%;
        padding: 0 5px;
    }

    .new-page-activity .form-group, .new-page-activity .date-begin-and-end, .new-page-activity .form-row-date {
        display: flex;
        flex-direction: column;
        padding: 0 5px;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 12px;
    }

    .new-page-activity .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .new-page-activity .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* 3. Typography & Labels */
    .new-page-activity label {
        font-size: 13px;
        font-weight: 500;
        color: #333;
        margin-bottom: 6px;
        text-align: right;
        display: flex; /* Helps align the red star */
    }

        /* Activity Subject red asterisk exactly like screenshot */
        .new-page-activity label span[style*="color:red"] {
            margin-right: 4px;
        }

    /* 4. Controls (Input, Select, Textarea) - Figma Gray Box */
    .new-page-activity .form-control, .new-page-activity .row-input {
        background-color: #e8e8e8 !important;
        border: 1px solid #dcdcdc !important;
        border-radius: 6px !important;
        padding: 8px 12px !important;
        font-size: 14px;
        color: #555 !important;
        width: 100%;
        height: 40px;
        box-sizing: border-box;
        box-shadow: none !important;
        outline: none;
    }

        /* Make Readonly inputs gray text so they pop less */
        .new-page-activity .form-control[readonly] {
            background-color: #e8e8e8 !important;
            color: #7b7b7b !important;
        }


    /* ========================================================================= */
    /* FIX FOR ICONS WITHIN INPUTS (Time & Selects & Phone & Location)           */
    /* ========================================================================= */

    .new-page-activity .input-with-icon {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
    }

        .new-page-activity .input-with-icon .left-icon {
            position: absolute;
            left: 10px;
            pointer-events: none;
            z-index: 10;
        }

        .new-page-activity .input-with-icon .right-icon {
            position: absolute;
            right: 10px;
            pointer-events: none;
            z-index: 10;
        }

    /* Force standard dropdown selects to ignore browser styles and use the SVG */
    .new-page-activity select.full-select {
        appearance: none;
        -webkit-appearance: none;
        background-image: none !important; /* Block native arrow */
        padding-left: 30px !important; /* Make room for left arrow SVG */
    }

    /* Custom injected time input fixing specific LTR alignment and icons */
    .new-page-activity .input-with-icon .figma-time {
        padding-left: 30px !important;
        padding-right: 32px !important;
        text-align: left !important;
        direction: ltr !important;
    }

    /* Hide native clock icon, using the injected red SVG icon instead */
    .new-page-activity input[type="time"]::-webkit-calendar-picker-indicator {
        display: none !important;
        -webkit-appearance: none;
    }

    /* Textarea height and padding flush */
    .new-page-activity textarea.form-control {
        min-height: 80px;
        height: auto;
        resize: none;
        /*padding: 12px !important;*/
    }



    .new-page-activity .input-group {
        position: relative;
        width: 100%;
    }

        .new-page-activity .input-group .form-control {
            /* Full width, standard border-radius, standard input box */
            border-radius: 6px !important;
            width: 100%;
            padding-left: 10px !important; /* Normal padding, icons float below in screenshot */
        }

    .new-page-activity .input-group-append {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end; /* Align right to match location in the original side */
        gap: 4px;
        margin-top: -10px; /* Pull them tightly underneath or overlapping slightly based on screenshot */
        position: absolute;
        bottom: -36px; /* Push below the input field exactly as shown in the screenshot */
        right: 0;
        z-index: 10;
    }

        .new-page-activity .input-group-append a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            height: 32px;
            width: 32px;
            background-color: #d9d9d9;
            border: 1px solid #dcdcdc;
            border-radius: 4px !important; /* Standalone buttons now */
            cursor: pointer;
            box-sizing: border-box;
            text-decoration: none;
        }

            .new-page-activity .input-group-append a.whatsapp {
                background-color: #55cd6c !important;
                border-color: #55cd6c !important;
                background-image: url("data:image/svg+xml;utf8,<svg fill='white' width='20' height='20' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path d='M12.01 2.01c-5.52 0-10 4.48-10 10 0 1.95.56 3.77 1.54 5.3l-1.53 4.67 4.8-1.5c1.49.91 3.25 1.44 5.12 1.44 5.51 0 10-4.48 10-10s-4.49-10-9.93-10zm5.41 14.5c-.24.7-1.4 1.34-1.95 1.39-.53.04-1.12.19-3.23-.68-2.54-1.05-4.17-3.64-4.29-3.81-.13-.16-1.02-1.36-1.02-2.59 0-1.23.64-1.84.87-2.07.22-.23.49-.29.66-.29.16 0 .34 0 .48.01.16.01.35-.06.53.38.2.49.68 1.66.75 1.8.06.14.1.31 0 .5s-.16.31-.32.5c-.15.18-.32.41-.45.52-.16.16-.32.33-.14.64.18.31.81 1.33 1.74 2.16 1.2.1 2.31.54 2.64.71.32.17.51.15.7-.07.18-.22.8-1.03 1.02-1.38.22-.35.43-.29.74-.18.31.11 1.95.92 2.29 1.09s.56.26.64.4c.08.15.08.85-.16 1.55z'/></svg>");
                background-repeat: no-repeat;
                background-position: center;
            }

            .new-page-activity .input-group-append a.waze32, .new-page-activity .input-group-append a.maps32 {
                background-size: 20px !important;
                background-position: center !important;
            }

    /* Added bottom padding to the form rows to make room for absolute positioned icons dropping below */
    .new-page-activity .customer-details-activity-container .form-row:last-child {
        padding-bottom: 40px;
    }

    /* ========================================================================= */
    /* MATERIAL DATEPICKER FIXES                                                 */
    /* ========================================================================= */
    .new-page-activity md-datepicker {
        display: flex;
        align-items: center;
        width: 100%;
        background-color: #e8e8e8;
        border: 1px solid #dcdcdc;
        border-radius: 6px;
        padding: 0;
        margin: 0;
        height: 40px;
        box-sizing: border-box;
        flex-direction: row-reverse; /* Put button on the right visually */
    }

        .new-page-activity md-datepicker.md-default-theme {
            background-color: #e8e8e8 !important;
        }

        .new-page-activity md-datepicker .md-datepicker-input-container {
            flex: 1;
            border: none;
            border-bottom: none;
            background: transparent;
            padding: 0;
            margin: 0;
            display: flex;
            align-items: center;
            height: 100%;
            box-sizing: border-box;
            background-image: url("data:image/svg+xml;utf8,<svg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
            background-repeat: no-repeat;
            background-position: left 10px center;
        }

        .new-page-activity md-datepicker .md-datepicker-input {
            font-size: 14px;
            height: 100%;
            padding: 0 5px 0 25px !important;
            border: none;
            background: transparent;
            text-align: right;
            flex: 1;
            min-width: 0;
        }

        .new-page-activity md-datepicker .md-datepicker-button {
            margin: 0;
            padding: 0;
            width: 36px;
            height: 100%;
            flex-shrink: 0;
            background-color: transparent !important;
            background-image: url("data:image/svg+xml;utf8,<svg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d51c1c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 6v6l4 2'/></svg>");
            background-repeat: no-repeat;
            background-position: center;
            border-radius: 0;
        }

            .new-page-activity md-datepicker .md-datepicker-button .md-datepicker-calendar-icon {
                display: none !important;
            }

        .new-page-activity md-datepicker .md-button.md-icon-button {
            border-radius: 0;
        }

    /* 5. Action Buttons */
    .new-page-activity .save-activity-button, .new-page-activity .button-1, .new-page-activity .save-activity-button-addRow {
        background-color: #d11c1c;
        border: none;
        border-radius: 6px;
        color: white;
        font-weight: 500;
        font-size: 14px;
        padding: 10px 15px;
        width: 100%;
        cursor: pointer;
        text-align: center;
        margin-top: 10px;
    }

        .new-page-activity .save-activity-button:hover, .new-page-activity .button-1:hover {
            background-color: #b01515;
        }


    /* ========================================================================= */
    /* FILES AND ATTACHMENTS GRID & ADD ITEMS                                    */
    /* ========================================================================= */

    /* Add Item Red Button overrides */
    .new-page-activity #addRow.save-activity-button-addRow {
        margin-top: 0;
        font-size: 16px;
        background-color: #d11c1c;
        border-radius: 8px;
        color: white !important;
    }

    /* Base Wrapper for Files Area */
    .new-page-activity .files-and-attachments-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 20px;
    }

    /* Individual File Blocks */
    .new-page-activity .file-attachment-box {
        flex: 1 1 calc(50% - 5px);
        background-color: #e8e8e8;
        border-radius: 6px;
        display: flex;
        align-items: center;
        padding: 10px;
        box-sizing: border-box;
        height: 44px;
    }

        .new-page-activity .file-attachment-box svg {
            flex-shrink: 0;
        }

        .new-page-activity .file-attachment-box a {
            flex: 1;
            margin: 0 10px;
            color: #333;
            text-decoration: none;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 14px;
        }

        .new-page-activity .file-attachment-box .remove-item {
            background: transparent;
            border: none;
            font-size: 16px;
            cursor: pointer;
            color: #d11c1c;
            font-weight: bold;
        }

        /* Blue "Add File" Specific Override */
        .new-page-activity .file-attachment-box.input-group-choose-file {
            background-color: #3b8cf2; /* Blue */
            color: white;
            text-align: center;
            justify-content: center;
            position: relative;
            cursor: pointer;
        }

    .new-page-activity .input-group-choose-file .overlay-layer {
        color: white;
    }

    .new-page-activity .upload_btn {
        opacity: 0;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    /* File Upload and General section containers */
    .new-page-activity .files-and-attachments {
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
    }

        .new-page-activity .files-and-attachments label {
            text-align: right;
            width: 100%;
            font-weight: bold;
            margin-bottom: 10px;
            display: inline-block;
        }

    .new-page-activity div.saveActivity {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
        margin-bottom: 20px;
    }

        .new-page-activity div.saveActivity input {
            flex: 1;
        }

        .new-page-activity div.saveActivity label {
            text-align: right;
            width: 100%;
        }

        .new-page-activity div.saveActivity select {
            background-color: #e8e8e8;
            padding: 10px;
            border-radius: 6px;
            width: 100%;
        }

    /* ========================================================================= */
    /* BOTTOM FINISH ACTION BUTTONS                                              */
    /* ========================================================================= */

    /* Bottom Actions Grid Container */
    .new-page-activity .buttons-finish-activity-container {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
        margin-top: 15px;
        clear: both;
    }

    .new-page-activity .finish-activity-row {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        width: 100% !important;
        margin-bottom: 12px;
    }

    .new-page-activity .finish-activity-cell {
        display: block; /* Block allows inputs to span natively */
        margin-left: 0;
    }

    .new-page-activity .cell-save-draft {
        flex: 1; /* Takes roughly 40% proportional visually */
    }

    .new-page-activity .cell-preview-sign {
        flex: 1.6; /* Takes roughly 60% proportional visually like mockup */
    }

    .new-page-activity .finish-activity-full {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Button Base Shared Styles */
    .new-page-activity .btn-finish-action {
        display: block;
        border-radius: 6px;
        padding: 10px !important;
        font-size: 16px;
        font-weight: bold;
        text-align: center;
        cursor: pointer;
        width: 100% !important;
        max-width: 100%;
        border: none;
        outline: none;
        box-shadow: 0px 2px 4px rgba(0,0,0,0.1);
        transition: background-color 0.2s;
        font-family: inherit;
        box-sizing: border-box;
        height: 45px;
        line-height: normal;
        white-space: nowrap; /* Don't allow text wrap, keep it crisp like mockup */
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .new-page-activity .btn-finish-action:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

    /* 1. Save draft / Gray */
    .new-page-activity .btn-save-draft {
        background-color: #a8a8a8;
        color: #333;
    }

        .new-page-activity .btn-save-draft:hover:not(:disabled) {
            background-color: #999;
        }

    /* 2. Preview and sign / Red */
    .new-page-activity .btn-preview-sign {
        background-color: #c8102e; /* Deep red extracted from mockup */
        color: white;
    }

        .new-page-activity .btn-preview-sign:hover:not(:disabled) {
            background-color: #a50d25;
        }

    /* 3. Close activity / White Outline */
    .new-page-activity .btn-close-activity {
        background-color: #ffffff;
        border: 1.5px solid #a82020; /* Dark red outline */
        color: #333;
    }

        .new-page-activity .btn-close-activity:hover:not(:disabled) {
            background-color: #fcfcfc;
        }