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

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

header {
    background: #1a1a2e;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

nav button {
    background: transparent;
    color: #aaa;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    border-radius: 4px;
    transition: all 0.2s;
}

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

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Stats */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}

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

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

.section-header h2 {
    font-size: 1.3rem;
}

.subtitle {
    font-weight: 400;
    color: #666;
    font-size: 1rem;
}

/* Buttons */
.btn-primary {
    background: #25d366;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1da851;
}

.btn-sm {
    background: #e8ecf0;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-sm:hover {
    background: #d0d5db;
}

.btn-danger {
    background: #ffe0e0;
    color: #c62828;
}

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

/* Forms */
.inline-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.inline-form.compact {
    padding: 0.7rem;
    margin-bottom: 0.5rem;
}

.inline-form input, .inline-form select {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    flex: 1;
    min-width: 150px;
}

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

th, td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    text-transform: uppercase;
}

td {
    font-size: 0.9rem;
}

tr:hover td {
    background: #f8fffe;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e8ecf0;
    color: #555;
    margin-left: 0.4rem;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Campaign Cards */
.campaigns-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.campaign-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.campaign-card.expanded {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.campaign-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.campaign-header:hover {
    background: #f8f9fa;
}

.campaign-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.campaign-link code {
    font-size: 0.8rem;
    background: #f0f0f0;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.campaign-body {
    padding: 1.5rem;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

/* Sellers */
.sellers-section h4 {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.sellers-list {
    margin-bottom: 1rem;
}

.seller-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    background: white;
    border: 1px solid #eee;
}

.seller-row.inactive {
    opacity: 0.5;
    background: #f5f5f5;
}

.seller-row .phone {
    color: #666;
    font-family: monospace;
    font-size: 0.85rem;
}

.seller-row span:first-child {
    font-weight: 500;
    min-width: 100px;
}

/* Snapshots */
.snapshot-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.snapshots-list {
    margin-top: 1rem;
    padding: 0.8rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.snapshot-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.snapshot-row .date {
    color: #888;
    font-size: 0.8rem;
}

/* Campaign info */
.campaign-info {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.campaign-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.full-link {
    display: block;
    background: #1a1a2e;
    color: #25d366;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    word-break: break-all;
}

.hint {
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
}

/* Filters */
.filters {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters select, .filters input {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

.results-count {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

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

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1a1a2e;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .section-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }

    .campaign-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .filters {
        flex-direction: column;
    }
}

code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}
