/* assets/style.css */
:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --whatsapp: #25D366;
    --call: #3b82f6;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* Utilities */
.hidden { display: none !important; }
.active { display: block; }
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: opacity 0.3s;
}

/* Buttons */
.btn {
    display: inline-block;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: 'Inter', sans-serif;
}
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--secondary); color: white; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }

.icon-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Forms */
.input-group {
    position: relative;
    margin-bottom: 15px;
}
.input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.input-group input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: 8px;
    border: 1px solid var(--secondary);
    background: rgba(15, 23, 42, 0.8);
    color: white;
    font-family: 'Inter', sans-serif;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}
.color-group { display: flex; align-items: center; gap: 10px; }
.color-group input[type="color"] { width: 50px; padding: 2px; }
.color-group i { display: none; }

/* Login Screen */
#login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px 20px;
    border-radius: 24px;
    text-align: center;
}
.login-container .logo {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}
.login-container h1 { margin-bottom: 5px; }
.login-container p { color: var(--text-muted); margin-bottom: 30px; }
.login-container button { width: 100%; margin-top: 10px; }

/* Main App Layout */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.header-content h2 { font-size: 1.2rem; font-weight: 700; }
.search-bar { position: relative; }
.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-bar input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border-radius: 20px;
    border: none;
    background: var(--secondary);
    color: white;
}
.search-bar input:focus { outline: none; box-shadow: 0 0 0 2px var(--primary); }

.app-main {
    padding: 20px;
    padding-bottom: 80px; 
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.badge {
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Tabs & Nav */
.tab-content.active {
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sub-tabs-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 15px;
    scrollbar-width: none;
    border-bottom: 1px solid var(--secondary);
}
.sub-tabs-container::-webkit-scrollbar { display: none; }
.sub-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: 'Inter';
}
.sub-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    z-index: 100;
}
.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 0.2s;
    font-family: 'Inter', sans-serif;
}
.nav-item i { font-size: 1.2rem; }
.nav-item.active { color: var(--primary); }

/* Lead Cards */
.leads-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
@media (min-width: 600px) {
    .leads-grid { grid-template-columns: 1fr 1fr; }
}
.lead-card {
    border-radius: 16px;
    padding: 15px;
    transition: transform 0.2s;
}
.lead-card:active { transform: scale(0.98); }
.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.lead-name { font-weight: 600; font-size: 1.1rem; }
.tc-name { font-size: 0.8rem; color: #a78bfa; margin-top:2px; display:flex; align-items:center; gap:4px;}
.tc-name i { color: #8b5cf6; }
.tc-name.failed { color: var(--text-muted); }
.tc-name.failed i { color: var(--text-muted); }
.lead-source { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.lead-status {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}
.lead-details { margin-bottom: 15px; font-size: 0.9rem; }
.lead-details p { margin-bottom: 4px; color: #cbd5e1; }
.lead-details i { width: 20px; color: var(--text-muted); }
.lead-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    color: white;
}
.btn-call { background-color: var(--call); }
.btn-whatsapp { background-color: var(--whatsapp); }

.notes-btn {
    width: 100%;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    background: var(--secondary);
    color: white;
    border: none;
    cursor: pointer;
    font-family: 'Inter';
    font-size: 0.85rem;
}

/* Filters & Pagination */
.filter-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 15px;
    scrollbar-width: none;
}
.filter-pills::-webkit-scrollbar { display: none; }
.pill {
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--secondary);
    color: white;
    border: none;
    white-space: nowrap;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}
.pill.active { background: var(--primary); }

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    align-items: center;
}
.pagination-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { font-size: 0.9rem; color: var(--text-muted); }

/* Form Card & Stats */
.form-card {
    padding: 20px;
    border-radius: 16px;
}
.form-card h4 { margin-bottom: 15px; display:flex; align-items:center; gap:8px;}
.form-card form button { width: 100%; }

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.stat-box {
    background: rgba(15,23,42,0.6);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}
.stat-box h5 { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 5px; }
.stat-box span { font-size: 1.5rem; font-weight: 700; color: var(--primary); }

.users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15,23,42,0.6);
    padding: 10px 15px;
    border-radius: 8px;
}
.user-item .role { font-size: 0.75rem; background: var(--secondary); padding: 2px 6px; border-radius: 4px; }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-content {
    width: 100%;
    max-width: 350px;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
}
.modal-content h3 { margin-bottom: 5px; }
.modal-content p { color: var(--text-muted); margin-bottom: 20px; }
.status-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.status-btn {
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    color: white;
}

/* Notes List */
.notes-list {
    text-align: left;
    margin-bottom: 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.note-item {
    background: rgba(15,23,42,0.6);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}
.note-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.note-text {
    font-size: 0.9rem;
}
