/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    background-color: #f8f9fa;
}

/* Mobile Header */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: #343a40;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.mobile-header .brand { font-weight: 600; font-size: 16px; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* Sidebar Styles */
.sidebar {
    background-color: #343a40;
    min-height: 100vh;
    color: #fff;
    padding: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Off-canvas behavior on small screens */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 48px; /* below mobile header */
        left: -260px;
        width: 240px;
        height: calc(100vh - 48px);
        overflow-y: auto;
        transition: left .25s ease;
        z-index: 1040;
    }
    .sidebar.open { left: 0; }
    .main-content { padding: 16px; }
}

.sidebar .nav-link {
    color: #ced4da;
    border-radius: 0;
    padding: 12px 20px;
    transition: all 0.3s;
}

.sidebar .nav-link:hover {
    background-color: #495057;
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: #007bff;
    color: #fff;
}

/* Main Content Area */
.main-content {
    padding: 20px 30px;
}

/* Ensure main content shifts below header on mobile */
@media (max-width: 991.98px) {
    .main-content { margin-top: 8px; }
}

/* Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
}

.btn {
    border-radius: 6px;
    padding: 8px 16px;
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tables */
table {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

/* Horizontal scroll for wide tables on mobile */
.table-responsive { overflow-x: auto; }
@media (max-width: 575.98px) {
    table { font-size: 14px; }
    .btn { padding: 6px 12px; font-size: 14px; }
    .form-control, .form-select { padding: 8px 12px; font-size: 14px; }
}

/* SMTP Settings Form */
.smtp-form {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Template Preview */
.template-preview {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: white;
    min-height: 300px;
}

/* Campaign Progress */
.progress {
    height: 10px;
    border-radius: 5px;
}