:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141f;
    --text-primary: #f0f0f5;
    --text-secondary: #9aa0a6;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --glass-bg: rgba(20, 20, 31, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --error: #ef4444;
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Login Overlay */
#login-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-box {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 3rem;
}

.login-box h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-box input {
    width: 100%;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1rem;
}

.error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Layout */
#dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.sidebar .logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

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

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 1rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
}

.sidebar-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
}

#logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Content Area */
.content {
    padding: 3rem;
    overflow-y: auto;
}

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

.content-header h1 {
    font-size: 2rem;
}

/* Tables */
.table-container {
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 1000px;
    /* Prevent squishing of data on small screens */
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
    /* Prevent headers from stacking */
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
    white-space: nowrap;
    /* Most columns shouldn't wrap to keep it clean */
}

/* Kanban Board Layout */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    height: calc(100vh - 250px);
    align-items: flex-start;
}

.kanban-column {
    flex: 1;
    min-width: 320px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kanban-column-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px 12px 0 0;
}

.kanban-column-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.kanban-column-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Kanban Cards */
.lead-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: grab;
    transition: all 0.2s ease;
}

.lead-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.lead-card:active {
    cursor: grabbing;
}

.lead-card.dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed var(--accent-color);
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.lead-card-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: white;
}

.lead-card-budget {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 700;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.lead-card-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.lead-card-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lead-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.lead-card-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Allow summary to wrap if we ever remove truncation */
td:nth-child(7) {
    white-space: normal;
    min-width: 250px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
}

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

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
}

@media (max-width: 1000px) {
    #dashboard-container {
        grid-template-columns: 1fr;
    }

    #mobile-menu-btn {
        display: block !important;
    }

    #close-sidebar-btn {
        display: block !important;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        padding: 1.5rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .pipeline-container {
        flex-direction: column;
        gap: 1rem;
    }

    .pipeline-container>div:nth-child(even) {
        transform: rotate(90deg);
        /* Rotate the arrows down */
    }

    .login-box {
        padding: 2rem 1.5rem;
    }
}