/* ConvertOps Shared Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-hover: #1c1c1c;
    --text-primary: #f5f5f0;
    --text-secondary: #8a8a80;
    --accent: #e8a023;
    --accent-dim: #c4861c;
    --accent-bg: rgba(232, 160, 35, 0.1);
    --accent-border: rgba(232, 160, 35, 0.2);
    --border: #222220;
    --border-light: #2a2a28;
    --green: #34d399;
    --green-bg: rgba(52, 211, 153, 0.1);
    --green-border: rgba(52, 211, 153, 0.2);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --red-border: rgba(239, 68, 68, 0.2);
    --blue: #60a5fa;
    --blue-bg: rgba(96, 165, 250, 0.1);
    --blue-border: rgba(96, 165, 250, 0.2);
    --purple: #a78bfa;
    --purple-bg: rgba(167, 139, 250, 0.1);
    --purple-border: rgba(167, 139, 250, 0.2);
    --yellow: #fbbf24;
    --yellow-bg: rgba(251, 191, 36, 0.1);
    --yellow-border: rgba(251, 191, 36, 0.2);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
    font-family: 'Space Grotesk', sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-primary); }

/* APP NAV */
.app-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.app-nav .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-decoration: none;
}

.app-nav .logo span { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-links a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.15s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-links a.active {
    color: var(--accent);
    background: var(--accent-bg);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.15s;
}

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

.btn-primary {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-dim);
    border-color: var(--accent-dim);
    color: #0a0a0a;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-danger {
    color: var(--red);
    border-color: var(--red-border);
    background: var(--red-bg);
}

.btn-danger:hover {
    background: var(--red);
    color: white;
}

/* FORMS */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #444;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8a80' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}

/* STATUS BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-contacted { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-quoted { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple-border); }
.badge-won { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-lost { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }

/* PAGE LAYOUT */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 32px 60px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* STATS ROW */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.15s;
    cursor: default;
}

.stat-card:hover {
    border-color: var(--border-light);
}

.stat-card .stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

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

/* PIPELINE COLUMNS */
.pipeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    min-height: 400px;
}

.pipeline-column {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.column-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-count {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--bg-card);
    padding: 2px 10px;
    border-radius: 100px;
    border: 1px solid var(--border);
}

.column-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

/* LEAD CARD */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s;
}

.lead-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-1px);
}

.lead-card .lead-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.lead-card .lead-service {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.lead-card .lead-contact {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lead-card .lead-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

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

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-actions .btn { flex: 1; justify-content: center; }

/* TIMELINE */
.timeline {
    margin-top: 20px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

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

.timeline-dot.sent { background: var(--green); }
.timeline-dot.pending { background: var(--text-secondary); }
.timeline-dot.failed { background: var(--red); }

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
}

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

.timeline-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.85rem;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--green-border);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 0.9rem;
    color: var(--green);
    z-index: 300;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

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

.toast.error {
    border-color: var(--red-border);
    color: var(--red);
}

/* LOADING */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

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

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

/* TABLE */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.table-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

table td {
    padding: 14px 20px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

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

table tr:hover td {
    background: var(--bg-hover);
}

/* FOLLOW-UP STATUS */
.followup-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.followup-step {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.followup-info { flex: 1; }

.followup-subject {
    font-size: 0.85rem;
    font-weight: 500;
}

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

/* RESPONSIVE */
@media (max-width: 1024px) {
    .pipeline {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .app-nav {
        padding: 12px 16px;
    }
    .nav-links a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .page-container {
        padding: 80px 16px 40px;
    }
    .pipeline {
        grid-template-columns: 1fr;
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .modal {
        width: 95%;
        padding: 20px;
    }
}
