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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

#app {
    max-width: 100%;
    min-height: 100vh;
}

header {
    background: #0078d4;
    color: white;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 18px;
    margin-bottom: 10px;
}

nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.1);
}

.nav-btn.active {
    background: white;
    color: #0078d4;
}

main {
    padding: 15px;
}

.tab-content {
    display: none;
}

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

h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #0078d4;
}

h3 {
    font-size: 14px;
    margin: 15px 0 10px;
    color: #666;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    font-family: 'Consolas', monospace;
}

.form-group small {
    color: #666;
    font-size: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn.primary {
    background: #0078d4;
    color: white;
}

.btn.primary:hover {
    background: #006abc;
}

.btn:not(.primary) {
    background: #e0e0e0;
    color: #333;
}

.btn:not(.primary):hover {
    background: #d0d0d0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upload-section p {
    margin-bottom: 10px;
}

.upload-section code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

#csv-file {
    margin-bottom: 10px;
    display: block;
}

#upload-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

#upload-status.success {
    display: block;
    background: #dff0d8;
    color: #3c763d;
}

#upload-status.error {
    display: block;
    background: #f2dede;
    color: #a94442;
}

.contacts-list {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 600;
}

.contact-email {
    color: #666;
    font-size: 12px;
}

.contact-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.campaigns-list {
    margin-top: 20px;
}

.campaign-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.campaign-item h4 {
    margin-bottom: 5px;
}

.campaign-item .subject {
    color: #666;
    font-size: 13px;
}

.campaign-item .status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-top: 5px;
}

.campaign-item .status.draft {
    background: #ffc107;
    color: #000;
}

.campaign-item .status.active {
    background: #28a745;
    color: white;
}

.checkbox-group {
    margin-bottom: 10px;
}

#recipient-list {
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.recipient-item {
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recipient-item input {
    margin: 0;
}

#send-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

#send-status.info {
    background: #d1ecf1;
    color: #0c5460;
}

#send-progress {
    margin-top: 10px;
}

.progress-item {
    padding: 5px 0;
    font-size: 13px;
}

.progress-item.success {
    color: #28a745;
}

.progress-item.pending {
    color: #666;
}

.stats-summary {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: white;
    padding: 20px 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #0078d4;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

#stats-details {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-row .email {
    font-weight: 600;
}

.stats-row .indicators {
    display: flex;
    gap: 10px;
}

.indicator {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.indicator.opened {
    background: #28a745;
    color: white;
}

.indicator.not-opened {
    background: #dc3545;
    color: white;
}

.indicator.replied {
    background: #0078d4;
    color: white;
}

.mark-replied-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
}

.mark-replied-btn:hover {
    background: #5a6268;
}

#reply-detected-banner {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 12px 15px;
    margin: -15px -15px 15px -15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#reply-detected-banner .banner-content {
    text-align: center;
    font-size: 13px;
}

#reply-detected-banner .btn {
    margin-top: 8px;
    padding: 6px 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid white;
}

.auto-refresh-note {
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
    font-style: italic;
}
