﻿/* ===== ROOT ===== */
:root {
    --primary: #6161ff;
    --primary-hover: #4f4fe6;
    --secondary: #00c875;
    --danger: #e2445c;
    --card-bg: #ffffff;
    --text-main: #323338;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --body-bg: #f6f7fb;
    --header-bg: #ffffff;
    --sidebar-bg: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

/* ===== DARK MODE ===== */
html.dark-mode {
    --primary: #6161ff;
    --primary-hover: #4f4fe6;
    --secondary: #00c875;
    --danger: #e2445c;
    --card-bg: #2a2a35;
    --text-main: #e8e8eb;
    --text-muted: #9ca3af;
    --border: #404052;
    --body-bg: #1a1a24;
    --header-bg: #242732;
}

/* ===== GLOBAL ===== */

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Global zoom: scale pages to 90% */
html {
    zoom: 100%;
}

body {
    background: var(--body-bg);
    color: var(--text-main);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
* {
    box-sizing: border-box;
}
/* ===== LAYOUT ===== */
.app-shell {
    display: flex;
    height: 100dvh;
    overflow: hidden;
}

.main-area {
    flex: 1;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

html,
body {
    overflow-x: hidden;
}
.monday-table-wrapper {
    -webkit-overflow-scrolling: touch;
}



    /* Smooth scrollbar */
    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.3);
        border-radius: 4px;
    }

/* Nav links */




html.dark-mode .sidebar .nav-link {
    color: var(--text-main);
}

html.dark-mode .sidebar .nav-link:hover {
    background: rgba(255,255,255,.12);
}


/* ===== SIDEBAR ===== */

.sidebar {
    width: 260px;
    min-width: 260px;
    height: 100dvh;
    background: var(--sidebar-bg);
    color: white;
    /* let inner element handle scrolling to avoid nested scroll traps */
    overflow-y: visible;
    overflow-x: hidden;
    transition: width .18s ease;
    flex-shrink: 0;
    contain: layout paint;
}

/* Make .sidebar-inner the single scroll container on all viewports */
.sidebar-inner {
    height: 100%;
    min-height: 0; /* allow flex child to shrink properly */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

    /* COLLAPSED */
    .sidebar.collapsed {
        width: 78px;
        min-width: 78px;
    }
        /* HIDE SUBMENUS WHEN COLLAPSED */
        .sidebar.collapsed .submenu {
            display: none !important;
        }

        /* HIDE CHEVRONS */
        .sidebar.collapsed .bi-chevron-up,
        .sidebar.collapsed .bi-chevron-down {
            display: none !important;
        }

        /* CENTER ICONS */
        .sidebar.collapsed .nav-link,
        .sidebar.collapsed .nav-toggle-btn {
            justify-content: center;
            padding-left: 0;
            padding-right: 0;
        }

        /* REMOVE ICON MARGIN */
        .sidebar.collapsed .me-2 {
            margin-right: 0 !important;
        }

        /* HIDE BRAND TEXT */
        .sidebar.collapsed .navbar-brand .nav-label {
            display: none !important;
        }



        /* HIDE TEXT */
        .sidebar.collapsed .nav-label,
        .sidebar.collapsed .menu-text,
        .sidebar.collapsed .brand-text {
            display: none;
        }

        /* CENTER ICONS */
        .sidebar.collapsed .nav-link {
            justify-content: center;
        }

    /* NAV LINK */
    .sidebar .nav-link {
        padding: 14px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        color: inherit;
        text-decoration: none;
        transition: background .2s ease;
    }

        .sidebar .nav-link:hover {
            background: rgba(255,255,255,.08);
        }

/* MOBILE SAFE */
@media (max-width: 768px) {

    .app-shell {
        display: flex;
        height: 100dvh;
        overflow: hidden;
    }

    .sidebar {
        position: relative;
        transform: none !important;
        left: 0;
        top: 0;
        z-index: 1;
    }

    .main-area {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .content-area {
        padding: 12px;
        overflow-y: auto;
    }

    .top-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--header-bg);
    }

    /* REMOVE OLD MOBILE OVERLAY */
    .overlay {
        display: none !important;
    }
    .sidebar.mobile-hidden {
        width: 0 !important;
        min-width: 0 !important;
        overflow: hidden;
        padding: 0 !important;
        border: 0 !important;
    }
}

/* ===== BUTTON ===== */
.menu-btn {
    font-size: 22px;
    background: none;
    border: none;
    cursor: pointer;
}

/* ===== USER ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: 600;
    color: #111827;
}

/* ===== CARDS ===== */
.module-card,
.qs-card,
.monday-board {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Hover effect optimized */
.qs-card:hover {
    transform: scale(1.02);
}

/* ===== TABLE ===== */
.monday-board {
 
}

.monday-table-wrapper {
    overflow: auto;
    max-height: 70vh; /* or your preferred height */
}
/* 🔥 FORCE TABLE WIDTH */
.monday-table {
    width: max-content !important; /* 🔥 KEY FIX */
    min-width: 1600px; /* adjust if needed */
    border-collapse: collapse;
    font-size: 13px;
    contain: layout paint;
}

    /* HEADER */
    .monday-table th {
        background: var(--card-bg) !important;
        color: #111 !important; /* strong text */
        font-weight: 600;
        position: sticky;
        top: 0;
        z-index: 100; /* 🔥 increase */
        border-bottom: 2px solid #ccc;
    }

    /* BODY */
    .monday-table td {
        padding: 8px;
        border-bottom: 1px solid #ddd;
        white-space: nowrap;
        vertical-align: middle; /* 🔥 THIS fixes your issue */
    }

/* Sticky column */
        .monday-table td:first-child,
        .monday-table th:first-child {
            position: sticky;
            left: 0;
            background: var(--card-bg);
        }

/* ===== STATUS (FIXED) ===== */
.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Soft modern colors */
.status-installed {
    background: #e6f9f1;
    color: #00a86b;
}

.status-delivered {
    background: #e6f0ff;
    color: #0056d6;
}

.status-damaged {
    background: #ffe6ea;
    color: #c92a2a;
}
.status-pending {
    background: #fff8e1;
    color: #b7791f;
}

.status-default {
    background: #e5e7eb;
    color: #374151;
}
.status-pill {
    border: 1px solid rgba(0,0,0,0.05);
}
/* ===== IMAGE ===== */
.table-img {
    width: 120px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;

}

.table-img:hover {
    transform: scale(1.1);
}

/* ===== GRID ===== */
.module-container {
    display: grid;
    gap: 10px;
    padding: 10px;
}

@media (min-width: 768px) {
    .module-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .module-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* MONDAY TABLE FEATURES */

/* Column emphasis */
.monday-table td:nth-child(3),
.monday-table td:nth-child(4),
.monday-table td:nth-child(6),
.monday-table td:nth-child(7),
.monday-table td:nth-child(8) {
    font-weight: bold;
}

/* Description column readable */
.monday-table td:nth-child(5) {
    text-align: left;
}

/* Wrap text */
.wrap {
    line-height: 1.4;
}

    .wrap::first-line {
        font-weight: bold;
    }



/* QS DASHBOARD COLORS */

.qs-card.success {
    background: #e8f5e9;
}

.qs-card.warning {
    background: #fff8e1;
}

.qs-card.orange {
    background: #ffe0b2;
}

.qs-card.danger {
    background: #fdecea;
}

.qs-card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* ===== DARK MODE STYLES ===== */

/* Cards */
html.dark-mode .module-card,
html.dark-mode .qs-card,
html.dark-mode .monday-board {
    background: var(--card-bg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    color: var(--text-main);
}

/* User name */
html.dark-mode .user-name {
    color: var(--text-main);
}

/* Table */
html.dark-mode .monday-table th {
    background: var(--card-bg) !important;
    color: var(--text-main) !important;
    border-bottom-color: var(--border);
}

html.dark-mode .monday-table td {
    border-bottom-color: var(--border);
    color: var(--text-main);
}

html.dark-mode .monday-table td:first-child,
html.dark-mode .monday-table th:first-child {
    background: var(--card-bg);
}

/* Table images */
html.dark-mode .table-img {
    border-color: var(--border);
}

/* QS Card colors for dark mode */
html.dark-mode .qs-card.success {
    background: rgba(0, 200, 117, 0.15);
}

html.dark-mode .qs-card.warning {
    background: rgba(249, 171, 0, 0.15);
}

html.dark-mode .qs-card.orange {
    background: rgba(244, 81, 30, 0.15);
}

html.dark-mode .qs-card.danger {
    background: rgba(226, 68, 92, 0.15);
}

/* Bootstrap component overrides for dark mode */
html.dark-mode .card {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text-main);
}

html.dark-mode .card-header {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

html.dark-mode .list-group-item {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text-main);
}

html.dark-mode .btn-light {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text-main);
}

html.dark-mode .btn-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

html.dark-mode .btn-outline-secondary {
    color: var(--text-main);
    border-color: var(--border);
}

html.dark-mode .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
}

/* Form elements */
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border);
}

html.dark-mode input:focus,
html.dark-mode textarea:focus,
html.dark-mode select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    color: var(--text-main);
}

/* Text colors */
html.dark-mode .text-muted {
    color: var(--text-muted) !important;
}

html.dark-mode .badge {
    background: var(--primary);
}

/* Badge styles */
html.dark-mode .badge.rounded-pill {
    background: var(--primary);
}

/* Position relative elements */
html.dark-mode .position-absolute {
    color: var(--text-main);
}

/* Scrollbar in dark mode */
html.dark-mode ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html.dark-mode ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

html.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

html.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Smooth transitions for all elements */
body,
.card,
.module-card,
.qs-card,
.monday-board,
button,
input,
select,
textarea {
    transition: background-color .2s ease, color .2s ease;
}




/* AGING COLORS */
.aging-green {
    background-color: #e6f9ed;
    border-left: 5px solid #28a745;
}

.aging-yellow {
    background-color: #fff8e1;
    border-left: 5px solid #ffc107;
}

.aging-orange {
    background-color: #ffe5d0;
    border-left: 5px solid #fd7e14;
}

.aging-red {
    background-color: #ffe5e5;
    border-left: 5px solid #dc3545;
    font-weight: 600;
}

.no-aging {
    background-color: white;
}




/* TIMELINE UI */
.timeline-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

    .circle.active {
        background: #28a745;
    }

.line {
    flex: 1;
    height: 4px;
    background: #ccc;
}

    .line.active {
        background: #28a745;
    }





/* CUSTOMER EXPAND ANIMATION */
.customer-card {
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

    .customer-card:hover {
        background: #f5f7fb;
    }

.customer-address {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.25s ease;
}

    .customer-address.show {
        max-height: 100px;
        opacity: 1;
        transform: translateY(0);
        margin-top: 4px;
    }

    .user-role-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 4px;
    width: fit-content;
}

.role-admin { background: #fff5f5; color: #c92a2a; }
.role-manager { background: #e7f5ff; color: #1971c2; }
.role-seller { background: #ebfbee; color: #2b8a3e; }
.role-default { background: #f1f3f5; color: #495057; }

.badge-count {
    background-color: #198754;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}
.photo-preview-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.img-container {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.img-container:hover .thumb-img {
    transform: scale(1.05);
}

.file-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    padding: 6px;
    opacity: 0;
    transition: 0.2s;
}

.img-container:hover .file-overlay {
    opacity: 1;
}
.toast-success.show {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #28a745;
    color: white;
    padding: 16px 26px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    z-index: 9999;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}
.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 9998;
}

.toast-success {
    display: none; /* 🔥 hidden by default */
}

    .toast-success.show {
        display: block;
    }

.toast-overlay {
    display: none; /* 🔥 hidden by default */
}

    .toast-overlay.show {
        display: block;
    }

.filter-bar {
    display: flex;
    gap: 10px;
    padding: 10px;
    align-items: end;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
}
.monday-table th:last-child,
.monday-table td:last-child {
    width: 220px; /* 🔥 give space */
    text-align: center; /* center content */
}

.actions-cell {
    display: flex;
    justify-content: center; /* center buttons */
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btn {
    min-width: 100px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* ===== ILLUSTRATION IMAGE (FIXED + SMOOTH) ===== */

.illustration-img {
    transition: transform 0.25s ease;
    cursor: pointer;
    border-radius: 8px;
}

    /* Hover zoom */
    .illustration-img:hover {
        transform: scale(1.1);
        z-index: 10;
    }

/* Optional: prevent overflow cut */
.img-container {
    overflow: hidden;
}
/* ===== MODULE IMAGE (FINAL FIX) ===== */

.module-img {
    width: 120px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: var(--card-bg);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

    /* Smooth zoom */
    .module-img:hover {
        transform: scale(1.08);
        box-shadow: 0 8px 20px rgba(0,0,0,0.25);
        z-index: 10;
    }
.top-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
}


/* ===== MONDAY-STYLE LOGIN ===== */
.monday-table-wrapper {
    position: relative;
    z-index: 1;
}
.login-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--body-bg);
}

/* CARD */
.login-card {
    width: 360px;
    background: var(--card-bg);
    padding: 28px 26px;
    border-radius: 10px;
    border: 1px solid #e6e9ef; /* softer instead of heavy shadow */
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.25s ease;
}

/* LOGO */
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}

    .login-logo img {
        height: 40px;
        object-fit: contain;
    }

/* TITLE */
.login-card h1 {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #323338;
}

/* SUBTITLE */
.login-card .subtitle {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

/* FORM */
.login-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* INPUT */
.login-card input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid #d0d4e4;
    font-size: 13px;
    background: var(--card-bg);
    transition: border 0.15s ease, box-shadow 0.15s ease;
}

    /* INPUT FOCUS */
    .login-card input:focus {
        outline: none;
        border-color: #0073ea; /* Monday blue */
        box-shadow: 0 0 0 2px rgba(0,115,234,0.15);
    }

/* REMEMBER */
.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #555;
}

    /* CHECKBOX */
    .remember input[type="checkbox"] {
        width: 15px;
        height: 15px;
        accent-color: #0073ea;
    }

/* BUTTON */
.login-card button {
    height: 40px;
    border-radius: 6px;
    border: none;
    background: #0073ea; /* Monday primary */
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

    /* BUTTON HOVER */
    .login-card button:hover {
        background: #005dcc;
    }

    /* DISABLED */
    .login-card button:disabled {
        background: #aac8f5;
        cursor: not-allowed;
    }

/* REGISTER LINK */
.login-card .text-center {
    font-size: 12px;
    color: #6b7280;
}

.login-card a {
    color: #0073ea;
    text-decoration: none;
    font-weight: 500;
}

/* ERROR */
.login-error {
    text-align: center;
    font-size: 12px;
    color: #e2445c;
}

/* ANIMATION */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}






/* ===== IMAGE POPUP ===== */

.photo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.photo-full {
    max-width: 95%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
}

/* CLOSE BUTTON */
.photo-close {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    font-size: 20px;
    cursor: pointer;
}
.photo-overlay {
    animation: fadeIn 0.2s ease;
}

.photo-full {
    animation: zoomIn 0.2s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/*View Layout Installer*/
.layout-box {
    width: 100%;
    height: calc(100dvh - 180px); /* adjust based on header */
    background: var(--card-bg);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.layout-viewer {
    flex: 1;
    width: 100%;
    overflow: hidden;
}

.layout-pdf {
    width: 100%;
    height: 100%;
    border: none;
}


/* PRIMARY ACTION (Install / Approve / Layout) */
.primary-btn {
    background: #00c875;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

    .primary-btn:hover {
        background: #00a86b;
    }

/* DANGER ACTION */
.danger-btn {
    background: #e2445c;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
}

    .danger-btn:hover {
        background: #c7324a;
    }


.modern-toolbar {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 10px;
    margin-bottom: 10px;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.status-filter {
    height: 40px;
    border-radius: 8px;
    padding: 0 10px;
    border: 1px solid #ddd;
    min-width: 150px;
}

/* ===== MODAL IMAGE FIX Installer Report Illustration ===== */
.preview-img {
    width: 100%;
    max-width: 100%;
    max-height: 250px; /* 🔥 control height */
    object-fit: contain; /* 🔥 keep aspect ratio */
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #f9fafc;
    padding: 6px;
}

/* Loading */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-card {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0,0,0,0.1);
    border-top: 5px solid #0d6efd;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: auto;
}

.loading-text {
    margin-top: 15px;
    font-size: 14px;
    color: #6c757d;
    letter-spacing: 0.3px;
    opacity: 0.85;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}













@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ---------------------------------------------------------- */
/* -----------------------Lead Validation start----------------------------------- */
/* Container for floating label + input */
.floating-input {
    position: relative;
    margin-bottom: 1.5rem;
}

    /* Input itself */
    .floating-input input,
    .floating-input select,
    .floating-input textarea {
        width: 100%;
        padding: 0.75rem 0.75rem 0.25rem 0.75rem;
        border: 1px solid #ccc;
        border-radius: 0.25rem;
        outline: none;
    }

        /* Input focus */
        .floating-input input:focus,
        .floating-input select:focus,
        .floating-input textarea:focus {
            border-color: #007bff;
        }

    /* Floating label */
    .floating-input label {
        position: absolute;
        top: 0.75rem;
        left: 0.75rem;
        color: #888;
        font-size: 0.9rem;
        pointer-events: none;
        transition: all 0.2s ease-out;
    }

    /* Move label up when input has value or focus */
    .floating-input input:not(:placeholder-shown) + label,
    .floating-input select:not([value=""]) + label,
    .floating-input textarea:not(:placeholder-shown) + label,
    .floating-input input:focus + label,
    .floating-input select:focus + label,
    .floating-input textarea:focus + label {
        top: -0.5rem;
        left: 0.75rem;
        font-size: 0.75rem;
        color: red; /* highlight on error */
        background: white;
        padding: 0 0.25rem;
    }

/* Input invalid highlight */
.is-invalid {
    border-color: red !important;
}

/* ---------------------Lead Validation end------------------------------------- */


/* ---------------------Lead image start------------------------------------- */
.image-wrapper {
    position: relative;
}

.see-more-overlay {
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
}

.img-thumbnail {
    transition: transform 0.2s ease;
}

    .img-thumbnail:hover {
        transform: scale(1.08);
    }

.gallery-btn {
    background: transparent !important;
    border: none !important;
    color: white;
    font-size: 16px;
    opacity: 0.8;
    transition: 0.2s ease;
}

    .gallery-btn:hover {
        opacity: 1;
        transform: scale(1.05);
    }
/* ---------------------Lead image end------------------------------------- */



/* ---------------------Lead Source start------------------------------------- */

/* SMALL TEXT */
.small {
    font-size: 0.75rem;
}

/* TOOLBAR SCROLL (horizontal scroll for source buttons) */
.toolbar-scroll {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

    .toolbar-scroll::-webkit-scrollbar {
        display: none;
    }

    /* PREVENT BUTTON SHRINKING */
    .toolbar-scroll button {
        flex: 0 0 auto;
    }

/* BUTTON TEXT RESPONSIVE */
.btn-text {
    display: inline;
}

@media (max-width: 768px) {
    .btn-text {
        display: none;
    }
}

/* OPTIONAL: show text on hover */
button:hover .btn-text {
    display: inline !important;
}

/* ✅ FIXED: ALLOW PAGE SCROLL */


/* MAIN CONTAINER */
.lead-container-5rows {
    width: 100%;
    height: 500px;
    display: block;
    padding: 10px;
    box-sizing: border-box;
}

    /* TABLE SCROLL ONLY */
    .lead-container-5rows .table-responsive {
        width: 100%;
        height: 100%;
        overflow: auto;
    }

    /* TABLE BEHAVIOR */
    .lead-container-5rows table {
        width: max-content;
        min-width: 100%;
    }

    /* PREVENT WRAPPING */
    .lead-container-5rows th,
    .lead-container-5rows td {
        white-space: nowrap;
    }

/* SINGLE DECLARATION ONLY */
.table-responsive {
    overflow: auto;
}

/* ===== TABLE ===== */
.table-responsive {
    overflow-x: auto;
}

.cif-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 2200px;
}

/* ===== HEADER ===== */
thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #212529;
    color: #fff;
}

/* ===== LEFT STICKY ===== */
.sticky-client {
    position: sticky;
    left: 0;
    background: #fff !important;
    z-index: 25;
    min-width: 180px;
    max-width: 220px;
    box-shadow: 3px 0 6px rgba(0,0,0,.08);
}

/* ===== RIGHT STICKY ===== */
.sticky-right {
    position: sticky;
    right: 0;
    background: #fff !important;
    z-index: 25;
    width: 90px;
    box-shadow: -3px 0 6px rgba(0,0,0,.08);
}

/* Sticky headers */
thead .sticky-client,
thead .sticky-right {
    z-index: 30;
}

/* Laptop */
@media (max-width: 1400px) {
    .sticky-client {
        min-width: 160px;
        max-width: 180px;
    }

    .sticky-right {
        width: 80px;
    }
}

/* Tablet */
@media (max-width: 992px) {

    .sticky-client {
        min-width: 140px;
        max-width: 160px;
    }

    /* Disable sticky chat */
    .sticky-right {
        position: static;
        width: auto;
        box-shadow: none;
    }

    .cif-table {
        font-size: 13px;
    }
}

/* Phone */
@media (max-width: 768px) {

    .sticky-client {
        min-width: 120px;
        max-width: 140px;
    }

    .cif-table {
        font-size: 12px;
    }
}

/* Body cells */
tbody td {
    background: #fff;
}

/* ✅ FIX: ENSURE TOOLBAR STAYS ABOVE TABLE */
.sticky-top {
    z-index: 1050 !important;
}
/* ---------------------Lead Source end------------------------------------- */





/* ---------------------Lead Activity Log Start------------------------------------- */

.timeline-container {
    position: relative;
    margin-left: 10px;
}

    .timeline-container::before {
        content: '';
        position: absolute;
        left: 20px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: #dee2e6;
    }

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    z-index: 1;
    margin-right: 15px;
}

.timeline-content {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    width: 100%;
}
/* ---------------------Lead Activity Log End------------------------------------- */



/* ================= INSTALLER ONLY STICKY ACTIONS ================= */

/* ================= DARK THEME ================= */
/* These rules intentionally target common containers and components
   so calling `toggleDarkMode()` (defined in index.html) will produce
   a consistent dark appearance. Keep overrides minimal to avoid
   interfering with component-specific styles. */

body.dark-mode {
    background: #0b0f14;
    color: #e6eef6;
}

    body.dark-mode .app-shell,
    body.dark-mode .main-area,
    body.dark-mode .content-area {
        background: transparent;
    }

    body.dark-mode .card,
    body.dark-mode .module-card,
    body.dark-mode .qs-card,
    body.dark-mode .monday-board,
    body.dark-mode .login-card,
    body.dark-mode .modern-toolbar {
        background: var(--card-bg);
        color: #e6eef6;
        border-color: #1f2a33;
        box-shadow: none;
    }

    body.dark-mode .top-header {
        background: transparent;
        color: #e6eef6;
    }



        body.dark-mode .sidebar .nav-link:hover {
            background: rgba(255,255,255,0.03);
        }

    body.dark-mode .user-name {
        color: #e6eef6;
    }
    body.dark-mode .menu-btn {
        color: #e6eef6;
    }

/* Table adjustments */
    body.dark-mode .monday-table th {
        background: var(--card-bg) !important;
        color: #cfe6ff !important;
        border-bottom-color: #26313a;
    }

    body.dark-mode .monday-table td {
        background: transparent;
        color: #dfe9f2;
        border-bottom: 1px solid #182026;
    }

/* Overlays, modals and popups */
    body.dark-mode .overlay {
        background: rgba(0,0,0,0.6);
    }
    body.dark-mode .photo-overlay {
        background: rgba(0,0,0,0.9);
    }

/* Loading screen tweak for dark */
body.dark-mode .loading-screen { background: linear-gradient(135deg,#071022,#0b1722); }

/* Small accents */
body.dark-mode .badge-count { background-color: #17a673; }
body.dark-mode .status-pill { color: #f1f5f9; }

/* Ensure inputs look correct */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #0b1216;
    color: #e6eef6;
    border-color: #1e2a31;
}


/* Sticky right column */
.installer-container .monday-table th:last-child,
.installer-container .monday-table td:last-child {
    position: sticky;
    right: 0;
    width: 220px;
}

/* Header (hide text only) */
.installer-container .monday-table th:last-child {
    background: var(--card-bg);
    z-index: 50;
    font-size: 0; /* 🔥 hides "Actions" text */
}

/* Body cell */
.installer-container .monday-table td:last-child {
    background: var(--card-bg);
    z-index: 20;
    box-shadow: -4px 0 10px rgba(0,0,0,0.08);
}


/*Inials*/
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0d6efd; /* blue */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid rgba(0,0,0,0.08);
}
.gmail-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    user-select: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;

}

    .gmail-avatar:hover {
        transform: scale(1.05);
        box-shadow: 0 3px 6px rgba(0,0,0,0.25);
    }
.status-red {
    background: #e2445c; /* your danger color */
}

.status-blue {
    background: #0073ea; /* nice Monday blue */
}







/**********************************TABS***************************************************/
.monday-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* TAB BASE */
.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    /* HOVER */
    .tab:hover {
        background: rgba(255,255,255,0.05);
    }

    /* ACTIVE (MONDAY STYLE) */
    .tab.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

    /* BADGE COUNT */
    .tab .badge-count {
        background: rgba(0,0,0,0.08);
        color: #333;
    }

    .tab.active .badge-count {
        background: rgba(255,255,255,0.25);
        color: #fff;
    }

/*/////////////////////////////////////////////Report Modal Specific Ctop /////////////////////////////////////////////////*/

.install-card {
    padding: 10px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
}

    .install-card input {
        text-align: center;
    }

/*/////////////////////////////////////////Toggle Batch Drawer /////////////////////////////////////////////////*/
/* overlay */
.batch-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

/* drawer */
.batch-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

/* header */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* buttons */
.drawer-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

    .drawer-btn.success {
        background: #28a745;
        color: #fff;
    }

    .drawer-btn.dark {
        background: #343a40;
        color: #fff;
    }

    .drawer-btn.warning {
        background: #ffc107;
        color: #000;
    }

/* status */
.drawer-status {
    padding: 10px;
    background: #e6ffed;
    border-radius: 8px;
    color: #198754;
    text-align: center;
    font-weight: 600;
}





/* make header sticky */
.batch-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #eef3ff;
}

/* inner layout */
.batch-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* highlight active */
.active-batch {
    background: #dbeafe !important;
}

.chat-btn {
    position: relative;
    background: #0dcaf0;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* 🔥 FLOATING BADGE */
.chat-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: red;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px white;
}
.chat-badge {
    animation: pop 0.2s ease;
}

@keyframes pop {
    from {
        transform: scale(0.5);
    }

    to {
        transform: scale(1);
    }
}

/* 🔥 MODERN ACTION BUTTON */
.floating-batch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    margin-left: 6px;
}

    /* hover effect */
    .floating-batch-btn:hover {
        transform: translateY(-1px) scale(1.05);
        box-shadow: 0 5px 12px rgba(0,0,0,0.25);
    }

    /* active (when opened) */
    .floating-batch-btn.active {
        background: linear-gradient(135deg, #212529, #000);
    }

    /* click press */
    .floating-batch-btn:active {
        transform: scale(0.95);
    }
.floating-batch-btn {
    border: 1px solid rgba(255,255,255,0.2);
}
.drawer-info-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
}

    .drawer-info-card.success {
        border-left: 4px solid #198754;
    }

    .drawer-info-card.dark {
        border-left: 4px solid #212529;
    }

.drawer-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.drawer-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}


/*Batch View*/
.batch-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.batch-chip-btn {
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.seen-text {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}


.jo-search-box {
    flex: 1;
    min-width: 260px;
}

    .jo-search-box input,
    .jo-search-box select {
        height: 45px;
    }

.filter-bar button {
    height: 45px;
    white-space: nowrap;
}

.jo-search-inline {
    min-width: 280px;
    flex: 1;
}

.jo-select {
    min-width: 260px;
    height: 45px;
}

.filter-bar input {
    height: 45px;
}

.filter-bar button {
    height: 45px;
    white-space: nowrap;
}
.recent-report-row {
    background-color: #ffe4ef !important;
}

    .recent-report-row:hover {
        background-color: #ffd6e7 !important;
    }



/* DESKTOP DEFAULT */
.mobile-module-view {
    display: none;
}

/* MOBILE VIEW */
@media (max-width: 768px) {

    .desktop-module-view {
        display: none;
    }

    .mobile-module-view {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .module-card {
        background: #fff;
        border-radius: 14px;
        padding: 14px;
        box-shadow: 0 2px 10px rgba(0,0,0,.08);
        border: 1px solid #e9ecef;
    }

    .module-card-img {
        width: 100%;
        max-height: 220px;
        object-fit: contain;
        border-radius: 10px;
        background: #f8f9fa;
    }

    .module-card-details {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 14px;
    }

    .module-card button {
        width: 100%;
    }
    .sidebar-inner {
        height: 100%;
        overflow-y: auto;
        pointer-events: auto;
    }
}

.img-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #999;
}
#completedAreaPdf .card {
    page-break-inside: avoid;
}

#completedAreaPdf img {
    page-break-inside: avoid;
}
.completed-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

    .completed-thumb:hover {
        transform: scale(1.05);
    }
.completed-area-img {
    cursor: pointer;
    height: 250px;
    width: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

    .completed-area-img:hover {
        transform: scale(1.02);
    }

.global-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.loading-card {
    background: #1f1f1f;
    padding: 30px 40px;
    border-radius: 18px;
    text-align: center;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.modal-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}


/*SOF TABS*/
.sof-tabs {
    display: inline-flex;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
}

.sof-tab {
    border: none;
    background: white;
    padding: 12px 28px;
    font-weight: 600;
    color: #495057;
    transition: .2s;
}

    .sof-tab.active {
        background: #0d6efd;
        color: white;
    }

    .sof-tab:hover:not(.active) {
        background: #f8f9fa;
    }



/* Mobile Friendly ASM Page */

@media screen and (max-width:768px) {

    .desktop-table {
        display: none !important;
    }

    .mobile-card {
        display: block !important;
    }

    .po-table {
        display: none !important;
    }

    .po-card {
        display: block !important;
    }

    .btn-mobile {
        width: 100%;
        margin-bottom: 6px;
    }

    /* NEW */

    .sof-card {
        border-radius: 16px;
        margin-bottom: 18px;
    }

    .po-group {
        background: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 16px;
        padding: 12px;
        margin-bottom: 35px; /* separates from next SOF */
    }

    .po-group-title {
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 12px;
        color: #0d6efd;
    }

    .po-card {
        border-left: 4px solid #0d6efd;
        border-radius: 12px;
        margin-bottom: 12px;
        overflow: hidden;
    }

        .po-card:last-child {
            margin-bottom: 0;
        }

    .sof-divider {
        height: 12px;
    }
}

@media screen and (min-width:769px) {

    .desktop-table {
        display: block !important;
    }

    .mobile-card {
        display: none !important;
    }

    .po-table {
        display: block !important;
    }

    .po-card {
        display: none !important;
    }
}

/* ===========================
   LOGS
=========================== */

.log-card {
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
    overflow: hidden;
    transition: .2s ease;
}

    .log-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 18px rgba(0,0,0,.08);
    }

    .log-card .card-body {
        padding: .7rem .9rem;
    }

/* ===========================
   BADGES
=========================== */

.badge {
    border-radius: 20px;
    padding: .45rem .8rem;
    font-size: .75rem;
    font-weight: 600;
}

/* ===========================
   MAIN SOF TABLE
=========================== */

.sof-table {
    width: 100%;
    margin-bottom: 0;
}

    .sof-table thead th {
        background: #f8f9fb;
        color: #495057;
        font-weight: 600;
        border-bottom: 2px solid #dee2e6;
        white-space: nowrap;
    }

    .sof-table td,
    .sof-table th {
        vertical-align: middle;
        padding: 14px 12px;
    }

    .sof-table tbody tr {
        transition: .2s;
    }

        .sof-table tbody tr:hover {
            background: #f8fbff;
        }

/* Selected SOF */

.sof-selected {
    background: #eef6ff !important;
}

    .sof-selected td:first-child {
        border-left: 4px solid #0d6efd;
    }

/* ===========================
   PO PANEL
=========================== */

.po-panel {
    margin: 10px 0;
    padding: 18px;
    background: #fafbfc;
    border: 1px solid #dee2e6;
    border-radius: 10px;
}

.po-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    padding: 12px 18px;
    font-weight: 600;
}

/* ===========================
   PO TABLE
=========================== */

.po-table {
    width: 100%;
    margin-bottom: 0;
    table-layout: fixed;
}

    .po-table thead th {
        background: #eef3f8;
        color: #495057;
        font-weight: 600;
    }

    .po-table td,
    .po-table th {
        vertical-align: middle;
        padding: 12px;
    }

    .po-table tbody tr:hover {
        background: #f8fbff;
    }

    /* PO Column Widths */

    .po-table th:nth-child(1),
    .po-table td:nth-child(1) {
        width: 12%;
    }

    .po-table th:nth-child(2),
    .po-table td:nth-child(2) {
        width: 14%;
    }

    .po-table th:nth-child(3),
    .po-table td:nth-child(3) {
        width: 16%;
    }

    .po-table th:nth-child(4),
    .po-table td:nth-child(4) {
        width: 18%;
    }

    .po-table th:nth-child(5),
    .po-table td:nth-child(5) {
        width: 14%;
    }

    .po-table th:nth-child(6),
    .po-table td:nth-child(6) {
        width: 14%;
    }

    .po-table th:nth-child(7),
    .po-table td:nth-child(7) {
        width: 6%;
    }

    .po-table th:nth-child(8),
    .po-table td:nth-child(8) {
        width: 12%;
    }

/* ===========================
   CARD
=========================== */

.card {
    width: 100%;
}

.table-responsive {
    width: 100%;
}




/* =========================================
   MODERN ASM MOBILE DESIGN
   ========================================= */

.asm-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 32px;
}

.mobile-sof-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e7eaf0;
    border-radius: 18px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .mobile-sof-card.expanded {
        border-color: #b9d3ff;
        box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12);
    }

.mobile-sof-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 16px 12px;
}

.mobile-sof-icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    color: #2563eb;
    font-size: 20px;
    background: #eaf2ff;
    border-radius: 13px;
}

.mobile-sof-title {
    flex: 1;
    min-width: 0;
}

.mobile-label {
    display: block;
    margin-bottom: 2px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.mobile-sof-title h5,
.modern-po-header h6 {
    overflow: hidden;
    margin: 0;
    color: #172033;
    font-size: 17px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-client-name {
    overflow: hidden;
    margin-top: 3px;
    color: #64748b;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 50px;
    white-space: nowrap;
}

    .modern-status.success {
        color: #087443;
        background: #dcfce7;
    }

    .modern-status.danger {
        color: #b42318;
        background: #fee4e2;
    }

    .modern-status.warning {
        color: #92400e;
        background: #fef3c7;
    }

    .modern-status.neutral {
        color: #475569;
        background: #f1f5f9;
    }

.mobile-sof-information {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 4px 16px 16px;
}

.mobile-info-item {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #eef1f5;
    border-radius: 12px;
}

.mobile-info-icon {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #64748b;
    background: #ffffff;
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.mobile-info-item span,
.modern-po-details span,
.modern-stage span {
    display: block;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
}

.mobile-info-item strong {
    display: block;
    overflow: hidden;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-details-button {
    display: flex;
    width: calc(100% - 32px);
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 16px 16px;
    padding: 11px 14px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 0;
    border-radius: 12px;
}

    .mobile-details-button.close {
        color: #475569;
        background: #f1f5f9;
    }

.mobile-expanded-content {
    padding: 16px;
    background: #f5f7fb;
    border-top: 1px solid #e6eaf0;
}

.mobile-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
}

    .mobile-section-heading span {
        display: block;
        color: #1e293b;
        font-size: 14px;
        font-weight: 800;
    }

    .mobile-section-heading small {
        display: block;
        margin-top: 2px;
        color: #94a3b8;
        font-size: 11px;
    }

    .mobile-section-heading > i {
        color: #64748b;
        font-size: 19px;
    }

.mobile-count-badge {
    min-width: 30px;
    padding: 5px 9px;
    color: #2563eb !important;
    text-align: center;
    background: #dbeafe;
    border-radius: 50px;
}

.modern-po-card {
    overflow: hidden;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid #e4e9f0;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
}

.modern-po-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #eef1f5;
}

.modern-po-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 15px;
}

    .modern-po-details > div {
        min-width: 0;
    }

    .modern-po-details strong {
        display: block;
        overflow: hidden;
        margin-top: 2px;
        color: #334155;
        font-size: 12px;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.modern-stage {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 15px 15px;
    padding: 11px 12px;
    color: #1d4ed8;
    background: #eff6ff;
    border-radius: 11px;
}

    .modern-stage > i {
        font-size: 18px;
    }

    .modern-stage strong {
        display: block;
        color: #1e40af;
        font-size: 12px;
    }

.mobile-documents {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 0 15px 15px;
}

.document-button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    padding: 10px;
    color: #334155;
    text-align: left;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

    .document-button:active {
        background: #f8fafc;
        transform: scale(0.99);
    }

    .document-button > .bi-chevron-right,
    .document-button > .bi-box-arrow-up-right,
    .document-button > .bi-plus-lg {
        margin-left: auto;
        color: #94a3b8;
    }

.document-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    font-size: 17px;
    border-radius: 10px;
}

    .document-icon.original {
        color: #dc2626;
        background: #fee2e2;
    }

    .document-icon.asm {
        color: #2563eb;
        background: #dbeafe;
    }

    .document-icon.ahr {
        color: #7c3aed;
        background: #ede9fe;
    }

    .document-icon.cad {
        color: #047857;
        background: #d1fae5;
    }

    .document-icon.upload {
        color: #d97706;
        background: #fef3c7;
    }

.document-content {
    display: block;
    flex: 1;
    min-width: 0;
}

    .document-content strong {
        display: block;
        color: #334155;
        font-size: 12px;
    }

    .document-content small {
        display: block;
        margin-top: 1px;
        color: #94a3b8;
        font-size: 10px;
    }

.pic-decision-panel {
    margin-top: 5px;
    padding: 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.pic-decision-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

    .pic-decision-title span {
        display: block;
        color: #94a3b8;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.08em;
    }

    .pic-decision-title strong {
        display: block;
        margin-top: 2px;
        color: #1e293b;
        font-size: 13px;
    }

    .pic-decision-title > i {
        font-size: 21px;
    }

.pic-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.modern-action {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 800;
    border: 0;
    border-radius: 11px;
}

    .modern-action.success {
        color: #ffffff;
        background: #16a34a;
    }

    .modern-action.danger {
        color: #ffffff;
        background: #dc2626;
    }

    .modern-action.warning {
        color: #92400e;
        background: #fef3c7;
        border: 1px solid #fcd34d;
    }

    .modern-action:disabled {
        color: #94a3b8;
        cursor: not-allowed;
        background: #e2e8f0;
        opacity: 1;
    }

.decision-message {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
}

    .decision-message.success {
        color: #087443;
        background: #dcfce7;
    }

    .decision-message.danger {
        color: #b42318;
        background: #fee4e2;
    }

.mobile-logs-card {
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e4e9f0;
    border-radius: 16px;
}

.mobile-timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 17px;
}

    .timeline-item:last-child {
        padding-bottom: 0;
    }

    .timeline-item:not(:last-child)::before {
        position: absolute;
        top: 12px;
        bottom: 0;
        left: 5px;
        width: 2px;
        content: "";
        background: #e2e8f0;
    }

.timeline-marker {
    position: relative;
    z-index: 1;
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    background: #3b82f6;
    border: 3px solid #dbeafe;
    border-radius: 50%;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-action {
    color: #1e293b;
    font-size: 12px;
    font-weight: 800;
}

.timeline-description {
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.5;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    color: #94a3b8;
    font-size: 9px;
}

.mobile-no-logs,
.mobile-empty-state {
    padding: 30px 16px;
    color: #94a3b8;
    text-align: center;
}

.mobile-no-logs {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
}

    .mobile-no-logs i {
        font-size: 25px;
    }

.mobile-empty-state {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
}

.mobile-empty-icon {
    display: grid;
    width: 55px;
    height: 55px;
    margin: 0 auto 12px;
    place-items: center;
    color: #64748b;
    font-size: 25px;
    background: #f1f5f9;
    border-radius: 16px;
}

.mobile-empty-state h5 {
    margin-bottom: 5px;
    color: #334155;
    font-size: 15px;
    font-weight: 800;
}

.mobile-empty-state p {
    margin: 0;
    font-size: 12px;
}

@media (max-width: 370px) {
    .mobile-sof-information,
    .modern-po-details {
        grid-template-columns: 1fr;
    }

    .mobile-sof-header {
        flex-wrap: wrap;
    }

        .mobile-sof-header > :last-child {
            margin-left: 56px;
        }
}


/* =========================================
   ACTIVITY LOG BUTTON
   ========================================= */

.mobile-log-button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    margin-top: 5px;
    padding: 13px;
    color: #334155;
    text-align: left;
    background: #ffffff;
    border: 1px solid #dfe5ec;
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

    .mobile-log-button:active {
        background: #f8fafc;
        transform: scale(0.99);
    }

.mobile-log-button-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #2563eb;
    font-size: 19px;
    background: #dbeafe;
    border-radius: 12px;
}

.mobile-log-button-text {
    display: block;
    flex: 1;
    min-width: 0;
}

    .mobile-log-button-text strong {
        display: block;
        color: #1e293b;
        font-size: 13px;
        font-weight: 800;
    }

    .mobile-log-button-text small {
        display: block;
        overflow: hidden;
        margin-top: 2px;
        color: #94a3b8;
        font-size: 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.mobile-log-count {
    display: grid;
    min-width: 27px;
    height: 27px;
    padding: 0 7px;
    place-items: center;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    background: #dbeafe;
    border-radius: 50px;
}

.mobile-log-button > .bi-chevron-right {
    color: #94a3b8;
    font-size: 13px;
}

/* =========================================
   ACTIVITY LOG MODAL
   ========================================= */

.mobile-logs-modal {
    padding: 14px;
}

    .mobile-logs-modal .modal-dialog {
        margin: auto;
    }

.modern-modal-content {
    overflow: hidden;
    max-height: 88vh;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.modern-modal-header {
    padding: 17px;
    background: #ffffff;
    border-bottom: 1px solid #eef1f5;
}

.modern-modal-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #2563eb;
    font-size: 19px;
    background: #dbeafe;
    border-radius: 12px;
}

.modern-modal-header .modal-title {
    margin: 0;
    color: #1e293b;
    font-size: 16px;
    font-weight: 800;
}

.modern-modal-subtitle {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10px;
}

.modern-logs-body {
    overflow-y: auto;
    padding: 18px;
    background: #f8fafc;
}

.mobile-timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 18px;
}

    .timeline-item:last-child {
        padding-bottom: 0;
    }

    .timeline-item:not(:last-child)::before {
        position: absolute;
        top: 14px;
        bottom: 0;
        left: 6px;
        width: 2px;
        content: "";
        background: #dbe3eb;
    }

.timeline-marker {
    position: relative;
    z-index: 1;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 5px;
    background: #3b82f6;
    border: 3px solid #dbeafe;
    border-radius: 50%;
}

.timeline-content {
    flex: 1;
    min-width: 0;
    padding: 13px;
    background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 13px;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.04);
}

.timeline-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.timeline-action {
    color: #1e293b;
    font-size: 12px;
    font-weight: 800;
}

.timeline-date {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 9px;
}

.timeline-description {
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.5;
}

.timeline-user {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: #94a3b8;
    font-size: 9px;
}

    .timeline-user strong {
        color: #64748b;
    }

.timeline-user-icon {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 50%;
}

.modern-empty-logs {
    padding: 45px 20px;
    text-align: center;
}

.modern-empty-logs-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 13px;
    place-items: center;
    color: #64748b;
    font-size: 25px;
    background: #e9eef5;
    border-radius: 17px;
}

.modern-empty-logs h6 {
    margin-bottom: 5px;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
}

.modern-empty-logs p {
    margin: 0;
    color: #94a3b8;
    font-size: 11px;
}

.modern-modal-footer {
    padding: 12px 17px;
    background: #ffffff;
    border-top: 1px solid #eef1f5;
}

.modern-modal-close-button {
    width: 100%;
    padding: 10px 15px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    background: #f1f5f9;
    border: 0;
    border-radius: 11px;
}


.cad-summary-container {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.cad-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cad-summary-card {
    height: 100%;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .cad-summary-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(15, 23, 42, 0.1);
    }

.cad-name {
    min-width: 0;
    overflow: hidden;
    color: #1e3a8a;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cad-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cad-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 8px;
    background: #f8fafc;
}

.cad-status-label {
    color: #475569;
    font-size: 0.83rem;
    font-weight: 600;
}

@media (max-width: 576px) {
    .cad-summary-container {
        padding: 12px;
    }

    .cad-summary-header {
        align-items: flex-start;
    }
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    margin-left: .4rem;
    padding: 0 .42rem;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
}

.sof-tab.active .tab-count {
    background: #fff;
    color: #0d6efd;
    box-shadow: 0 .1rem .35rem rgba(0, 0, 0, .16);
}

.tab-count:empty {
    display: none;
}

/* =========================================
   Lead Notes Code Start
   ========================================= */

.note-box {
    min-height: 70px;
}

.note-text {
    white-space: pre-line;
    word-break: break-word;
    font-size: 0.9rem;
}
/* =========================================
   Lead Notes Code End
   ========================================= */



/* CAD PO AGE COLORS — must remain below tbody td */
.po-table tbody tr.aging-green > td {
    background-color: #d9ead3 !important;
}

.po-table tbody tr.aging-yellow > td {
    background-color: #fce4ec !important;
}

.po-table tbody tr.aging-orange > td {
    background-color: #fce4ec !important;
}

.po-table tbody tr.aging-red > td {
    background-color: #f4cccc !important;
}

/* Keep age color while hovering */
.po-table tbody tr.aging-green:hover > td {
    background-color: #c9e2c2 !important;
}

.po-table tbody tr.aging-yellow:hover > td,
.po-table tbody tr.aging-orange:hover > td {
    background-color: #f8d5df !important;
}

.po-table tbody tr.aging-red:hover > td {
    background-color: #edb9b9 !important;
}