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

:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #222633;
    --border: #2a2e3a;
    --text: #e4e6eb;
    --text-dim: #8b8fa3;
    --primary: #4f8cff;
    --primary-hover: #3a7af0;
    --danger: #ff4d6a;
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
    --gray: #6b7280;
    --radius: 12px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
}

h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.1rem; font-weight: 500; margin: 24px 0 12px; color: var(--text-dim); }

/* Buttons */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-secondary { background: var(--green); color: #000; }
.btn-secondary:hover { opacity: 0.85; }
.btn-ghost { background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card-hover); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    margin: 24px 0;
    transition: border-color 0.2s, background 0.2s;
}
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(79, 140, 255, 0.05);
}
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-sub { color: var(--text-dim); font-size: 0.85rem; margin: 8px 0; }
.upload-status { margin-top: 16px; font-weight: 500; }
.upload-status.success { color: var(--green); }
.upload-status.error { color: var(--red); }

/* Session List */
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-card-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.session-card-wrapper .session-card {
    flex: 1;
}
.session-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: background 0.2s;
}
.session-card:hover { background: var(--bg-card-hover); }
.session-meta { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 0.85rem; }

/* Delete session button (X) */
.btn-delete-session {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.btn-delete-session:hover {
    color: var(--danger);
    background: rgba(255, 77, 106, 0.12);
    border-color: rgba(255, 77, 106, 0.3);
}


/* Badges */
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-active { background: rgba(79, 140, 255, 0.15); color: var(--primary); }
.badge-paused { background: rgba(251, 191, 36, 0.15); color: var(--yellow); }
.badge-completed { background: rgba(52, 211, 153, 0.15); color: var(--green); }

/* Header Row */
.header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.back-link { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: var(--text); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat-number { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }
.stat-answered .stat-number { color: var(--green); }
.stat-noanswer .stat-number { color: var(--red); }
.stat-voicemail .stat-number { color: var(--yellow); }
.stat-cancelled .stat-number { color: var(--gray); }

/* Progress Bar */
.progress-bar-container {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 28px;
    margin-bottom: 20px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--green));
    border-radius: 8px;
    transition: width 0.5s ease;
}
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Current Call Card */
.current-call-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}
.call-status-indicator {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 12px;
    background: var(--bg);
}
.call-status-indicator.status-calling { color: var(--primary); background: rgba(79, 140, 255, 0.1); }
.call-status-indicator.status-answered { color: var(--green); background: rgba(52, 211, 153, 0.1); }
.call-status-indicator.status-busy,
.call-status-indicator.status-not_found,
.call-status-indicator.status-timeout { color: var(--red); background: rgba(248, 113, 113, 0.1); }
.call-status-indicator.status-voicemail { color: var(--yellow); background: rgba(251, 191, 36, 0.1); }
.call-status-indicator.status-cancelled,
.call-status-indicator.status-skipped { color: var(--gray); background: rgba(107, 114, 128, 0.1); }
.call-status-indicator.status-error { color: var(--danger); background: rgba(255, 77, 106, 0.1); }

.call-contact-name { font-size: 1.4rem; font-weight: 600; margin-bottom: 4px; }
.call-contact-phone { font-size: 1rem; color: var(--text-dim); margin-bottom: 8px; }
.call-extra-data { font-size: 0.85rem; color: var(--text-dim); }
.call-extra-data p { margin: 2px 0; }

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

/* Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 600;
}
tbody td {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr.status-calling { background: rgba(79, 140, 255, 0.08); }

/* Status Badges in Table */
.status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.status-pending { color: var(--text-dim); background: rgba(107, 114, 128, 0.15); }
.status-badge.status-calling { color: var(--primary); background: rgba(79, 140, 255, 0.15); }
.status-badge.status-answered { color: var(--green); background: rgba(52, 211, 153, 0.15); }
.status-badge.status-busy,
.status-badge.status-not_found,
.status-badge.status-timeout { color: var(--red); background: rgba(248, 113, 113, 0.15); }
.status-badge.status-voicemail { color: var(--yellow); background: rgba(251, 191, 36, 0.15); }
.status-badge.status-cancelled,
.status-badge.status-skipped { color: var(--gray); background: rgba(107, 114, 128, 0.15); }
.status-badge.status-error { color: var(--danger); background: rgba(255, 77, 106, 0.15); }

/* Delete Button */
.btn-delete {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.btn-delete:hover {
    color: var(--danger);
    background: rgba(255, 77, 106, 0.1);
}

/* Responsive */
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .controls { flex-wrap: wrap; }
}
