/* Contact Detail Page Styles */
:root {
    /* Colors */
    --surface: #ffffff;
    --surface-hover: #f5f5f5;
    --surface-accent: #f8fafc;
    --surface-tooltip: #1f2937;
    --border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tooltip: #ffffff;
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-hover: #3c76e0;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition: 0.2s ease;

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 72px;
}

.dark {
    --surface: #1f2937;
    --surface-hover: #374151;
    --surface-accent: #111827;
    --surface-tooltip: #f3f4f6;
    --border: #374151;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-tooltip: #111827;
    --primary: #4361ee;
    --primary-light: rgba(37, 99, 235, 0.1);
    --primary-hover: #5f7ef0;
}

/* Main Layout */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 0 !important;
    padding: 0;
    min-height: 100vh;
    background: var(--surface-accent);
    transition: margin-left var(--transition);
}

.portal-sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Contact Detail Header */
.contact-detail-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
}

.header-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.btn-back > svg {
    width: 16px;
    height: 16px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 0;
}

.breadcrumb #contactName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.breadcrumb > svg {
    width: 14px;
    height: 14px;
}

/* Contact Hero Section */
.contact-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

/* Contact Info Card */
.contact-info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.03),
        0 8px 16px rgba(0, 0, 0, 0.04),
        0 16px 32px rgba(0, 0, 0, 0.02),
        0 32px 64px rgba(0, 0, 0, 0.01);
    flex: 1;
    max-width: 600px;
    position: relative;
    background: linear-gradient(145deg, var(--surface) 0%, rgba(248, 250, 252, 0.8) 100%);
}

.contact-hero-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.contact-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 2rem;
    flex-shrink: 0;
}

.contact-name-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.contact-basic-info h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
    max-width: 300px;
}

.contact-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.contact-meta-separator {
    color: var(--text-secondary);
    opacity: 0.5;
    font-size: 0.875rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid;
    position: relative;
    overflow: hidden;
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 3s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.status-badge.lead {
    background: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

.status-badge.client {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.status-badge > svg {
    width: 12px;
    height: 12px;
}

.contact-location,
.contact-since {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.contact-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
    color: var(--text-primary);
    text-decoration: none;
}

.btn:hover {
    background: var(--surface-hover);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.btn > svg,
.btn-icon > svg {
    width: 16px;
    height: 16px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    padding: 0.75rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    display: none;
    padding: 0.5rem 0;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.dropdown-item:hover {
    background: var(--surface-hover);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item > svg {
    width: 16px;
    height: 16px;
}

/* Contact Content Layout */
.contact-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Cards */
.info-card,
.activity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 0 1.5rem 1.5rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.info-item span {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-word;
}

/* Hours Summary */
.hours-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-accent);
    border-radius: 8px;
}

.hours-stat {
    text-align: center;
    min-width: 0; /* Allow flex items to shrink */
}

.hours-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    word-break: break-all;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.hours-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1.3;
}

/* Recent Hours */
.recent-hours {
    max-height: 300px;
    overflow-y: auto;
    position: relative;
}

.hours-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.hours-entry:last-child {
    border-bottom: none;
}

.hours-entry-info {
    flex: 1;
}

.hours-entry-date {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.hours-entry-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.hours-entry-amount {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.hours-entry-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
    flex-shrink: 1;
}

.hours-entry-hours {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.hours-entry-cost {
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
    text-align: right;
    line-height: 1.2;
    max-width: 100px;
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    max-height: 600px;
    overflow-y: auto;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
}

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

/* Timeline line - appears in the middle between cards with gaps */
.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -0.5rem;
    transform: translateX(-50%);
    width: 2px;
    height: 1rem;
    background: var(--border);
    z-index: 1;
}

/* Remove the timeline marker since we're not using it anymore */
.timeline-marker {
    display: none;
}

.timeline-content {
    background: var(--surface-accent);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.timeline-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.timeline-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.timeline-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timeline-message {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.timeline-follow-up {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: var(--surface-accent);
    border-left: 3px solid var(--border);
    opacity: 0.8;
}

.timeline-follow-up strong {
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.9;
}

/* Entry Actions Menu */
.entry-actions {
    position: relative;
    transition: opacity var(--transition);
}

.timeline-item:hover .entry-actions,
.hours-entry:hover .entry-actions {
    opacity: 1;
}

.entry-actions-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    width: 24px;
    height: 24px;
}

.entry-actions-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.entry-actions-btn > svg {
    width: 14px;
    height: 14px;
}

.entry-actions-menu {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    min-width: 120px;
    z-index: 10000;
    display: none;
    padding: 0.25rem 0;
}

.entry-actions-menu.active {
    display: block;
}

.entry-actions-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.entry-actions-item:hover {
    background: var(--surface-hover);
}

.entry-actions-item.danger {
    color: var(--danger);
}

.entry-actions-item > svg {
    width: 12px;
    height: 12px;
}

.dark .entry-actions-menu {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

/* Empty States */
.empty-timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-timeline > svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-timeline p {
    margin: 0;
    font-size: 0.875rem;
}

.empty-timeline .empty-subtitle {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.modal.active {
    display: block;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.active .modal-overlay {
    opacity: 1;
}

.modal-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 480px;
    height: 100%;
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.active .modal-content {
    transform: translateX(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background-color: var(--surface);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
}

.modal-close-btn > svg {
    width: 20px;
    height: 20px;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background-color: var(--surface-hover);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background-color: var(--surface);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

/* Custom dropdown styling */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-group select:hover {
    border-color: var(--primary);
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Dark mode dropdown arrow */
.dark .form-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Activity Type Buttons */
.activity-type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.activity-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.activity-type-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: var(--surface-hover);
}

.activity-type-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.activity-type-btn > svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.activity-type-btn span {
    font-size: 0.8125rem;
    font-weight: 500;
}

.dark .activity-type-btn {
    background: var(--surface-hover);
    border-color: var(--border);
}

.dark .activity-type-btn:hover {
    background: var(--border);
}

.dark .activity-type-btn.active {
    background: rgba(67, 97, 238, 0.15);
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Mobile Responsive */
/* iPad and tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem;
    }
    
    .contact-hero {
        flex-direction: column;
        gap: 1.25rem;
        align-items: stretch;
    }
    
    .contact-info-card {
        padding: 2rem;
        border-radius: 14px;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .contact-info-card::before {
        border-radius: 14px;
    }
    
    .contact-hero-left {
        display: flex;
        align-items: center;
        gap: 1.25rem;
        width: 100%;
        text-align: left;
    }
    
    .contact-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
        flex-shrink: 0;
    }
    
    .contact-basic-info h1 {
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1.2;
    }
    
    .status-badge {
        padding: 0.3125rem 0.625rem;
        font-size: 0.75rem;
        border-radius: 5px;
    }
    
    .status-badge > svg {
        width: 11px;
        height: 11px;
    }
    
    .contact-meta {
        gap: 0.625rem;
    }
    
    .contact-location,
    .contact-since {
        font-size: 0.9375rem;
    }
    
    .contact-meta-separator {
        font-size: 0.9375rem;
    }
    
    .contact-hero-actions {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .contact-hero-actions .btn {
        flex: 0 1 auto;
        min-width: 100px;
        max-width: 140px;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .contact-hero-actions .btn-icon {
        width: 44px;
        height: 44px;
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding-top: 4rem;
    }
    
    .portal-sidebar.collapsed + .main-content {
        margin-left: 0;
    }
    
    .contact-detail-header {
        padding: 1rem 1.5rem;
    }
    
    .header-navigation {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .breadcrumb {
        font-size: 0.8125rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .contact-hero {
        /* Keep horizontal layout like desktop, just adjust spacing */
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .contact-info-card {
        /* Maintain card structure but adjust padding */
        padding: 1.5rem;
        border-radius: 12px;
        max-width: none;
    }
    
    .contact-info-card::before {
        border-radius: 12px;
    }
    
    .contact-hero-left {
        /* Keep horizontal layout: avatar on left, info on right */
        display: flex;
        align-items: center;
        gap: 1rem;
        width: 100%;
        text-align: left;
    }
    
    .contact-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        flex-shrink: 0;
        border: 2px solid rgba(255, 255, 255, 0.7);
        box-shadow: 
            0 1px 4px rgba(0, 0, 0, 0.08),
            0 4px 12px rgba(0, 0, 0, 0.06),
            0 8px 16px rgba(0, 0, 0, 0.04);
        background: var(--primary);
        color: white;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .contact-avatar:hover {
        transform: translateY(-1px);
        box-shadow: 
            0 2px 6px rgba(0, 0, 0, 0.1),
            0 6px 16px rgba(0, 0, 0, 0.08),
            0 12px 24px rgba(0, 0, 0, 0.06);
    }
    
    .contact-basic-info {
        flex: 1;
        min-width: 0;
    }
    
    .contact-name-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
    }
    
    .contact-basic-info h1 {
        font-size: 1.25rem;
        font-weight: 700;
        line-height: 1.2;
        margin: 0;
        color: var(--text-primary);
        letter-spacing: -0.01em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
        flex-shrink: 1;
    }
    
    .status-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
        border-radius: 4px;
        font-weight: 600;
        flex-shrink: 0;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }
    
    .status-badge > svg {
        width: 10px;
        height: 10px;
    }
    
    .contact-meta {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .contact-location,
    .contact-since {
        font-size: 0.8125rem;
        color: var(--text-secondary);
    }
    
    .contact-meta-separator {
        color: var(--text-secondary);
        opacity: 0.5;
        font-size: 0.8125rem;
    }
    
    .contact-hero-actions {
        /* Stack actions below the card and take full width */
        display: flex;
        justify-content: stretch;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
        width: 100%;
    }
    
    .contact-hero-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .contact-hero-actions .btn-icon {
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        padding: 0.625rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hours-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .hours-value {
        font-size: 1.125rem;
    }
    
    .hours-entry-cost {
        max-width: 80px;
        font-size: 0.6875rem;
    }
    
    .modal-content {
        width: 100%;
        border-left: none;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    /* Activity type buttons responsive */
    .activity-type-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .activity-type-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }

    .activity-type-btn > svg {
        width: 18px;
        height: 18px;
    }

    .activity-type-btn span {
        font-size: 0.75rem;
    }
}

/* iPhone SE and very small screens */
@media (max-width: 480px) {
    .contact-detail-header {
        padding: 0.75rem 1rem;
    }
    
    .contact-content {
        padding: 1rem;
    }
    
    .contact-info-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .contact-info-card::before {
        border-radius: 8px;
    }
    
    .contact-hero-left {
        gap: 0.75rem;
    }
    
    .contact-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .contact-basic-info h1 {
        font-size: 1.125rem;
        line-height: 1.3;
    }
    
    .contact-name-row {
        gap: 0.375rem;
        margin-bottom: 0.375rem;
    }
    
    .status-badge {
        padding: 0.1875rem 0.375rem;
        font-size: 0.625rem;
        border-radius: 3px;
    }
    
    .status-badge > svg {
        width: 8px;
        height: 8px;
    }
    
    .contact-meta {
        gap: 0.375rem;
    }
    
    .contact-location,
    .contact-since {
        font-size: 0.75rem;
    }
    
    .contact-meta-separator {
        font-size: 0.75rem;
    }
    
    .contact-hero-actions {
        margin-top: 0.75rem;
        gap: 0.375rem;
        width: 100%;
        justify-content: stretch;
    }
    
    .contact-hero-actions .btn {
        flex: 1;
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .contact-hero-actions .btn-icon {
        width: 36px;
        height: 36px;
        padding: 0.5rem;
    }
}

/* Dark Mode Adjustments */
.dark .status-badge.lead {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.dark .status-badge.client {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.dark .modal-content {
    background-color: var(--surface);
    border-left-color: var(--border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

/* Dark mode real-world contact card */
.dark .contact-info-card {
    background: linear-gradient(145deg, #1f2937 0%, #111827 50%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.10),
        0 16px 32px rgba(0, 0, 0, 0.08),
        0 32px 64px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.dark .contact-info-card:hover {
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.20),
        0 8px 16px rgba(0, 0, 0, 0.16),
        0 16px 32px rgba(0, 0, 0, 0.14),
        0 32px 64px rgba(0, 0, 0, 0.12),
        0 48px 96px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.dark .contact-info-card::before {
    background: 
        radial-gradient(circle at 20% 20%, rgba(67, 97, 238, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(67, 97, 238, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
}

.dark .contact-avatar {
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.15);
}

.dark .contact-avatar:hover {
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.3),
        0 12px 24px rgba(0, 0, 0, 0.2);
}

.dark .form-group input[type="text"],
.dark .form-group input[type="email"],
.dark .form-group input[type="tel"],
.dark .form-group input[type="date"],
.dark .form-group input[type="number"],
.dark .form-group select,
.dark .form-group textarea {
    background-color: var(--surface-hover);
    border-color: var(--border);
    color: var(--text-primary);
}

.dark .form-group select:hover {
    border-color: var(--primary);
}

.dark .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.brand-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    align-items: end;
    height: 24px;
}

.dot {
    width: 1rem;
    height: 1rem;
    background-color: var(--color);
    border-radius: 50%;
    animation: dotBounce 1.2s ease-in-out infinite var(--delay);
}

@keyframes dotBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-12px);
    }
}

.loading-text {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 0;
}

/* Dark mode loading overlay */
.dark .loading-overlay {
    background: rgba(31, 41, 55, 0.95);
}

/* Custom Form Responses Section */
.custom-responses-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.custom-responses-header {
    margin-bottom: 1rem;
}

.custom-responses-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-responses-header h4::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

.custom-responses-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.custom-response-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    background: var(--surface-accent);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
}

.custom-response-item:hover {
    background: var(--surface-hover);
}

.custom-response-item label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.custom-response-item span {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.5;
    word-wrap: break-word;
}

/* Dark mode styles for custom responses */
.dark .custom-responses-section {
    border-top-color: var(--border);
}

.dark .custom-response-item {
    background: var(--surface-hover);
    border-color: var(--border);
}

.dark .custom-response-item:hover {
    background: var(--surface-accent);
}

/* Responsive styles for custom responses */
@media (max-width: 768px) {
    .custom-responses-section {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .custom-response-item {
        padding: 0.625rem;
    }
    
    .custom-response-item label {
        font-size: 0.75rem;
    }
    
    .custom-response-item span {
        font-size: 0.875rem;
    }
} 