* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page {
    display: none;
}

.page.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 10px;
}

.btn:hover {
    transform: scale(1.02);
}

.toggle-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.toggle-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.toggle-link a:hover {
    text-decoration: underline;
}

.message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 5px;
    text-align: center;
    min-height: 20px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.textarea-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 12px;
    background-color: #6c63ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-small:hover {
    background-color: #5a52d5;
}

/* Dashboard Styles */
#dashboard-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    height: 100vh;
}

.dashboard-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    margin: 0;
    font-size: 24px;
}

.btn-logout {
    padding: 10px 20px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-logout:hover {
    transform: scale(1.05);
}

.dashboard-content {
    flex: 1;
    display: flex;
    gap: 30px;
    padding: 40px;
}

.sidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-database {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-database:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.btn-campaign {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-campaign:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.btn-header-footer {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-header-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.main-content {
    flex: 1;
    color: white;
    text-align: center;
}

.main-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

#dashboard-message {
    font-size: 24px;
    font-weight: 300;
}

/* Campaign Page Styles */
#campaign-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    height: 100vh;
}

.campaign-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.campaign-content {
    flex: 1;
    display: flex;
    gap: 30px;
    padding: 40px;
    overflow: auto;
}

.campaign-form {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    max-height: 100%;
}

.campaign-form h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

.campaign-form .form-group {
    margin-bottom: 20px;
}

.campaign-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.campaign-form input,
.campaign-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.campaign-form input:focus,
.campaign-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-create-campaign {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 10px;
}

.btn-create-campaign:hover {
    transform: scale(1.02);
}

.campaign-preview {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.campaign-preview h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 15px;
}

.preview-box {
    flex: 1;
    border: 2px dashed #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
}

.preview-box img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Database Page Styles */
#database-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    height: 100vh;
}

.database-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.database-content {
    flex: 1;
    display: flex;
    gap: 30px;
    padding: 40px;
    overflow: auto;
}

.database-form-container {
    display: flex;
    gap: 30px;
    width: 100%;
}

.database-form {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    max-height: 100%;
}

.database-form h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
}

.database-form .form-group {
    margin-bottom: 20px;
}

.database-form label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.database-form input,
.database-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.database-form input:focus,
.database-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-create-database {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 10px;
}

.btn-create-database:hover {
    transform: scale(1.02);
}

.database-info {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    max-height: 100%;
}

.database-info h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 15px;
}

.database-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}
/* Import DB Styles */
.import-db-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
}

.import-db-content {
    padding: 40px;
}

.import-step {
    display: none;
}

.import-step.active {
    display: block;
}

.import-form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.import-form {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
}

.import-form h3 {
    margin-bottom: 20px;
    color: #333;
}

.import-info {
    background: #f0f4ff;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.import-info h3 {
    margin-bottom: 15px;
    color: #333;
}

.import-info p {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.import-info pre {
    background: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    overflow-x: auto;
    margin: 10px 0;
}

.column-preview {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.column-preview h4 {
    margin-bottom: 15px;
    color: #333;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table th,
.preview-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.preview-table th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.preview-table tr:nth-child(even) {
    background: #f9f9f9;
}

.import-report-container {
    max-width: 600px;
    margin: 0 auto;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.report-stat {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
}

.report-section {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}

.report-section h4 {
    margin-bottom: 15px;
    color: #333;
}

.email-list {
    list-style: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.email-list li {
    padding: 8px;
    color: #666;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
}

.email-list li:last-child {
    border-bottom: none;
}

.btn-upload,
.btn-import,
.btn-finish {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-top: 20px;
}

.btn-upload:hover,
.btn-import:hover,
.btn-finish:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-import-db {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
    margin-bottom: 10px;
}

.btn-import-db:hover {
    transform: translateY(-2px);
}

.message.loading {
    color: #0066cc;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.dashboard-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.lists-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.list-card {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: transform 0.2s, box-shadow 0.2s;
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.list-card-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
}

.list-card-info {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.list-card-date {
    color: #999;
    font-size: 12px;
    margin-bottom: 12px;
}

.list-card-actions {
    display: flex;
    gap: 10px;
}

.btn-delete-list {
    background: #ff4444;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    flex: 1;
    transition: background 0.2s;
}

.btn-delete-list:hover {
    background: #cc0000;
}
/* Header & Footer Page Styles */
.header-footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.hf-form-section,
.hf-list-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.hf-form-section h2,
.hf-list-section h2 {
    color: #333;
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    color: #333;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.button-group .btn {
    flex: 1;
}

.btn-cancel {
    background: #999;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #777;
}

#hf-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

#hf-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#hf-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hf-list {
    max-height: 600px;
    overflow-y: auto;
}

.hf-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s;
}

.hf-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hf-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
}

.hf-item-preview {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    max-height: 100px;
    overflow: hidden;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
}

.hf-item-actions {
    display: flex;
    gap: 8px;
}

.btn-edit-hf,
.btn-delete-hf {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-edit-hf {
    background: #667eea;
    color: white;
}

.btn-edit-hf:hover {
    background: #5568d3;
}

.btn-delete-hf {
    background: #dc3545;
    color: white;
}

.btn-delete-hf:hover {
    background: #c82333;
}

.placeholder {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

.btn-back {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 20px;
    width: 100%;
    transition: background 0.2s;
}

.btn-back:hover {
    background: #5568d3;
}

/* ===== SECTION CAMPAGNES ===== */
.campaigns-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.campaign-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.campaign-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.campaign-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.campaign-card-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.campaign-card-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.campaign-card-status.draft {
    background: #fff3cd;
    color: #856404;
}

.campaign-card-status.sent {
    background: #d4edda;
    color: #155724;
}

.campaign-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
    font-size: 14px;
}

.campaign-card-stat {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.campaign-card-stat-label {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.campaign-card-stat-value {
    font-weight: 600;
    color: #667eea;
    font-size: 18px;
}

.campaign-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.campaign-card-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-view-stats {
    background: #667eea;
    color: white;
}

.btn-view-stats:hover {
    background: #5568d3;
}

.btn-delete-campaign {
    background: #dc3545;
    color: white;
}

.btn-delete-campaign:hover {
    background: #c82333;
}

/* ===== PAGE DÉTAILS CAMPAGNE ===== */
.campaign-details-content {
    max-width: 1200px;
    margin: 0 auto;
}

.campaign-info-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.info-row span {
    color: #555;
    font-size: 14px;
}

.info-row strong {
    color: #333;
    margin-right: 5px;
}

/* Cartes statistiques */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-rate {
    font-size: 14px;
    color: #999;
}

/* Onglets */
.tabs-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f9f9f9;
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    min-width: 150px;
}

.tab-button:hover {
    color: #333;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Tableau de données */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f5f5f5;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #555;
    word-break: break-all;
}

.data-table tbody tr:hover {
    background: #f9f9f9;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-footer-content {
        grid-template-columns: 1fr;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .campaigns-container {
        grid-template-columns: 1fr;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .info-row {
        grid-template-columns: 1fr;
    }

    .tab-button {
        min-width: 120px;
        padding: 12px 15px;
        font-size: 13px;
    }
}