/**
 * CRM Enhancement Suite - Styles
 * Add this in <head> after your main stylesheet
 */

/* ===== NOTIFICATION SYSTEM ===== */
.notif-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid var(--info-color);
    background: transparent;
    border-radius: 0;
    padding: 0;
    min-width: auto;
}

.notif-badge.has-notifs {
    animation: pulse-notif 2s infinite;
}

@keyframes pulse-notif {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Notification Tabs */
.notifications-tabs .notif-tab.active {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
}

.notifications-tabs .notif-tab:hover {
    color: var(--primary-color);
    background: var(--gray-100);
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.15s;
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-item.unread {
    background: #eff6ff;
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.notif-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
}

.notif-message {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 2px;
}

.notif-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

.notif-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

/* ===== CONTACT DROPDOWNS ===== */
.contact-dropdown {
    position: relative;
    display: inline-block;
}

.cdd-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.cdd-trigger:hover {
    background: var(--gray-100);
}

.cdd-count {
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.cdd-chevron {
    font-size: 10px;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.cdd-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    margin-top: 4px;
}

.cdd-menu.open {
    display: block;
    animation: fadeSlide 0.15s ease-out;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.cdd-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.1s;
    border-bottom: 1px solid var(--gray-100);
}

.cdd-item:last-child {
    border-bottom: none;
}

.cdd-item:hover {
    background: var(--gray-50);
}

.cdd-item.primary {
    background: #fef3c7;
    font-weight: 600;
}

.cdd-item.primary:hover {
    background: #fde68a;
}

.cdd-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cdd-star {
    color: var(--warning-color);
    font-size: 10px;
}

.cdd-copy {
    opacity: 0.3;
    font-size: 11px;
    transition: opacity 0.15s;
}

.cdd-item:hover .cdd-copy {
    opacity: 0.7;
}

/* ===== SALE OVERVIEW GRID ===== */
.sale-overview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: var(--gray-700);
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}

.sog-col {
    background: var(--gray-800);
    padding: 12px;
}

.sog-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-700);
}

.sog-row:last-child {
    border-bottom: none;
}

.sog-label {
    color: var(--gray-400);
    font-size: 12px;
}

.sog-value {
    font-weight: 500;
    color: white;
}

.sog-value.positive {
    color: #22c55e;
}

.sog-value.negative {
    color: #ef4444;
}

.sog-value.link {
    color: #60a5fa;
    cursor: pointer;
    text-decoration: underline;
}

.sog-value.link:hover {
    color: #93c5fd;
}

.sog-value.cabin {
    color: #fbbf24;
}

.sog-value.pnr {
    color: #22c55e;
    font-family: monospace;
}

.sog-value.route {
    color: #22c55e;
}

/* ===== SEGMENTS ===== */
.segments-list {
    background: var(--gray-800);
    border-radius: 8px;
    padding: 8px;
}

.segment-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--gray-700);
    margin: 4px 0;
    border-radius: 4px;
    border-left: 3px solid #3b82f6;
    font-family: monospace;
    font-size: 13px;
    color: white;
}

.seg-num {
    color: var(--gray-500);
    width: 20px;
}

.seg-carrier {
    color: #60a5fa;
    font-weight: 600;
}

.seg-flight {
    color: #fbbf24;
}

.seg-class {
    color: #22c55e;
    font-weight: 600;
}

.seg-date {
    color: var(--gray-300);
}

.seg-route {
    color: #f97316;
    flex: 1;
}

.seg-time {
    color: var(--gray-400);
}

.no-segments {
    padding: 20px;
    text-align: center;
    color: var(--gray-500);
    background: var(--gray-100);
    border-radius: 8px;
}

/* ===== PAYMENT SECTION ===== */
.payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.payment-card-section,
.billing-section {
    background: var(--gray-50);
    padding: 16px;
    border-radius: 8px;
}

.section-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 14px;
}

.card-block {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
}

.card-header {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.pay-field {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}

.pay-field:last-child {
    border-bottom: none;
}

.pay-label {
    width: 100px;
    color: var(--gray-500);
    font-size: 13px;
    flex-shrink: 0;
}

.pay-value {
    flex: 1;
    font-family: monospace;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.pay-value:hover {
    background: var(--gray-100);
}

.pay-toggle {
    background: none;
    border: 1px solid var(--gray-300);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-500);
    margin-left: 8px;
    transition: all 0.15s;
}

.pay-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.pay-copy {
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    transition: color 0.15s;
}

.pay-copy:hover {
    color: var(--primary-color);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .sale-overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .payment-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sale-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== CUSTOM SENDER DROPDOWN ===== */
.custom-dd-trigger:hover {
    border-color: var(--primary-color) !important;
}

/* ===== LEAD LINK STYLING ===== */
.lead-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.lead-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* ===== REMARKS CELL ===== */
.remarks-cell {
    cursor: pointer;
    position: relative;
}
.remarks-cell:hover {
    background: var(--gray-50);
}
.remarks-preview {
    font-size: 12px;
    color: var(--gray-600);
}

/* ===== REMARKS POPUP ===== */
#remarksPopup {
    animation: fadeSlide 0.15s ease-out;
}

.remarks-popup {
    position: fixed;
    z-index: 10001;
    width: 320px;
    max-height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.remarks-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.remarks-popup-title {
    font-weight: 600;
    font-size: 14px;
}

.remarks-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.remarks-popup-close:hover {
    opacity: 1;
}

.remarks-popup-body {
    padding: 12px 16px;
    overflow-y: auto;
    max-height: 340px;
}

.remarks-popup-option {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.remarks-popup-option:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.remarks-popup-option-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.remarks-popup-entry {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: flex-start;
}

.remarks-popup-entry:last-child {
    margin-bottom: 0;
}

.remarks-popup-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-500);
    min-width: 50px;
    flex-shrink: 0;
}

.remarks-popup-text {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
    word-break: break-word;
}

.remarks-popup-client .remarks-popup-label {
    color: var(--info-color);
}

.remarks-popup-agent .remarks-popup-label {
    color: var(--success-color);
}

.remarks-popup-empty {
    text-align: center;
    color: var(--gray-400);
    padding: 16px 0;
    font-size: 13px;
}

.custom-dd-option {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.1s;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}

.custom-dd-option:last-child {
    border-bottom: none;
}

.custom-dd-option:hover {
    background: var(--gray-50);
}

.custom-dd-option.selected {
    background: #f0f4ff;
    font-weight: 600;
}

/* ===== AGENT CELL LAYOUT ===== */
.agent-dropdown .agent-dropdown-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-cell-icons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 4px;
}

.agent-cell-icons .agent-chevron-icon {
    font-size: 10px;
    color: var(--gray-400);
}

.agent-cell-icons .agent-history-icon {
    font-size: 11px;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.15s;
}

.agent-cell-icons .agent-history-icon:hover {
    color: var(--primary-color);
}

/* ===== AGENT HISTORY POPUP ===== */
#agentHistoryPopup {
    animation: fadeSlide 0.15s ease-out;
}

/* ===== FILTER LOADING STATE ===== */

/* ===== NOTIFICATION TAB INDICATOR ===== */
.notif-tab-indicator {
    transition: opacity 0.2s;
}

.notif-tab.active .notif-tab-indicator {
    display: none !important;
}

/* ===== FILTER LOADING STATE ===== */
.table-filter-loading {
    position: relative;
    pointer-events: none;
}
.table-filter-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.6);
    z-index: 10;
}
.table-filter-loading tbody {
    opacity: 0.3;
    transition: opacity 0.15s;
}