/* styles.css - High-end monochrome design, mobile-responsive, forced light mode */



/* Reset and Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #1a1a1a;
    line-height: 1.6;
    overflow-x: hidden;
}
.loader {
    border: 4px solid #f3f3f3; /* Light grey circle */
    border-top: 4px solid #3498db; /* Blue spinner */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto 0;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
body.modal-open {
    overflow: hidden;
}
.contact-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

/* CardSnap & AI Update Modal Styles */
.modal-content.large {
    max-width: 700px;
}
#cardsnap-capture-modal video {
    width: 100%;
    border-radius: 8px;
    background-color: #000;
}
#cardsnap-capture-modal canvas {
    display: none; /* Hidden canvas for processing */
}
#cardsnap-verify-modal .form-group {
    margin-bottom: 10px;
}
#cardsnap-verify-modal input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
#cardsnap-followup-modal .message-suggestion {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}
#cardsnap-followup-modal .message-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
body.sidebar-open {
    overflow: hidden;
}
a {
    text-decoration: none;
    color: #000;
}
a:hover {
    color: #333;
}

a.btn:hover {
    color:white;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    color: #000;
}
h1 {
    font-size: 28px;
    margin-bottom: 20px;
}
h2 {
    font-size: 22px;
    margin-bottom: 15px;
}
h3 {
    font-size: 18px;
    margin-bottom: 10px;
}
p {
    font-size: 16px;
}

/* Buttons */
button, .btn {
    cursor: pointer;
    border: none;
    padding: 8px 18px;
    background: linear-gradient(135deg, #000, #1a1a1a);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
button i, .btn i {
    margin-right: 8px;
}
button:hover, .btn:hover {
    background: linear-gradient(135deg, #333, #4a4a4a);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
button:active {
    transform: translateY(0);
    box-shadow: none;
}
.save-btn {
    background: linear-gradient(135deg, #28a745, #218838);
}
.save-btn:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
}
.ai-btn {
    background: linear-gradient(45deg, #5f2c82, #49a09d);
    border: none;
}
.ai-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Success Message */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.success-message.show {
    opacity: 1;
}

/* Progress Bar for Uploads */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    margin: 10px 0;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #28a745, #218838);
    width: 0;
    transition: width 0.3s ease;
}

/* File Name Display */
.file-name-display {
    display: block;
    font-size: 14px;
    color: #6c757d;
    margin: 8px 0;
    font-style: italic;
    word-break: break-all;
}

/* Custom File Upload */
.file-upload {
    position: relative;
    display: inline-block;
}
.file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.file-upload-label {
    padding: 8px 18px;
    background: linear-gradient(135deg, #000, #1a1a1a);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
}
.file-upload-label i {
    margin-right: 8px;
}
.file-upload-label:hover {
    background: linear-gradient(135deg, #333, #4a4a4a);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Inputs and Dropdowns */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: border 0.3s, box-shadow 0.3s, background 0.2s;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}
input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="number"]:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #000;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
    outline: none;
    background: #f9fafb;
}
#add-note-form textarea {
    min-height: 120px;
}
#add-note-form textarea::placeholder {
    color: #6c757d;
    font-style: italic;
}
.tag-select {
    width: 100% !important;
    min-height: 40px !important;
}
.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 15px;
    padding: 8px;
    min-height: 40px;
}
.select2-container--default .select2-selection--multiple:focus,
.select2-container--default .select2-selection--single:focus {
    border-color: #000;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: linear-gradient(135deg, #000, #1a1a1a);
    color: #fff;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    margin-right: 5px;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0 5px;
    min-height: 40px;
    line-height: 30px;
}
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #6c757d;
    font-style: italic;
}
input[type="search"] {
    max-width: 250px;
    padding-left: 35px;
    background: #fff url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjNmM3NTdkIiBkPSJNMTUuNSA4LjVDMTUuNSA1LjQ3IDEyLjUzIDIuNVM1LjUgNS40NyA1LjUgOC41YzAgMi4wMyAxLjQ3IDMuNzMgMy40NSAxLjE4TDE5IDE4LjE4bDMuODItMy44Mi0xLjE4LTMuNDVDMTguNzcgMTAuNDcgMjAuNDcgOC41IDE4LjQ3IDguNVoiLz48L3N2Zz4=") no-repeat 10px center / 18px;
    border-radius: 20px;
}
.form-group select {
    appearance: none;
    background: #fff url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgMjQgNiI+PHBhdGggZmlsbD0iIzZjNzU3ZCIgZD0iTTEyIDE0bC00LTQuNWg4bDQtNC41eiIvPjwvc3ZnPg==") no-repeat right 15px center / 18px;
    padding-right: 35px;
    cursor: pointer;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
}
.header {
    background: #fff;
    border-bottom: 1px solid #d1d5db;
    padding: 12px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
}
.hamburger {
    margin-right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #000;
    display: none;
}
.logo img {
    height: 40px;
}
.user-info {
    margin-left: auto;
}
.user-info span {
    font-size: 16px;
    margin-right: 15px;
}
.footer {
    background: #fff;
    border-top: 1px solid #d1d5db;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    color: #6c757d;
}
.sidebar {
    background: linear-gradient(180deg, #ffffff, #f9fafb);
    width: 260px;
    border-right: 1px solid #d1d5db;
    padding: 15px 0;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
    z-index: 99;
}
.sidebar-logo {
    text-align: center;
    margin-bottom: 20px;
}
.sidebar-logo img {
    max-width: 200px;
    width: 100%;
}
.sidebar-welcome {
    text-align: center;
    font-size: 16px;
    margin-bottom: 20px;
    color: #6c757d;
}
.sidebar ul {
    list-style: none;
}
.sidebar ul li {
    margin: 0 8px 6px;
    font-size: 15px;
    padding: 10px 15px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
}
.sidebar ul li.active {
    background: #000;
    color: #fff;
}
.sidebar ul li.active a {
    color: #fff;
}
.sidebar ul li.active i {
    color: #fff;
}
.sidebar ul li a {
    display: flex;
    align-items: center;
    width: 100%;
    color: inherit;
}
.sidebar ul li i {
    margin-right: 12px;
    font-size: 18px;
    color: #4b5563;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
}
.sidebar ul li:hover {
    background: #000;
    color: #fff;
    transform: translateX(3px);
}
.sidebar ul li:hover a {
    color: #fff;
}
.sidebar ul li:hover i {
    color: #fff;
}
.sidebar ul li + li {
    border-top: 1px solid #d1d5db;
}
.sidebar-logout {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
}
.sidebar-logout button {
    width: calc(100% - 20px);
    margin: 0 auto;
}
.main-content {
    margin-left: 260px;
    padding: 25px;
    width: calc(100% - 260px);
    min-height: 100vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: margin-left 0.3s ease;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.table th, .table td {
    padding: 15px;
    border-bottom: 1px solid #d1d5db;
    text-align: left;
    font-size: 15px;
}
.table th {
    background: #f1f1f1;
    font-weight: 600;
}
.table tbody tr:hover {
    background: #f9fafb;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #000;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
.modal.is-visible {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.close, .close-lb {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
}
.close:hover {
    color: #000;
}

/* Status Colors */
.status-cold { color: #007bff; }
.status-warm { color: #ffc107; }
.status-hot { color: #dc3545; }
.status-customer { color: #28a745; }
.status-lost { color: #6c757d; }

/* Auth Pages */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #ffffff, #e9ecef);
    padding: 20px;
}
.auth-container {
    width: 100%;
    max-width: 400px;
}
.auth-form {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    text-align: left;
}
.auth-logo {
    display: block;
    margin: 0 auto 20px;
    height: 60px;
}
.auth-logo,
.auth-title,
.auth-form a {
    text-align: center;
    display: block;
}
.auth-form a {
    margin-top: 20px;
}
.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #000;
}
.auth-form .form-group input {
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
}
.auth-form button {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    font-size: 16px;
}
.error {
    color: #dc3545;
    font-size: 14px;
    margin-bottom: 20px;
}
.auth-form a {
    font-size: 14px;
    color: #000;
    text-decoration: underline;
}
.auth-form a:hover {
    text-decoration: none;
}

/* Edit Page */
.edit-main {
    display: flex;
    gap: 20px;
}
.edit-fields {
    flex: 1;
}
.edit-sidebar {
    width: 300px;
    margin-left: 20px;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.tab-list {
    display: none;
}
.tab-item {
    display: inline-block;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}
.tab-item.active {
    background: #000;
    color: #fff;
    border-radius: 6px 6px 0 0;
}
.tab-content {
    display: block;
}
.sidebar-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 20px;
}
.sidebar-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sidebar-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
}
.note, .document, .timeline-entry {
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.edit-sidebar button[type="submit"] {
    width: 100%;
    margin-bottom: 20px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    color: #000;
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 16px;
}
.back-link i {
    margin-right: 5px;
}
.back-link:hover {
    color: #333;
}
.delete-btn {
    background: #dc3545;
    margin-bottom: 20px;
}
.delete-btn:hover {
    background: #c82333;
}

/* Contacts Page Specific */
.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.contacts-header h1 {
    margin-bottom: 0;
}
.add-contact-btn {
    font-size: 16px;
    text-transform: uppercase;
    padding: 10px 20px;
    margin: 0;
}
.ai-toggle-container {
    padding: 15px;
    background: #f0f2f5;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ai-toggle-label {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}
.ai-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.ai-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.ai-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}
.ai-toggle .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ai-toggle input:checked + .slider {
    background: linear-gradient(45deg, #5f2c82, #49a09d);
}
.ai-toggle input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}
.ai-toggle input:checked + .slider:before {
    transform: translateX(24px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar-logout {
        position: absolute;
        bottom: 100px;
        left: 0;
        width: 100%;
        text-align: center;
    }
    .hamburger {
        display: block;
    }
    .sidebar {
        left: -260px;
        transition: left 0.3s ease;
    }
    .sidebar.open {
        left: 0;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .edit-main {
        flex-direction: column;
    }
    .edit-fields {
        width: 100%;
    }
    .edit-sidebar {
        width: 100%;
        margin-left: 0;
    }
    .tab-list {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        background: #f1f1f1;
        padding: 10px 0;
        margin-bottom: 20px;
    }
    .tab-item {
        flex: 0 0 auto;
        margin-right: 10px;
        padding: 8px 12px;
        font-size: 14px;
    }
    .tab-content {
        display: none;
    }
    .tab-content.active {
        display: block;
    }
    .contacts-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .add-contact-btn {
        margin-top: 10px;
    }
    .table {
        display: block;
        overflow-x: auto;
    }
    .table thead, .table tbody, .table tr, .table th, .table td {
        display: block;
    }
    .table thead {
        display: none;
    }
    .table tr {
        margin-bottom: 15px;
        border-bottom: 1px solid #d1d5db;
    }
    .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    .table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
    }
    #contacts-table tr.expanded td.contact-detail {
        display: flex;
        align-items: flex-start;
        text-align: left;
        padding: 8px 10px;
        flex-wrap: wrap;
    }
    #contacts-table tr.expanded td.contact-detail::before {
        content: attr(data-label);
        font-weight: bold;
        flex: 0 0 110px;
        margin-right: 10px;
    }
    #contacts-table tr.expanded td.contact-detail > span {
        flex: 1 1 auto;
        word-break: break-word;
    }
    #contacts-table thead th:not(:first-child) {
        display: none;
    }
    #contacts-table td.contact-detail, #contacts-table td.actions-cell a {
        display: none;
    }
    .expand-btn {
        display: inline-block;
        cursor: pointer;
        padding: 5px;
        font-size: 16px;
    }
}
.expand-btn {
    display: none;
}
.page-btn {
    display: inline-block;
    margin-right: 5px;
}

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Mobile View Toggle for Edit Page */
.mobile-view-toggle {
    display: none;
}
@media (max-width: 768px) {
    .mobile-view-toggle {
        display: flex;
        width: 100%;
        margin-bottom: 20px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        overflow: hidden;
    }
    .mobile-view-toggle .toggle-btn {
        flex: 1;
        padding: 12px 10px;
        background: #f1f5f9;
        color: #475569;
        border: none;
        border-radius: 0;
        margin: 0;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease-in-out;
    }
    .mobile-view-toggle .toggle-btn:first-child {
        border-right: 1px solid #d1d5db;
    }
    .mobile-view-toggle .toggle-btn.active {
        background: #000;
        color: #fff;
    }
    .engagement-view {
        display: none;
    }
    .profile-view {
        display: block;
    }
}

/* Mobile-Only Save Button & Feedback */
.mobile-save-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    font-size: 16px;
}
.mobile-save-feedback {
    margin-top: 15px;
}
@media (min-width: 769px) {
    .mobile-save-btn,
    .mobile-save-feedback {
        display: none;
    }
    .header {
        display:none;
    }
}

/* CardSnap Signature Button */
.signature-control-area {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.add-signature-btn {
    font-weight: 600;
}
.signature-selector-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.signature-selector-container select.signature-select {
    flex-grow: 1;
    padding: 8px;
    border-radius: 5px;
    background-color: #f9f9f9;
}
.remove-signature-btn {
    flex-shrink: 0;
    background: #e2e8f0;
    color: #475569;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}
.remove-signature-btn:hover {
    background: #ef4444;
    color: white;
}

/* --- NEW NOTIFICATION BADGE STYLES --- */
.notification-badge {
    display: none; /* Hidden by default */
    background-color: #dc3545; /* Red color */
    color: #fff;
    border-radius: 50%;
    padding: 1px 6px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    position: relative;
    top: -8px;
    left: 4px;
}
/* Style for badges inside tabs */
.tab-link .notification-badge {
    top: -1px;
}