/*
 Theme Name:   ATP Leads Manager
 Theme URI:    https://leads.atp.art
 Description: ATP Leads Manager child theme. Build 7.8 fixes completed card actions to show one View Details button and one Redo Deep Dive button.
 Author:       ATP.art
 Author URI:   https://atp.art
 Template:     astra
 Version: 7.8
 License:      Private
 Text Domain:  atp-leads
*/

/* ============================================
   CSS RESET & BASE
   ============================================ */
:root {
    --navy: #1a2332;
    --navy-light: #243447;
    --navy-dark: #111927;
    --white: #ffffff;
    --off-white: #f5f7fa;
    --border: #e1e5eb;
    --text-primary: #1a2332;
    --text-secondary: #5a6577;
    --text-muted: #8a95a5;
    --timing-now: #e74c3c;
    --timing-soon: #f39c12;
    --timing-approaching: #f1c40f;
    --timing-early: #27ae60;
    --timing-late: #95a5a6;
    --status-new: #3498db;
    --status-maybe: #e67e22;
    --status-active: #27ae60;
    --status-declined: #95a5a6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
}

/* Override Astra defaults */
body.atp-leads-page {
    background: var(--off-white);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
}

.atp-leads-page .site-header,
.atp-leads-page #masthead {
    background: var(--navy) !important;
}

.atp-leads-page .site-header *,
.atp-leads-page #masthead * {
    color: var(--white) !important;
}

.atp-leads-page .site-content {
    max-width: 100%;
    padding: 0;
}

.atp-leads-page #primary {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

.atp-leads-page .entry-header {
    display: none;
}

/* ============================================
   APP HEADER
   ============================================ */
.atp-app-header {
    background: var(--navy);
    color: var(--white);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.atp-app-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--white);
}

.atp-app-header .atp-nav {
    display: flex;
    gap: 8px;
}

.atp-app-header .atp-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.atp-app-header .atp-nav a:hover,
.atp-app-header .atp-nav a.active {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

/* ============================================
   STATS BAR
   ============================================ */
.atp-stats-bar {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.atp-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--off-white);
    border-radius: var(--radius);
    font-size: 14px;
}

.atp-stat .stat-count {
    font-weight: 700;
    font-size: 18px;
}

.atp-stat .stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.atp-stat.stat-now .stat-count { color: var(--timing-now); }
.atp-stat.stat-soon .stat-count { color: var(--timing-soon); }
.atp-stat.stat-approaching .stat-count { color: var(--timing-approaching); }
.atp-stat.stat-early .stat-count { color: var(--timing-early); }
.atp-stat.stat-late .stat-count { color: var(--timing-late); }

/* ============================================
   FILTER BAR
   ============================================ */
.atp-filter-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--white);
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.atp-filter-bar select,
.atp-filter-bar input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--white);
    min-width: 160px;
    transition: var(--transition);
}

.atp-filter-bar select:focus,
.atp-filter-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(26,35,50,0.1);
}

.atp-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.atp-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.atp-status-checkboxes {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto;
}

.atp-status-checkboxes label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
}

.atp-status-checkboxes input[type="checkbox"] {
    accent-color: var(--navy);
}

.atp-filter-bar .atp-clear-filters {
    padding: 8px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.atp-filter-bar .atp-clear-filters:hover {
    color: var(--timing-now);
    border-color: var(--timing-now);
}

/* ============================================
   LEADS GRID
   ============================================ */
.atp-leads-container {
    padding: 24px;
}

.atp-leads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

.atp-no-results {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    font-size: 16px;
    grid-column: 1 / -1;
}

/* ============================================
   LEAD CARD
   ============================================ */
.atp-lead-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    border: 1px solid var(--border);
}

.atp-lead-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.atp-card-header {
    padding: 16px 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.atp-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.atp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.atp-badge-timing {
    color: var(--white);
}

.atp-badge-timing.timing-now { background: var(--timing-now); }
.atp-badge-timing.timing-soon { background: var(--timing-soon); }
.atp-badge-timing.timing-approaching { background: var(--timing-approaching); color: var(--text-primary); }
.atp-badge-timing.timing-early { background: var(--timing-early); }
.atp-badge-timing.timing-late { background: var(--timing-late); }

.atp-badge-industry {
    background: var(--off-white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.atp-card-body {
    padding: 12px 16px;
}

.atp-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary);
    line-height: 1.3;
}

.atp-card-location {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.atp-card-location::before {
    content: '📍';
    font-size: 12px;
}

.atp-card-oneliner {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.atp-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.atp-card-meta-item {
    display: flex;
    gap: 4px;
    overflow: hidden;
}

.atp-card-meta-label {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.atp-card-meta-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card Footer */
.atp-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.atp-card-footer select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: var(--white);
}

.atp-card-footer select.status-new { color: var(--status-new); border-color: var(--status-new); }
.atp-card-footer select.status-maybe { color: var(--status-maybe); border-color: var(--status-maybe); }
.atp-card-footer select.status-active { color: var(--status-active); border-color: var(--status-active); }
.atp-card-footer select.status-declined { color: var(--status-declined); border-color: var(--status-declined); }

.atp-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.atp-btn {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.atp-btn-outline {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.atp-btn-outline:hover {
    border-color: var(--navy);
    color: var(--navy);
}

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

.atp-btn-primary:hover {
    background: var(--navy-light);
}

.atp-btn-deepdive {
    background: #8e44ad;
    color: var(--white);
}

.atp-btn-deepdive:hover {
    background: #7d3c98;
}

.atp-btn-deepdive.requested {
    background: var(--off-white);
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: default;
}

.atp-btn-deepdive.completed {
    background: var(--timing-early);
    color: var(--white);
}

.atp-btn-source {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
}

.atp-btn-source:hover {
    color: var(--navy);
}

/* ============================================
   EXPANDED CARD DETAILS
   ============================================ */
.atp-card-details {
    display: none;
    padding: 16px;
    background: var(--off-white);
    border-top: 1px solid var(--border);
}

.atp-card-details.open {
    display: block;
}

.atp-card-details h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.atp-card-details h4:not(:first-child) {
    margin-top: 16px;
}

.atp-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}

.atp-detail-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.atp-detail-item span {
    color: var(--text-primary);
}

.atp-contacts-box,
.atp-deepdive-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.atp-deepdive-box {
    white-space: normal;
}

.atp-deepdive-box p {
    margin: 0 0 8px;
}

/* ============================================
   COMPANIES TABLE
   ============================================ */
.atp-companies-container {
    padding: 24px;
}

.atp-companies-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--border);
}

.atp-companies-table thead {
    background: var(--navy);
}

.atp-companies-table thead th {
    color: var(--white);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.atp-companies-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.atp-companies-table tbody tr:hover {
    background: var(--off-white);
}

.atp-companies-table tbody td {
    padding: 12px 16px;
    font-size: 14px;
}

.atp-companies-table .company-name-link {
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    cursor: pointer;
}

.atp-companies-table .company-name-link:hover {
    text-decoration: underline;
}

.atp-company-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.atp-company-status-badge.status-open {
    background: #eaf4fe;
    color: var(--status-new);
}

.atp-company-status-badge.status-client {
    background: #eafaf1;
    color: var(--status-active);
}

.atp-company-status-badge.status-do_not_target {
    background: #fdf2f2;
    color: var(--timing-now);
}

.atp-companies-table select.company-status-select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
}

/* Company Projects Popover */
.atp-company-projects {
    display: none;
    padding: 12px 16px;
    background: var(--off-white);
    font-size: 13px;
}

.atp-company-projects.open {
    display: table-row;
}

.atp-company-projects td {
    padding: 12px 16px;
    background: var(--off-white);
}

.atp-company-projects ul {
    margin: 0;
    padding: 0 0 0 16px;
}

.atp-company-projects li {
    margin-bottom: 4px;
}

.atp-company-projects li a {
    color: var(--navy);
    text-decoration: none;
}

.atp-company-projects li a:hover {
    text-decoration: underline;
}

/* Company filter */
.atp-companies-filter {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.atp-companies-filter select,
.atp-companies-filter input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* ============================================
   DASHBOARD
   ============================================ */
.atp-dashboard-container {
    padding: 24px;
}

.atp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.atp-dashboard-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.atp-dashboard-card h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    margin: 0;
    background: var(--off-white);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.atp-dashboard-card-body {
    padding: 20px;
}

.atp-dash-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.atp-dash-stat-row:last-child {
    border-bottom: none;
}

.atp-dash-stat-row .label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.atp-dash-stat-row .count {
    font-weight: 700;
    font-size: 16px;
}

.atp-dash-stat-row .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-now { background: var(--timing-now); }
.dot-soon { background: var(--timing-soon); }
.dot-approaching { background: var(--timing-approaching); }
.dot-early { background: var(--timing-early); }
.dot-late { background: var(--timing-late); }
.dot-new { background: var(--status-new); }
.dot-maybe { background: var(--status-maybe); }
.dot-active { background: var(--status-active); }
.dot-declined { background: var(--status-declined); }

/* Recent leads list */
.atp-recent-leads {
    list-style: none;
    padding: 0;
    margin: 0;
}

.atp-recent-leads li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.atp-recent-leads li:last-child {
    border-bottom: none;
}

.atp-recent-leads .lead-name {
    font-weight: 600;
    color: var(--text-primary);
}

.atp-recent-leads .lead-date {
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   NOTIFICATIONS / TOASTS
   ============================================ */
.atp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--navy);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.atp-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.atp-toast.error {
    background: var(--timing-now);
}

.atp-toast.success {
    background: var(--timing-early);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.atp-loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.atp-loading.active {
    display: block;
}

.atp-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .atp-app-header {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
    }

    .atp-app-header .atp-nav {
        width: 100%;
        justify-content: center;
    }

    .atp-stats-bar {
        padding: 12px 16px;
        gap: 8px;
    }

    .atp-stat {
        padding: 6px 10px;
        font-size: 12px;
    }

    .atp-stat .stat-count {
        font-size: 14px;
    }

    .atp-filter-bar {
        padding: 10px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .atp-filter-bar select,
    .atp-filter-bar input[type="text"] {
        min-width: auto;
        width: 100%;
    }

    .atp-filter-group {
        width: 100%;
    }

    .atp-filter-group select,
    .atp-filter-group input {
        flex: 1;
    }

    .atp-status-checkboxes {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .atp-leads-container {
        padding: 16px;
    }

    .atp-leads-grid {
        grid-template-columns: 1fr;
    }

    .atp-card-meta {
        grid-template-columns: 1fr;
    }

    .atp-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .atp-companies-container {
        padding: 16px;
        overflow-x: auto;
    }

    .atp-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .atp-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .atp-app-header h1 {
        font-size: 16px;
    }

    .atp-app-header .atp-nav a {
        padding: 6px 10px;
        font-size: 12px;
    }

    .atp-leads-grid {
        gap: 12px;
    }
}

/* ============================================
   UTILITY
   ============================================ */
.atp-hidden {
    display: none !important;
}

.atp-text-muted {
    color: var(--text-muted);
}

.atp-mb-0 { margin-bottom: 0; }
.atp-mt-16 { margin-top: 16px; }

/* ============================================
   FIXES
   ============================================ */

/* Fix: Full width header */
.atp-app-header {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    padding-left: 30px !important;
    padding-right: 30px !important;
    box-sizing: border-box !important;
}

/* Fix: Description no truncation */
.atp-card-oneliner {
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
    max-height: none !important;
    display: block !important;
    text-overflow: unset !important;
}

/* Fix: Size & Completion inline */
.atp-card-meta-inline {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.atp-meta-separator {
    color: #999 !important;
    margin: 0 4px !important;
}

/* Fix: Project type styling matches other meta */
.atp-card-project-type {
    display: none !important;
}

/* === FINAL POLISH === */

/* Inline stats bar */
.atp-stats-bar-inline {
    max-width: 1200px;
    margin: 8px auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #333;
    background: #fff;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
}
.atp-stat-inline { white-space: nowrap; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 3px; }
.atp-stat-sep { color: #ccc; margin: 0 6px; }

/* Timing key i button */
.atp-timing-key-toggle {
    margin-left: auto;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #555;
    line-height: 1;
}
.atp-timing-key-toggle:hover { background: #e0e0e0; }

/* Filter separators */
.atp-filter-sep { color: #ccc; font-size: 16px; margin: 0 6px; }

/* Filter group labels all same */
.atp-filter-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
    color: #555;
}

/* Scope checkboxes */
.atp-scope-checkboxes { display: flex; gap: 6px; align-items: center; }
.atp-scope-checkboxes label { font-size: 10px; white-space: nowrap; }

/* Timing checkboxes with emoji */
.atp-timing-checkboxes label { font-size: 10px; white-space: nowrap; }
.atp-status-checkboxes label { font-size: 10px; white-space: nowrap; }

/* Developer list indent */
.atp-developer-list {
    display: block;
    padding-left: 0;
    line-height: 1.6;
}

/* Card meta — all same font */
.atp-card-meta-item {
    font-size: 13px;
    margin-bottom: 4px;
}
.atp-card-meta-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.atp-card-meta-value {
    font-size: 13px;
    color: #1a2332;
}

/* Status + Deep Dive same line */
.atp-card-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Status dropdown smaller */
.status-dropdown {
    font-size: 11px;
    padding: 3px 6px;
    height: auto;
}

/* Button text darker */
.atp-btn-outline {
    color: #333;
    border-color: #999;
}
.atp-btn-outline:hover {
    color: #111;
    border-color: #666;
}

/* Notes resizable */
.atp-notes-editor {
    resize: vertical;
    overflow: auto;
    min-height: 80px;
    width: 100%;
    box-sizing: border-box;
}

/* Notes toolbar buttons visible */
.atp-notes-tool {
    min-width: 28px;
    font-size: 14px;
    padding: 2px 8px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 700;
}
.atp-notes-tool:hover { background: #f0f0f0; }

/* Description no truncation */
.atp-card-oneliner {
    -webkit-line-clamp: unset;
    overflow: visible;
    max-height: none;
    display: block;
    text-overflow: unset;
}

/* Scope badge positioning */
.atp-card-scope-badge {
    flex-shrink: 0;
}

/* Hide old stats bar if still present */
.atp-stats-bar { display: none; }

/* Stats bar section labels */
.atp-stat-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    margin-right: 4px;
}
.atp-stat-sep-double {
    font-weight: 700;
    margin: 0 10px;
}

/* Deep Dive Modal */
.atp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.atp-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.atp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5eb;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 12px 12px 0 0;
    z-index: 1;
}
.atp-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a2332;
    margin: 0;
}
.atp-modal-close {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}
.atp-modal-close:hover {
    background: #f0f0f0;
}
.atp-modal-body {
    padding: 24px;
}
.atp-dd-section {
    margin-bottom: 16px;
}
.atp-dd-section label {
    font-size: 13px;
    font-weight: 700;
    color: #1a2332;
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.atp-dd-section div, .atp-dd-section span {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}
.atp-dd-section a {
    color: #2563eb;
    text-decoration: none;
}
.atp-dd-section a:hover {
    text-decoration: underline;
}
.atp-company-profile-box {
    background: #f9fafb;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
    padding: 12px;
}
.atp-company-profile-box .atp-profile-item {
    margin-bottom: 6px;
    font-size: 13px;
}

/* Waiting button */
.btn-deepdive-waiting {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Contact items in modal */
.atp-contact-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.atp-contact-item:last-child {
    border-bottom: none;
}
.atp-contact-header {
    margin-bottom: 4px;
}
.atp-contact-confidence {
    margin-right: 4px;
}
.atp-contact-name {
    font-size: 14px;
}
.atp-contact-title {
    font-size: 13px;
    color: #666;
}
.atp-contact-details {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}
.atp-contact-email {
    font-size: 13px;
    color: #27ae60;
}
.atp-contact-linkedin {
    font-size: 12px;
    color: #2563eb;
}
.atp-contact-notes {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    font-style: italic;
}
.atp-btn-enrich {
    font-size: 11px;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid #8e44ad;
    color: #8e44ad;
    border-radius: 3px;
    cursor: pointer;
}
.atp-btn-enrich:hover {
    background: #8e44ad;
    color: #fff;
}
.atp-btn-more-contacts {
    margin-top: 12px;
    width: 100%;
}


.btn-redo-deepdive {
  padding: 8px 10px;
  min-width: 40px;
  width: 40px;
  text-align: center;
  margin-left: 6px;
}


.atp-deepdive-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.atp-deepdive-actions-inline .btn-view-details {
  margin-right: 0;
}

.btn-redo-deepdive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  line-height: 1;
}


.atp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
