:root {
    --primary: #25d366;
    --primary-dark: #128c7e;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #38bdf8;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(37, 211, 102, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.15) 0px, transparent 50%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 600;
}

h1 span {
    color: var(--primary);
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge.connected {
    background: rgba(37, 211, 102, 0.2);
    color: #4ade80;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 1rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 0.75rem;
    transition: all 0.3s;
}

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

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

main.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem 3rem;
    min-height: 100vh;
    background-color: var(--bg);
}

.blast-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

#qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    min-height: 250px;
    justify-content: center;
}

#qr-container p {
    color: #334155;
}

#qr-code canvas {
    max-width: 100%;
}

.success-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

#ready-msg {
    text-align: center;
    padding: 2rem;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
    font-size: 0.875rem;
}

input,
textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    height: 120px;
    resize: none;
}

button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: var(--primary-dark);
}

.secondary-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-top: 1.5rem;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.secondary-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

#progress-section {
    grid-column: span 2;
}

.progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 1rem;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

#log {
    margin-top: 1.5rem;
    height: 150px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.875rem;
    color: #4ade80;
}

.hidden {
    display: none;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 10;
}

.sidebar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.sidebar-brand span {
    color: var(--primary);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.2rem;
    color: var(--text-dim);
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-item:hover, .menu-item.active {
    background: rgba(37, 211, 102, 0.1);
    color: white;
}

.menu-item.active {
    border-left: 3px solid var(--primary);
    background: rgba(37, 211, 102, 0.15);
}

.menu-item.back-home {
    background: rgba(255, 255, 255, 0.03);
    border-left: none;
}

.menu-item.back-home:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Page Views */
.page-view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1.5rem;
}

.main-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

/* Leads Stats Summary */
.leads-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stats-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.stats-card h3 {
    font-size: 0.875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stats-card p {
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
}

.stats-card.status-new { border-left: 4px solid var(--accent); }
.stats-card.status-interested { border-left: 4px solid var(--primary); }
.stats-card.status-pending { border-left: 4px solid #f59e0b; }
.stats-card.status-won { border-left: 4px solid #a855f7; }

/* Leads Action Panel */
.leads-actions-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.import-section {
    flex: 1;
    min-width: 300px;
}

.import-section h2 {
    font-size: 1.15rem;
    color: white;
    margin-bottom: 0.3rem;
}

.download-sample {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: text-decoration 0.3s;
}

.download-sample:hover {
    text-decoration: underline;
}

.operation-section {
    display: flex;
    gap: 1rem;
}

/* Leads Table Section */
.table-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.table-header-controls h2 {
    font-size: 1.25rem;
    color: var(--accent);
}

.filters {
    display: flex;
    gap: 1rem;
}

.filters input, .filters select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.filters input {
    width: 250px;
}

/* Responsive Table */
.table-container {
    overflow-x: auto;
    width: 100%;
}

#leads-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

#leads-table th, #leads-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#leads-table th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
}

#leads-table td {
    color: white;
    font-size: 0.95rem;
}

#leads-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.empty-row {
    text-align: center;
    color: var(--text-dim) !important;
    padding: 3rem !important;
    font-style: italic;
}

/* Status Badges */
.tag-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}

.tag-badge.tag-baru {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.2);
}

.tag-badge.tag-berminat {
    background: rgba(37, 211, 102, 0.15);
    color: #4ade80;
    border-color: rgba(37, 211, 102, 0.2);
}

.tag-badge.tag-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.tag-badge.tag-won {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.2);
}

.tag-badge.tag-tidakberminat {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Note Input Box */
.note-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 10px;
    color: white;
    font-family: inherit;
    font-size: 0.875rem;
    width: 100%;
    transition: all 0.3s;
}

.note-input:hover, .note-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    outline: none;
}

/* Table Actions */
.table-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.action-btn-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    transition: all 0.3s;
}

.action-btn-circle.blast {
    color: var(--primary);
    border-color: rgba(37, 211, 102, 0.2);
}

.action-btn-circle.blast:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.action-btn-circle.delete {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.action-btn-circle.delete:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@media (max-width: 968px) {
    .sidebar {
        width: 70px;
        padding: 1.5rem 0.5rem;
        align-items: center;
    }
    
    .sidebar-brand {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .sidebar-brand span {
        display: none;
    }
    
    .menu-item {
        justify-content: center;
        padding: 0.75rem;
        width: 45px;
        height: 45px;
    }
    
    .menu-item span, .menu-item.back-home span {
        display: none;
    }
    
    main.main-content {
        margin-left: 70px;
        padding: 2rem 1.5rem;
    }
    
    .blast-grid {
        grid-template-columns: 1fr;
    }
    
    #progress-section {
        grid-column: span 1;
    }
}

/* Connection tab styles */
.connect-tab.active {
    background: var(--primary) !important;
    color: white !important;
}
.connect-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08) !important;
    color: white !important;
}
.connect-panel.hidden {
    display: none !important;
}

/* Syncing state spinner and warning badge */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.badge.warning {
    background: rgba(234, 179, 8, 0.2) !important;
    color: #facc15 !important;
}