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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #333;
}

header {
    background: #1a73e8;
    color: white;
    padding: 1rem 2rem;
}

header h1 { font-size: 1.4rem; }

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 1rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab:hover { color: #1a73e8; }
.tab.active { color: #1a73e8; border-bottom-color: #1a73e8; font-weight: 600; }

.tab-group-label {
    font-size: 0.7rem; font-weight: 700; color: #999; text-transform: uppercase;
    padding: 0.75rem 0.5rem 0.75rem 0; align-self: center; letter-spacing: 0.05em;
}
.tab-divider {
    width: 1px; background: #ddd; margin: 0.5rem 0.25rem; align-self: stretch;
}

/* Main */
main { padding: 1rem 2rem; max-width: 1400px; margin: 0 auto; }

/* Search */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.search-bar select,
.search-bar input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-bar input { flex: 1; max-width: 300px; }

/* Buttons */
button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.actions { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }

#btn-create { background: #1a73e8; color: white; }
#btn-create:hover { background: #1557b0; }
#btn-delete-selected { background: #dc3545; color: white; }
#btn-delete-selected:hover { background: #b02a37; }
#btn-search { background: #1a73e8; color: white; }
#btn-reload { background: #6c757d; color: white; }

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f8f9fa; font-weight: 600; position: sticky; top: 0; white-space: nowrap; }
tr:hover { background: #f5f8ff; }
td { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.actions-cell { white-space: nowrap; }
td.actions-cell button { padding: 0.25rem 0.5rem; font-size: 0.8rem; margin-right: 0.25rem; }

.btn-edit { background: #ffc107; color: #333; }
.btn-del { background: #dc3545; color: white; }

.empty-state { padding: 3rem; text-align: center; color: #999; line-height: 1.6; }

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

.pagination button { background: #e0e0e0; }
.pagination button:hover:not(:disabled) { background: #ccc; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination select { padding: 0.4rem; border: 1px solid #ccc; border-radius: 4px; }

#page-info { font-size: 0.9rem; min-width: 80px; text-align: center; }

/* Modal */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white; border-radius: 8px; width: 90%; max-width: 700px;
    max-height: 80vh; display: flex; flex-direction: column;
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; border-bottom: 1px solid #eee;
}

.modal-header button { background: none; font-size: 1.5rem; color: #999; }
#modal-body { padding: 1rem 1.5rem; overflow-y: auto; flex: 1; }

#json-editor {
    width: 100%; font-family: 'Courier New', monospace; font-size: 0.85rem;
    padding: 0.75rem; border: 1px solid #ccc; border-radius: 4px;
    resize: vertical;
}

.modal-footer {
    padding: 1rem 1.5rem; border-top: 1px solid #eee;
    display: flex; gap: 0.5rem; justify-content: flex-end;
}

#btn-submit { background: #1a73e8; color: white; }
#btn-cancel { background: #6c757d; color: white; }

/* Status bar */
.status-bar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    padding: 0.5rem 2rem; font-size: 0.85rem; z-index: 999;
    transition: all 0.3s;
}

.status-bar.success { background: #d4edda; color: #155724; }
.status-bar.error { background: #f8d7da; color: #721c24; }
.status-bar.info { background: #d1ecf1; color: #0c5460; }
