.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    padding-right: 60px !important; /* Make room for two icons */
    width: 100%;
}

.input-icons {
    position: absolute;
    right: 10px;
    display: flex;
    gap: 12px; /* Space between the wand and the eye */
    align-items: center;
    cursor: pointer;
    color: #888;
    z-index: 2;
}

.input-icons i:hover {
    color: #fff;
}

#supporters_rows td {
    line-height: 1.5;
    word-break: break-word; /* Prevents long messages from breaking the table width */
}

/* Optional: subtle color for the pipe separator */
#supporters_rows td:last-child {
    color: #ccc; 
}

.floating-back-icon {
    position: fixed;
    bottom: 95px; /* Adjust slightly based on your specific reCAPTCHA height */
    right: 20px;
    font-size: 40px;
    color: #ffffff;
    cursor: pointer;
    z-index: 9999;
    text-shadow: 0px 0px 10px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.floating-back-icon:hover {
    transform: scale(1.1);
    color: #cccccc;
}

/* ==========================================================================
   Mobile-specific sizing (SweetAlert & Layout Rules)
   ========================================================================== */
@media only screen and (max-width: 480px) {
    .swal2-popup {
        width: 90% !important; /* Takes up most of the screen width safely */
        padding: 1rem !important;
        margin: 0 auto !important;
    }
    
    .swal2-title {
        font-size: 1.25rem !important; /* Prevents title from wrapping weirdly */
    }

    .swal2-content {
        font-size: 0.9rem !important;
    }

    .swal2-actions {
        flex-direction: column !important; /* Stacks buttons so they don't squash */
        gap: 10px !important;
        padding: 0 0 15px 0 !important;
        width: 100% !important;
    }

    .swal2-actions button {
        width: 100% !important; /* Full width inside the container for easy tapping */
        margin: 0 !important;
        box-sizing: border-box;
    }

    .inv-header {
        flex-direction: column !important;
    }
    
    .inv-header div:last-child {
        text-align: left !important;
        margin-top: 15px;
    }

    .inv-url {
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .inv-id-text {
        font-size: 0.65rem !important;
        word-break: break-all;
    }

    #printable-invoice {
        padding: 20px !important;
    }
}

/* --- Global SweetAlert Colors & Styling --- */
/* 1. Change the actual button color */
.swal2-styled.swal2-confirm {
  background-color: #2ecc71 !important; 
  border: none !important;
  box-shadow: none !important;
}

/* 2. Kill the purple focus ring */
.swal2-styled:focus {
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.5) !important; 
  outline: none !important;
}

/* 3. Handle the hover state so it doesn't flip back to purple */
.swal2-styled.swal2-confirm:hover {
  background-color: #27ae60 !important;
  background-image: none !important; 
}

/* Target the Deny or Cancel button specifically */
.swal2-container .swal2-styled.swal2-deny, 
.swal2-container .swal2-styled.swal2-cancel {
    background-color: #aaa6a6 !important; 
    color: #fff !important;
    border: 1px solid #aaa6a6 !important;
    opacity: 1 !important; 
}

.swal2-container .swal2-styled.swal2-deny:hover,
.swal2-container .swal2-styled.swal2-cancel:hover {
    background-color: #aaa6a6 !important;
    box-shadow: 0 0 8px #72707033 !important;
}

/* If the replies container has ANY children, hide the pencil icon of the parent */
.message-container:has(.reply-list > .message-container) .fa-pencil {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

/* Legacy fallback for older browsers */
.message-container .reply-list:not(:empty) ~ .chat-icons .fa-pencil {
    opacity: 0.5;
    cursor: not-allowed;
}

#chat-window {
    height: 65vh !important; 
    min-height: 535px !important; 
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #000;
    border: 1px solid #333;
    padding: 10px;
}

.ai-helper-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    margin-left: 8px;
    border: none;
    transition: transform 0.2s;
}

.ai-helper-btn:hover {
    transform: scale(1.1);
    background: #0056b3;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Desktop View: 3 wide */
@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.product-card {
    border: 1px solid #a8ff60; 
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

/* Desktop Modal Setup */
.swal2-popup {
    width: 500px !important;    
    max-width: 95% !important;  
    background: #1a1a1a !important; 
    border: 1px solid #444 !important;
    overflow: hidden !important;
}

/* --- Scheduler Grid Styles --- */
#employee-lanes {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    gap: 0;
    background: #111;
    border: 1px solid #444;
    min-height: 700px;
    position: relative;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 100% 60px;
    background-position-y: 40px; 
}

#employee-lanes > div {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 85vw; 
}

.lane {
    border-right: 1px solid #333;
    position: relative;
    min-width: 150px; 
}

.lane-header {
    background: #222;
    color: #a8ff60; 
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #444;
    position: sticky;
    top: 0;
    z-index: 10;
}

.appointment-card {
    position: absolute;
    width: 90%;
    left: 5%;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.8em;
    color: #000;
    font-weight: 600;
    box-shadow: 3px 3px 0px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.2s;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.2);
}

.appointment-card:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
    z-index: 20;
}

/* Status Colors */
.status-scheduled { background: #55aaff !important; }
.status-completed { background: #a8ff60 !important; }
.status-cancelled { background: #ff5555 !important; opacity: 0.7; }

#booking-container label {
    color: #55aaff;
    font-size: 0.85em;
    margin-bottom: 5px;
    display: block;
}

.time-gutter {
    width: 40px;
    border-right: 1px solid #444;
    background: #1a1a1a;
    color: #666;
    font-size: 0.7em;
    text-align: right;
    padding-right: 5px;
}

/* Force container to drop internal spacing layout */
.swal2-html-container {
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
    background: transparent !important;
    display: block !important; 
}

#task-tree-wrapper {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.task-card input[type="checkbox"] {
    width: 22px !important;  
    margin: 0 !important;
    padding: 0 !important;    
}

/* --- BOM Configuration --- */
.bom-row { 
    display: grid; 
    grid-template-columns: 2fr 80px 100px 40px; 
    gap: 10px; 
    margin-bottom: 8px; 
    align-items: center; 
}

.bom-input { 
    background: #ffffff; 
    border: 1px solid #cbd5e0; 
    border-radius: 4px; 
    padding: 8px; 
    color: #2d3748; 
    font-weight: 600; 
}

@media (max-width: 600px) {
    .bom-row { 
        display: grid !important;
        grid-template-areas: 
            "name name name"
            "qty price del";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 45px;
        gap: 8px;
        background: #2d3748; 
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 12px;
    }
    
    .b-name  { grid-area: name; }
    .b-qty   { grid-area: qty; }
    .b-price { grid-area: price; }
    .bom-del-btn { grid-area: del; }
    
    .bom-input { 
        width: 100% !important; 
        box-sizing: border-box;
        color: #1a202c !important; 
        background: #ffffff !important; 
        font-size: 14px; 
    }
}

/* --- Tabs Layout --- */
.tab {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    border-bottom: 2px solid #ccc; 
    margin-bottom: 2em;
    background: #f9f9f9 !important; 
}

.tab button {
    flex: 1 !important;
    background: #eeeeee !important; 
    color: #666 !important; 
    border: 1px solid #ccc !important;
    border-bottom: none !important; 
    border-radius: 4px 4px 0 0 !important; 
    box-shadow: none !important;
    cursor: pointer;
    padding: 15px 10px !important;
    margin: 0 2px 0 0 !important; 
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85em;
    transition: all 0.2s ease;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important; 
    min-height: 70px !important;    
    line-height: 1.2 !important;
}

.tab button:hover {
    background: #e0e0e0 !important;
    color: #333 !important;
}

.tab button.active {
    background: #ffffff !important; 
    color: #51baad !important;    
    border: 2px solid #51baad !important;
    border-bottom: 2px solid #ffffff !important; 
    margin-bottom: -2px !important; 
    z-index: 2;
}

.tabcontent {
    display: none;
    padding: 20px 0;
    border-top: none !important;
}

.canvas-container {
    position: relative;
    height: 300px; 
    width: 100%;
}

/* --- Pipeline Layout --- */
.pipeline-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pipeline-card {
    width: calc(25% - 15px) !important;
    margin-right: 20px !important;
    margin-bottom: 20px !important;
    padding: 1.5em 1em !important;
    border-radius: 4px;
    background: #ffffff;
    border: solid 1px #dddddd;
    border-top: 4px solid #585858; 
    text-align: center;
}

.pipeline-card:nth-child(4n) {
    margin-right: 0 !important;
}

@media screen and (max-width: 980px) {
    .pipeline-card {
        width: calc(50% - 10px) !important;
        margin-right: 20px !important;
    }
    .pipeline-card:nth-child(4n) {
        margin-right: 20px !important;
    }
    .pipeline-card:nth-child(2n) {
        margin-right: 0 !important;
    }
}

@media screen and (max-width: 480px) {
    .pipeline-card {
        padding: 1em 0.5em !important;
    }
    .pipeline-card h3 {
        font-size: 1.1em !important;
    }
}

/* --- HUD & Diagnostic Views --- */
.hud-container {
    background: #000; 
    padding: 20px;
    border: 1px solid #a8ff60; 
    font-family: 'Courier New', monospace;
    color: #fff;
    text-align: left;
}

.hud-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.hud-table th {
    color: #a8ff60; 
    border-bottom: 2px solid #a8ff60;
    padding: 10px 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.hud-table td {
    padding: 12px 5px;
    border-bottom: 1px solid #333;
    font-size: 0.95rem;
}

.hud-qty { 
    color: #55aaff; 
    font-weight: bold; 
}

.hud-price { 
    color: #ffffff; 
}

.hud-total { 
    color: #a8ff60; 
    font-weight: bold; 
}

.hud-footer {
    border-top: 2px solid #a8ff60;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    color: #a8ff60;
}

.date-column {
    padding: 10px;
    line-height: 1.2;
    border-right: 2px solid #eee;
}

.day-text {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #333;
}

.date-text {
    font-size: 0.9rem;
    color: #666;
}

.time-text {
    margin-top: 4px;
    font-weight: bold;
    color: #007bff; 
    font-size: 1rem;
}

.mins-column {
    text-align: right;
    font-family: monospace;
}

.unit-text {
    font-size: 0.8rem;
    color: #888;
}

/* --- Invoice Modal & Print Layout --- */
.swal2-actions {
    background: #1a1a1a !important;
    margin: 0 !important;
    padding: 0 0 30px 0 !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
}

.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.inv-url {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0;
    color: #000;
}

.invoice-footer-actions {
    background: #f0f0f0;
    padding: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    border-radius: 0 0 4px 4px;
    border-top: 1px solid #ddd;
}

@media screen and (max-width: 500px) {
    .inv-office-details {
        text-align: left !important;
        margin-top: 10px;
        width: 100%;
    }
}

@media print {
    body *, 
    .swal2-container, 
    .swal2-actions, 
    .invoice-footer-actions {
        visibility: hidden !important;
    }

    #printable-invoice, 
    #printable-invoice * {
        visibility: visible !important;
    }

    #printable-invoice {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        background: white !important;
    }
}