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

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

header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
}

nav {
    display: flex;
    gap: 4px;
}

.tab {
    padding: 6px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-radius: 6px;
    transition: all 0.15s;
}

.tab:hover {
    background: #eee;
}

.tab.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

#client-switcher {
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

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

.tab-content {
    display: none;
}

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

.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.badge {
    background: #ea4335;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.badge.ok {
    background: #34a853;
}

/* Error cards */
.error-card {
    border: 1px solid #fde7e7;
    background: #fff8f8;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
}

.error-card .group {
    font-weight: 600;
    color: #c62828;
}

.error-card .source {
    font-size: 13px;
    color: #666;
    margin: 4px 0;
}

.error-card .error-msg {
    font-size: 13px;
    color: #ea4335;
    margin: 4px 0;
}

.error-card .meta {
    font-size: 12px;
    color: #999;
}

/* Groups table */
#groups-table {
    width: 100%;
    border-collapse: collapse;
}

#groups-table th,
#groups-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#groups-table th {
    font-weight: 600;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

#groups-table th:hover {
    color: #333;
}

#groups-table tr:hover {
    background: #f9f9f9;
}

.ratio-warn {
    color: #ea4335;
    font-weight: 600;
}

/* Feed items */
.feed-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.feed-item .time {
    color: #999;
    font-size: 13px;
    white-space: nowrap;
    min-width: 50px;
}

.feed-item .group {
    font-weight: 500;
    min-width: 120px;
}

.feed-item .title {
    color: #666;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-item .status {
    font-size: 13px;
}

.feed-item .status.ok {
    color: #34a853;
}

.feed-item .status.err {
    color: #ea4335;
}

.feed-item a {
    color: #1a73e8;
    text-decoration: none;
}

.feed-item a:hover {
    text-decoration: underline;
}

/* Groups summary (overview tab) */
.groups-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.group-mini {
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 13px;
}

.group-mini .name {
    font-weight: 600;
}

.group-mini .stats {
    color: #666;
    margin-top: 2px;
}

/* Empty state */
.empty {
    color: #999;
    text-align: center;
    padding: 40px;
    font-size: 14px;
}

/* Loading */
.loading {
    color: #999;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }

    header {
        flex-wrap: wrap;
    }
}
