.theme-light {
  --bg-color: #ffffff;
  --text-color: #000000;

  --bubble-bg: #f9f9f9;
  --bubble-border: #ddd;
  --bubble-hover-bg: #f0f0f0;

  --user-bg: #ffffff;
  --user-border: #e6e6e6;
  --technician-bg: #f0f7ff;
  --technician-border: #d0e6ff;
  --delivery-bg: #f0f7ff;
  --delivery-border: #d0e6ff;
  --manager-bg: #fff7e6;
  --manager-border: #ffe0a3;

  --bubble-text: #333;
  --bubble-text-strong: #111;
  --bubble-text-muted: #666;

  --badge-bg: #f00;
  --badge-text: #fff;

  --sent-msg-bg: #e1ffc7;
  --sent-msg-color: #000;
  --received-msg-bg: #d2e3fc;
  --received-msg-color: #000;

  --meta-color: #555;
  --timestamp-color: #666;

  --menu-hover-bg: #f0f0f0;
  --menu-hover-color: #000;

  --modal-bg: #ffffff;
  --modal-text-color: #333;
  --modal-border: #ccc;
  --modal-heading-color: #000;
}

.theme-dark {
  --bg-color: #000000;
  --text-color: #f5f5f5;

  --bubble-bg: #111111;
  --bubble-border: #333333;
  --bubble-hover-bg: #222222;

  --user-bg: #111111;
  --user-border: #333333;
  --technician-bg: #1a1a1a;
  --technician-border: #444444;
  --delivery-bg: #1a1a1a;
  --delivery-border: #444444;
  --manager-bg: #222222;
  --manager-border: #555555;

  --bubble-text: #eee;
  --bubble-text-strong: #fff;
  --bubble-text-muted: #aaa;

  --badge-bg: #ff4444;
  --badge-text: #fff;

  --sent-msg-bg: #0d47a1;
  --sent-msg-color: #ffffff;
  --received-msg-bg: #1b5e20;
  --received-msg-color: #ffffff;

  --meta-color: #cccccc;
  --timestamp-color: #aaaaaa;

  --menu-hover-bg: #333333;
  --menu-hover-color: #f5f5f5;

  --modal-bg: #1e1e1e;
  --modal-text-color: #f0f0f0;
  --modal-border: #555;
  --modal-heading-color: #ffffff;
}

.theme-blue {
  --bg-color: #e6f0ff;
  --text-color: #003366;

  --bubble-bg: #dce9ff;
  --bubble-border: #99c2ff;
  --bubble-hover-bg: #cce0ff;

  --user-bg: #e6f0ff;
  --user-border: #99c2ff;
  --technician-bg: #dce9ff;
  --technician-border: #99c2ff;
  --delivery-bg: #dce9ff;
  --delivery-border: #99c2ff;
  --manager-bg: #cce5ff;
  --manager-border: #80bfff;

  --bubble-text: #003366;
  --bubble-text-strong: #001a33;
  --bubble-text-muted: #336699;

  --badge-bg: #003366;
  --badge-text: #fff;

  --sent-msg-bg: #cce5ff;
  --sent-msg-color: #003366;
  --received-msg-bg: #99ccff;
  --received-msg-color: #003366;

  --meta-color: #003366;
  --timestamp-color: #336699;

  --menu-hover-bg: #99ccff;
  --menu-hover-color: #003366;

  --modal-bg: #f0f7ff;
  --modal-text-color: #003366;
  --modal-border: #99c2ff;
  --modal-heading-color: #001a33;
}

body {
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 0;
  background: var(--bg-color);
 
}

* {
    box-sizing: border-box;
}


/* ============================================================
   HANDOVER CONFIRMATION MODAL
   ============================================================ */

.handover-confirmation-modal {
    position: fixed;
    inset: 0;

    z-index: 30000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.58);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    box-sizing: border-box;
}


/* ============================================================
   CARD
   ============================================================ */

.handover-confirmation-card {

    width: 100%;
    max-width: 440px;

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    box-sizing: border-box;

    background: var(--modal-bg, #121212);

    color: var(
        --modal-text-color,
        #ffffff
    );

    border: 1px solid var(
        --modal-border,
        rgba(255,255,255,.10)
    );

    border-radius: 14px;

    padding: 20px;

    box-shadow:
        0 20px 60px rgba(0,0,0,.45);

    animation:
        handoverModalIn
        .22s
        cubic-bezier(.2,.8,.2,1);
}


/* ============================================================
   HEADER
   ============================================================ */

.handover-confirmation-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 16px;
}


.handover-confirmation-header h3 {

    margin: 0;

    font-size: 18px;

    font-weight: 700;

    line-height: 1.3;

    letter-spacing: .1px;
}


/* ============================================================
   CLOSE BUTTON
   ============================================================ */

.handover-close-btn {

    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    padding: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border: none;

    border-radius: 50%;

    background: transparent;

    color: inherit;

    font-size: 15px;

    cursor: pointer;

    opacity: .72;

    transition:
        background .16s ease,
        opacity .16s ease,
        transform .16s ease;
}


.handover-close-btn:hover {

    opacity: 1;

    background:
        rgba(255,255,255,.08);

    transform: scale(1.04);
}


.handover-close-btn:active {

    transform: scale(.96);
}


/* ============================================================
   BODY
   ============================================================ */

.handover-confirmation-body {

    font-size: 14px;

    line-height: 1.5;
}


.handover-confirmation-body > p:first-child {

    margin:
        0 0 14px;

    opacity: .82;
}


/* ============================================================
   OWNER DETAILS
   ============================================================ */

.handover-owner-details {

    display: flex;

    flex-direction: column;

    gap: 0;

    margin:
        12px 0 18px;

    padding: 4px 14px;

    border: 1px solid
        rgba(255,255,255,.10);

    border-radius: 10px;

    background:
        rgba(255,255,255,.045);
}


.handover-owner-row {

    display: grid;

    grid-template-columns:
        82px minmax(0, 1fr);

    align-items: center;

    gap: 12px;

    min-height: 46px;

    border-bottom:
        1px solid
        rgba(255,255,255,.07);
}


.handover-owner-row:last-child {

    border-bottom: none;
}


.handover-owner-row strong {

    font-size: 12px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: .45px;

    opacity: .58;
}


.handover-owner-row span {

    min-width: 0;

    overflow-wrap: anywhere;

    font-size: 14px;

    font-weight: 500;

    text-align: right;

    color: inherit;
}


/* ============================================================
   QUESTION
   ============================================================ */

.handover-confirmation-question {

    margin:
        16px 0 14px;

    font-size: 14px;

    font-weight: 600;

    text-align: center;

    opacity: .92;
}


/* ============================================================
   ACTIONS
   ============================================================ */

.handover-confirmation-actions {

    display: flex;

    flex-direction: column;

    gap: 9px;

    margin-top: 12px;
}


.handover-confirmation-actions button {

    width: 100%;

    min-height: 44px;

    padding:
        10px 14px;

    border-radius: 9px;

    border: none;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background .16s ease,
        transform .16s ease,
        opacity .16s ease,
        border-color .16s ease;
}


.handover-confirmation-actions button:hover {

    transform: translateY(-1px);
}


.handover-confirmation-actions button:active {

    transform: translateY(0);
}


/* ============================================================
   PRIMARY — SEND APPROVAL
   ============================================================ */

.handover-confirmation-actions
#handoverApprovalBtn {

    background: #4CAF50;

    color: #ffffff;
}


.handover-confirmation-actions
#handoverApprovalBtn:hover {

    background: #43a047;
}


/* ============================================================
   SECONDARY — THIS IS MY ACCOUNT
   ============================================================ */

.handover-confirmation-actions
#handoverMyAccountBtn {

    background: transparent;

    color: inherit;

    border:
        1px solid
        rgba(255,255,255,.20);
}


.handover-confirmation-actions
#handoverMyAccountBtn:hover {

    background:
        rgba(255,255,255,.07);

    border-color:
        rgba(255,255,255,.30);
}


/* ============================================================
   DISABLED
   ============================================================ */

.handover-confirmation-actions
button:disabled {

    opacity: .50;

    cursor: not-allowed;

    transform: none;
}


/* ============================================================
   STATUS
   ============================================================ */

.handover-confirmation-status {

    min-height: 18px;

    margin-top: 12px;

    font-size: 12px;

    line-height: 1.4;

    text-align: center;

    opacity: .72;
}


/* ============================================================
   MODAL ANIMATION
   ============================================================ */

@keyframes handoverModalIn {

    from {

        opacity: 0;

        transform:
            translateY(16px)
            scale(.98);
    }

    to {

        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 520px) {

    .handover-confirmation-modal {

        padding: 12px;

        align-items: flex-end;
    }


    .handover-confirmation-card {

        max-width: none;

        max-height:
            calc(100vh - 24px);

        padding: 17px;

        border-radius: 14px;
    }


    .handover-confirmation-header h3 {

        font-size: 17px;
    }


    .handover-owner-details {

        padding:
            3px 12px;
    }


    .handover-owner-row {

        grid-template-columns:
            70px minmax(0, 1fr);

        min-height: 44px;

        gap: 8px;
    }


    .handover-owner-row span {

        font-size: 13px;
    }


    .handover-confirmation-actions button {

        min-height: 46px;
    }
}


/* ============================================================
   LIGHT THEME
   ============================================================ */

@media (prefers-color-scheme: light) {

    .handover-confirmation-modal {

        background:
            rgba(0,0,0,.38);
    }


    .handover-confirmation-card {

        background:
            var(--modal-bg, #ffffff);

        color:
            var(--modal-text-color, #222222);

        border-color:
            var(
                --modal-border,
                rgba(0,0,0,.10)
            );

        box-shadow:
            0 20px 60px
            rgba(0,0,0,.22);
    }


    .handover-owner-details {

        background:
            rgba(0,0,0,.035);

        border-color:
            rgba(0,0,0,.10);
    }


    .handover-owner-row {

        border-bottom-color:
            rgba(0,0,0,.07);
    }


    .handover-confirmation-actions
    #handoverMyAccountBtn {

        border-color:
            rgba(0,0,0,.18);
    }


    .handover-confirmation-actions
    #handoverMyAccountBtn:hover {

        background:
            rgba(0,0,0,.045);
    }
}

@media (min-width: 400px) {
    
.modal {
  position: fixed;
  z-index: 1100;
  right: 0;
  top:0;
  width: 100%;
  max-width: 600px;
  padding: 8px;
  display: flex;
  margin-bottom:var(--app-status-height);
  margin-top:var(--app-input-height);
  height: calc(100% - var(--app-status-height) - var(--app-input-height));
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
}

.modal-content {
  background-color: var(--modal-bg);
  color: var(--modal-text-color);
  border-radius: 8px;
  padding: 8px;
  width: 100%;
  
  max-width: 100%;
  overflow-x: hidden;
  border: 2px solid #000;
  box-sizing:border-box;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

}

.modal {
    overflow-y:auto;
}

.modal-content h3,
.modal-content h4 { 
    color: var(--modal-heading-color); 
    font-size: 20px;
    font-weight: 700;
    margin: initial;
    padding:0;
}

.modal-content p,
.modal-content ul,
.modal-content li,
.modal-content label { color: var(--modal-text-color); }

/* Lists inside modals */
.modal-content li { margin-bottom: 5px; }

@media (max-width : 400px) {
   
.modal {
  position: fixed;
  z-index: 1100;
  right: 0;
  top:0;
  width: 100%;
  height: calc(100% - var(--app-status-height));
  margin-bottom:var(--app-status-height);
  padding: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
}

.modal-content {
  background-color: var(--modal-bg);
  color: var(--modal-text-color);
  border-radius: 8px;
  padding: 4px;
  max-width: 100%;
  width: 100%;
  overflow-x: hidden;
  border: 2px solid #000;
  margin-top:0;
  box-sizing:border-box;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

}

.div {
    margin:5px;
}

.registration-field-error {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
    background-color: #fff8f8 !important;
}

#mapPicker, #directionPicker {
    min-height:65vh;
    max-height:80vh;
 
}

.map-content {
    padding:10px;
}

#directionsPanel {
    max-height:40vh;
    overflow:auto;    
}

#mobileToast {
    display:none;
    position:fixed;
    bottom:16px;
    left:50%;
    transform:translateX(-50%);
    background:#111827;
    color:#fff;
    padding:10px 14px;
    border-radius:8px;
    z-index:9999;
}

#restoreLoader {
    display:none;
    align-items:center;
    justify-content:center;    
}

#saveNewTemplate {
    background:#4CAF50;
    color:white;
    padding:10px;
    border:none;
    border-radius:5px;
    cursor:pointer;    
}

#tplText {
    height:100px;
}

#tplPlaceholders {
    display:flex;
    flex-wrap:wrap;
    gap:4px;
    margin-top:4px;
}

.image-input-wrapper {
    position:relative;
    display:inline-block;
}

#tplImageThumb {
    max-width:60px;
    max-height:60px;
    display:none;
    border:1px solid #ccc;
    border-radius:4px;
}

#removeImageButton {
    display:none;
    position:absolute;
    top:0;
    right:0;
    background:red;
    color:white;
    border:none;
    border-radius:50%;
    width:20px;
    height:20px;
    cursor:pointer;
}

#tplPreviewCard {
    max-width:100%;
}

#identifier {
    display:block;
    width:100%;
    margin-bottom:10px;
}

#password {
    display:block;
    width:100%;
    margin-bottom:15px;
}

#loginBtn {
    width:100%; 
    margin-bottom:12px;
}

#openModal button{
    background:none;
    border:none;
    color:#007bff;
    cursor:pointer;
}

#openModal {
    font-size:0.9em;
}

.main-container {
  width: 100%;
  max-width: 100%;
  margin: auto;
  min-height:100vh;
  background:
    linear-gradient(
      135deg,
      #FFF4E5 0%,
      #FFE0B2 50%,
      #FFF7EC 100%
    );
}

h3 {
margin:5px;    
}

.messageInput,
#messageInput {
    width: 100%;
    padding: 8px;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 20px;      /* keep current rounded look */
    font: inherit;
    color: inherit;
    background: inherit;

    resize: none;
    overflow-y: hidden;

    min-height: 40px;
    max-height: 120px;

    line-height: 1.4;
    box-sizing: border-box;
}

.media-item,
.document-item {
  margin: 6px 0;
}

.media-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.preview-img {
  max-width: 200px;
  max-height: 200px;
  object-fit: cover;
  border-radius: 4px;
}

.preview-video {
  width: 200px;
  max-height: 200px;
  object-fit: contain;
  border-radius: 4px;
}

.download-icon {
  margin-top: 4px;
  text-decoration: none;
  font-size: 0.9em;
}

.doc-header {
  display: flex;
  align-items: center;
}

.doc-icon {
  margin-right: 6px;
}

.file-name {
  font-weight: 500;
}

.file-meta {
  font-size: 0.85em;
  color: #555;
  margin-top: 4px;
  margin-left: 22px;
}
#welcomeBox.modal {
  position: fixed;
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#welcomeBox .modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  width:100%;
  max-width: 500px;
  box-sizing:border-box;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#welcomeBox .actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input, select {
    padding:8px;
    margin-bottom:6px;
    box-sizing:border-box;
    width:100%;
}
label {
    margin-bottom:6px;
}
.card-actions {
    display:flex;
    background-color: #007bff;
    justify-content:center;
    padding:4px 6px;
    align-items:center;
    gap:10px;
}
.card-actions button {
    font-size:16px;
}

.template-creator {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: flex-start;
  padding:10px;
}

.template-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width:100%;
  padding:10px;
  min-width:50%;
  border:2px solid #ddd;
  border-radius: 8px;
  box-sizing:border-box;
}

.template-preview {
  width:100%;
  padding:10px;
  box-sizing:border-box;
}


/* Unified modal positioning */
.template-modal,
.quickreply-modal {
  position: fixed;
  bottom: 60px;   /* ✅ 100px above bottom */
  right: 10px;     /* ✅ 10px from right */
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 2000;
  min-width: 180px;
}

/* Options list inside both modals */
.template-options,
.quickreply-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  min-width: 200px;
  overflow-y: auto;
  margin: 12px;
}

/* Template card styling */
.template-card {
  width: 100%;
  max-width:200px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.template-card-header {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.template-card-image-wrapper {
  width: 100%;
  height: 130px;
  border: 1px dashed #ccc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  overflow: hidden;
  position: relative;
}

.template-card-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
#tplImageFile {
    border:1px solid #ccc;
    border-radius:8px;
}
.template-card-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #999;
}

.template-card-text {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

/* Buttons and actions */
.template-btn,
#saveQuickReplyBtn {
  padding: 5px 8px;
}

.template-actions {
  margin-top: 15px;
  text-align: center;
}

#createTemplateBtn {
  background: #4CAF50;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.reply-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reply-btn {
  flex: 1;
  display: flex;              /* allow children inline */
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: #fafafa;
}

.reply-btn .delete-btn {
  margin-left: 8px;
  color: red;
  cursor: pointer;
}

.close-btn {
  margin-left: 10px;
  
}

/* Mobile form view */
@media (max-width: 600px) {

.template-creator {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-height:100%;
  max-width:100%;
  padding:10px;
  box-sizing:border-box;
}
/* Template card styling */
.template-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
 
}
@media screen and (max-width: 480px) {
  .grid-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-row-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .grid-row-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}
.grid-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    font-size:14px;
    color:#000;
  }
 .grid-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    font-size:14px;
    color:#000;
  }
  .grid-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    font-size:14px;
    color:#000;
  }

  .grid-row div,
  .grid-row-2 div,
  .grid-row-4 {
    background: none;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
    word-break: break-word;
  }

 .grid-row.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.grid-row label {
    text-decoration:underline;
}
.grid-row-2 label {
    text-decoration:underline;
}
.grid-row-4 label {
    text-decoration:underline;
}
/* Responsive table wrapper */
#inlineTab {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table styling (desktop/tablet) */
#sheetTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
  min-width: 600px; /* desktop minimum */
}

#sheetTable th,
#sheetTable td {
  padding: 6px 10px;
  text-align: left;
  border: 1px solid #ccc;
  white-space: nowrap;
}

#sheetTable th {
  background: #f5f5f5;
}

#sheetTable td select,
#sheetTable td input {
  width: auto;
  min-width: 50px;
  max-width: 150px;
  box-sizing: border-box;
}

/* Tablet adjustments */
@media (max-width: 768px) {
  #sheetTable {
    font-size: 12px;
    min-width: 500px;
  }
}

/* Mobile form view */
@media (max-width: 600px) {
  #sheetTable {
    font-size: 11px;
    min-width: auto;   /* allow table to shrink to screen */
    width: 100%;
  }

  #sheetTable,
  #sheetTable thead,
  #sheetTable tbody,
  #sheetTable th,
  #sheetTable td,
  #sheetTable tr {
    display: block;
    width: 100%;
  }

  #sheetTable thead {
    display: none; /* hide header row */
  }

  #sheetTable tr {
    margin-bottom: 12px;
    border: 1px solid #ddd;
    padding: 8px;
    background: #fafafa;
  }

  #sheetTable td {
    border: none;
    padding: 6px 0;
    display: flex;
    flex-direction: column;   /* stack label above control */
    align-items: flex-start;
  }

  #sheetTable td::before {
    content: attr(data-label);
    font-weight: bold;
    margin-bottom: 4px;
  }

  #sheetTable td input,
  #sheetTable td select {
    width: 100%;   /* full width controls */
    max-width: none;
  }
  
}
.attach-btn svg,
.attach-btn svg *,
.send-btn svg,
.send-btn svg *{

    pointer-events:none;

}
@media (max-width: 600px) {
  #sheetTable { display: none; } /* hide sheet on mobile */

  #mobileForm {
      border-radius:8px;
      margin-bottom:10px;
  }
  #mobileForm label {
    font-weight: bold;
    margin-top: 8px;
  }

  #mobileForm input,
  #mobileForm select {
    width: 100%;
    margin-bottom: 6px;
    padding: 6px;
    box-sizing: border-box;
  }

  #mobileForm button {
    width: 100%;
    padding: 8px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
  }
}

#guidelinesText {
  max-height: 400px;   /* fixed viewport height */
  overflow-y: auto;    /* enable scrolling */
  padding-right: 8px;
  background:#fff;
}

.tab-container {
  display: flex;
  margin-bottom: 10px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  cursor: pointer;
  background: #f0f0f0;
  border: none;
  outline: none;
  font-weight: bold;
}
.tab-btn.csv, .tab-btn.inline{
    border:1px solid #ccc;
    border-radius:8px;
}
.tab-btn.active {
  background: #007bff;
  color: white;
}
.tab-btn.active {
  background-color: #007bff;
  color: #fff;
}


.tab-content {
  display: none;
  margin:6px;
  margin-bottom: var(--app-status-height);
  padding:6px;
  border:2px solid #000;
  border-radius:8px;
  box-sizing:border-box;
}

.tab-content.active {
  display: block;
}


.input-locked {
  opacity: 0.6;
  pointer-events: none;
}
.location-box {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  margin-top: 6px;
  background: #f9f9f9;
  max-width: 260px;
}

.location-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.location-address {
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
}

.location-link {
  font-size: 13px;
  color: #007bff;
  text-decoration: none;
}
/* ----------------------------------
   Bottom Floating Support Menu
-----------------------------------*/
#bottomMenu {
  position: fixed;
  bottom: 0;
  right: 6px;
  z-index: 12000;
  display:none;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

#bottomMenu:hover,
.support-menu.active {
  opacity: 1;
}

/* ----------------------------------
   Support Menu Wrapper
-----------------------------------*/
.support-menu {
  position: relative;
  display: inline-block;
}

/* ----------------------------------
   Floating Toggle Button (Glass)
-----------------------------------*/
.support-menu .menu-item.support {
  width: 38px;
  height:var(--app-status-height);
  border-radius: 10%;
  background: rgba(210, 227, 252, 0.35);

  backdrop-filter: blur(6px);
  border: 2px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);

  font-size: 22px;
  color: #000;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-menu .menu-item.support:hover {
  transform: scale(1.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}


/* ----------------------------------
   Submenu Container
-----------------------------------*/
.submenu {
  
  position: fixed;
  display:none;
  bottom:var(--app-status-height);
  right: 2px;

  flex-direction: column;
  gap: 6px;
}

/* ----------------------------------
   Submenu Buttons (Solid)
-----------------------------------*/
.submenu .menu-item {
  width: 200px;
  max-width:90%;
  text-align:right;
  padding: 8px 6px;
  border-radius: 8px;
  background: #ffffff;
  color: #000;
  
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* ----------------------------------
   Generic Menu Item
-----------------------------------*/
.menu-item {
  box-sizing: border-box;
  border-radius: 6px;
}

#chatMessagesWrapper {
    position: relative;
    flex: 1;
    min-height: 0;
}

/* ----------------------------------
   Desktop Hover Behavior
-----------------------------------*/
@media (min-width: 768px) {
  .support-menu:hover .submenu {
    display: flex;
  }
}

/* ----------------------------------
   Mobile Toggle Behavior
-----------------------------------*/
@media (max-width: 767px) {
  .support-menu.active .submenu {
    display: flex;
  }
}

/* ----------------------------------
   Dark Mode Safety
-----------------------------------*/
@media (prefers-color-scheme: dark) {
  .support-menu .menu-item.support {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
  }

  .submenu .menu-item {
    background: #1e1e1e;
    color: #fff;
  }
}

.ticks {
  font-size: 0.8em;
  margin-left: 6px;
}

.tick-loader {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: tick-loader-spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes tick-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

.ticks.sent { color: gray; }
.ticks.delivered { color: gray; }
.ticks.read { color: dodgerblue; }

.meta-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.chat-thumbnail {
  max-width: 150px;
  max-height: 150px;
  border-radius: 6px;
  margin-top: 6px;
  cursor: pointer;
}

.download-btn {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 0.8em;
  cursor: pointer;
}
#autoBackupModal { z-index: 1100; /* higher than settingsModal */ }
.viewer-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.viewer-content img {
  max-width: 90%;
  max-height: 90%;
}

.chat-thumbnail:hover {
  opacity: 0.9;
}

.chat-file {
  display: inline-block;
  margin-top: 6px;
  color: #0066cc;
  text-decoration: none;
}

.chat-file:hover {
  text-decoration: underline;
}

.benefits-flex {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.benefit-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}
.benefit-box h5 {
  margin: 0;
  padding: 10px;
  background: #f5f5f5;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.benefit-box h5:hover {
  background: #eaeaea;
}
.benefit-detail {
  display: none;
  padding: 10px;
  background: #fff;
  animation: fadeIn 0.3s ease;
}
.arrow {
  font-size: 0.8em;
  transition: transform 0.3s ease;
}
.benefit-box.open .arrow {
  transform: rotate(180deg);
}

.pricing-box {
  margin-top: 20px;
  padding: 15px;
  background: #f0f8ff;
  border-radius: 6px;
  text-align: center;
}

.button-group {
  display: flex;
  gap: 5px;
}

#chatHeading {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  text-align: left;
  display: flex;
  align-items: center;
}

#chatUserName {
  font-size: 1em;
  color: blue;
  margin: 5px;
  min-width: 150px;
}

/* Right menu + toggle */
.menu-slot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-toggle,
.menu-btn,
.back-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #333;
}
.back-btn, #settingsBtn, #logoutBtn {
    display:none;
}

/* Menu dropdown */
.menu-dropdown {
  position: absolute;
  top: 48px; /* directly below header bar */
  right: 8px;
  background: var(--bg-color);
  border: 1px solid var(--bubble-border);
  border-radius: 6px;
  min-width: 180px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
}
.menu-dropdown button,
.menu-dropdown a.btn {
  display: block;
  width: 100%;
  padding: 10px;
  box-sizing:border-box;
  text-align: left;
  background: var(--bubble-bg);
  color: var(--text-color);
  border: none;
  cursor: pointer;
  text-decoration: none; /* removes underline for links */
}

.menu-dropdown button:hover,
.menu-dropdown a.btn:hover {
  background: var(--menu-hover-bg);
  color: var(--menu-hover-color);
}

.search-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;        /* space between input and button */
  margin: 0 8px;
}

#globalSearchBox {
  min-width: 0;
  border: 2px solid #ccc;
  padding: 8px;
  border-radius: 8px;
  box-sizing: border-box;
}

.close-search {
  flex: 0 0 auto;  /* button stays natural size */
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #333;
}
.close-search:hover {
  color: #000;
}

/* ===============================
   Header / Top Bar
   =============================== */
#buttonContainer {
  display: flex;
  align-items: center;
  border-bottom:2px solid #ccc;
  justify-content: space-between;
  height:var(--app-header-height);
  width: 100%;
  background: #fff;
  padding: 0 8px;
  box-sizing: border-box;
  position: relative;
}

.header-slot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

/* Mobile override: search bar overlays full width */
@media (max-width: 600px) {
  .search-wrapper {
    position: absolute;
    top: 10px;
    margin:auto;
    left: 0;
    right: 0;
    height:var(--app-input-height);
    background: #fff;
    padding: 0 8px;
    box-sizing: border-box;
    display: none; /* hidden until toggled */
    z-index: 1000;
  }

  .search-wrapper.active {
    display: flex;   /* <-- flex restores layout */
    align-items: center;
  }

  #globalSearchBox {
    flex: 1;
    width: 100%;
  }

  /* Hide heading and menu when search overlay is active */
  #buttonContainer.search-active .header-slot,
  #buttonContainer.search-active .menu-slot {
    visibility: hidden;
  }

}
#buttonContainer form {
    width:100%;
}

@media (min-width: 601px) {
  .search-toggle.visible { display: none; }
  #globalSearchBox { display: block; }
  .search-wrapper.active { position: static; display: flex; }
  #buttonContainer.search-active .header-slot,
  #buttonContainer.search-active .menu-slot {
    visibility: visible;
  }
  .close-search {display:none;}
  .back-btn { display: none; }
}

@media (max-width: 601px) {
  .search-toggle.visible { display: block; }
  .search-toggle { display: block; } 
}

.search-toggle { display: none; } 

/* ===============================
   Chat Container
   =============================== */
#chatBox {
  width: 100%;
  display: flex;
  position:relative;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Message meta */
.meta {
  display: flex;
  flex-direction: column;
  margin-top: 5px;
}

.message-content { font-size: 16px; }
.timestamp { font-size: 12px; margin-top: 2px; }

/* Sent/Received bubbles */
.message-sent {
  position: relative;
  background: var(--sent-msg-bg);
  color: var(--sent-msg-color);
  text-align: left;
  padding: 4px;
  font-size: 0.9em;
  margin-left: 30%;
  margin-bottom: 10px;
  border-radius: 1em;
}

.message-received {
  position: relative;
  background: var(--received-msg-bg);
  color: var(--received-msg-color);
  text-align: left;
  padding: 4px;
  font-size: 0.9em;
  margin-right: 30%;
  margin-bottom: 10px;
  border-radius: 1em;
}
.media-wrapper {
    padding:8px;
}
.bubble {
    margin-bottom:15px;
}
/* Document link inside sent bubble */
.message-sent .document-item {
  background: color-mix(in srgb, var(--sent-msg-bg) 90%, black 10%);
}

/* Document link inside received bubble */
.message-received .document-item {
  background: color-mix(in srgb, var(--received-msg-bg) 90%, black 10%);
}

.document-item {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}

.ticks-status {
  position: absolute;
  top: 10px;
  right: 6px;
  font-size: 1em;
  color: #666;
}

/* Buttons inside booking events */
.message-booking {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

/* ===============================
   User Bubbles (List)
   =============================== */
.user-bubble {
  display: flex;
  width: 100%;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 5px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--bubble-border);
  cursor: pointer;
  transition: background-color 0.2s ease;
  background-color: var(--bubble-bg);
  color: var(--bubble-text);
}

/* Role-based modifiers */
.user-bubble.user,
.user-bubble.customer { background: var(--bubble-bg); border: 2px solid var(--user-border); }
.user-bubble.technician { background: var(--bubble-bg); border: 2px solid var(--technician-border); }
.user-bubble.delivery { background: var(--bubble-bg); border: 2px solid var(--delivery-border); }
.user-bubble.manager { background: var(--bubble-bg); border: 2px solid var(--manager-border); }
.user-bubble:hover { background-color: var(--bubble-hover-bg); }

.sender-icon { font-size: 1.1rem; }
.user-name { font-weight: bold; font-size: 0.95em; color: var(--bubble-text-strong); }
.user-phone { font-size: 0.85em; color: var(--bubble-text-muted); }
.last-message-time { font-size: 0.8em; color: var(--bubble-text-muted); }

.message-count {
  display: none;
  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.8em;
  min-width: 20px;
  text-align: center;
}

.message-count.recipient-badge {
  background-color: red;   /* recipient unread badge */
  color: white;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 12px;
  margin-top: 2px;
}

.message-count.sender-badge {
  background-color: blue;  /* sender delivery badge */
  color: white;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 12px;
  margin-top: 2px;         /* stacked below recipient badge */
}

#uploadStatus {
  position: fixed;
  bottom: 50px;
  right:10px;
  background-color: #28a745;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  display: none;
  z-index:1000;
  font-size: 16px;
  animation: fadeOut 3s forwards;  
}

/* Upload popup message */
.popup {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #28a745;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  display: none;
  font-size: 16px;
  animation: fadeOut 3s forwards;
}

.upload-card{
    width:220px;
    display:flex;
    gap:12px;
    align-items:center;
}

.upload-preview{
    width:56px;
    height:56px;

    border-radius:12px;

    background:#f3f4f6;

    display:flex;
    justify-content:center;
    align-items:center;

    flex-shrink:0;
}

.upload-spinner{
    width:24px;
    height:24px;

    border:3px solid rgba(0,0,0,.12);
    border-top-color:#25d366;

    border-radius:50%;

    animation:uploadSpin .8s linear infinite;
}

.upload-info{
    flex:1;
    overflow:hidden;
}

.upload-title{
    font-size:14px;
    font-weight:600;
    color:#25d366;
}

.upload-name{
    margin-top:4px;

    font-size:13px;
    color:#666;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

@keyframes uploadSpin{
    to{
        transform:rotate(360deg);
    }
}

@keyframes spin{
    to{
        transform:rotate(360deg);
    }
}

@keyframes fadeOut {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===============================
   Toaster
   =============================== */
#toastContainer {
  position: fixed;
  bottom: 0;
  right: 20px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideIn 0.3s forwards;
}
.toast.success { background: #28a745; }
.toast.error   { background: #dc3545; }
@keyframes slideIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ===============================
   Modals
   =============================== */


/* Headings inside cookie modal */
#cookieModal h3, 
#cookieModal h4 {
  margin-top: 0;
  color: #222;
}

/* Terms list */
#cookieModal ul {
  margin: 0;
  padding-left: 10px;
}
#cookieModal li {
  margin-bottom: 5px;
  color: #555;
}

/* Primary button */
#cookieModal .btn-primary {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
}
#cookieModal .btn-primary:hover {
  background-color: #0056b3;
}

/* Close button */
#cookieModal .close {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 1.2rem;
  color: #666;
  cursor: pointer;
}
#cookieModal .close:hover {
  color: #000;
}
#cookieModal label {
  display: inline-flex;
  align-items: center;   /* vertically center checkbox and text */
  gap: 6px;
  width:20%;
  margin: 8px 0;
  color: #333;
}
#cookieModal input {
    width:80%;
}
/* Animation */
@keyframes fadeIn {
  from {opacity: 0; transform: translateY(-10px);}
  to {opacity: 1; transform: translateY(0);}
}

#cookieModal {
    
  text-align: left;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 5px;
  
}

.close-btn, .close {
  position: absolute;
  z-index:1000;
  right: 10px;
  top: 10px;
  background: none !important;
  border: none !important;
  cursor: pointer;
  font-size: 18px;
}


.register-close-btn {
  position: absolute;
  z-index:1000;
  right: 10px;
  top: calc(var(--app-header-height)+10px);
  background: none !important;
  border: none !important;
  cursor: pointer;
  font-size: 18px;
}


.inline-close-btn {
  
  background: none !important;
  border: none !important;
  cursor: pointer;
  font-size: 18px;
}
.chip-input {
  margin-bottom: 16px;
  width: 100%;
}

.chip-input label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.chip-wrapper {
  display: flex;
  gap: 8px;
}

.chip-wrapper input {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.add-chip-btn {
  padding: 0 12px;
  font-size: 20px;
  border: none;
  background: #0078d4;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}


.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  background: #e0e0e0;
  padding: 6px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  font-size: 15px;
}

.chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  margin-left: 6px;
}

.step-buttons {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}
.step-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background-color: #0078d7;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.step-buttons button:hover { background-color: #005fa3; }
/* Locked state */
.btn-disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  border: none;
  padding: 8px 14px;
  margin-top: 10px;
  border-radius: 6px;
  font-size: 14px;
}
.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* Smooth transition */
#finalRegisterBtn {
  transition: background-color 0.25s ease, color 0.25s ease;
}
.password-wrapper {
  position: relative;
  margin-bottom: 10px;
}

.password-wrapper input {
  width: 100%;
  padding-right: 35px; /* space for eye icon */
}
.match-message {
  font-size: 12px;
  margin-bottom: 10px;
}
.match-message.error { color: red; }
.match-message.success { color: green; }

.toggle-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

.strength-meter {
  font-size: 12px;
  margin-bottom: 10px;
}
.strength-meter.weak { color: red; }
.strength-meter.medium { color: orange; }
.strength-meter.strong { color: green; }


.btn-primary {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 8px 14px;
  margin-top: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.btn-primary:hover { background-color: #0056b3; }

.btn-secondary {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
  padding: 8px 14px;
  margin-top: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.btn-secondary:hover { background-color: #e0e0e0; }

.btn-danger {
  background-color: #dc3545;
  color: #fff;
  border: none;
  padding: 8px 14px;
  margin-top: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.btn-danger:hover { background-color: #a71d2a; }

.input-error {
  border: 2px solid #dc3545 !important;
  background: #ffe6e6;
}
.input-error:focus {
  outline: none;
  box-shadow: 0 0 5px #dc3545;
}

/* Contact list in modal */
#contactList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 6px;
 
}

.flex-container {
    display:flex;
    gap:8px;
    justify-content:space-between;
    align-content:center;
    align-items:center;
    flex-wrap:nowrap;
    padding:5px;
}

@media (max-width : 300px) {
    
.flex-container {
    display:flex;
    gap:8px;
    justify-content:space-between;
    flex-direction:column;
    align-content:center;
    align-items:center;
    flex-wrap:wrap;
    padding:5px;
}

/* Headings inside cookie modal */
#cookieModal h3, 
#cookieModal h4 {
  margin-top: 0;
  color: #222;
}

/* Terms list */
#cookieModal ul {
  margin: 0;
  padding-left: 10px;
}
#cookieModal li {
  margin-bottom: 5px;
  color: #555;
}

/* Primary button */
#cookieModal .btn-primary {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.80rem;
}
#cookieModal .btn-primary:hover {
  background-color: #0056b3;
}

/* Close button */
#cookieModal .close {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 1.2rem;
  color: #666;
  cursor: pointer;
}
#cookieModal .close:hover {
  color: #000;
}
#cookieModal label {
  display: inline-flex;
  align-items: center;   /* vertically center checkbox and text */
  gap: 4px;
  width:20%;
  margin: 4px 0;
  color: #333;
}
#cookieModal input {
    width:80%;
}
}

.cookieConsent {
    max-height:150px; 
    overflow-y:auto; 
    border:1px solid #ccc; 
    padding:8px; 
    margin-bottom:10px;    
}

.contact-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
  font-size: 14px;
}
.contact-btn:hover {
  background: #e6f0ff;
  border-color: #99c2ff;
}

.reply-btn {
  flex: 1;
  text-align: left;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
}
.reply-btn:hover { background: #e6f0ff; }

.delete-btn {
  margin-left: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #c00;
}
.delete-btn:hover { color: #900; }

.reply-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===============================
   Login
   =============================== */
#loginBox {
  width: 90%;
  margin:auto;
  max-width:300px;
  border-radius:8px;
  padding: 8px;
  box-sizing: border-box;
}

#loginBtn {
  background: black;
  color: white;
  cursor: pointer;
  font-size: 16px;
  padding: 10px 15px;
  border-radius: 5px;
  margin-top: 10px;
}

#loginBox > div:last-child {
    margin-top: 10px;
    text-align: center;
}

#loginBox > div:last-child button {
    background: none;
    border: none;
    padding: 4px 0;

    color: #007bff;
    font-size: 14px;

    cursor: pointer;
}

#loginBox > div:last-child button:hover {
    text-decoration: underline;
}

/* =========================================================
   MPIN LOGIN
   Match the existing #loginBox styling
   ========================================================= */

#mpinLoginBox {
    width: 90%;
    max-width: 300px;
    margin: 20px auto;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 8px;
}

#mpinLoginBox h3 {
    margin: 0 0 15px;
    text-align: center;
    color: #333;
}


/* MPIN input */

#mpinLoginInput {
    width: 100%;
    box-sizing: border-box;

    padding: 10px;
    margin: 8px 0;

    border: 1px solid #ccc;
    border-radius: 4px;

    font-size: 16px;
    text-align: center;
    letter-spacing: 4px;

    outline: none;
}

#mpinLoginInput:focus {
    border-color: #999;
}


/* MPIN login button */

#mpinLoginBtn {
    width: 100%;

    background: black;
    color: white;

    cursor: pointer;

    font-size: 16px;
    padding: 10px 15px;

    border: none;
    border-radius: 5px;

    margin-top: 8px;
    box-sizing: border-box;
}

#mpinLoginBtn:hover {
    background: #222;
}


/* Password login switch */

#mpinLoginBox > div {
    text-align: center;
}

#mpinLoginBox > div button {
    background: none;
    border: none;

    padding: 4px 0;

    color: #007bff;
    cursor: pointer;

    font-size: 14px;
}

#mpinLoginBox > div button:hover {
    text-decoration: underline;
}


/* =========================================================
   MPIN CREATION MODAL
   ========================================================= */

#createMPINModal #mpinInfo {
    box-sizing: border-box;
}

#createMPINModal #newMPIN,
#createMPINModal #confirmMPIN {
    width: 100%;
    box-sizing: border-box;

    padding: 8px 10px;
    margin: 8px 0;

    border: 1px solid #ccc;
    border-radius: 4px;

    font-size: 16px;
}

#createMPINModal #newMPIN:focus,
#createMPINModal #confirmMPIN:focus {
    outline: none;
    border-color: #999;
}


/* MPIN match message */

#createMPINModal #mpinMatchMessage {
    min-height: 18px;
    margin-top: 4px;

    font-size: 13px;
}


/* Create button */

#createMPINModal #createMPINBtn {
    width: 100%;
    box-sizing: border-box;

    margin-top: 10px;
}

.closeBtn { font-size: 28px; color: red; }

.logged-user {
  margin: 10px;
  font-weight: bold;
  color: var(--text-color);
}

/* ===============================
   Misc
   =============================== */
mark {
  background-color: yellow;
  color: black;
  padding: 0 2px;
  border-radius: 2px;
}

#confirmationBox p{
  text-align: left;
  margin-left: 10px;
}
#confirmationBox h4 { text-decoration: underline; }

#logoutBtn:hover,
#installButton:hover { background: darkred; }

.logo img {
    width: 100%;
    display: block;
    margin: 10px auto 0 auto;
  }
  
@media (max-width: 600px) {
  .logo img {
    max-width:100px;
  }
}

@media (max-width: 900px) {
  .logo img {
    max-width:120px;
  }
}

@media (min-width: 1200px) {
  .logo img {
    max-width:130px;
  }
}

@media (max-width: 1200px) {
  .logo img {
    max-width:130px;
  }
}
/* Container around media + icon */
.media-item {
  position: relative;
  display: inline-block;
  max-width: 200px;
  max-height: 200px;
}

/* Image/video sizing */
.preview-img,
.preview-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

/* Inline preview download icon (bottom-left corner) */
.download-icon {
  position: absolute;
  bottom: 8px;
  left: 8px; /* ⬅️ bottom-left */
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  backdrop-filter: saturate(150%) blur(2px);
}

.download-icon:hover,
.download-icon:focus {
  background: rgba(0,0,0,0.8);
  transform: scale(1.06);
}

/* Lightbox modal */
.media-viewer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  padding: 24px;
}
.media-viewer.active { display: flex; }

/* Enlarged content */
.media-viewer .viewer-content {
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  overflow: hidden;
}
.media-viewer img,
.media-viewer video {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  background: #000;
}

/* Close button (top-right corner) */
.media-viewer .viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.9);
  color: #111;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  z-index: 10000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.media-viewer .viewer-close:hover { background: #fff; }

/* Lightbox viewer download icon (bottom-left corner) */
.viewer-wrapper {
  position: relative;
  display: inline-block;
}
.viewer-download {
  position: absolute;
  bottom: 12px;
  left: 12px; /* ⬅️ bottom-left */
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  transition: background 0.2s ease;
}
.viewer-download:hover {
  background: rgba(0,0,0,0.8);
}

/* Booking event container */
.message-booking {
  display: flex;
  justify-content: flex-start;
  margin: 8px 0;
}

.message-booking  {
  background-color: #fff3cd;   /* soft amber background */
  border: 1px solid #ffeeba;   /* subtle border */
  border-radius: 8px;
  padding: 10px;
  max-width: 80%;
  font-size: 0.95em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Tag label inside booking bubble */
.booking-tag {
  display: inline-block;
  font-weight: bold;
  color: #856404;              /* dark amber text */
  margin-bottom: 6px;
}


/* =========================
   Dropdown (styled like button)
========================= */
.msg-dropdown {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  min-width: 180px;
  padding: 10px;

  background-color: #ffffff;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23999' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;

  cursor: pointer;
}

.msg-dropdown {
  order: -1; /* forces dropdown above button */
}

.msg-btn {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.options {
    margin:10px;
}

/* =========================
   Button containers
========================= */
.button-container,
.cta-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  margin-left: 0;
  padding-left: 0;
  box-sizing: border-box;
}


/* =========================
   Base message button
========================= */
.msg-btn {
  width: 100%;                 /* full width inside bubble */
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #1A73E8;

  background: #FFFFFF;
  color: #1A73E8;

  font-size: 14px;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

/* Hover / active */
.msg-btn:hover {
  background-color: #E8F0FE;
  transform: scale(1.02);
}

.msg-btn:active {
  background-color: #D2E3FC;
  transform: scale(0.98);
}

/* =========================
   Booking / warning buttons
========================= */
.message-booking .msg-btn {
  background-color: #F2994A;   /* warm, action-oriented */
  border-color: #F2994A;
  color: #FFFFFF;
}

.message-booking .msg-btn:hover {
  background-color: #E5892F;
}

/* =========================
   Primary CTA buttons
========================= */
.cta-container .msg-btn {
  background-color: #1A73E8;
  border-color: #1A73E8;
  color: #FFFFFF;
}

.cta-container .msg-btn:hover {
  background-color: #1558C0;
}

/* =========================
   Emergency / critical action
========================= */
.msg-btn.emergency {
  background-color: #D32F2F;
  border-color: #D32F2F;
  color: #FFFFFF;
}

.msg-btn.emergency:hover {
  background-color: #B71C1C;
}

/* ===============================
   Message Row (Input + Buttons)
=============================== */
.message-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height:var(--app-input-height);
  width: 100%;
}

/* ===============================
   Text Input (Elastic)
=============================== */
.message-row input[type="text"] {
  flex: 1 1 auto;     /* Grow but respect siblings */
  min-width: 0;      /* CRITICAL — prevents flex overflow */
  padding: 8px;
  margin:2px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
  background: #ffffff;
}

/* ===============================
   Button Rail (Fixed width)
=============================== */
.message-row .attach-btn,
.message-row .send-btn {
  flex: 0 0 auto;      /* NEVER shrink */
  width: 30px;
  height: 30px;
  border-radius: 30%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: background 0.15s ease, transform 0.1s ease;
}

/* ===============================
   Attach Button
=============================== */
.message-row .attach-btn {
  background-color: #16a34a;
  color: #ffffff;
}
.message-row .attach-btn:hover {
  background-color: #15803d;
  transform: scale(1.05);
}

/* ===============================
   Send Button
=============================== */
.message-row .send-btn {
  background-color: #2563eb;
  color: #ffffff;
}
.message-row .send-btn:hover {
  background-color: #1d4ed8;
  transform: scale(1.05);
}

/* Disabled send */
.message-row .send-btn.disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}

/* ===============================
   Hidden file input
=============================== */
#fileInput {
  display: none;
}

/* ===============================
   Attach popup
=============================== */
#attachPopup {
  position: absolute;
  bottom: 56px;
  right: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  padding: 8px;
  min-width: 180px;
  max-width:250px;
  z-index: 9999;
}

.attach-option {
  width: 100%;
  padding: 8px 12px;
  margin: 4px 0;
  border: none;
  border-radius: 6px;
  background: #f9fafb;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.attach-option:hover {
  background: #e5e7eb;
}

/* ===============================
   Prevent left drift
=============================== */
.message-received {
  margin-left: 0;
}

/* ===============================
   Registration / Steps
   =============================== */
.reg-step { margin-top: 20px; }
.reg-step h4 { margin-bottom: 10px; color: #444; }

#registerBox input,
#registerBox select {
  width: 100%;
  padding: 8px 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

#termsCheckbox,
#autoBackupCheckbox {
    max-width:32px;
}

.form-inline-button {
    position: absolute;
    right: 8px;
    border-radius: 4px;
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Scrollable container for job categories (vendor + technician) */
.scrollable-job-list { 
  max-height: 250px; 
  overflow-y: auto; 
  background:#fff;
  font-size:0.8em;
  font-family: Arial, sans-serif;
  border: 1px solid #ccc;
  margin-top: 4px; 
  position: relative;   /* required for sticky children */
  padding: 0;           /* remove padding so header aligns cleanly */
}

/* =========================================================
   STICKY HEADER ROW
========================================================= */

.job-category-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    font-weight: bold;
    font-family: Arial, sans-serif;

    border-bottom: 2px solid #666;
    padding: 6px;

    box-sizing: border-box;

    gap: 10px;

    background: #f9f9f9;

    position: sticky;
    top: 0;
    z-index: 2;
}


/* ---------------------------------------------------------
   SELECT HEADER
--------------------------------------------------------- */

.job-category-header .checkbox-select-label {
    flex: 0 0 50px;

    width: 50px;
    min-width: 50px;

    text-align: center;
}


/* ---------------------------------------------------------
   JOB CATEGORY HEADER
--------------------------------------------------------- */

.job-category-header .job-label {
    flex: 1 1 0;

    min-width: 0;

    text-align: left;
}


/* ---------------------------------------------------------
   HOME SERVICE HEADER
--------------------------------------------------------- */

.job-category-header .checkbox-col-label {
    flex: 0 0 50px;

    width: 50px;
    min-width: 50px;

    text-align: center;
}


/* =========================================================
   JOB CATEGORY ROW
========================================================= */

.job-category-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    padding: 6px 4px;

    border-bottom: 1px dashed #ddd;

    box-sizing: border-box;

    gap: 10px;
}


/* ---------------------------------------------------------
   SELECT CHECKBOX CELL
--------------------------------------------------------- */

.job-category-row .checkbox-select {
    flex: 0 0 50px;

    width: 50px;
    min-width: 50px;

    text-align: center;
}


/* ---------------------------------------------------------
   JOB NAME + ASSET INFORMATION
--------------------------------------------------------- */

.job-category-row .job-name {
    flex: 1 1 0;

    min-width: 0;

    text-align: left;
}


/* ---------------------------------------------------------
   JOB TITLE
--------------------------------------------------------- */

.job-category-row .job-title {
    font-weight: 500;

    line-height: 1.4;

    white-space: normal;
}


/* ---------------------------------------------------------
   ASSET INFORMATION
--------------------------------------------------------- */

.job-category-row .job-assets {
    margin-top: 2px;

    font-size: 12px;

    line-height: 1.3;

    color: #666;

    white-space: normal;
}


/* ---------------------------------------------------------
   HOME SERVICE CELL
--------------------------------------------------------- */

.job-category-row .checkbox-cell {
    flex: 0 0 50px;

    width: 50px;
    min-width: 50px;

    text-align: center;
}


/* ---------------------------------------------------------
   CHECKBOX
--------------------------------------------------------- */

.job-category-row input[type="checkbox"] {
    width: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    vertical-align: middle;
}

/* =========================================================
   PRODUCT CATEGORY MULTI-SELECT
========================================================= */

.scrollable-product-list {
    width: 100%;

    max-height: 250px;
    min-height: 100px;

    overflow-y: auto;
    overflow-x: hidden;

    background: #fff;

    font-size: 0.8em;
    font-family: Arial, sans-serif;

    border: 1px solid #ccc;

    margin-top: 4px;
    padding: 0;

    box-sizing: border-box;
}

.scrollable-product-list option {
    padding: 7px 8px;
}

.popup-overlay {
  position: fixed;
  inset: 0; /* replaces top/left/width/height */

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.55);

  z-index: 9000;

  /* prevents layout shift during animation */
  padding: 10px;
}

.popup-box {

  margin: auto; /* HARD CENTER — never rely on flex alone */

  width: 100%;
  max-width: 600px;

  background: #fff;
  border-radius: 10px;
  padding: 12px;

  display: flex;
  flex-direction: column;
  align-items: center; /* prevents left drift */

}

.popup-actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}

.popup-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}


.close-popup {
  right: 5px;
  top: 5px;
  color:red;
  background: none !important;
  border: none !important;
  cursor: pointer;
}

.structured-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:2px;
  padding:10px 12px;
}

.structured-btn-title{
  font-weight:500;
  font-size:14px;
  line-height:1.25;
}

.structured-btn-desc{
  font-size:12px;
  color:#6b7280;
  line-height:1.3;
}

.structured-btn-price{
  font-size:12.5px;
  font-weight:700;
  color:#059669;
  margin-top:2px;
}

/* Base modal overlay */
#profile-modal {
  display: none;
  position: fixed;
  inset: 0;

  width: 100%;
  height: calc(100% - var(--app-status-height));
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;

  overflow-y: auto;

  /* Center modal */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal content container */
.profile-modal-content {
  background: #fff;
  padding: 10px;

  /* Remove top/bottom positioning */
  margin: 0;

  border-radius: 8px;

  width: min(420px, calc(100% - 30px));
  max-width: 420px;

  position: relative;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);

  font-family: Arial, sans-serif;

  /* Prevent oversized modal */
  max-height: calc(100% - var(--app-status-height));
  overflow-y: auto;
}

/* Close button */
.modal-close-btn {
  position: absolute;
  top: 10px; right: 10px;
  cursor: pointer;
  color:red;
  font-size:35px;
}

/* Title */
.modal-title {
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: bold;
}

/* Profile fields */
.profile-modal-content label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.profile-input-name,
.profile-input-email,
.profile-select-gender,
.vendor-business-name,
.vendor-gstin,
.technician-duty-in,
.technician-duty-out,
.delivery-vehicle-number {
  width: 100%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Checkbox */
.profile-checkbox-backup {
  margin-left: 8px;
}

/* Role block */
.profile-role-block {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

/* Action buttons */
.modal-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

#profile-edit-btn,
.profile-edit-btn,
#profile-save-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#profile-edit-btn,
.profile-edit-btn {
  background: #007bff;
  color: #fff;
}

#profile-save-btn {
  background: #28a745;
  color: #fff;
}


/* ============================================================
   COMMON OTP SYSTEM
   Existing #otpBox design remains the visual baseline.
============================================================ */


/* ============================================================
   OTP INPUTS
   Common styling for both OTP implementations
============================================================ */

#otpInput,
#profileOtpInput {
    width: 100%;
    max-width: 260px;

    margin: 12px auto;

    display: block;
    box-sizing: border-box;

    height: 45px;
    padding: 6px 10px;

    font-size: 20px;
    font-weight: 600;

    letter-spacing: 5px;
    text-align: center;

    border-radius: 8px;
    border: 1px solid #ddd;

    outline: none;

    background: #fff;
    color: #222;

    transition:
        border-color .16s ease,
        box-shadow .16s ease;
}


#otpInput:focus,
#profileOtpInput:focus {
    border-color: #999;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, .08);
}


#otpInput::placeholder,
#profileOtpInput::placeholder {
    font-size: 14px;
    font-weight: 400;

    letter-spacing: normal;

    color: #999;
}


/* ============================================================
   EXISTING OTP CONTAINER
   KEEP CURRENT DESIGN
============================================================ */

#otpContainerUI {
    position: fixed;

    bottom: 0;
    left: 50%;

    transform: translateX(-50%);

    width: 100%;

    z-index: 10000;

    pointer-events: none;
}


/* ============================================================
   EXISTING OTP CARD
============================================================ */

.otp-card {
    pointer-events: auto;

    background:
        var(--modal-bg, #121212);

    color:
        var(--modal-text-color, #ffffff);

    border:
        1px solid var(
            --modal-border,
            rgba(255,255,255,.08)
        );

    padding: 10px;

    display: flex;
    flex-direction: column;

    gap: 12px;

    box-shadow:
        0 18px 48px rgba(0,0,0,.45);

    animation:
        otpSlideUp .26s cubic-bezier(.2,.8,.2,1);

    backdrop-filter:
        blur(12px);

    will-change:
        transform,
        opacity;
}


/* ============================================================
   EXISTING OTP BOX
   Current design preserved
============================================================ */

.otp-box {
    display: none;

    position: fixed;

    bottom: var(--app-status-height);

    left: 0;
    right: 0;

    background: #fff;

    border-top:
        1px solid #ccc;

    padding: 10px;

    box-shadow:
        0 -2px 6px rgba(0,0,0,.1);

    z-index: 10000;
}


/* ============================================================
   OTP ANIMATION
============================================================ */

@keyframes otpSlideUp {

    from {
        opacity: 0;
        translate: 0 50px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}


/* ============================================================
   OTP HEADERS
   Common header for existing + profile OTP
============================================================ */

.otp-header,
.profile-otp-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    width: 100%;
}


/* Existing OTP title */

.otp-header h3,
.profile-otp-header h3 {
    margin: 0;

    font-size: 16px;
    font-weight: 600;
}


/* ============================================================
   OTP SUBTEXT
============================================================ */

.otp-subtext,
.profile-otp-subtext {
    margin:
        0 0 12px 0;

    font-size: 14px;

    line-height: 1.45;

    color: #666;

    opacity: .75;
}


/* ============================================================
   EXISTING OTP CARD TYPOGRAPHY
============================================================ */

.otp-card strong {
    font-size: 15.5px;

    letter-spacing: .25px;
}


/* ============================================================
   OTP CODE DISPLAY
============================================================ */

.otp-code {
    font-size: 26px;

    font-weight: 700;

    letter-spacing: 6px;

    text-align: center;

    padding: 12px;

    border-radius: 10px;

    background:
        rgba(255,255,255,.05);
}


/* ============================================================
   COMMON OTP BUTTON SYSTEM
============================================================ */

#otpBox button,
#profileOtpModal button,
.otp-card button {

    height: 42px;

    width: 100%;

    border-radius: 10px;

    border: none;

    cursor: pointer;

    font-weight: 600;

    font-size: 14px;

    transition:
        background-color .16s ease,
        opacity .16s ease,
        transform .16s ease;
}


/* ============================================================
   PRIMARY OTP ACTION
============================================================ */

#otpBox .btn-primary,
#profileOtpModal .btn-primary,
.otp-card button:not(.retry),
.otp-verify-btn {

    background: #4CAF50;

    color: #fff;
}


#otpBox .btn-primary:hover,
#profileOtpModal .btn-primary:hover,
.otp-card button:not(.retry):hover,
.otp-verify-btn:hover {

    background: #43a047;

    transform:
        translateY(-1px);
}


/* ============================================================
   RETRY / SECONDARY OTP ACTION
============================================================ */

#otpBox .btn-secondary,
#profileOtpModal .btn-secondary,
.otp-card button.retry {

    background: transparent;

    color: #ff9800;

    border:
        1px solid rgba(255,183,77,.65);
}


#otpBox .btn-secondary:hover,
#profileOtpModal .btn-secondary:hover,
.otp-card button.retry:hover {

    background:
        rgba(255,183,77,.14);
}


/* ============================================================
   DISABLED OTP BUTTON
============================================================ */

#otpBox button:disabled,
#profileOtpModal button:disabled,
.otp-card button:disabled {

    opacity: .55;

    cursor: not-allowed;

    transform: none;
}


/* ============================================================
   OTP TIMER
============================================================ */

#otpTimer,
#profileOtpTimer,
.otp-timer,
.otp-countdown {

    display: block;

    margin-top: 8px;

    font-size: 12px;

    line-height: 1.4;

    color: #666;

    text-align: right;
}


/* ============================================================
   PROFILE OTP MODAL
   Uses the existing OTP box visual language.
============================================================ */

#profileOtpModal {

    display: none;

    position: fixed;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%, -50%);

    width:
        min(92%, 420px);

    box-sizing: border-box;

    z-index: 10001;

    background: #fff;

    color: #222;

    border:
        1px solid #ccc;

    border-radius: 10px;

    padding: 16px;

    box-shadow:
        0 18px 48px rgba(0,0,0,.25);
}


/* ============================================================
   PROFILE OTP HEADER
============================================================ */

#profileOtpModal .profile-otp-header {

    margin-bottom: 4px;
}


/* ============================================================
   PROFILE OTP CLOSE
============================================================ */

#profileOtpModal .close-popup {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    border-radius: 50%;

    cursor: pointer;

    font-size: 15px;

    line-height: 1;

    opacity: .75;

    transition:
        background-color .16s ease,
        opacity .16s ease,
        transform .16s ease;
}


#profileOtpModal .close-popup:hover {

    background:
        rgba(0,0,0,.08);

    opacity: 1;
}


#profileOtpModal .close-popup:active {

    transform:
        scale(.92);
}


/* ============================================================
   PROFILE OTP SUBTEXT
============================================================ */

#profileOtpModal .profile-otp-subtext {

    margin-top: 8px;
}


/* ============================================================
   PROFILE OTP INPUT
   Same dimensions and visual language as #otpInput
============================================================ */

#profileOtpModal #profileOtpInput {

    max-width: 260px;

    height: 45px;

    margin:
        12px auto;

    padding:
        6px 10px;

    font-size: 20px;

    letter-spacing: 5px;

    text-align: center;

    border:
        1px solid #ddd;

    border-radius: 8px;

    background: #fff;

    color: #222;
}


/* ============================================================
   PROFILE OTP VERIFY
============================================================ */

#profileOtpModal #verifyProfileOtpBtn {

    width: 100%;

    height: 42px;

    margin-top: 12px;

    border-radius: 10px;

    background: #4CAF50;

    color: #fff;
}


#profileOtpModal #verifyProfileOtpBtn:hover {

    background: #43a047;

    transform:
        translateY(-1px);
}


/* ============================================================
   PROFILE OTP RETRY
============================================================ */

#profileOtpModal #retryProfileOtpBtn {

    width: 100%;

    height: 42px;

    margin-top: 8px;

    border-radius: 10px;

    background: transparent;

    color: #ff9800;

    border:
        1px solid rgba(255,183,77,.65);
}


#profileOtpModal #retryProfileOtpBtn:hover:not(:disabled) {

    background:
        rgba(255,183,77,.14);
}


/* ============================================================
   PROFILE OTP TIMER
============================================================ */

#profileOtpModal #profileOtpTimer {

    min-height: 17px;

    margin-top: 8px;

    font-size: 12px;

    color: #666;

    text-align: right;
}


/* ============================================================
   GUIDE TEXT
============================================================ */

.otp-guide {

    font-size: 13px;

    opacity: .82;

    line-height: 1.45;
}


/* ============================================================
   OTP CLOSE BUTTON - GENERIC
============================================================ */

.otp-close {

    align-self: flex-end;

    background: none;

    border: none;

    font-size: 15px;

    cursor: pointer;

    color: inherit;

    opacity: .75;
}


.otp-close:hover {
    opacity: 1;
}


/* ============================================================
   LEGACY OTP ACTIONS
   Existing classes retained
============================================================ */

.otp-actions {

    margin-top: 10px;

    display: flex;

    gap: 8px;
}


.otp-verify-btn,
.otp-cancel-btn {

    padding:
        6px 12px;

    border: none;

    border-radius: 4px;

    cursor: pointer;
}


.otp-verify-btn {

    background:
        #28a745;

    color: #fff;
}


.otp-cancel-btn {

    background:
        #dc3545;

    color: #fff;
}


/* ============================================================
   OTP BLOCK
   Existing design retained
============================================================ */

.otp-block {

    margin-top: 20px;

    padding: 12px;

    border:
        1px solid #ccc;

    border-radius: 6px;

    background:
        #f9f9f9;
}


/* ============================================================
   LEGACY OTP TITLE / TEXT
============================================================ */

.otp-title {

    margin-bottom: 8px;

    font-size: 16px;

    font-weight: bold;
}


.otp-text {

    font-size: 14px;

    margin-bottom: 10px;
}


/* ============================================================
   LEGACY OTP INPUT
============================================================ */

.otp-input {

    width: 100%;

    box-sizing: border-box;

    padding: 6px;

    border:
        1px solid #ccc;

    border-radius: 4px;
}


/* ============================================================
   OTP MODAL HEADER
   Legacy class retained
============================================================ */

.otp-modal-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    width: 100%;

    gap: 12px;
}


/* ============================================================
   SPECIAL OTP BUTTONS
============================================================ */

#sendOtpBtn {

    background: #28a745;

    color: #fff;
}


#cancelOtpBtn {

    background: #dc3545;

    color: #fff;
}


/* ============================================================
   MOBILE HARDENING
============================================================ */

@media (max-width: 520px) {

    #otpContainerUI {

        bottom: 12px;

        width: 96%;
    }


    .otp-card {

        padding: 16px;

        border-radius: 12px;
    }


    .otp-box {

        padding: 12px;

        bottom:
            var(--app-status-height, 0px);
    }


    #profileOtpModal {

        width: 92%;

        max-width: none;

        padding: 16px;

        border-radius: 12px;
    }


    #profileOtpModal #profileOtpInput {

        max-width: 100%;

        height: 45px;
    }


    .otp-code {

        font-size: 22px;

        letter-spacing: 5px;
    }


    #otpBox button,
    #profileOtpModal button {

        height: 44px;
    }
}
