/* =========================================================
   EMAIL VERIFICATION DASHBOARD
   Complete Dashboard Styles
   ========================================================= */

:root {
    --primary: #6d7aff;
    --primary-dark: #5865e8;
    --primary-light: #eef0ff;

    --success: #16a34a;
    --success-light: #ecfdf3;

    --warning: #d97706;
    --warning-light: #fff7ed;

    --danger: #dc2626;
    --danger-light: #fef2f2;

    --dark: #111827;
    --text: #374151;
    --muted: #6b7280;

    --border: #e5e7eb;
    --background: #f7f8fc;
    --white: #ffffff;

    --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.05);
    --shadow: 0 8px 25px rgba(17, 24, 39, 0.08);
    --shadow-lg: 0 15px 40px rgba(17, 24, 39, 0.12);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --transition: all 0.2s ease;
}

/* =========================================================
   GLOBAL
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

/* =========================================================
   HEADER
   ========================================================= */

.dashboard-header {
    padding: 28px 0 20px;
}

.dashboard-header h1 {
    margin: 0;
    color: var(--dark);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.dashboard-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    color: var(--dark);
    font-weight: 700;
}

.card-header h2 {
    font-size: 18px;
}

.card-header h3 {
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

/* =========================================================
   STATS
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card.valid::before {
    background: var(--success);
}

.stat-card.risky::before {
    background: var(--warning);
}

.stat-card.invalid::before {
    background: var(--danger);
}

.stat-label {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.stat-value {
    color: var(--dark);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

/* =========================================================
   UPLOAD
   ========================================================= */

.upload-area {
    padding: 25px;
}

.upload-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 30px;
    border: 2px dashed #cfd4dc;
    border-radius: var(--radius);
    background: #fafbff;
    text-align: center;
    transition: var(--transition);
}

.upload-box:hover,
.upload-box.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 22px;
}

.upload-title {
    margin: 0 0 5px;
    color: var(--dark);
    font-size: 16px;
    font-weight: 700;
}

.upload-description {
    margin: 0 0 15px;
    color: var(--muted);
    font-size: 13px;
}

.file-input {
    display: none;
}

.file-name {
    display: none;
    margin-top: 15px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: #f3f4f6;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    filter: brightness(0.94);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

/* =========================================================
   JOB STATUS
   ========================================================= */

.job-status-card {
    display: none;
}

.job-status-card.visible {
    display: block;
}

.job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.job-id {
    color: var(--muted);
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.status-badge.processing {
    background: #eff6ff;
    color: #2563eb;
}

.status-badge.completed {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.failed {
    background: var(--danger-light);
    color: var(--danger);
}

.status-badge.pending {
    background: #f3f4f6;
    color: var(--muted);
}

/* =========================================================
   PROGRESS
   ========================================================= */

.progress-wrapper {
    margin: 20px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #9a8cf8, #6d7aff);
    transition: width 0.4s ease;
}

/* =========================================================
   JOB COUNTS
   ========================================================= */

.job-counts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.job-count {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafafa;
}

.job-count-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.job-count-value {
    margin-top: 4px;
    color: var(--dark);
    font-size: 20px;
    font-weight: 800;
}

/* =========================================================
   TOOLBAR
   ========================================================= */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 260px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    background: white;
    color: var(--dark);
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 122, 255, 0.12);
}

.filter-select {
    height: 40px;
    padding: 0 35px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    background: white;
    color: var(--text);
}

.filter-select:focus {
    border-color: var(--primary);
}

/* =========================================================
   TABLE
   ========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.email-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.email-table th {
    padding: 13px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.email-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f0f1f3;
    color: var(--text);
    font-size: 13px;
    vertical-align: middle;
}

.email-table tbody tr {
    transition: background 0.15s ease;
}

.email-table tbody tr:hover {
    background: #fafbff;
}

.email-address {
    color: var(--dark);
    font-weight: 600;
    word-break: break-all;
}

/* =========================================================
   STATUS
   ========================================================= */

.email-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
}

.email-status.valid {
    background: var(--success-light);
    color: var(--success);
}

.email-status.risky {
    background: var(--warning-light);
    color: var(--warning);
}

.email-status.invalid {
    background: var(--danger-light);
    color: var(--danger);
}

.email-status.pending {
    background: #f3f4f6;
    color: var(--muted);
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    display: none;
    padding: 50px 20px;
    text-align: center;
}

.empty-state.visible {
    display: block;
}

.empty-icon {
    margin-bottom: 10px;
    color: #9ca3af;
    font-size: 36px;
}

.empty-state h3 {
    margin: 0 0 5px;
    color: var(--dark);
    font-size: 16px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

/* =========================================================
   LOADING
   ========================================================= */

.loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 35px;
    color: var(--muted);
}

.loading.visible {
    display: flex;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   ALERT
   ========================================================= */

.alert {
    display: none;
    margin-bottom: 18px;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.alert.visible {
    display: block;
}

.alert.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.alert.error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert.info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px;
}

.pagination button {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text);
    font-weight: 600;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.pagination button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================================
   EXPORT MENU
   ========================================================= */

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* =========================================================
   FOOTER
   ========================================================= */

.dashboard-footer {
    padding: 20px 0 30px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .job-counts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100% - 20px, 1200px);
    }

    .dashboard-header h1 {
        font-size: 24px;
    }

    .toolbar {
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .toolbar .btn {
        flex: 1;
    }

    .job-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .job-counts {
        grid-template-columns: 1fr 1fr;
    }

    .card-body {
        padding: 15px;
    }

    .upload-area {
        padding: 15px;
    }

    .upload-box {
        min-height: 150px;
        padding: 20px;
    }

    .job-count {
        padding: 10px;
    }

    .job-count-value {
        font-size: 18px;
    }

    .export-buttons {
        width: 100%;
    }

    .export-buttons .btn {
        flex: 1;
    }
}