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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 600;
    font-size: 1.25rem;
    margin-right: 2rem;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255,255,255,0.7);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn:hover {
    background: #f5f5f5;
}

.btn-primary {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}

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

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #666;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.form-section {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.form-section h3 {
    margin-bottom: 1rem;
}

.form-divider {
    text-align: center;
    color: #999;
    margin: 1rem 0;
    position: relative;
}

.form-divider::before,
.form-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

/* Tables */
.table {
    width: 100%;
    background: white;
    border-radius: 8px;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f9f9f9;
    font-weight: 600;
    font-size: 0.875rem;
    color: #666;
}

.table tbody tr:hover {
    background: #f9f9f9;
}

.table-sm td,
.table-sm th {
    padding: 0.5rem;
}

.table-info {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.stat-percent {
    font-size: 0.75rem;
    color: #999;
}

.stat-card.stat-success .stat-value { color: #27ae60; }
.stat-card.stat-primary .stat-value { color: #3498db; }
.stat-card.stat-danger .stat-value { color: #e74c3c; }

/* Actions grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-title {
    font-weight: 500;
}

/* Section */
.section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h1,
.section-header h2 {
    margin: 0;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-sent {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Indicators */
.indicator {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.indicator-success {
    background: #d4edda;
    color: #155724;
}

.indicator-primary {
    background: #cce5ff;
    color: #004085;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert a {
    color: inherit;
    font-weight: 500;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50, #3498db);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

/* Filters */
.filters-form {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filters-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination-info {
    color: #666;
    font-size: 0.875rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    color: #666;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* Duplicates list */
.duplicate-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fff3cd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.duplicate-item:hover {
    background: #ffe69c;
}

.duplicate-item input {
    margin-top: 0.25rem;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: #eee;
    border-radius: 3px;
    font-size: 0.875rem;
    margin: 0.125rem;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Text utilities */
.text-center { text-align: center; }
.text-muted { color: #666; }
.text-warning { color: #856404; }

/* Code */
code {
    background: #f4f4f4;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.875rem;
}

/* Error tooltip */
.error-tooltip {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 11px;
    line-height: 16px;
    cursor: help;
    margin-left: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 1rem;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }

    .container {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }
}
