/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #216C7A 0%, #1a5a66 50%, #0f4a54 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #216C7A 0%, #1a5a66 50%, #0f4a54 100%);
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
}

.login-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-section {
    text-align: center;
}

.login-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-button {
    padding: 15px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.login-button:hover {
    background: #5a6fd8;
}

.login-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.login-divider span {
    background: white;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.login-method {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.login-method:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.login-method.azure-ad {
    background: #0078d4;
    color: white;
    border-color: #0078d4;
}

.login-method.azure-ad:hover {
    background: #106ebe;
}

.login-method.clear-session {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.login-method.clear-session:hover {
    background: #c82333;
}

.master-password-form {
    display: none;
    margin-top: 20px;
}

.master-password-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

.master-password-form button {
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Dashboard Styles */
.dashboard-container {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: transparent;
    padding: 15px 30px;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    display: none;
}

.header::after {
    display: none;
}

.header-left {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    color: white;
    margin-bottom: 0;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.header-left h1 i {
    color: #a8e6cf;
    margin-right: 12px;
    font-size: 28px;
}

/* Version badge */
.version-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Dev mode badge */
.dev-mode-badge {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    animation: pulse 2s infinite;
    border: 1px solid rgba(255,255,255,0.3);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* View Toggle Styles */
.view-toggle {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

.view-toggle-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.view-toggle-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.5);
}

.view-toggle-btn.active {
    background: rgba(255,255,255,0.3);
    color: white;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.view-toggle-btn i {
    margin-right: 6px;
    font-size: 11px;
}

.auth-info {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.user-info {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.auth-buttons {
    display: flex;
    gap: 12px;
}

.auth-button {
    padding: 10px 18px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.2);
}

.settings-button {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.settings-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.logout-button {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    backdrop-filter: blur(10px);
}

.logout-button:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Main Content */
.main-content {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-top: -15px;
    width: 100%;
    height: calc(100vh - 70px);
    overflow: hidden;
}

/* Project Details Header */
#projectDetails h2 {
    margin-bottom: 5px;
}

#projectDetails h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: normal;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.projects-panel {
    flex: 0 0 300px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 300px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.sync-button {
    padding: 12px 20px;
    background: #216C7A;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.sync-button:hover {
    background: #1a5a66;
}

.projects-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.projects-list::-webkit-scrollbar {
    width: 8px;
}

.projects-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.projects-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.projects-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.project-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.project-item.selected {
    border-color: #667eea;
    background: #e3f2fd;
}

/* On-hold projects */
.project-item.project-on-hold {
    border-left: 6px solid #f59e0b; /* orange */
    background: #fff7ed; /* light orange */
}
.on-hold-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #b45309;
    background: #fde68a;
    border-radius: 10px;
}

/* Specific orange background for waiting statuses */
.project-item .meta-item.status-waiting-for-customer,
.project-item .meta-item.status-waiting-for-development {
    background: #fff7ed;
    border-radius: 6px;
    padding: 2px 6px;
}

.project-key {
    font-weight: 500;
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.project-summary {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-badge {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    min-width: 35px;
    text-align: center;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

.meta-item {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    font-size: 10px;
}

.meta-item.status-in-progress {
    color: #17a2b8;
}

.meta-item.status-planning {
    color: #ffc107;
}

.meta-item.status-completed {
    color: #28a745;
}

.meta-item.priority-high {
    color: #dc3545;
}

.meta-item.priority-medium {
    color: #ffc107;
}

.meta-item.priority-low {
    color: #28a745;
}

.meta-item.assignee {
    color: #6c757d;
}

/* Project Loading Spinner */
.project-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner-container {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.spinner-container p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Details Panel */
.details-panel {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 0;
    width: 100%;
    max-width: none;
    position: relative;
    height: 100%;
    overflow-y: auto;
}

.loading {
    text-align: center;
    color: #666;
    padding: 40px;
}

/* Project Details Header */
.details-panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.project-metrics {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-width: 120px;
}

.metric-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.metric-value {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

/* Tab Styles */
.tab-container {
    margin-top: 20px;
    width: 100%;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    width: 100%;
}

.tab-buttons {
    display: flex;
    gap: 10px;
}

.tab-sync-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tab-sync-buttons .sync-button {
    margin-bottom: 0;
    padding: 8px 16px;
    font-size: 12px;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16.8px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #333;
}

/* Tab button active state */
.tab-button.active {
    color: #216C7A;
    border-bottom-color: #216C7A;
}

.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
    width: 100%;
}

/* Customer and Deal tabs use same styling as project-details-section */
#customerTab,
#dealTab {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: none;
    margin-bottom: 30px;
    width: 100%;
}

.customer-info,
.deal-info {
    width: 100%;
}

/* Customer and Deal info styling - direct within the tab containers */
#customerInfoTab h4,
#dealInfoTab h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.metadata-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.metadata-item {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
}

.metadata-item:last-child {
    margin-bottom: 0;
}

.metadata-item i {
    color: #007bff;
    width: 20px;
    text-align: center;
}

.metadata-item strong {
    color: #333;
    font-weight: 600;
    min-width: 120px;
}

/* Loading and error states for HubSpot tabs */
.loading, .error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.error {
    color: #dc3545;
    background: #fff5f5;
    border-color: #ffcdd2;
}

/* Project Details */
.project-details-section {
    margin-bottom: 30px;
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.project-details-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
}

.project-details-grid {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    overflow: hidden;
    min-width: 0;
}

.project-details-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    min-width: 0;
    overflow: hidden;
    gap: 8px;
    height: 95px;
}

/* Tempo Account display - truncate long names with ellipsis and show full name on hover */
#tempoAccountDisplay {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    cursor: help;
    display: block;
}

.field-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.field-content label {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.field-content label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin: 0;
    line-height: 1.2;
}

.field-content span {
    color: #666;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    display: block;
    line-height: 1.4;
    white-space: normal;
    max-height: 2.8em;
    overflow: hidden;
}

.field-note {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
    display: block;
}

.view-button, .edit-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.view-button {
    background: #17a2b8;
    color: white;
}

.view-button:hover {
    background: #138496;
}

.edit-button {
    background: #28a745;
    color: white;
}

.edit-button:hover {
    background: #218838;
}

/* External Links and Field Actions */
.external-link {
    color: #17a2b8;
    text-decoration: none;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.external-link:hover {
    color: #138496;
    transform: scale(1.1);
}

.field-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 5px;
    width: 100%;
    justify-content: flex-start;
}



/* Epic Overview Container */
#epicOverviewContainer {
    width: 100%;
    min-width: 0;
    flex: 1;
}

/* Key Data Section */
.key-data-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.key-data-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Key Data Section icon color */
.key-data-section h3 i {
    color: #216C7A;
}

.key-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Ensure date fields are side by side */
.key-data-grid .date-field:nth-child(1),
.key-data-grid .date-field:nth-child(2) {
    grid-column: span 1;
}

.key-data-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    position: relative;
}

/* On-hold reason should span full width and be styled orange */
.on-hold-reason-field {
    grid-column: 1 / -1;
    background: #fff7ed; /* light orange */
    border-left: 6px solid #f59e0b; /* orange */
}
.on-hold-reason-field label {
    color: #b45309;
}
.on-hold-reason-field span {
    color: #7c2d12;
}

/* Project Description - Full Width Row */
.key-data-description-row {
    margin-top: 10px;
    width: 100%;
}

.key-data-field-full-width {
    grid-column: 1 / -1;
    border-left: 6px solid #0078d4; /* blue */
}

.key-data-field-full-width label {
    color: #005a9e;
}

.key-data-field-full-width span {
    color: #333;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.key-data-field label {
    font-weight: 600;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.key-data-field span {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Date status colors */
.date-warning {
    color: #f7931e !important; /* orange */
    font-weight: 600;
}

.date-danger {
    color: #dc3545 !important; /* red */
    font-weight: 700;
}

/* Generic warning text */
.text-warning {
    color: #f7931e !important;
    font-weight: 600;
}

/* Inline tentative label next to date */
.tentative-inline {
    color: #666;
    font-size: 12px;
    font-style: italic;
    margin-left: 8px;
}

.key-data-field .edit-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.key-data-field .edit-icon:hover {
    background: #218838;
    transform: scale(1.1);
}

.key-data-field .edit-icon i {
    color: white;
    font-size: 12px;
}

/* Tentative checkbox disabled unless in edit mode */
#goLiveDateEditor input[type="checkbox"] {
    pointer-events: none;
}

/* Project Metrics Section */
.project-metrics-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.project-metrics-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Project Metrics Section icon color */
.project-metrics-section h3 i {
    color: #216C7A;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.metric-card {
    background: #f8f9fa;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Metric card value color */
.metric-card .metric-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #216C7A;
}

.metric-card .metric-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Activity & Next Steps */
.activity-next-steps-section {
    margin-bottom: 30px;
}

.activity-next-steps-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
}

.activity-next-steps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.activity-section, .next-steps-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.activity-section h4, .next-steps-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.activity-input, .next-step-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    resize: vertical;
}

.activity-input {
    min-height: 80px;
}

.add-button {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
}

.add-button:hover {
    background: #218838;
}

/* Activity Comments and Next Steps Items */
.activity-comment {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.comment-content {
    flex: 1;
}

.comment-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.edit-comment-btn,
.delete-comment-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.edit-comment-btn {
    color: #17a2b8;
}

.edit-comment-btn:hover {
    background: #e3f2fd;
}

.delete-comment-btn {
    color: #dc3545;
}

.delete-comment-btn:hover {
    background: #ffebee;
}

.system-badge {
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 10px;
}

.activity-comment .comment-text {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    /* Prevent super-long tokens/URLs from blowing layout */
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    /* Multi-line clamp with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* show up to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-comment .comment-meta {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.next-step-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.step-content {
    flex: 1;
}

.next-step-item .step-text {
    color: #333;
    font-size: 14px;
    margin-bottom: 8px;
}

.step-meta {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.step-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
    align-items: center;
}

.edit-step-btn,
.delete-step-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.edit-step-btn {
    color: #17a2b8;
}

.edit-step-btn:hover {
    background: #e3f2fd;
}

.delete-step-btn {
    color: #dc3545;
}

.delete-step-btn:hover {
    background: #ffebee;
}

.next-step-item .done-button {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.next-step-item .done-button:hover {
    background: #218838;
}

/* JIRA Tasks */
.jira-tasks-container {
    margin-top: 20px;
}

.kanban-board {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.kanban-column {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 400px;
}

.kanban-column h4 {
    padding: 15px;
    margin: 0;
    background: #e3f2fd;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    color: #1976d2;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column h4::before {
    content: '';
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.kanban-column.todo h4::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231976d2'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

.kanban-column.active h4::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231976d2'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

.kanban-column.completed h4::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231976d2'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.task-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.task-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.task-key {
    font-size: 11px;
    font-weight: 600;
    color: #1976d2;
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
    font-family: 'Courier New', monospace;
}

.task-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.3;
}

.task-meta {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

/* HubSpot Data */
.hubspot-data-container {
    margin-top: 20px;
}

.hubspot-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hubspot-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

/* HubSpot Data Items */
.hubspot-item {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.hubspot-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.hubspot-item h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #e3f2fd;
    padding-bottom: 10px;
}

.hubspot-item h4 i {
    font-size: 20px;
}

.metadata-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.metadata-item {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #e3f2fd;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}





.metadata-item strong {
    color: #333;
    font-weight: 600;
    min-width: 140px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-item i {
    color: #1976d2;
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}



.hubspot-item h5 {
    color: #216C7A;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.hubspot-item p {
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.hubspot-item .label {
    font-weight: 600;
    color: #333;
    display: inline-block;
    min-width: 120px;
}



.customer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #216C7A;
    text-decoration: none;
    padding: 12px 18px;
    background: #f8f9fa;
    border: 2px solid #216C7A;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-bottom: 15px;
}

.customer-link:hover {
    background: #216C7A;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 108, 122, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.system-settings-modal {
    max-width: 1000px;
}

.modal-header {
    background: #216C7A;
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.settings-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.settings-tabs .settings-tab-button {
    border-bottom: none;
    border-radius: 0;
    padding: 15px 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.settings-tabs .settings-tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.settings-tabs .settings-tab-button.active {
    background: #007bff;
    color: white;
    border-bottom: 3px solid #0056b3;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

/* Loading Spinner Styles */
.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Error Container Styles */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-text {
    font-size: 18px;
    font-weight: 600;
    color: #dc3545;
    margin-bottom: 10px;
}

.error-details {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    max-width: 400px;
    word-wrap: break-word;
}

.retry-button {
    background: #0078d4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.retry-button:hover {
    background: #0056b3;
}

/* Spinning sync icon */
.fa-sync.fa-spin {
    animation: spin 1s linear infinite;
}

/* Notification System Styles */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 4px solid #007bff;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left-color: #28a745;
}

.notification-error {
    border-left-color: #dc3545;
}

.notification-warning {
    border-left-color: #ffc107;
}

.notification-info {
    border-left-color: #17a2b8;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.notification-close:hover {
    background: #f8f9fa;
    color: #333;
}

.settings-content {
    padding: 20px;
}

.settings-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.form-group input, .form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group small {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.modal-footer {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 0 0 10px 10px;
    border-top: 1px solid #e0e0e0;
}

.footer-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tab-save-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .projects-panel {
        flex: none;
        width: 100%;
    }
    
    .activity-next-steps-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-form {
        grid-template-columns: 1fr;
    }
    
    .footer-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .tab-save-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* User Management Styles */
.users-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.create-user-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.create-user-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.existing-users-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-email {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.user-name {
    color: #666;
    font-size: 14px;
}

.user-role {
    margin-top: 5px;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: #dc3545;
    color: white;
}

.role-user {
    background: #007bff;
    color: white;
}

.role-guest {
    background: #6c757d;
    color: white;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-selector {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.no-users {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Date input styling */
.date-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    background: white;
}

.date-input:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

/* Make date fields side by side */
.key-data-grid .date-field {
    flex: 1;
    min-width: 200px;
}

/* Ensure date fields are properly sized */
.key-data-grid .date-field:nth-child(1) {
    grid-column: 1;
}

.key-data-grid .date-field:nth-child(2) {
    grid-column: 2;
}

/* Responsive design for project details */
@media (max-width: 1200px) {
    .project-details-grid {
        flex-direction: column;
        gap: 15px;
    }
    
    .project-details-field {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .field-actions {
        justify-content: flex-start;
        margin-left: 0;
        margin-top: 10px;
    }
    
    /* Stack date fields on smaller screens */
    .key-data-grid {
        grid-template-columns: 1fr;
    }
    
    .key-data-grid .date-field:nth-child(1),
    .key-data-grid .date-field:nth-child(2) {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .project-details-field {
        padding: 12px;
    }
    
    .field-content span {
        font-size: 13px;
    }
    
    .view-button, .edit-button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* List View Table Styles - Enhanced Design */
.list-view-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    margin: 20px 0;
    font-size: 14px;
    border: 1px solid #e8eaed;
    table-layout: fixed;
}

.list-view-table th {
    background: #f8f9fa;
    color: #333;
    padding: 20px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    border-bottom: 2px solid #e8eaed;
}

.list-view-table th:first-child {
    border-top-left-radius: 16px;
}

.list-view-table th:last-child {
    border-top-right-radius: 16px;
}

.list-view-table td {
    padding: 18px 16px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
    vertical-align: middle;
    line-height: 1.5;
    background: white;
    transition: all 0.2s ease;
    overflow: hidden;
}

.list-view-table tr {
    transition: all 0.2s ease;
}

.list-view-table tr:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 8px;
}

.list-view-table tr:hover td {
    background: #f8f9fa;
}

/* Prevent text color change on row hover */
.list-view-table tr:hover .truncate,
.list-view-table tr:hover td {
    color: #333 !important;
}

.list-view-table tr:last-child td {
    border-bottom: none;
}

.list-view-table tr:last-child:hover td:first-child {
    border-bottom-left-radius: 8px;
}

.list-view-table tr:last-child:hover td:last-child {
    border-bottom-right-radius: 8px;
}

/* Column width constraints - fixed widths */
.list-view-table .col-title {
    width: 20%;
}

.list-view-table .col-key {
    width: 8%;
}

.list-view-table .col-status {
    width: 8%;
}

.list-view-table .col-description {
    width: 15%;
}

.list-view-table .col-dates {
    width: 8%;
}

.list-view-table .col-people {
    width: 10%;
}

.list-view-table .col-progress {
    width: 8%;
}

.list-view-table .col-comment {
    width: 15%;
}

.list-view-table .col-followups {
    width: 8%;
}

/* Enhanced text truncation with fixed hover behavior */
.list-view-table .truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    line-height: 1.4;
    position: relative;
}

/* Only show hover for specific columns */
.list-view-table .col-comment .truncate,
.list-view-table .col-description .truncate {
    cursor: pointer;
}


/* Prevent text color change on row hover */
.list-view-table tr:hover .truncate,
.list-view-table tr:hover td {
    color: #333 !important;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 60px;
}

.status-todo {
    background: #f5f5f5;
    color: #666;
}

.status-in-progress {
    background: #e3f2fd;
    color: #17a2b8;
}

.status-done {
    background: #e8f5e8;
    color: #388e3c;
}

.status-blocked {
    background: #fff3e0;
    color: #f57c00;
}

/* Date color coding */
.date-overdue {
    color: #d32f2f;
    font-weight: 600;
}

.date-warning {
    color: #f57c00;
    font-weight: 600;
}

.date-ok {
    color: #388e3c;
    font-weight: 600;
}

/* Progress bar styling - improved */
.progress-bar {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.progress-text {
    font-size: 11px;
    color: #666;
    font-weight: 600;
    text-align: center;
}

/* List view container styling */
#listViewContainer {
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Epic link styling */
.epic-link {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.epic-link:hover {
    color: #1557b0;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .list-view-table {
        font-size: 13px;
    }
    
    .list-view-table th,
    .list-view-table td {
        padding: 12px 8px;
    }
}

/* Button Spinner States */
.sync-button.loading {
    position: relative;
    pointer-events: none;
    width: auto !important;
    min-width: fit-content !important;
    height: 44px !important; /* 12px top + 12px bottom + ~20px for text */
    min-height: 44px !important;
    padding: 12px 20px !important;
}

.sync-button.loading .button-content {
    opacity: 0;
}

.sync-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
