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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #2563eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: hidden;
}

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

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-left-color: var(--primary);
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
    max-width: 1200px;
    width: 100%;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.01em;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--text-primary);
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="number"]:hover,
input[type="text"]:hover {
    border-color: var(--primary-light);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: block;
    padding: 16px 24px;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
}

.file-input-label:hover {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
    border-style: solid;
}

.selected-folder {
    margin-top: 12px;
    padding: 12px 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
    font-size: 14px;
    display: none;
    font-weight: 500;
}

.selected-folder.show {
    display: block;
}

button {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-sm);
}

button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

button.success {
    background: var(--success);
}

button.success:hover:not(:disabled) {
    background: #059669;
}

.progress {
    margin-top: 24px;
    display: none;
}

.progress.show {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.log {
    margin-top: 24px;
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    font-size: 13px;
    display: none;
    line-height: 1.6;
}

.log.show {
    display: block;
}

.log-entry {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.log-entry.success {
    color: #065f46;
    background: #d1fae5;
    border-left: 3px solid var(--success);
}

.log-entry.error {
    color: #991b1b;
    background: #fee2e2;
    border-left: 3px solid var(--error);
}

.log-entry.info {
    color: #1e40af;
    background: #dbeafe;
    border-left: 3px solid var(--primary);
}

.log-entry.warn {
    color: #92400e;
    background: #fef3c7;
    border-left: 3px solid var(--warning);
}

.files-list {
    margin-top: 16px;
    padding: 20px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
}

.files-list h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}

.files-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.files-list li {
    padding: 8px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.files-list li:before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
    font-size: 16px;
}

small {
    color: var(--text-muted);
    font-size: 13px;
    display: block;
    margin-top: 6px;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

a.success {
    display: block;
    background: var(--success);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

a.success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

table th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.01em;
}

table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-primary);
}

table tr:hover {
    background: var(--bg);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
    color: var(--text-secondary);
}

.email-results {
    margin-top: 24px;
}

.email-results h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

#emailList {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}

#accountsPreview {
    margin-top: 16px;
    padding: 20px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}

#accountsPreview h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
}

#accountsList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

#accountsList li {
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .nav-text {
        display: none;
    }

    .sidebar-header h1 {
        font-size: 16px;
    }

    .main-content {
        margin-left: 70px;
        padding: 20px;
    }

    .card {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .main-content {
        margin-left: 0;
    }
}

